Skip to content

Add local source and auto fallback to store list#7714

Draft
dmerand wants to merge 4 commits into
donald/store-list-local-auth-seamfrom
donald/store-list-local-fallback
Draft

Add local source and auto fallback to store list#7714
dmerand wants to merge 4 commits into
donald/store-list-local-auth-seamfrom
donald/store-list-local-fallback

Conversation

@dmerand
Copy link
Copy Markdown
Contributor

@dmerand dmerand commented Jun 4, 2026

Summary

Add --source local and auto fallback to shopify store list on top of #7709.

Position in the stack

PR Role
#7708 BP-only store list
#7709 local auth summary API
#7714 local source + auto fallback

Scope

  • add --source auto|bp|local to shopify store list
  • add local-source.ts, backed by listStoredStoreAuthSummaries()
  • restore local result rendering and empty states
  • make auto prefer BP and fall back to local auth when BP:
    • cannot resolve the current CLI session as a user account
    • cannot fulfill the request without interactive reauthentication
    • aborts store listing for the current session
  • keep explicit --source bp strict: no local fallback
  • thread noPrompt through ensureAuthenticatedBusinessPlatform() so auto can probe BP before deciding to fall back
  • update command/docs artifacts for the restored command surface

Contract cleanup included in this PR

  • distinguish requested source from resolved source
  • distinguish BP results from local results in the store list types
  • make BP retrieval outcomes explicit so fallback policy stays in list/index.ts

Why this stays separate from #7709

#7709 introduced the local read API.

This PR is the behavior layer on top:

  • command flag surface
  • source selection and fallback policy
  • local result projection
  • output and docs updates

Smoke checks

  • node packages/cli/bin/dev.js store list --json
    • returns BP results with the existing partial-failure warning in this environment
  • node packages/cli/bin/dev.js store list --json --source local
    • returns local auth summaries in this environment

@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 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

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

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/session.d.ts
@@ -119,9 +119,10 @@ export declare function ensureAuthenticatedThemes(store: string, password: strin
  * Ensure that we have a valid session to access the Business Platform API.
  *
  * @param scopes - Optional array of extra scopes to authenticate with.
+ * @param options - Optional auth behavior overrides such as .
  * @returns The access token for the Business Platform API.
  */
-export declare function ensureAuthenticatedBusinessPlatform(scopes?: BusinessPlatformScope[]): Promise<string>;
+export declare function ensureAuthenticatedBusinessPlatform(scopes?: BusinessPlatformScope[], options?: EnsureAuthenticatedAdditionalOptions): Promise<string>;
 /**
  * Logout from Shopify.
  *

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.

1 participant