Commands
Every Litestore command is a package.json script that you run with bun run, and each script covers a task such as building, testing or seeding.
Every command listed here is a script in package.json, and you run it with bun run <name> from the repository root. The packageManager field pins Bun 1.2.2, and the CI workflow installs the same version, so your machine and CI run the same tooling.
Development server
| Script | What it runs | Notes |
|---|---|---|
dev | next dev -p 3000 --turbopack --disable-source-maps | The storefront opens on port 3000 and the admin at /admin. |
email | email dev | It starts the React Email preview server. The templates live in modules/email/templates/, and email dev looks in emails/ unless you pass --dir modules/email/templates. |
icons | scripts/build-icons.ts | It writes the icon sprite (public/icons/sprite.svg) and platform/types/icons.d.ts. |
Git ignores the icon sprite and platform/types/icons.d.ts, so on a fresh clone you need to run bun run icons once before typecheck will pass.
Build
| Script | What it runs | Notes |
|---|---|---|
build | next build | It runs with a 6 GB Node heap. The prebuild hook runs icons first. |
start | next start -p 3000 | It serves the production build on port 3000. |
Database
| Script | What it runs | Notes |
|---|---|---|
db:generate | prisma generate | The postinstall hook runs it after every bun install. |
db:migrate | prisma migrate dev --create-only | It writes a new migration file from your schema changes but doesn't apply it. |
db:deploy | prisma migrate deploy | It applies the migrations that haven't run yet. Use it in production and after db:migrate. |
db:reset | prisma migrate reset | It drops the database, applies every migration again and then runs the seed. |
db:seed | bun prisma/seed.ts | It fills the database with demo data. |
db:studio | prisma studio --port 5556 | It opens Prisma Studio, a browser view of the database tables. |
To change the schema, edit prisma/schema.prisma and create a migration, then apply it:
bun run db:migrate
bun run db:deployRead the migration file before you apply it, because --create-only leaves time to edit the SQL first.
Linting and formatting
| Script | What it runs | Notes |
|---|---|---|
lint | biome check --write . | It lints and formats the code and writes the fixes it can make to your files. |
format | biome format --write . | It only formats the code. |
Litestore uses Biome for both linting and formatting, and the rules are in biome.json.
Type checking
| Script | What it runs | Notes |
|---|---|---|
typecheck | tsc --noEmit | It checks the types across the project with a 5 GB Node heap. |
On a machine with little memory, stop the dev server before you run it.
Tests
| Script | What it runs | Notes |
|---|---|---|
test | vitest run | It runs the unit tests once. They mock the database, so they don't need Postgres. |
test:integration | vitest run --config vitest.integration.config.ts | It runs the tests in test/integration/ against a real Postgres database called litestore_test. Set TEST_DATABASE_URL to use a different one. |
test:e2e | test/e2e/reset-db.ts, then playwright test | It resets the test database and runs the Playwright browser tests in test/e2e/. |
eval:ai | test/evals/run.ts | It runs the AI assistant against the test cases in test/evals/cases.ts. It needs an AI provider key. |
Continuous integration
bun run verifyverify runs typecheck, lint and test one after another and stops at the first failure. The GitHub Actions workflow in .github/workflows/verify.yml runs it on every push to main and on every pull request, after it installs dependencies and runs icons.
Run verify before you push, so you find the same failures CI would find.