Show each store's plan in store list - #8470
Open
amcaplan wants to merge 1 commit into
Open
Conversation
`store list` reported Subdomain, Name, Type and Created, so telling a Plus store from a Basic one meant running `store info` per store. `accessibleShops` already exposes `planName`, so the listing query now selects it and the table gains a `Plan` column. The plan-handle mapper moves up beside its sibling `store-type.ts` — both `store info` and `store list` map a raw BP plan name to a public handle now — and gains a `planLabel` for the column, mirroring `storeTypeLabel`. An unrecognized plan has no handle, so the cell is left blank rather than showing a raw internal plan name, matching how `store info` omits the row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: devx/e362b752-c5f2-41f2-8a72-a957ead40228
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is cohesive and low-risk, reuses existing plan mapping semantics, and includes targeted test updates for both mapping and output.
Pull request overview
Adds store plan visibility to shopify store list by selecting each shop’s planName from the Business Platform listing query, mapping it to the same public plan handles used by store info, and rendering the result as a new Plan column (plus plan in --json output).
Changes:
- Introduces shared plan mapping utilities (
planHandle,planLabel) and migratesstore infoto use them. - Extends the BP “list accessible shops” GraphQL query + mapping layer to include
planNameand exposeplanin results. - Updates
store listtable rendering/tests to include the newPlancolumn and blank it for unrecognized plans.
File summaries
| File | Description |
|---|---|
| packages/store/src/cli/services/store/plan.ts | New shared plan mapping + label helpers used by both store info and store list. |
| packages/store/src/cli/services/store/plan.test.ts | Unit tests for plan mapping/label behavior (including unknown/null/empty cases). |
| packages/store/src/cli/services/store/list/types.ts | Extends StoreListEntry with optional plan field. |
| packages/store/src/cli/services/store/list/result.ts | Adds Plan column to rendered table output via planLabel. |
| packages/store/src/cli/services/store/list/result.test.ts | Updates table output expectations and adds blank-plan test case; extends JSON expectation to include plan. |
| packages/store/src/cli/services/store/list/bp-source.ts | Maps node.planName to plan via planHandle when building list entries. |
| packages/store/src/cli/services/store/list/bp-source.test.ts | Adds coverage ensuring unrecognized plans are omitted (undefined). |
| packages/store/src/cli/services/store/info/plan.ts | Removes now-duplicated plan mapper (superseded by shared plan.ts). |
| packages/store/src/cli/services/store/info/plan.test.ts | Removes tests for deleted plan mapper (replaced by plan.test.ts). |
| packages/store/src/cli/services/store/info/index.ts | Switches store info to use shared planHandle. |
| packages/store/src/cli/services/store/constants.ts | Updates documentation for PLAN_HANDLES_BY_NAME to reflect shared usage. |
| packages/store/src/cli/api/graphql/business-platform-organizations/queries/list_accessible_shops.graphql | Adds planName selection to the listing query. |
| packages/store/src/cli/api/graphql/business-platform-organizations/generated/list_accessible_shops.ts | Regenerates types/document to include planName. |
| .changeset/store-list-plan.md | Adds a minor changeset documenting the user-facing store list enhancement. |
Review details
- Files reviewed: 13/14 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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?
From OK2 feedback in #devtools-proj-cli-dev-stores:
store listshould show the store's plan.Today the table reports Subdomain, Name, Type and Created, so telling a Plus store from a Basic one means running
shopify store info --store <domain>once per store. Per the thread, this lists the plan types the waystore infoalready does, rather than inventing a second vocabulary of plan names.Not a release blocker —
store listis already out in the wild displaying what it displays.WHAT is this pull request doing?
accessibleShopsalready exposesplanName, so the listing query selects it and the table gains aPlancolumn:The plan-handle mapper moves from
services/store/info/plan.tsup toservices/store/plan.ts, beside its siblingstore-type.ts, sincestore infoandstore listnow share it. It gains aplanLabelfor the table column, mirroringstoreTypeLabel, andmapPlanToPublicHandleis renamedplanHandleto match that pair.PLAN_HANDLES_BY_NAMEstays inconstants.ts.The four plan types map through the same table as
store info(Basic, Grow, Advanced, Plus — the raw BP names are Shopify-internal and differ from the marketing names). Anything unrecognized has no handle, so the cell is left blank rather than showing a raw internal plan name — best-effort display, matching howstore infoomits the row.planis added to each entry in--jsonoutput too.No command or flag metadata changed, so no manifest/readme/docs regeneration.
How to test your changes?
Stores on the four plans show
Basic/Grow/Advanced/Plus; dev stores and anything on an unlisted plan show a blankPlancell.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add🤖 Generated with Claude Code