create-prisma 0.3.2-pr.31.57.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 +84 -133
- package/dist/cli.mjs +1 -1
- package/dist/{create-B39mwJIP.mjs → create-BHPCtgUf.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,140 +1,135 @@
|
|
|
1
1
|
# create-prisma
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffold a new app with Prisma already wired up.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
+
## Quick Start
|
|
18
18
|
|
|
19
|
-
|
|
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
|
-
|
|
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
|
|
30
|
+
yarn dlx create-prisma@latest
|
|
45
31
|
```
|
|
46
32
|
|
|
47
|
-
Scaffold into the current directory:
|
|
48
|
-
|
|
49
33
|
```bash
|
|
50
|
-
create-prisma
|
|
34
|
+
bunx create-prisma@latest
|
|
51
35
|
```
|
|
52
36
|
|
|
53
|
-
Create an Elysia project non-interactively:
|
|
54
|
-
|
|
55
37
|
```bash
|
|
56
|
-
|
|
38
|
+
deno run -A npm:create-prisma@latest
|
|
57
39
|
```
|
|
58
40
|
|
|
59
|
-
|
|
41
|
+
If you already have it available locally:
|
|
60
42
|
|
|
61
43
|
```bash
|
|
62
|
-
create-prisma
|
|
44
|
+
create-prisma
|
|
63
45
|
```
|
|
64
46
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
create-prisma --name my-web --template next --provider postgresql
|
|
69
|
-
```
|
|
47
|
+
## Common Examples
|
|
70
48
|
|
|
71
|
-
Create a
|
|
49
|
+
Create a project interactively:
|
|
72
50
|
|
|
73
51
|
```bash
|
|
74
|
-
create-prisma
|
|
52
|
+
create-prisma
|
|
75
53
|
```
|
|
76
54
|
|
|
77
|
-
Create
|
|
55
|
+
Create a Hono app non-interactively:
|
|
78
56
|
|
|
79
57
|
```bash
|
|
80
|
-
create-prisma --name my-
|
|
58
|
+
create-prisma --name my-api --template hono --provider postgresql
|
|
81
59
|
```
|
|
82
60
|
|
|
83
|
-
|
|
61
|
+
Scaffold into the current directory:
|
|
84
62
|
|
|
85
63
|
```bash
|
|
86
|
-
create-prisma --name
|
|
64
|
+
create-prisma --name . --template hono --provider postgresql
|
|
87
65
|
```
|
|
88
66
|
|
|
89
|
-
Create a
|
|
67
|
+
Create a monorepo with a shared Prisma package:
|
|
90
68
|
|
|
91
69
|
```bash
|
|
92
|
-
create-prisma --name my-
|
|
70
|
+
create-prisma --name my-monorepo --template turborepo --provider postgresql
|
|
93
71
|
```
|
|
94
72
|
|
|
95
|
-
|
|
73
|
+
Use Prisma Postgres auto-provisioning:
|
|
96
74
|
|
|
97
75
|
```bash
|
|
98
|
-
create-prisma --name my-
|
|
76
|
+
create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
|
|
99
77
|
```
|
|
100
78
|
|
|
101
|
-
|
|
79
|
+
## Supported Templates
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
81
|
+
- `hono`
|
|
82
|
+
- `elysia`
|
|
83
|
+
- `nest`
|
|
84
|
+
- `next`
|
|
85
|
+
- `svelte`
|
|
86
|
+
- `astro`
|
|
87
|
+
- `nuxt`
|
|
88
|
+
- `tanstack-start`
|
|
89
|
+
- `turborepo`
|
|
106
90
|
|
|
107
|
-
|
|
91
|
+
## Supported Databases
|
|
108
92
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
- `postgresql`
|
|
94
|
+
- `mysql`
|
|
95
|
+
- `sqlite`
|
|
96
|
+
- `sqlserver`
|
|
97
|
+
- `cockroachdb`
|
|
112
98
|
|
|
113
|
-
|
|
99
|
+
## Supported Package Managers
|
|
114
100
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
- `npm`
|
|
102
|
+
- `pnpm`
|
|
103
|
+
- `yarn`
|
|
104
|
+
- `bun`
|
|
105
|
+
- `deno`
|
|
118
106
|
|
|
119
|
-
|
|
107
|
+
## Useful Flags
|
|
120
108
|
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
122
|
+
## Add-ons
|
|
126
123
|
|
|
127
|
-
|
|
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
|
-
|
|
126
|
+
- Prisma skills for coding agents
|
|
127
|
+
- Prisma MCP setup
|
|
128
|
+
- Prisma IDE extension install
|
|
132
129
|
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
182
|
-
- `bun run
|
|
183
|
-
- `bun run
|
|
184
|
-
- `bun run
|
|
185
|
-
- `bun run
|
|
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
|
-
##
|
|
149
|
+
## Telemetry
|
|
196
150
|
|
|
197
|
-
|
|
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
|
-
|
|
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
|
-
|
|
155
|
+
- `DO_NOT_TRACK`
|
|
156
|
+
- `CREATE_PRISMA_DISABLE_TELEMETRY`
|
|
157
|
+
- `CREATE_PRISMA_TELEMETRY_DISABLED`
|
package/dist/cli.mjs
CHANGED
|
@@ -1609,7 +1609,7 @@ async function getAnonymousId() {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
function getCommonProperties() {
|
|
1611
1611
|
return {
|
|
1612
|
-
"cli-version": "0.3.2-pr.31.
|
|
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
|
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-
|
|
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.
|
|
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