Skip to content

Add --country flag to store create dev#7947

Draft
amcaplan wants to merge 1 commit into
mainfrom
add-country-flag-to-store-create-dev
Draft

Add --country flag to store create dev#7947
amcaplan wants to merge 1 commit into
mainfrom
add-country-flag-to-store-create-dev

Conversation

@amcaplan

Copy link
Copy Markdown
Contributor

What

Adds a --country flag to shopify store create dev, implementing the country piece of shop/world#22968.

This extracts and shares the country-code validation that already exists for store create preview:

  • flags.ts now exports the shared countryFlag(env) factory (normalizes input to trimmed uppercase), the isCountryCode() validator, and a new shared invalidCountryCodeMessage constant so both commands report identical guidance.
  • devStoreFlags.country added (env SHOPIFY_FLAG_STORE_COUNTRY) alongside the existing previewStoreFlags.country.
  • store create preview now uses the shared invalidCountryCodeMessage (removed the duplicated string).
  • store create dev validates --country and threads it into createDevStore, surfacing it in JSON and success output.

Draft — why

This is intentionally flag scaffolding only. country is not yet sent to the BP createAppDevelopmentStore mutation because the published schema does not expose the argument until the backend lands:

  • Backend PR: shop/world#671185 (part of shop/world#22968) — not yet merged to main.
  • The CLI's graphql-codegen fetches the schema from shop/world main, and CI enforces a freshness check. Wiring country onto the operation now would fail that check.

The flag is validated end-to-end locally (tophatted against a local BP that accepts country), so the wiring is a trivial follow-up.

Follow-up (once shop/world#671185 merges)

  1. pnpm graphql-codegen:get-graphql-schemas && pnpm graphql-codegen
  2. Add $country: String to create_app_development_store.graphql and the country: $country argument.
  3. Replace the NOTE in services/store/create/dev.ts with country: options.country.
  4. Add a changeset and unhide the command when the broader feature is ready.

Notes

  • Command is hidden; no changeset (not functional end-to-end yet).
  • Tests: 36 pass (command + service). Type-check and lint clean.

Extracts and shares the country-code validation already used by
store create preview: countryFlag, isCountryCode, and a shared
invalidCountryCodeMessage in flags.ts, plus devStoreFlags.country.

The flag is validated, plumbed into createDevStore options, and shown
in JSON/success output, but is NOT yet sent to the BP
createAppDevelopmentStore mutation -- the published schema does not
expose a country argument until shop/world#671185 (part of
shop/world#22968) merges. GraphQL wiring is a trivial follow-up.

Command is hidden; no changeset (not functional end-to-end yet).

Assisted-By: devx/bf777827-dc69-4993-9b11-c401dc19c4be
@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 28, 2026
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