create-prisma 0.7.2 → 0.8.0-pr.57.218.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 +39 -155
- package/dist/cli.mjs +9 -3
- package/dist/create-BHt4J1kk.mjs +1489 -0
- package/dist/index.d.mts +43 -59
- package/dist/index.mjs +35 -2
- package/package.json +24 -19
- package/templates/create/_shared/.gitattributes.hbs +11 -0
- package/templates/create/_shared/README.md.hbs +72 -0
- package/templates/create/_shared/module.ts.hbs +30 -0
- package/templates/create/_shared/pnpm-workspace.yaml.hbs +16 -0
- package/templates/create/_shared/prisma-composer.config.ts.hbs +13 -0
- package/templates/create/_shared/prisma.config.ts.hbs +19 -0
- package/templates/create/_shared/service.ts.hbs +44 -0
- package/templates/create/_shared/src/prisma/composer.ts.hbs +10 -0
- package/templates/create/_shared/src/prisma/db.ts.hbs +63 -0
- package/templates/create/_shared/src/prisma/seed.ts.hbs +36 -0
- package/templates/create/_shared/src/prisma/users.ts.hbs +35 -0
- package/templates/create/astro/{astro.config.mjs.hbs → astro.config.mjs} +1 -2
- package/templates/create/astro/package.json.hbs +5 -5
- package/templates/create/astro/src/pages/api/users.ts.hbs +6 -23
- package/templates/create/astro/src/pages/index.astro.hbs +19 -56
- package/templates/create/astro/tsconfig.json +3 -0
- package/templates/create/elysia/package.json.hbs +6 -7
- package/templates/create/elysia/src/index.ts.hbs +18 -27
- package/templates/create/elysia/tsconfig.json +3 -1
- package/templates/create/hono/package.json.hbs +6 -7
- package/templates/create/hono/src/index.ts.hbs +11 -15
- package/templates/create/hono/tsconfig.json +3 -1
- package/templates/create/minimal/.yarnrc.yml.hbs +3 -0
- package/templates/create/minimal/package.json.hbs +21 -0
- package/templates/create/minimal/src/index.ts.hbs +19 -0
- package/templates/create/{turborepo/apps/api → minimal}/tsconfig.json +2 -2
- package/templates/create/nest/package.json.hbs +7 -7
- package/templates/create/nest/src/app.module.ts.hbs +9 -10
- package/templates/create/nest/src/main.ts.hbs +3 -10
- package/templates/create/nest/src/prisma.service.ts.hbs +6 -5
- package/templates/create/nest/src/users.controller.ts.hbs +3 -5
- package/templates/create/nest/src/users.service.ts.hbs +4 -11
- package/templates/create/nest/tsconfig.json +3 -2
- package/templates/create/next/eslint.config.mjs +8 -1
- package/templates/create/next/package.json.hbs +10 -10
- package/templates/create/next/src/app/page.tsx.hbs +17 -56
- package/templates/create/next/tsconfig.json +1 -0
- package/templates/create/nuxt/app/pages/index.vue.hbs +12 -45
- package/templates/create/nuxt/package.json.hbs +8 -7
- package/templates/create/nuxt/server/api/users.get.ts.hbs +3 -15
- package/templates/create/nuxt/tsconfig.json +3 -0
- package/templates/create/svelte/package.json.hbs +9 -11
- package/templates/create/svelte/src/routes/+page.server.ts.hbs +4 -16
- package/templates/create/svelte/src/routes/+page.svelte.hbs +14 -164
- package/templates/create/svelte/svelte.config.js +1 -4
- package/templates/create/svelte/tsconfig.json +2 -1
- package/templates/create/svelte/vite.config.ts +3 -0
- package/templates/create/tanstack-start/package.json.hbs +14 -14
- package/templates/create/tanstack-start/src/routes/__root.tsx.hbs +2 -3
- package/templates/create/tanstack-start/src/routes/index.tsx.hbs +27 -78
- package/templates/create/tanstack-start/tsconfig.json +4 -2
- package/templates/create/tanstack-start/vite.config.ts +2 -4
- package/dist/src-B3hRLZ0U.mjs +0 -2527
- package/templates/create/astro/README.md.hbs +0 -47
- package/templates/create/astro/prisma/schema.prisma.hbs +0 -21
- package/templates/create/astro/prisma/seed.ts.hbs +0 -38
- package/templates/create/astro/prisma.compute.ts.hbs +0 -10
- package/templates/create/astro/prisma.config.ts.hbs +0 -15
- package/templates/create/astro/src/lib/prisma.ts.hbs +0 -55
- package/templates/create/elysia/README.md.hbs +0 -43
- package/templates/create/elysia/deno.json.hbs +0 -5
- package/templates/create/elysia/prisma/schema.prisma.hbs +0 -25
- package/templates/create/elysia/prisma/seed.ts.hbs +0 -38
- package/templates/create/elysia/prisma.compute.ts.hbs +0 -11
- package/templates/create/elysia/prisma.config.ts.hbs +0 -15
- package/templates/create/elysia/src/lib/prisma.ts.hbs +0 -56
- package/templates/create/hono/README.md.hbs +0 -43
- package/templates/create/hono/deno.json.hbs +0 -5
- package/templates/create/hono/prisma/schema.prisma.hbs +0 -25
- package/templates/create/hono/prisma/seed.ts.hbs +0 -38
- package/templates/create/hono/prisma.compute.ts.hbs +0 -10
- package/templates/create/hono/prisma.config.ts.hbs +0 -15
- package/templates/create/hono/src/lib/prisma.ts.hbs +0 -56
- package/templates/create/nest/README.md.hbs +0 -43
- package/templates/create/nest/deno.json.hbs +0 -5
- package/templates/create/nest/prisma/schema.prisma.hbs +0 -25
- package/templates/create/nest/prisma/seed.ts.hbs +0 -40
- package/templates/create/nest/prisma.compute.ts.hbs +0 -10
- package/templates/create/nest/prisma.config.ts.hbs +0 -15
- package/templates/create/nest/src/lib/prisma.ts.hbs +0 -58
- package/templates/create/next/README.md.hbs +0 -42
- package/templates/create/next/deno.json.hbs +0 -12
- package/templates/create/next/prisma/schema.prisma.hbs +0 -21
- package/templates/create/next/prisma/seed.ts.hbs +0 -38
- package/templates/create/next/prisma.compute.ts.hbs +0 -9
- package/templates/create/next/prisma.config.ts.hbs +0 -15
- package/templates/create/next/src/lib/prisma.ts.hbs +0 -56
- package/templates/create/nuxt/README.md.hbs +0 -44
- package/templates/create/nuxt/deno.json.hbs +0 -5
- package/templates/create/nuxt/prisma/schema.prisma.hbs +0 -21
- package/templates/create/nuxt/prisma/seed.ts.hbs +0 -38
- package/templates/create/nuxt/prisma.compute.ts.hbs +0 -9
- package/templates/create/nuxt/prisma.config.ts.hbs +0 -15
- package/templates/create/nuxt/server/utils/prisma.ts.hbs +0 -56
- package/templates/create/svelte/README.md.hbs +0 -45
- package/templates/create/svelte/deno.json.hbs +0 -5
- package/templates/create/svelte/prisma/schema.prisma.hbs +0 -21
- package/templates/create/svelte/prisma/seed.ts.hbs +0 -38
- package/templates/create/svelte/prisma.config.ts.hbs +0 -15
- package/templates/create/svelte/src/lib/server/prisma.ts.hbs +0 -53
- package/templates/create/tanstack-start/README.md.hbs +0 -43
- package/templates/create/tanstack-start/deno.json.hbs +0 -13
- package/templates/create/tanstack-start/prisma/schema.prisma.hbs +0 -21
- package/templates/create/tanstack-start/prisma/seed.ts.hbs +0 -38
- package/templates/create/tanstack-start/prisma.compute.ts.hbs +0 -9
- package/templates/create/tanstack-start/prisma.config.ts.hbs +0 -15
- package/templates/create/tanstack-start/src/lib/prisma.server.ts.hbs +0 -56
- package/templates/create/turborepo/README.md.hbs +0 -42
- package/templates/create/turborepo/apps/api/package.json.hbs +0 -26
- package/templates/create/turborepo/apps/api/src/index.ts.hbs +0 -55
- package/templates/create/turborepo/deno.json.hbs +0 -5
- package/templates/create/turborepo/package.json.hbs +0 -30
- package/templates/create/turborepo/packages/db/package.json.hbs +0 -22
- package/templates/create/turborepo/packages/db/prisma/schema.prisma.hbs +0 -21
- package/templates/create/turborepo/packages/db/prisma/seed.ts.hbs +0 -38
- package/templates/create/turborepo/packages/db/prisma.config.ts.hbs +0 -15
- package/templates/create/turborepo/packages/db/src/client.ts.hbs +0 -63
- package/templates/create/turborepo/packages/db/src/index.ts +0 -2
- package/templates/create/turborepo/packages/db/tsconfig.json +0 -15
- package/templates/create/turborepo/pnpm-workspace.yaml +0 -3
- package/templates/create/turborepo/prisma.compute.ts.hbs +0 -14
- package/templates/create/turborepo/turbo.json +0 -28
- /package/templates/create/{astro → _shared}/deno.json.hbs +0 -0
- /package/templates/create/{turborepo → elysia}/.yarnrc.yml.hbs +0 -0
- /package/templates/create/next/{next.config.ts.hbs → next.config.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,195 +1,79 @@
|
|
|
1
1
|
# create-prisma
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Create a Prisma 8 app with Prisma Composer built in.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Quick start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
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`, `prisma.config.ts`, and Compute deploy defaults for Compute-ready templates
|
|
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 the template env file with `DATABASE_URL`
|
|
15
|
-
- can install dependencies and run `prisma generate` for you
|
|
16
|
-
- can deploy the finished app to Prisma Compute and return a live URL
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
Use the package runner you already have:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npx create-prisma@latest
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
pnpm dlx create-prisma@latest
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
yarn dlx create-prisma@latest
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
bunx create-prisma@latest
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
deno run -A npm:create-prisma@latest
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
If you already have it available locally:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
create-prisma
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Common Examples
|
|
49
|
-
|
|
50
|
-
Create a project interactively:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
create-prisma
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Create a Hono app non-interactively:
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
create-prisma --name my-api --template hono --provider postgresql
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Scaffold into the current directory:
|
|
7
|
+
Use your package manager:
|
|
63
8
|
|
|
64
9
|
```bash
|
|
65
|
-
create-prisma
|
|
10
|
+
npx create-prisma@latest my-app
|
|
11
|
+
pnpm dlx create-prisma@latest my-app
|
|
12
|
+
yarn dlx create-prisma@latest my-app
|
|
13
|
+
bunx create-prisma@latest my-app
|
|
66
14
|
```
|
|
67
15
|
|
|
68
|
-
|
|
16
|
+
The CLI initializes Prisma 8 with `prisma@next`, installs dependencies, emits the contract, and generates a deployable Composer app. PostgreSQL projects use Composer's native Prisma Postgres provider, including migrations and a typed runtime client.
|
|
69
17
|
|
|
70
|
-
|
|
71
|
-
create-prisma --name my-monorepo --template turborepo --provider postgresql
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Use Prisma Postgres auto-provisioning:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
|
|
78
|
-
```
|
|
18
|
+
The deployment prompt is:
|
|
79
19
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
create-prisma --name my-api --template hono --provider postgresql --deploy
|
|
20
|
+
```text
|
|
21
|
+
Deploy to Prisma now?
|
|
84
22
|
```
|
|
85
23
|
|
|
86
|
-
|
|
24
|
+
Choose no to deploy later with the generated `deploy` script.
|
|
87
25
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- `elysia`
|
|
92
|
-
- `nest`
|
|
93
|
-
- `next`
|
|
94
|
-
- `svelte`
|
|
95
|
-
- `astro`
|
|
96
|
-
- `nuxt`
|
|
97
|
-
- `tanstack-start`
|
|
98
|
-
- `turborepo`
|
|
26
|
+
When multiple Prisma workspace sessions are available, the CLI asks which workspace should receive
|
|
27
|
+
the deployment. For unattended usage, pass `--workspace <id-or-name>` or omit it to use the active
|
|
28
|
+
workspace. Choosing another workspace also updates the Prisma CLI's active workspace session.
|
|
99
29
|
|
|
100
|
-
|
|
30
|
+
## Templates
|
|
101
31
|
|
|
32
|
+
- `minimal`
|
|
102
33
|
- `hono`
|
|
103
34
|
- `elysia`
|
|
104
35
|
- `nest`
|
|
105
36
|
- `next`
|
|
37
|
+
- `svelte` (SvelteKit)
|
|
106
38
|
- `astro`
|
|
107
39
|
- `nuxt`
|
|
108
40
|
- `tanstack-start`
|
|
109
|
-
- `turborepo`
|
|
110
41
|
|
|
111
|
-
|
|
42
|
+
PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring. npm, pnpm, Yarn, and Bun are supported.
|
|
112
43
|
|
|
113
|
-
|
|
114
|
-
- `mysql`
|
|
115
|
-
- `sqlite`
|
|
116
|
-
- `sqlserver`
|
|
117
|
-
- `cockroachdb`
|
|
118
|
-
|
|
119
|
-
## Supported Package Managers
|
|
120
|
-
|
|
121
|
-
- `npm`
|
|
122
|
-
- `pnpm`
|
|
123
|
-
- `yarn`
|
|
124
|
-
- `bun`
|
|
125
|
-
- `deno`
|
|
126
|
-
|
|
127
|
-
## Useful Flags
|
|
128
|
-
|
|
129
|
-
- `--name` project name or relative path
|
|
130
|
-
- `--template` choose the template
|
|
131
|
-
- `--provider` choose the database provider
|
|
132
|
-
- `--package-manager` choose the package manager/runtime
|
|
133
|
-
- `--schema-preset empty|basic`
|
|
134
|
-
- `--deploy` deploy supported templates to Prisma Compute
|
|
135
|
-
- `--yes` accept defaults and skip prompts
|
|
136
|
-
- `--no-install` scaffold only
|
|
137
|
-
- `--no-generate` skip `prisma generate`
|
|
138
|
-
- `--prisma-postgres` provision Prisma Postgres for PostgreSQL
|
|
139
|
-
- `--skills --mcp --extension` enable optional add-ons
|
|
140
|
-
- `--force` allow scaffolding into a non-empty directory
|
|
141
|
-
- `--verbose` print full command output
|
|
142
|
-
|
|
143
|
-
## Add-ons
|
|
144
|
-
|
|
145
|
-
`create-prisma` can also help with a few optional extras:
|
|
146
|
-
|
|
147
|
-
- Prisma skills for coding agents
|
|
148
|
-
- Prisma MCP setup
|
|
149
|
-
- Prisma IDE extension install
|
|
150
|
-
|
|
151
|
-
These can be selected interactively or enabled with flags.
|
|
152
|
-
When Prisma Compute deploy is selected, the skills add-on recommends the `prisma-compute` skill too.
|
|
153
|
-
|
|
154
|
-
## Deploy to Prisma Compute
|
|
155
|
-
|
|
156
|
-
After scaffolding, `create-prisma` can deploy your app to [Prisma Compute](https://www.prisma.io/docs/compute), the serverless hosting for TypeScript apps that runs next to your Prisma Postgres database. It is offered for the templates the Prisma CLI can deploy today: `hono`, `elysia`, `nest`, `next`, `astro`, `nuxt`, `tanstack-start`, and `turborepo`.
|
|
157
|
-
|
|
158
|
-
Accept the deploy prompt when it appears, or pass the flag:
|
|
44
|
+
Deno is supported for local minimal PostgreSQL apps:
|
|
159
45
|
|
|
160
46
|
```bash
|
|
161
|
-
create-prisma
|
|
47
|
+
deno run -A npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy
|
|
162
48
|
```
|
|
163
49
|
|
|
164
|
-
|
|
50
|
+
Prisma Compute does not support Deno deployments yet.
|
|
51
|
+
|
|
52
|
+
## Options
|
|
165
53
|
|
|
166
|
-
|
|
54
|
+
- positional project name or `--name`
|
|
55
|
+
- `--template`
|
|
56
|
+
- `--provider postgres|postgresql|mongo|mongodb`
|
|
57
|
+
- `--authoring psl|typescript`
|
|
58
|
+
- `--package-manager npm|pnpm|yarn|bun|deno`
|
|
59
|
+
- `--deploy` / `--no-deploy`
|
|
60
|
+
- `--workspace <id-or-name>`
|
|
61
|
+
- `--yes`
|
|
62
|
+
- `--force`
|
|
63
|
+
- `--verbose`
|
|
167
64
|
|
|
168
|
-
|
|
65
|
+
This branch intentionally targets Prisma 8 only. It does not generate a Prisma 7 compatibility path.
|
|
169
66
|
|
|
170
|
-
##
|
|
67
|
+
## Development
|
|
171
68
|
|
|
172
69
|
```bash
|
|
173
70
|
bun install
|
|
71
|
+
bun run test:unit
|
|
72
|
+
bun run typecheck
|
|
174
73
|
bun run check
|
|
175
74
|
bun run build
|
|
176
|
-
bun run start
|
|
177
75
|
```
|
|
178
76
|
|
|
179
|
-
Useful repo scripts:
|
|
180
|
-
|
|
181
|
-
- `bun run dev`
|
|
182
|
-
- `bun run typecheck`
|
|
183
|
-
- `bun run format`
|
|
184
|
-
- `bun run lint`
|
|
185
|
-
- `bun run bump`
|
|
186
|
-
|
|
187
77
|
## Telemetry
|
|
188
78
|
|
|
189
|
-
Published builds may send anonymous usage telemetry
|
|
190
|
-
|
|
191
|
-
Disable it with any of:
|
|
192
|
-
|
|
193
|
-
- `DO_NOT_TRACK`
|
|
194
|
-
- `CREATE_PRISMA_DISABLE_TELEMETRY`
|
|
195
|
-
- `CREATE_PRISMA_TELEMETRY_DISABLED`
|
|
79
|
+
Published builds may send anonymous usage telemetry. It never includes project names, file paths, or database URLs. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import "./create-BHt4J1kk.mjs";
|
|
3
|
+
import { createCreatePrismaCli } from "./index.mjs";
|
|
4
|
+
|
|
3
5
|
//#region src/cli.ts
|
|
4
|
-
createCreatePrismaCli().run()
|
|
6
|
+
createCreatePrismaCli().run({ process: { exit(code) {
|
|
7
|
+
const commandExitCode = typeof process.exitCode === "number" && process.exitCode !== 0 ? process.exitCode : code;
|
|
8
|
+
process.exit(commandExitCode);
|
|
9
|
+
} } });
|
|
10
|
+
|
|
5
11
|
//#endregion
|
|
6
|
-
export {};
|
|
12
|
+
export { };
|