Skip to content

Extract the shared --store flag out of the store auth and execute commands#7755

Open
amcaplan wants to merge 1 commit into
ariel/cli-kit-url-helpersfrom
ariel/store-flags
Open

Extract the shared --store flag out of the store auth and execute commands#7755
amcaplan wants to merge 1 commit into
ariel/cli-kit-url-helpersfrom
ariel/store-flags

Conversation

@amcaplan

@amcaplan amcaplan commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📚 Part of the store info stack — review/merge bottom-up:
#7753 gid codec → #7754 url helpers → #7755 (this)#7756 GraphQL layer → #7660 store info

WHY are these changes introduced?

store auth and store execute each defined their own --store flag inline — identical except for the trailing words of the help text. store info (top of this stack) needs the same flag, so rather than copy it a third time, consolidate the shared definition. Pulling it into its own PR keeps the two pre-existing commands' churn out of the feature PR — a reviewer of store info shouldn't have to reason about why auth/execute changed.

WHAT is this pull request doing?

Adds packages/store/src/cli/flags.ts exporting storeFlags.store (char s, SHOPIFY_FLAG_STORE, normalized via normalizeStoreFqdn, required) and converts store auth and store execute to consume it.

Behavior-preserving except the flag's help text is now the generic "The myshopify.com domain of the store." — previously each command appended its own suffix ("…to authenticate against." / "…to execute against."). The manifest, README, and reference docs are regenerated to match. No user-facing behavior change, so no changeset (the help-text normalization is cosmetic; consistent with the other base PRs in this stack).

How to test your changes?

  • pnpm vitest run packages/storeauth/execute suites still pass.
  • shopify store auth --help / shopify store execute --help show the normalized --store description.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows) — no platform-specific behavior
  • I've considered possible documentation changes — manifest/README/reference docs regenerated
  • I've considered analytics changes to measure impact — none
  • The change is user-facing — N/A beyond a cosmetic help-text tweak; no changeset

amcaplan commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 8, 2026
@amcaplan amcaplan marked this pull request as ready for review June 8, 2026 15:57
@amcaplan amcaplan requested review from a team as code owners June 8, 2026 15:57
@amcaplan amcaplan force-pushed the ariel/store-flags branch from 505bb03 to caa73ce Compare June 9, 2026 18:26
@amcaplan amcaplan force-pushed the ariel/cli-kit-url-helpers branch from 4a1a131 to 14f6ca7 Compare June 9, 2026 18:26
…mands

The `store auth` and `store execute` commands each defined their own
`--store` flag inline (char `s`, `SHOPIFY_FLAG_STORE`, normalized via
`normalizeStoreFqdn`, required). Lift the shared definition into
`packages/store/src/cli/flags.ts` as `storeFlags.store` and have both
commands consume it.

Behavior-preserving except that the flag's help text is now the generic
"The myshopify.com domain of the store." (previously each command
appended its own "to authenticate against." / "to execute against."
suffix); manifest, README, and reference docs are regenerated to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amcaplan amcaplan force-pushed the ariel/cli-kit-url-helpers branch from 14f6ca7 to 854c2e3 Compare June 9, 2026 20:19
@amcaplan amcaplan force-pushed the ariel/store-flags branch from caa73ce to a7adece Compare June 9, 2026 20:19
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/common/gid.d.ts
/**
 * Extracts the trailing numeric id from a plain GraphQL global id like
 * `gid://shopify/Product/123`.
 *
 * @param gid - A plain GraphQL global id string.
 * @returns The trailing numeric id, or undefined when the string does not end with `/<digits>`.
 */
export declare function numericIdFromGid(gid: string): string | undefined;
/**
 * Decodes a base64-encoded GraphQL global id (for example, the form
 * Business Platform APIs return) and returns the trailing numeric id.
 *
 * @param gid - A base64-encoded GraphQL global id.
 * @returns The trailing numeric id, or undefined when the decoded string does not end with `/<digits>`.
 */
export declare function numericIdFromEncodedGid(gid: string): string | undefined;
/**
 * Encodes a plain GraphQL global id (`gid://...`) as base64, which is the
 * form some Business Platform endpoints require.
 *
 * @param gid - A plain GraphQL global id string to encode.
 * @returns The base64-encoded gid.
 */
export declare function encodeGid(gid: string): string;

Existing type declarations

packages/cli-kit/dist/public/common/url.d.ts
@@ -12,4 +12,20 @@ export declare function isValidURL(url: string): boolean;
  * @param url - The string to parse into a URL.
  * @returns A URL object if the parsing is successful, undefined otherwise.
  */
-export declare function safeParseURL(url: string): URL | undefined;
\ No newline at end of file
+export declare function safeParseURL(url: string): URL | undefined;
+/**
+ * Extracts the lowercased hostname from a URL-shaped string. Tolerates
+ * bare hosts (without a scheme) and inputs that come back from APIs as
+ * either  or .
+ *
+ * @param value - A URL or bare host string, possibly null/undefined.
+ * @returns The lowercased hostname, or undefined when the input is empty.
+ */
+export declare function extractHost(value: string | null | undefined): string | undefined;
+/**
+ * Extracts the subdomain handle from a  URL or host.
+ *
+ * @param value - A URL or host string, possibly null/undefined.
+ * @returns The myshopify subdomain handle, or undefined when the input isn't a  URL.
+ */
+export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
\ No newline at end of file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants