Skip to content

Commit 7554e7a

Browse files
feat: Add Elysia and Nest create templates (#31)
* add elysia and nest create templates * format runtime helper changes * fix runtime template review feedback * tighten port parsing and bootstrap handling * fix deno template imports and runtime paths * simplify nest dev flow and inject template deps * clean up shared types and template deps * remove dead setup and runtime plumbing * fix remaining review feedback * rewrite README for users
1 parent 6fd2070 commit 7554e7a

50 files changed

Lines changed: 1158 additions & 409 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 86 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,135 @@
11
# create-prisma
22

3-
A modern Prisma 7 CLI with first-party project templates and a smooth create flow.
3+
Scaffold a new app with Prisma already wired up.
44

5-
## Stack
5+
`create-prisma` gives you a project template, Prisma setup, database scripts, and a working starting point without making you assemble everything by hand.
66

7-
- `trpc-cli` for command routing
8-
- `zod@4` for validated input schemas
9-
- `@clack/prompts@1` for interactive UX
10-
- `execa` for external command execution
11-
- `fs-extra` for filesystem operations
12-
- `handlebars` for conditional template rendering
13-
- `tsdown` for ESM builds
7+
## What It Does
148

15-
## Usage
9+
- creates a new app from a supported template
10+
- adds Prisma 7 dependencies for your database
11+
- scaffolds `prisma/schema.prisma`, `prisma/seed.ts`, and `prisma.config.ts`
12+
- writes a Prisma client singleton in the right place for the selected template
13+
- adds `db:generate`, `db:migrate`, and `db:seed` scripts
14+
- creates or updates `.env` with `DATABASE_URL`
15+
- can install dependencies and run `prisma generate` for you
1616

17-
Run directly with Bun:
17+
## Quick Start
1818

19-
```bash
20-
bunx create-prisma@latest
21-
```
22-
23-
Run directly with Yarn:
19+
Use the package runner you already have:
2420

2521
```bash
26-
yarn dlx create-prisma@latest
22+
npx create-prisma@latest
2723
```
2824

29-
Run directly with Deno:
30-
3125
```bash
32-
deno run -A npm:create-prisma@latest
26+
pnpm dlx create-prisma@latest
3327
```
3428

35-
Create a new project (default command):
36-
3729
```bash
38-
create-prisma
30+
yarn dlx create-prisma@latest
3931
```
4032

41-
Create a Hono project non-interactively:
42-
4333
```bash
44-
create-prisma --name my-api --template hono --provider postgresql
34+
bunx create-prisma@latest
4535
```
4636

47-
Create a Next.js project non-interactively:
48-
4937
```bash
50-
create-prisma --name my-web --template next --provider postgresql
38+
deno run -A npm:create-prisma@latest
5139
```
5240

53-
Create a SvelteKit project non-interactively:
41+
If you already have it available locally:
5442

5543
```bash
56-
create-prisma --name my-app --template svelte --provider postgresql
44+
create-prisma
5745
```
5846

59-
Create an Astro project non-interactively:
47+
## Common Examples
48+
49+
Create a project interactively:
6050

6151
```bash
62-
create-prisma --name my-site --template astro --provider postgresql
52+
create-prisma
6353
```
6454

65-
Create a Nuxt project non-interactively:
55+
Create a Hono app non-interactively:
6656

6757
```bash
68-
create-prisma --name my-nuxt-app --template nuxt --provider postgresql
58+
create-prisma --name my-api --template hono --provider postgresql
6959
```
7060

71-
Create a TanStack Start project non-interactively:
61+
Scaffold into the current directory:
7262

7363
```bash
74-
create-prisma --name my-start-app --template tanstack-start --provider postgresql
64+
create-prisma --name . --template hono --provider postgresql
7565
```
7666

77-
Create a Turborepo project with a `packages/db` Prisma package:
67+
Create a monorepo with a shared Prisma package:
7868

7969
```bash
8070
create-prisma --name my-monorepo --template turborepo --provider postgresql
8171
```
8272

83-
Set package manager non-interactively:
73+
Use Prisma Postgres auto-provisioning:
8474

8575
```bash
86-
create-prisma --name my-app --template hono --package-manager pnpm --install
76+
create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
8777
```
8878

89-
Skip Prisma Client generation:
79+
## Supported Templates
9080

91-
```bash
92-
create-prisma --name my-app --template hono --no-generate
93-
```
81+
- `hono`
82+
- `elysia`
83+
- `nest`
84+
- `next`
85+
- `svelte`
86+
- `astro`
87+
- `nuxt`
88+
- `tanstack-start`
89+
- `turborepo`
9490

95-
Show verbose command output:
91+
## Supported Databases
9692

97-
```bash
98-
create-prisma --name my-app --template hono --verbose
99-
```
93+
- `postgresql`
94+
- `mysql`
95+
- `sqlite`
96+
- `sqlserver`
97+
- `cockroachdb`
10098

101-
Run fully non-interactive with defaults:
99+
## Supported Package Managers
102100

103-
```bash
104-
create-prisma --yes
105-
```
101+
- `npm`
102+
- `pnpm`
103+
- `yarn`
104+
- `bun`
105+
- `deno`
106106

107-
Use Prisma Postgres auto-provisioning for PostgreSQL:
107+
## Useful Flags
108108

109-
```bash
110-
create-prisma --name my-app --template hono --provider postgresql --prisma-postgres
111-
```
109+
- `--name` project name or relative path
110+
- `--template` choose the template
111+
- `--provider` choose the database provider
112+
- `--package-manager` choose the package manager/runtime
113+
- `--schema-preset empty|basic`
114+
- `--yes` accept defaults and skip prompts
115+
- `--no-install` scaffold only
116+
- `--no-generate` skip `prisma generate`
117+
- `--prisma-postgres` provision Prisma Postgres for PostgreSQL
118+
- `--skills --mcp --extension` enable optional add-ons
119+
- `--force` allow scaffolding into a non-empty directory
120+
- `--verbose` print full command output
112121

113-
Enable add-ons with individual flags:
122+
## Add-ons
114123

115-
```bash
116-
create-prisma --name my-app --template next --skills --mcp --extension
117-
```
124+
`create-prisma` can also help with a few optional extras:
125+
126+
- Prisma skills for coding agents
127+
- Prisma MCP setup
128+
- Prisma IDE extension install
118129

119-
Or run locally:
130+
These can be selected interactively or enabled with flags.
131+
132+
## Local Development
120133

121134
```bash
122135
bun install
@@ -125,64 +138,20 @@ bun run build
125138
bun run start
126139
```
127140

128-
The CLI updates `package.json` with Prisma dependencies, optionally runs dependency installation with your selected package manager, and scaffolds Prisma 7 setup files directly inside each app template:
129-
130-
- `prisma/schema.prisma`
131-
- `prisma/seed.ts`
132-
- `src/lib/prisma.ts`, `src/lib/prisma.server.ts`, `src/lib/server/prisma.ts`, `server/utils/prisma.ts`, or `packages/db/src/client.ts`
133-
- `prisma.config.ts`
134-
- `src/generated/prisma` or `server/generated/prisma` (Nuxt) or `packages/db/src/generated/prisma` (Turborepo)
135-
- `.env` (creates or updates `DATABASE_URL`, and writes `CLAIM_URL` when Prisma Postgres is provisioned)
136-
- runs `prisma generate` automatically after scaffolding
137-
138-
`create` is the default command and currently supports:
139-
140-
- templates: `hono`, `next`, `svelte`, `astro`, `nuxt`, `tanstack-start`, `turborepo`
141-
- project name via `--name`
142-
- schema presets via `--schema-preset empty|basic` (default: `basic`)
143-
144-
`create` prompts for database choice, package manager, and whether to install dependencies now.
145-
Supported providers in this flow: `postgresql`, `mysql`, `sqlite`, `sqlserver`, `cockroachdb`.
146-
Supported package managers: `bun`, `deno`, `npm`, `pnpm`, `yarn`.
147-
Package manager prompt auto-detects from `package.json`/lockfiles/user agent and uses that as the initial selection.
148-
`--yes` accepts defaults (`postgresql`, detected package manager, Prisma Postgres enabled for PostgreSQL, install enabled) and skips prompts.
149-
`--no-generate` skips automatic `prisma generate`.
150-
`--verbose` prints full install/generate command output; default mode keeps output concise.
151-
`--force` (create only) allows scaffolding in a non-empty target directory.
152-
Add-ons can be selected interactively or through flags: `--skills`, `--mcp`, `--extension`.
153-
When add-ons are enabled, `create` prompts for the relevant agent and IDE selections, then installs curated Prisma skills (`skills@latest`), configures Prisma MCP (`add-mcp@latest`), and installs the Prisma IDE extension for supported IDE CLIs.
154-
When `postgresql` is selected, `create` can provision Prisma Postgres via `create-db --json` and auto-fill `DATABASE_URL`.
155-
Generated projects also include `db:seed` and configure Prisma's `migrations.seed` hook to run `tsx prisma/seed.ts`.
141+
Useful repo scripts:
156142

157-
## Telemetry
143+
- `bun run dev`
144+
- `bun run typecheck`
145+
- `bun run format`
146+
- `bun run lint`
147+
- `bun run bump`
158148

159-
Published builds may send anonymous PostHog telemetry for `create` runs to help improve the CLI. It does not include project names, file paths, or database URLs. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
160-
161-
## Scripts
162-
163-
- `bun run build` - Build to `dist/`
164-
- `bun run check` - Run formatting and lint checks
165-
- `bun run dev` - Watch mode build
166-
- `bun run start` - Run built CLI
167-
- `bun run lint` - Run `oxlint` with warnings treated as failures
168-
- `bun run lint:fix` - Apply safe `oxlint` fixes
169-
- `bun run format` - Format the repo with `oxfmt`
170-
- `bun run format:check` - Check formatting with `oxfmt`
171-
- `bun run typecheck` - TypeScript checks only
172-
- `bun run bump` - Create a release PR (interactive semver bump)
173-
- `bun run bump -- patch|minor|major|x.y.z` - Non-interactive bump
174-
- `bun run bump -- --dry-run patch` - Preview next version without changing files
175-
- `bun run release-notes` - Generate GitHub release notes via `changelogithub`
176-
177-
## Release Workflow
149+
## Telemetry
178150

179-
This repo uses a manual, script-driven release flow:
151+
Published builds may send anonymous usage telemetry to help improve the CLI. It does not include project names, file paths, or database URLs.
180152

181-
1. Run `bun run bump` (or pass `patch|minor|major|x.y.z`).
182-
2. The script creates a `release/vX.Y.Z` branch and a PR with commit `chore(release): X.Y.Z`.
183-
3. Merge that PR to `main` with squash (keep commit title `chore(release): X.Y.Z`).
184-
4. GitHub Actions runs `bun run check`, `bun run typecheck`, and `bun run build` before publishing.
185-
5. GitHub Actions creates the `vX.Y.Z` tag and GitHub Release notes via `changelogithub`.
186-
6. GitHub Actions publishes only for `chore(release):` commits, using npm trusted publishing (OIDC, no npm token secret).
153+
Disable it with any of:
187154

188-
Every PR from a branch in this repository also publishes a preview package to npm using the dist-tag `pr<PR_NUMBER>`, so PR 3 is installable as `create-prisma@pr3`.
155+
- `DO_NOT_TRACK`
156+
- `CREATE_PRISMA_DISABLE_TELEMETRY`
157+
- `CREATE_PRISMA_TELEMETRY_DISABLED`

0 commit comments

Comments
 (0)