Extract the shared --store flag out of the store auth and execute commands#7755
Open
amcaplan wants to merge 1 commit into
Open
Extract the shared --store flag out of the store auth and execute commands#7755amcaplan wants to merge 1 commit into
amcaplan wants to merge 1 commit into
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4 tasks
dmerand
approved these changes
Jun 8, 2026
505bb03 to
caa73ce
Compare
4a1a131 to
14f6ca7
Compare
…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>
14f6ca7 to
854c2e3
Compare
caa73ce to
a7adece
Compare
Contributor
Differences in type declarationsWe 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:
New type declarationspackages/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 declarationspackages/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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
store authandstore executeeach defined their own--storeflag 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 ofstore infoshouldn't have to reason about whyauth/executechanged.WHAT is this pull request doing?
Adds
packages/store/src/cli/flags.tsexportingstoreFlags.store(chars,SHOPIFY_FLAG_STORE, normalized vianormalizeStoreFqdn, required) and convertsstore authandstore executeto 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/store—auth/executesuites still pass.shopify store auth --help/shopify store execute --helpshow the normalized--storedescription.Checklist