Skip to content

Show each store's plan in store list - #8470

Open
amcaplan wants to merge 1 commit into
mainfrom
display-plan-in-store-list
Open

Show each store's plan in store list#8470
amcaplan wants to merge 1 commit into
mainfrom
display-plan-in-store-list

Conversation

@amcaplan

@amcaplan amcaplan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

From OK2 feedback in #devtools-proj-cli-dev-stores: store list should 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 way store info already does, rather than inventing a second vocabulary of plan names.

Not a release blocker — store list is already out in the wild displaying what it displays.

WHAT is this pull request doing?

accessibleShops already exposes planName, so the listing query selects it and the table gains a Plan column:

╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Listing stores.                                                             │
│                                                                              │
│  Organization  Acme (1234)                                                   │
│                                                                              │
│  To list stores authenticated directly with `shopify store auth`, run        │
│  `shopify store auth list`.                                                  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Subdomain  Name     Type  Plan  Created
─────────  ───────  ────  ────  ────────────
my-shop    My Shop  Dev   Grow  May 22, 2026

The plan-handle mapper moves from services/store/info/plan.ts up to services/store/plan.ts, beside its sibling store-type.ts, since store info and store list now share it. It gains a planLabel for the table column, mirroring storeTypeLabel, and mapPlanToPublicHandle is renamed planHandle to match that pair. PLAN_HANDLES_BY_NAME stays in constants.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 how store info omits the row. plan is added to each entry in --json output too.

No command or flag metadata changed, so no manifest/readme/docs regeneration.

How to test your changes?

shopify store list
shopify store list --json

Stores on the four plans show Basic/Grow/Advanced/Plus; dev stores and anything on an unlisted plan show a blank Plan cell.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

🤖 Generated with Claude Code

`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
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 3, 2026
@amcaplan
amcaplan marked this pull request as ready for review September 3, 2026 18:56
@amcaplan
amcaplan requested a review from a team as a code owner September 3, 2026 18:56
Copilot AI lite review requested due to automatic review settings September 3, 2026 18:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 migrates store info to use them.
  • Extends the BP “list accessible shops” GraphQL query + mapping layer to include planName and expose plan in results.
  • Updates store list table rendering/tests to include the new Plan column 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.

@amcaplan
amcaplan requested a review from dmerand September 3, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants