create-thorcommerce-app
v0.0.15
Published
CLI to scaffold ThorCommerce projects
Downloads
104
Maintainers
Readme
create-thorcommerce-app
Create a Thor Commerce template or app:
pnpm dlx create-thorcommerce-appWhen creating a React Router app, the CLI can also configure persistent Thor session storage on Cloudflare D1. Choose Yes when prompted to create and configure a D1 database.
The CLI then:
- installs
@thor-commerce/[email protected], Wrangler, and the Cloudflare Vite plugin; - creates the Worker entrypoint and
wrangler.jsonc; - creates a D1 database bound as
THOR_SESSIONS; - creates and applies the Thor session migration locally and remotely;
- configures
thorAppto useD1SessionStorage; and - generates Cloudflare Worker types.
Wrangler may open a browser so you can sign in to Cloudflare. Creating D1
infrastructure requires a Cloudflare account and network access. If you decline
the option, the generated app keeps Thor's default in-memory session storage,
which is useful for local development or for replacing with another
SessionStorage implementation.
The generated app includes:
pnpm run deploy
pnpm run typecheck
pnpm run typegenThe D1 database and migration are created before the scaffolded app's initial Git commit, so the generated Cloudflare configuration is checked in.
