Skip to content

Ask about demo data when creating a dev store interactively - #8459

Merged
nickwesselman merged 1 commit into
mainfrom
nick/dev-store-demo-data-prompt
Sep 2, 2026
Merged

Ask about demo data when creating a dev store interactively#8459
nickwesselman merged 1 commit into
mainfrom
nick/dev-store-demo-data-prompt

Conversation

@nickwesselman

@nickwesselman nickwesselman commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

shopify store create dev can already populate a new store with demo data through
--with-demo-data, but nothing ever asks about it. A developer creating a store
interactively — including through the inline creation flow that #8323 and #8397 just
added to app dev — gets an empty store and no indication that demo data was an
option.

WHAT is this pull request doing?

Adds a demo data question to interactive dev store creation, asked after the name and
plan prompts.

  • New shared devStoreDemoDataPrompt in @shopify/organizations, next to the existing
    name and plan prompts, re-exported as storeDemoDataPrompt (store) and
    devStoreDemoDataPrompt (app) through the same thin delegates those two already use.
    "Yes, add demo data" is preselected.

  • store create dev gives the flag the standard tri-state behavior. --with-demo-data is
    renamed to --demo-data and gains allowNo, so:

    // An unspecified flag means "ask" where we can prompt and "no" where we can't.
    const withDemoData = flags['demo-data'] ?? (terminalSupportsPrompting() ? await storeDemoDataPrompt() : false)

    --demo-data and --no-demo-data answer the question outright and skip the prompt. An
    unspecified flag prompts in an interactive terminal and defaults to false in a
    non-interactive one, using the same terminalSupportsPrompting() check that
    requiredIfNonInteractive enforcement uses. SHOPIFY_FLAG_STORE_DEMO_DATA counts as
    specified, so it also skips the prompt.

  • app dev has no demo data flag and rejects non-TTY runs upstream, so it always asks,
    on both the zero-store and store-picker creation paths.

One note for reviewers: --with-demo-data is renamed rather than aliased. The command is
hidden, and the flag only reached main alongside the unreleased inline creation work, so
no documented workflow should depend on the old spelling. Say the word if you would rather
keep --with-demo-data as a hidden alias.

How to test your changes?

  1. shopify store create dev --organization-id <id> --name test-store --plan basic in a
    terminal — asks "Populate the store with demo data?" with Yes preselected.
  2. Same command with --demo-data or --no-demo-data — no question, and the created store
    reflects the flag.
  3. Same command piped from another process (or with CI=1) — no question, demo data off.
  4. shopify app dev --reset in an App Management organization, then either accept the
    zero-store creation flow or pick "Create a new dev store" from the picker — name, plan,
    then the demo data question, and the created store reflects the answer.

Tophat: the app dev path was exercised locally end to end (name, plan, demo data
question, store created, dev started). The store create dev flag-gating paths are
covered by unit tests but were not live-tophatted.

Changelog

No changeset. This builds on the inline dev store creation from #8323 and #8397, which is
not released yet, so the whole flow will be covered by a single changelog entry rather than
one per PR in this stack.

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 — intentionally omitted, see Changelog above

@nickwesselman
nickwesselman requested review from a team as code owners September 2, 2026 18:24
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 2, 2026
@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch 2 times, most recently from f0acab5 to fb5f5cc Compare September 2, 2026 18:33
@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch from fb5f5cc to ef68bf4 Compare September 2, 2026 18:49
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 2, 2026
@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch from ef68bf4 to 5a0db4e Compare September 2, 2026 18:52
message: 'Populate the store with demo data?',
confirmationMessage: 'Yes, add demo data',
cancellationMessage: 'No, start with an empty store',
defaultValue: true,

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.

The CLI defaults to no demo data; it's an opt-in. Here it's phrased as an opt-out. Do we want to align the two experiences?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we should encourage new users to use it.

Comment thread packages/store/src/cli/commands/store/create/dev.ts Outdated
@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch 2 times, most recently from b5c7729 to a8ab9ce Compare September 2, 2026 20:29

@amcaplan amcaplan 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.

I'm ambivalent about the whole idea, but I can live with it.

@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch from a8ab9ce to 93e375a Compare September 2, 2026 21:17
Add a shared `devStoreDemoDataPrompt` and ask it after the name and plan
prompts, so an interactively created dev store can be populated with demo
data without leaving the CLI.

Rename `--with-demo-data` to `--demo-data` with `allowNo`, giving the flag
the standard tri-state behavior: `--demo-data` and `--no-demo-data` answer
the question outright, while an unspecified flag prompts in an interactive
terminal and defaults to false everywhere else.

`app dev` has no demo data flag and rejects non-TTY runs upstream, so it
always asks, on both the zero-store and store-picker creation paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/a27b4557-3ac8-448a-8860-7a5ed6b20687
@nickwesselman
nickwesselman force-pushed the nick/dev-store-demo-data-prompt branch from 93e375a to 82de102 Compare September 2, 2026 21:20
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release.

🏳️ Removed Flags

The following flags were removed from existing commands:

Command Flag
store:create:dev --with-demo-data

🔧 Removed Environment Variables

The following env vars are no longer referenced in command flags:

Env Var Previously Used By
SHOPIFY_FLAG_STORE_WITH_DEMO_DATA store:create:dev --with-demo-data

@nickwesselman
nickwesselman added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit f7e6c37 Sep 2, 2026
27 of 30 checks passed
@nickwesselman
nickwesselman deleted the nick/dev-store-demo-data-prompt branch September 2, 2026 21:43
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.

2 participants