create-prisma 0.3.2-pr.31.56.1 → 0.3.2-pr.31.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,140 +1,135 @@
1
1
  # create-prisma
2
2
 
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.
4
4
 
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.
6
6
 
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
14
8
 
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
16
16
 
17
- Run directly with Bun:
17
+ ## Quick Start
18
18
 
19
- ```bash
20
- bunx create-prisma@latest
21
- ```
22
-
23
- Run directly with Yarn:
24
-
25
- ```bash
26
- yarn dlx create-prisma@latest
27
- ```
28
-
29
- Run directly with Deno:
19
+ Use the package runner you already have:
30
20
 
31
21
  ```bash
32
- deno run -A npm:create-prisma@latest
22
+ npx create-prisma@latest
33
23
  ```
34
24
 
35
- Create a new project (default command):
36
-
37
25
  ```bash
38
- create-prisma
26
+ pnpm dlx create-prisma@latest
39
27
  ```
40
28
 
41
- Create a Hono project non-interactively:
42
-
43
29
  ```bash
44
- create-prisma --name my-api --template hono --provider postgresql
30
+ yarn dlx create-prisma@latest
45
31
  ```
46
32
 
47
- Scaffold into the current directory:
48
-
49
33
  ```bash
50
- create-prisma --name . --template hono --provider postgresql
34
+ bunx create-prisma@latest
51
35
  ```
52
36
 
53
- Create an Elysia project non-interactively:
54
-
55
37
  ```bash
56
- create-prisma --name my-elysia-api --template elysia --provider postgresql
38
+ deno run -A npm:create-prisma@latest
57
39
  ```
58
40
 
59
- Create a NestJS project non-interactively:
41
+ If you already have it available locally:
60
42
 
61
43
  ```bash
62
- create-prisma --name my-nest-api --template nest --provider postgresql
44
+ create-prisma
63
45
  ```
64
46
 
65
- Create a Next.js project non-interactively:
66
-
67
- ```bash
68
- create-prisma --name my-web --template next --provider postgresql
69
- ```
47
+ ## Common Examples
70
48
 
71
- Create a SvelteKit project non-interactively:
49
+ Create a project interactively:
72
50
 
73
51
  ```bash
74
- create-prisma --name my-app --template svelte --provider postgresql
52
+ create-prisma
75
53
  ```
76
54
 
77
- Create an Astro project non-interactively:
55
+ Create a Hono app non-interactively:
78
56
 
79
57
  ```bash
80
- create-prisma --name my-site --template astro --provider postgresql
58
+ create-prisma --name my-api --template hono --provider postgresql
81
59
  ```
82
60
 
83
- Create a Nuxt project non-interactively:
61
+ Scaffold into the current directory:
84
62
 
85
63
  ```bash
86
- create-prisma --name my-nuxt-app --template nuxt --provider postgresql
64
+ create-prisma --name . --template hono --provider postgresql
87
65
  ```
88
66
 
89
- Create a TanStack Start project non-interactively:
67
+ Create a monorepo with a shared Prisma package:
90
68
 
91
69
  ```bash
92
- create-prisma --name my-start-app --template tanstack-start --provider postgresql
70
+ create-prisma --name my-monorepo --template turborepo --provider postgresql
93
71
  ```
94
72
 
95
- Create a Turborepo project with a `packages/db` Prisma package:
73
+ Use Prisma Postgres auto-provisioning:
96
74
 
97
75
  ```bash
98
- create-prisma --name my-monorepo --template turborepo --provider postgresql
76
+ create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
99
77
  ```
100
78
 
101
- Set package manager non-interactively:
79
+ ## Supported Templates
102
80
 
103
- ```bash
104
- create-prisma --name my-app --template hono --package-manager pnpm --install
105
- ```
81
+ - `hono`
82
+ - `elysia`
83
+ - `nest`
84
+ - `next`
85
+ - `svelte`
86
+ - `astro`
87
+ - `nuxt`
88
+ - `tanstack-start`
89
+ - `turborepo`
106
90
 
107
- Skip Prisma Client generation:
91
+ ## Supported Databases
108
92
 
109
- ```bash
110
- create-prisma --name my-app --template hono --no-generate
111
- ```
93
+ - `postgresql`
94
+ - `mysql`
95
+ - `sqlite`
96
+ - `sqlserver`
97
+ - `cockroachdb`
112
98
 
113
- Show verbose command output:
99
+ ## Supported Package Managers
114
100
 
115
- ```bash
116
- create-prisma --name my-app --template hono --verbose
117
- ```
101
+ - `npm`
102
+ - `pnpm`
103
+ - `yarn`
104
+ - `bun`
105
+ - `deno`
118
106
 
119
- Run fully non-interactive with defaults:
107
+ ## Useful Flags
120
108
 
121
- ```bash
122
- create-prisma --yes
123
- ```
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
124
121
 
125
- Use Prisma Postgres auto-provisioning for PostgreSQL:
122
+ ## Add-ons
126
123
 
127
- ```bash
128
- create-prisma --name my-app --template hono --provider postgresql --prisma-postgres
129
- ```
124
+ `create-prisma` can also help with a few optional extras:
130
125
 
131
- Enable add-ons with individual flags:
126
+ - Prisma skills for coding agents
127
+ - Prisma MCP setup
128
+ - Prisma IDE extension install
132
129
 
133
- ```bash
134
- create-prisma --name my-app --template next --skills --mcp --extension
135
- ```
130
+ These can be selected interactively or enabled with flags.
136
131
 
137
- Or run locally:
132
+ ## Local Development
138
133
 
139
134
  ```bash
140
135
  bun install
@@ -143,64 +138,20 @@ bun run build
143
138
  bun run start
144
139
  ```
145
140
 
146
- 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:
147
-
148
- - `prisma/schema.prisma`
149
- - `prisma/seed.ts`
150
- - `src/lib/prisma.ts`, `src/lib/prisma.server.ts`, `src/lib/server/prisma.ts`, `server/utils/prisma.ts`, or `packages/db/src/client.ts`
151
- - `prisma.config.ts`
152
- - `src/generated/prisma` or `server/generated/prisma` (Nuxt) or `packages/db/src/generated/prisma` (Turborepo)
153
- - `.env` (creates or updates `DATABASE_URL`, and writes `CLAIM_URL` when Prisma Postgres is provisioned)
154
- - runs `prisma generate` automatically after scaffolding
155
-
156
- `create` is the default command and currently supports:
157
-
158
- - templates: `hono`, `elysia`, `nest`, `next`, `svelte`, `astro`, `nuxt`, `tanstack-start`, `turborepo`
159
- - project name via `--name`
160
- - schema presets via `--schema-preset empty|basic` (default: `basic`)
161
-
162
- `create` prompts for database choice, package manager, and whether to install dependencies now.
163
- Supported providers in this flow: `postgresql`, `mysql`, `sqlite`, `sqlserver`, `cockroachdb`.
164
- Supported package managers: `bun`, `deno`, `npm`, `pnpm`, `yarn`.
165
- Package manager prompt auto-detects from `package.json`/lockfiles/user agent and uses that as the initial selection.
166
- `--yes` accepts defaults (`postgresql`, detected package manager, Prisma Postgres enabled for PostgreSQL, install enabled) and skips prompts.
167
- `--no-generate` skips automatic `prisma generate`.
168
- `--verbose` prints full install/generate command output; default mode keeps output concise.
169
- `--force` (create only) allows scaffolding in a non-empty target directory.
170
- Add-ons can be selected interactively or through flags: `--skills`, `--mcp`, `--extension`.
171
- 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.
172
- When `postgresql` is selected, `create` can provision Prisma Postgres via `create-db --json` and auto-fill `DATABASE_URL`.
173
- Generated projects also include `db:seed` and configure Prisma's `migrations.seed` hook to run `tsx prisma/seed.ts`.
174
-
175
- ## Telemetry
176
-
177
- 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`.
178
-
179
- ## Scripts
141
+ Useful repo scripts:
180
142
 
181
- - `bun run build` - Build to `dist/`
182
- - `bun run check` - Run formatting and lint checks
183
- - `bun run dev` - Watch mode build
184
- - `bun run start` - Run built CLI
185
- - `bun run lint` - Run `oxlint` with warnings treated as failures
186
- - `bun run lint:fix` - Apply safe `oxlint` fixes
187
- - `bun run format` - Format the repo with `oxfmt`
188
- - `bun run format:check` - Check formatting with `oxfmt`
189
- - `bun run typecheck` - TypeScript checks only
190
- - `bun run bump` - Create a release PR (interactive semver bump)
191
- - `bun run bump -- patch|minor|major|x.y.z` - Non-interactive bump
192
- - `bun run bump -- --dry-run patch` - Preview next version without changing files
193
- - `bun run release-notes` - Generate GitHub release notes via `changelogithub`
143
+ - `bun run dev`
144
+ - `bun run typecheck`
145
+ - `bun run format`
146
+ - `bun run lint`
147
+ - `bun run bump`
194
148
 
195
- ## Release Workflow
149
+ ## Telemetry
196
150
 
197
- 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.
198
152
 
199
- 1. Run `bun run bump` (or pass `patch|minor|major|x.y.z`).
200
- 2. The script creates a `release/vX.Y.Z` branch and a PR with commit `chore(release): X.Y.Z`.
201
- 3. Merge that PR to `main` with squash (keep commit title `chore(release): X.Y.Z`).
202
- 4. GitHub Actions runs `bun run check`, `bun run typecheck`, and `bun run build` before publishing.
203
- 5. GitHub Actions creates the `vX.Y.Z` tag and GitHub Release notes via `changelogithub`.
204
- 6. GitHub Actions publishes only for `chore(release):` commits, using npm trusted publishing (OIDC, no npm token secret).
153
+ Disable it with any of:
205
154
 
206
- 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`
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./create-CBvKLvJr.mjs";
2
+ import "./create-BHPCtgUf.mjs";
3
3
  import { createCreatePrismaCli } from "./index.mjs";
4
4
 
5
5
  //#region src/cli.ts
@@ -276,7 +276,7 @@ function getRuntimeScriptCommand(packageManager, kind, options) {
276
276
  switch (kind) {
277
277
  case "dev": return `tsx watch ${sourceEntrypoint}`;
278
278
  case "build": return "tsc";
279
- case "start": return `tsx ${builtEntrypoint ?? sourceEntrypoint}`;
279
+ case "start": return builtEntrypoint ? `node ${builtEntrypoint}` : `tsx ${sourceEntrypoint}`;
280
280
  }
281
281
  }
282
282
  function getInstallArgs(packageManager) {
@@ -1609,7 +1609,7 @@ async function getAnonymousId() {
1609
1609
  }
1610
1610
  function getCommonProperties() {
1611
1611
  return {
1612
- "cli-version": "0.3.2-pr.31.56.1",
1612
+ "cli-version": "0.3.2-pr.31.58.1",
1613
1613
  "node-version": process.version,
1614
1614
  platform: process.platform,
1615
1615
  arch: process.arch
@@ -1866,7 +1866,7 @@ async function collectCreateContext(input) {
1866
1866
  const useDefaults = input.yes === true;
1867
1867
  const force = input.force === true;
1868
1868
  const projectNameInput = input.name ?? (useDefaults ? DEFAULT_PROJECT_NAME : await promptForProjectName());
1869
- if (!projectNameInput) return;
1869
+ if (projectNameInput === void 0) return;
1870
1870
  const projectName = String(projectNameInput).trim();
1871
1871
  const projectNameValidationError = validateProjectName(projectName);
1872
1872
  if (projectNameValidationError) {
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-CBvKLvJr.mjs";
2
+ import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-BHPCtgUf.mjs";
3
3
  import { os } from "@orpc/server";
4
4
  import { createCli } from "trpc-cli";
5
5
 
6
6
  //#region src/index.ts
7
- const CLI_VERSION = "0.3.2-pr.31.56.1";
7
+ const CLI_VERSION = "0.3.2-pr.31.58.1";
8
8
  const router = os.router({ create: os.meta({
9
9
  description: "Create a new project with Prisma setup",
10
10
  default: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.3.2-pr.31.56.1",
3
+ "version": "0.3.2-pr.31.58.1",
4
4
  "private": false,
5
5
  "description": "Create Prisma 7 projects with first-party templates and great DX.",
6
6
  "homepage": "https://github.com/prisma/create-prisma",
@@ -13,7 +13,7 @@ import { prisma } from "./lib/prisma{{#if (eq packageManager "deno")}}.ts{{/if}}
13
13
  const rawPort = ({{#if (eq packageManager "deno")}}Deno.env.get("PORT"){{else}}process.env.PORT{{/if}} ?? "").trim();
14
14
  const parsedPort = rawPort.length > 0 ? Number(rawPort) : Number.NaN;
15
15
  const port =
16
- Number.isFinite(parsedPort) && parsedPort >= 0 && parsedPort <= 65535 ? parsedPort : 3000;
16
+ Number.isInteger(parsedPort) && parsedPort >= 0 && parsedPort <= 65535 ? parsedPort : 3000;
17
17
 
18
18
  const app = new Elysia({{#if (eq packageManager "deno")}}{{else}}{ adapter: node() }{{/if}})
19
19
  .get("/", () => {
@@ -31,7 +31,7 @@ app.get("/users", async (c) => {
31
31
  const rawPort = ({{#if (eq packageManager "deno")}}Deno.env.get("PORT"){{else}}process.env.PORT{{/if}} ?? "").trim();
32
32
  const parsedPort = rawPort.length > 0 ? Number(rawPort) : Number.NaN;
33
33
  const port =
34
- Number.isFinite(parsedPort) && parsedPort >= 0 && parsedPort <= 65535 ? parsedPort : 3000;
34
+ Number.isInteger(parsedPort) && parsedPort >= 0 && parsedPort <= 65535 ? parsedPort : 3000;
35
35
  serve({
36
36
  fetch: app.fetch,
37
37
  port,