Skip to content

feat: add @dashcommerce/create scaffolding CLI#9

Merged
cavewebs merged 2 commits intomainfrom
create-cli
Apr 20, 2026
Merged

feat: add @dashcommerce/create scaffolding CLI#9
cavewebs merged 2 commits intomainfrom
create-cli

Conversation

@cavewebs
Copy link
Copy Markdown
Contributor

The 'npm create @dashcommerce@latest' onboarding story. New package at packages/create/ that downloads a template from a flat repo on GitHub and walks the user through install + git init.

Current template registry points to emdashCommerce/starter (the flat repo the sync workflow mirrors to). Adding more templates later means appending to the TEMPLATES map in src/index.ts and publishing a new version — no other CLI changes needed.

  • bin: create-dashcommerce (npm-convention — 'npm create @dashcommerce' resolves to '@dashcommerce/create' package's bin)
  • deps kept minimal: giget (template download), prompts (interactive UI), picocolors (matching emdash's terminal colors)
  • tsdown emits an esm bundle with a node shebang and chmod'd entry
  • Detects the invoking pm from npm_config_user_agent; falls back to npm
  • Non-interactive mode via --template flag + positional dir arg; --help prints usage + template registry
  • Refuses to clobber a non-empty target directory
  • prepublishOnly hook ensures dist/ is built before publish

Included a changeset (.changeset/first-create-cli.md) marking this as a minor release. When this merges to main, the Version Packages PR will open with @dashcommerce/create@0.1.0; merging that publishes the package.

The 'npm create @dashcommerce@latest' onboarding story. New package at packages/create/ that downloads a template from a flat repo on GitHub and walks the user through install + git init.

Current template registry points to emdashCommerce/starter (the flat repo the sync workflow mirrors to). Adding more templates later means appending to the TEMPLATES map in src/index.ts and publishing a new version — no other CLI changes needed.

- bin: create-dashcommerce (npm-convention — 'npm create @dashcommerce' resolves to '@dashcommerce/create' package's bin)
- deps kept minimal: giget (template download), prompts (interactive UI), picocolors (matching emdash's terminal colors)
- tsdown emits an esm bundle with a node shebang and chmod'd entry
- Detects the invoking pm from npm_config_user_agent; falls back to npm
- Non-interactive mode via --template flag + positional dir arg; --help prints usage + template registry
- Refuses to clobber a non-empty target directory
- prepublishOnly hook ensures dist/ is built before publish

Included a changeset (.changeset/first-create-cli.md) marking this as a minor release. When this merges to main, the Version Packages PR will open with @dashcommerce/create@0.1.0; merging that publishes the package.
The CLI is now the primary onboarding path — 'npm create @dashcommerce@latest' scaffolds a ready-to-run project in 30 seconds, zero cloud accounts required. One-click Deploy buttons are real but require real post-click setup (D1/R2/KV provisioning, secrets, seed); framing them as instant onboarding oversells.

Rework:
- New top-section 'Quick start' leads with the CLI, shows bootstrap+dev, and offers git clone as a fallback. The storefront + Stripe + checkout walkthrough flows naturally from a running local site.
- Deploy section moved BELOW the feature walkthrough with honest framing ('expect to do some post-click configuration'). Each platform's setup shrunk to the essentials — full detail lives in dashcommerce.dev/docs once that's updated to match.
- Railway section updated with the ephemeral-filesystem caveat and 'railway run bun run bootstrap' as the seed step.
@cavewebs cavewebs merged commit 1947c6b into main Apr 20, 2026
1 check failed
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
cavewebs added a commit that referenced this pull request Apr 21, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @dashcommerce/create@0.2.0

### Minor Changes

- [#9](#9)
[`c3418af`](c3418af)
Thanks [@cavewebs](https://github.com/cavewebs)! - Initial release —
scaffold a new DashCommerce project with `npm create
@dashcommerce@latest`.

- Interactive prompts for project directory, template, dependency
install, and git init
- `--template <name>` flag for non-interactive overrides (default:
`starter`)
- Template downloads via `giget` from the `emdashCommerce/starter` flat
repo
- Detects the invoking package manager (bun/pnpm/yarn/npm) and runs
install with it
    -   Prints Stripe setup + `bun run dev` next steps on success
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.

1 participant