Extract @shopify/store package from @shopify/cli#7330
Merged
Conversation
This was referenced Apr 16, 2026
7e01abd to
acc94a4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts the existing store:auth and store:execute CLI functionality into a new @shopify/store package (mirroring the @shopify/theme package structure) and wires the main CLI to load these commands from the new package.
Changes:
- Added a new
packages/storepackage containing thestore authandstore executecommands plus supporting auth/execute services and tests. - Updated
@shopify/clito depend on@shopify/storeand register its commands via the shared command map pattern. - Updated Changesets fixed-version grouping and workspace lockfile to include the new package.
Reviewed changes
Copilot reviewed 11 out of 48 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds workspace linking for @shopify/store and lockfile updates from new package deps. |
| packages/store/vite.config.ts | Adds Vite/Vitest config wiring consistent with other packages. |
| packages/store/tsconfig.json | Adds TS project config for the new package. |
| packages/store/tsconfig.build.json | Adds build TS config excluding tests. |
| packages/store/src/index.ts | Exposes the store command map consumed by @shopify/cli. |
| packages/store/src/cli/services/store/execute/targets.ts | Defines GraphQL execution target(s) (admin). |
| packages/store/src/cli/services/store/execute/targets.test.ts | Tests GraphQL target selection/adapter behavior. |
| packages/store/src/cli/services/store/execute/result.ts | Handles stdout/file output for execute results + success rendering. |
| packages/store/src/cli/services/store/execute/result.test.ts | Tests output/file behavior for execute results. |
| packages/store/src/cli/services/store/execute/request.ts | Validates/loads query + variables; parses GraphQL; blocks mutations unless allowed. |
| packages/store/src/cli/services/store/execute/request.test.ts | Tests request parsing/validation scenarios. |
| packages/store/src/cli/services/store/execute/index.ts | Orchestrates request prep, context loading, and execution. |
| packages/store/src/cli/services/store/execute/index.test.ts | Tests orchestration flow and defaults. |
| packages/store/src/cli/services/store/execute/admin-transport.ts | Executes Admin GraphQL requests and handles auth expiry/errors. |
| packages/store/src/cli/services/store/execute/admin-transport.test.ts | Tests admin transport success + error paths (401, GraphQL errors). |
| packages/store/src/cli/services/store/execute/admin-context.ts | Loads stored auth and resolves Admin API version. |
| packages/store/src/cli/services/store/execute/admin-context.test.ts | Tests context building and version resolution behavior. |
| packages/store/src/cli/services/store/auth/token-client.ts | Implements OAuth token exchange/refresh + scope lookup. |
| packages/store/src/cli/services/store/auth/token-client.test.ts | Tests token exchange/refresh and scope lookup behavior. |
| packages/store/src/cli/services/store/auth/session-store.ts | Implements local persistence for store app sessions. |
| packages/store/src/cli/services/store/auth/session-store.test.ts | Tests session persistence, corruption handling, and clearing behavior. |
| packages/store/src/cli/services/store/auth/session-lifecycle.ts | Loads sessions and refreshes expired tokens with error recovery. |
| packages/store/src/cli/services/store/auth/session-lifecycle.test.ts | Tests expiry logic and refresh success/failure cases. |
| packages/store/src/cli/services/store/auth/scopes.ts | Parses/merges/validates requested vs granted scopes (incl implied reads). |
| packages/store/src/cli/services/store/auth/scopes.test.ts | Tests scope parsing/merging/grant validation. |
| packages/store/src/cli/services/store/auth/result.ts | Presents auth results in text vs JSON modes. |
| packages/store/src/cli/services/store/auth/result.test.ts | Tests presenter output routing for text/JSON flows. |
| packages/store/src/cli/services/store/auth/recovery.ts | Centralizes auth-related AbortError helpers and next-steps. |
| packages/store/src/cli/services/store/auth/pkce.ts | Builds PKCE bootstrap (verifier/challenge/auth URL). |
| packages/store/src/cli/services/store/auth/pkce.test.ts | Tests PKCE helper correctness and URL parameters. |
| packages/store/src/cli/services/store/auth/index.ts | Orchestrates store auth: scope resolution, PKCE, token exchange, persistence. |
| packages/store/src/cli/services/store/auth/index.test.ts | Tests auth orchestration across scope and browser-open outcomes. |
| packages/store/src/cli/services/store/auth/existing-scopes.ts | Resolves existing scopes remotely with local fallback and debug logging. |
| packages/store/src/cli/services/store/auth/existing-scopes.test.ts | Tests remote-preferred scope resolution and fallback behavior. |
| packages/store/src/cli/services/store/auth/config.ts | Defines auth constants (client ID, callback path, helpers). |
| packages/store/src/cli/services/store/auth/callback.ts | Implements local callback server for PKCE and validates store/state. |
| packages/store/src/cli/services/store/auth/callback.test.ts | Tests callback server success/error/timeout/port-in-use paths. |
| packages/store/src/cli/commands/store/execute.ts | Adds shopify store execute command in new package. |
| packages/store/src/cli/commands/store/execute.test.ts | Tests flag wiring and output mode handling for execute command. |
| packages/store/src/cli/commands/store/auth.ts | Adds shopify store auth command in new package. |
| packages/store/src/cli/commands/store/auth.test.ts | Tests flag wiring and presenter selection for auth command. |
| packages/store/project.json | Adds Nx targets for build/lint/type-check/clean for new package. |
| packages/store/package.json | Defines @shopify/store package metadata, exports, deps, scripts. |
| packages/cli/tsconfig.json | Adds TS project reference to ../store. |
| packages/cli/src/index.ts | Removes inlined store commands and registers @shopify/store command map. |
| packages/cli/package.json | Adds @shopify/store dependency. |
| packages/cli/oclif.manifest.json | Marks store commands with customPluginName: @shopify/store. |
| .changeset/config.json | Adds @shopify/store to the fixed version group. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
acc94a4 to
81fd9c2
Compare
isaacroldan
reviewed
Apr 17, 2026
isaacroldan
approved these changes
Apr 17, 2026
Move existing store:auth and store:execute commands and their services into a dedicated @shopify/store package, following the same pattern as @shopify/theme. This prepares the store namespace for new commands like store create dev. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81fd9c2 to
9a6b6b8
Compare
gonzaloriestra
approved these changes
Apr 17, 2026
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.

Summary
store:authandstore:executecommands frompackages/cliinto a dedicated@shopify/storepackage@shopify/themefor package scaffolding, Nx config, and command registration@shopify/storeto the changeset fixed version groupStack: PR 1 of 3 — #7331 extracts
@shopify/organizations, #7332 addsstore create devTest plan
pnpm nx build storepassespnpm nx type-check storepassescd packages/store && pnpm vitest run— all tests passcd packages/cli && pnpm vitest run— no regressions🤖 Generated with Claude Code