Skip to content

Extract @shopify/store package from @shopify/cli#7330

Merged
amcaplan merged 3 commits intomainfrom
ariel/extract-store-package
Apr 17, 2026
Merged

Extract @shopify/store package from @shopify/cli#7330
amcaplan merged 3 commits intomainfrom
ariel/extract-store-package

Conversation

@amcaplan
Copy link
Copy Markdown
Contributor

@amcaplan amcaplan commented Apr 16, 2026

Summary

  • Extracts existing store:auth and store:execute commands from packages/cli into a dedicated @shopify/store package
  • Follows the same pattern as @shopify/theme for package scaffolding, Nx config, and command registration
  • Adds @shopify/store to the changeset fixed version group

Stack: PR 1 of 3 — #7331 extracts @shopify/organizations, #7332 adds store create dev

Test plan

  • pnpm nx build store passes
  • pnpm nx type-check store passes
  • cd packages/store && pnpm vitest run — all tests pass
  • cd packages/cli && pnpm vitest run — no regressions

🤖 Generated with Claude Code

@amcaplan amcaplan force-pushed the ariel/extract-store-package branch from 7e01abd to acc94a4 Compare April 16, 2026 15:48
@amcaplan amcaplan marked this pull request as ready for review April 16, 2026 18:33
@amcaplan amcaplan requested review from a team as code owners April 16, 2026 18:33
Copilot AI review requested due to automatic review settings April 16, 2026 18:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/store package containing the store auth and store execute commands plus supporting auth/execute services and tests.
  • Updated @shopify/cli to depend on @shopify/store and 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.

Copy link
Copy Markdown
Contributor

@byrichardpowell byrichardpowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Copy Markdown
Contributor Author

amcaplan commented Apr 16, 2026

@amcaplan amcaplan force-pushed the ariel/extract-store-package branch from acc94a4 to 81fd9c2 Compare April 16, 2026 21:23
Comment thread packages/cli/tsconfig.json Outdated
amcaplan and others added 2 commits April 17, 2026 12:16
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>
@amcaplan amcaplan force-pushed the ariel/extract-store-package branch from 81fd9c2 to 9a6b6b8 Compare April 17, 2026 09:19
@amcaplan amcaplan added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit 01a720b Apr 17, 2026
25 checks passed
@amcaplan amcaplan deleted the ariel/extract-store-package branch April 17, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants