create-prisma 0.4.2-pr.40.103.1 → 0.4.2-pr.53.183.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.
Files changed (76) hide show
  1. package/README.md +38 -151
  2. package/dist/cli.mjs +1 -1
  3. package/dist/create-DIOWKea-.mjs +1250 -0
  4. package/dist/index.d.mts +14 -28
  5. package/dist/index.mjs +14 -5
  6. package/package.json +3 -3
  7. package/templates/create/_shared/README.md.hbs +38 -0
  8. package/templates/create/_shared/module.ts.hbs +28 -0
  9. package/templates/create/_shared/pnpm-workspace.yaml.hbs +11 -0
  10. package/templates/create/_shared/prisma-composer.config.ts.hbs +11 -0
  11. package/templates/create/_shared/prisma.config.ts.hbs +10 -0
  12. package/templates/create/_shared/service.ts.hbs +42 -0
  13. package/templates/create/_shared/src/prisma/composer.ts.hbs +8 -0
  14. package/templates/create/_shared/src/prisma/db.ts.hbs +41 -0
  15. package/templates/create/_shared/{prisma → src/prisma}/seed.ts.hbs +7 -17
  16. package/templates/create/_shared/src/prisma/users.ts.hbs +35 -0
  17. package/templates/create/astro/astro.config.mjs +3 -4
  18. package/templates/create/astro/src/pages/api/users.ts.hbs +1 -2
  19. package/templates/create/astro/src/pages/index.astro.hbs +2 -2
  20. package/templates/create/elysia/package.json.hbs +3 -3
  21. package/templates/create/elysia/src/index.ts.hbs +3 -13
  22. package/templates/create/hono/package.json.hbs +3 -3
  23. package/templates/create/hono/src/index.ts.hbs +2 -2
  24. package/templates/create/minimal/package.json.hbs +3 -1
  25. package/templates/create/minimal/src/index.ts.hbs +17 -39
  26. package/templates/create/minimal/tsconfig.json +1 -1
  27. package/templates/create/nest/package.json.hbs +2 -2
  28. package/templates/create/nest/src/app.module.ts.hbs +4 -4
  29. package/templates/create/nest/src/main.ts.hbs +2 -6
  30. package/templates/create/nest/src/prisma.service.ts.hbs +1 -1
  31. package/templates/create/nest/src/users.controller.ts.hbs +1 -2
  32. package/templates/create/nest/src/users.service.ts.hbs +1 -2
  33. package/templates/create/next/eslint.config.mjs +8 -1
  34. package/templates/create/next/next.config.ts +1 -1
  35. package/templates/create/next/package.json.hbs +1 -1
  36. package/templates/create/next/src/app/page.tsx.hbs +2 -5
  37. package/templates/create/nuxt/app/pages/index.vue.hbs +1 -1
  38. package/templates/create/nuxt/nuxt.config.ts +0 -5
  39. package/templates/create/nuxt/package.json.hbs +2 -1
  40. package/templates/create/nuxt/server/api/users.get.ts.hbs +1 -2
  41. package/templates/create/svelte/package.json.hbs +0 -1
  42. package/templates/create/svelte/src/routes/+page.server.ts.hbs +1 -2
  43. package/templates/create/svelte/src/routes/+page.svelte.hbs +1 -1
  44. package/templates/create/svelte/svelte.config.js +1 -4
  45. package/templates/create/svelte/vite.config.ts +1 -2
  46. package/templates/create/tanstack-start/src/routes/index.tsx.hbs +2 -2
  47. package/templates/create/tanstack-start/tsconfig.json +1 -1
  48. package/templates/create/tanstack-start/vite.config.ts +2 -2
  49. package/dist/create-CHVnIodq.mjs +0 -1896
  50. package/templates/create/astro/README.md.hbs +0 -45
  51. package/templates/create/astro/deno.json.hbs +0 -5
  52. package/templates/create/astro/src/lib/prisma.ts.hbs +0 -73
  53. package/templates/create/elysia/README.md.hbs +0 -42
  54. package/templates/create/elysia/deno.json.hbs +0 -5
  55. package/templates/create/elysia/src/lib/prisma.ts.hbs +0 -73
  56. package/templates/create/hono/README.md.hbs +0 -42
  57. package/templates/create/hono/deno.json.hbs +0 -5
  58. package/templates/create/hono/src/lib/prisma.ts.hbs +0 -73
  59. package/templates/create/minimal/README.md.hbs +0 -39
  60. package/templates/create/minimal/deno.json.hbs +0 -5
  61. package/templates/create/minimal/src/lib/prisma.ts.hbs +0 -73
  62. package/templates/create/nest/README.md.hbs +0 -43
  63. package/templates/create/nest/deno.json.hbs +0 -5
  64. package/templates/create/nest/src/lib/prisma.ts.hbs +0 -73
  65. package/templates/create/next/README.md.hbs +0 -42
  66. package/templates/create/next/deno.json.hbs +0 -12
  67. package/templates/create/next/src/lib/prisma.ts.hbs +0 -73
  68. package/templates/create/nuxt/README.md.hbs +0 -45
  69. package/templates/create/nuxt/deno.json.hbs +0 -5
  70. package/templates/create/nuxt/server/utils/prisma.ts.hbs +0 -73
  71. package/templates/create/svelte/README.md.hbs +0 -44
  72. package/templates/create/svelte/deno.json.hbs +0 -5
  73. package/templates/create/svelte/src/lib/server/prisma.ts.hbs +0 -73
  74. package/templates/create/tanstack-start/README.md.hbs +0 -44
  75. package/templates/create/tanstack-start/deno.json.hbs +0 -12
  76. package/templates/create/tanstack-start/src/lib/prisma.server.ts.hbs +0 -73
package/README.md CHANGED
@@ -1,179 +1,66 @@
1
1
  # create-prisma
2
2
 
3
- Scaffold a new app with Prisma Next already wired up.
3
+ Create a Prisma Next app with Prisma Composer built in.
4
4
 
5
- `create-prisma@next` gives you a project template, Prisma Next setup, database scripts, and a working starting point without making you assemble everything by hand.
5
+ ## Quick start
6
6
 
7
- ## What It Does
8
-
9
- - creates a new app from a supported template
10
- - adds Prisma Next dependencies for PostgreSQL or MongoDB
11
- - runs `prisma-next init --no-install` to scaffold `prisma/contract.*`, `prisma-next.config.ts`, `prisma/db.ts`, `prisma-next.md`, and `.env.example`
12
- - writes a template-specific Prisma Next runtime helper
13
- - adds `contract:emit`, `db:init`, `db:update`, `db:verify`, `db:seed`, `migration:plan`, `migrate`, `migration:status`, and `migration:show` scripts
14
- - adds `db:up` / `db:down` and `docker-compose.yml` for default MongoDB projects
15
- - creates or updates `.env` with `DATABASE_URL`
16
- - can install dependencies and run `prisma-next contract emit`
17
-
18
- `db:init`, migrations, and seeding are never run automatically. PostgreSQL projects show
19
- `db:init` as a manual follow-up command; MongoDB projects show `db:up` plus the migration
20
- plan/apply path for initial schema setup.
21
-
22
- ## Quick Start
23
-
24
- Use the package runner you already have:
25
-
26
- ```bash
27
- npx create-prisma@next
28
- ```
29
-
30
- ```bash
31
- pnpm dlx create-prisma@next
32
- ```
33
-
34
- ```bash
35
- yarn dlx create-prisma@next
36
- ```
37
-
38
- ```bash
39
- bunx create-prisma@next
40
- ```
41
-
42
- ```bash
43
- deno run -A npm:create-prisma@next
44
- ```
45
-
46
- If you already have it available locally:
47
-
48
- ```bash
49
- create-prisma
50
- ```
51
-
52
- ## Common Examples
53
-
54
- Create a project interactively:
7
+ Use your package manager:
55
8
 
56
9
  ```bash
57
- create-prisma
10
+ npx create-prisma@next my-app
11
+ pnpm dlx create-prisma@next my-app
12
+ yarn dlx create-prisma@next my-app
13
+ bunx create-prisma@next my-app
58
14
  ```
59
15
 
60
- Create a Minimal project non-interactively:
16
+ The CLI initializes Prisma Next with `@prisma/cli@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.
61
17
 
62
- ```bash
63
- create-prisma --name my-script --template minimal --provider postgres
64
- ```
18
+ The only Composer prompt is:
65
19
 
66
- Create a Hono app non-interactively:
67
-
68
- ```bash
69
- create-prisma --name my-api --template hono --provider postgres
20
+ ```text
21
+ Deploy to Prisma now?
70
22
  ```
71
23
 
72
- Create a MongoDB app:
24
+ Choose no to deploy later with the generated `deploy` script.
73
25
 
74
- ```bash
75
- create-prisma --name my-api --template hono --provider mongodb
76
- ```
26
+ ## Templates
77
27
 
78
- Scaffold into the current directory:
28
+ - `minimal`
29
+ - `hono`
30
+ - `elysia`
31
+ - `nest`
32
+ - `next`
33
+ - `svelte` (SvelteKit)
34
+ - `astro`
35
+ - `nuxt`
36
+ - `tanstack-start`
79
37
 
80
- ```bash
81
- create-prisma --name . --template hono --provider postgres
82
- ```
83
-
84
- Use TypeScript contract authoring:
38
+ PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring. npm, pnpm, Yarn, and Bun are supported.
85
39
 
86
- ```bash
87
- create-prisma --name my-app --template next --authoring typescript
88
- ```
40
+ ## Options
89
41
 
90
- Use Prisma Postgres auto-provisioning:
42
+ - positional project name or `--name`
43
+ - `--template`
44
+ - `--provider postgres|postgresql|mongo|mongodb`
45
+ - `--authoring psl|typescript`
46
+ - `--package-manager npm|pnpm|yarn|bun`
47
+ - `--deploy` / `--no-deploy`
48
+ - `--yes`
49
+ - `--force`
50
+ - `--verbose`
91
51
 
92
- ```bash
93
- create-prisma --name my-app --template nest --provider postgres --prisma-postgres
94
- ```
52
+ This branch intentionally targets Prisma Next only. It does not generate a Prisma 7 compatibility path.
95
53
 
96
- Target a specific Prisma Next release (useful for regression / bisect work):
97
-
98
- ```bash
99
- create-prisma --name my-app --template hono --prisma-next-version 0.10.0
100
- ```
101
-
102
- Scaffold against an open PR via pkg.pr.new:
103
-
104
- ```bash
105
- create-prisma --name my-app --template hono --prisma-next-version pkg-pr-new:bad6795
106
- ```
107
-
108
- ## Supported Templates
109
-
110
- - `minimal` - script-first Prisma Next starter with no web framework
111
- - `hono` - lightweight TypeScript API server
112
- - `elysia` - Bun-friendly TypeScript API server
113
- - `nest` - structured Node API with controllers and services
114
- - `next` - full-stack React app with App Router
115
- - `svelte` - full-stack Svelte 5 app with Vite
116
- - `astro` - content-oriented web app with server routes
117
- - `nuxt` - full-stack Vue app with Nitro server routes
118
- - `tanstack-start` - React app with file routes and server functions
119
-
120
- ## Supported Databases
121
-
122
- - `postgres` / `postgresql`
123
- - `mongo` / `mongodb`
124
-
125
- ## Supported Package Managers
126
-
127
- - `npm`
128
- - `pnpm`
129
- - `yarn`
130
- - `bun`
131
- - `deno`
132
-
133
- ## Useful Flags
134
-
135
- - `--name` project name or relative path
136
- - `--template` choose the template
137
- - `--provider postgres|postgresql|mongo|mongodb` (default: `postgres`)
138
- - `--authoring psl|typescript` (default: `psl`)
139
- - `--package-manager` choose the package manager/runtime
140
- - `--database-url` set `DATABASE_URL`
141
- - `--yes` accept defaults and skip prompts
142
- - `--no-install` scaffold only
143
- - `--no-emit` skip `prisma-next contract emit`
144
- - `--prisma-postgres` provision Prisma Postgres for PostgreSQL
145
- - `--prisma-next-version <spec>` target a specific Prisma Next release, npm dist-tag, or
146
- pkg.pr.new PR preview. Accepts a published version (`0.10.0`, `0.11.0-dev.9`),
147
- an npm dist-tag (`latest` (default), `dev`, `next`, …), or `pkg-pr-new:<sha|branch|pr-number>`
148
- to install from `https://pkg.pr.new/prisma/prisma-next/<package>@<ref>`.
149
- - `--force` allow scaffolding into a non-empty directory
150
- - `--verbose` print full command output
151
-
152
- Generated Node-based Prisma Next projects document Node.js 24 LTS or newer.
153
-
154
- ## Local Development
54
+ ## Development
155
55
 
156
56
  ```bash
157
57
  bun install
58
+ bun run test:unit
59
+ bun run typecheck
158
60
  bun run check
159
61
  bun run build
160
- bun run start
161
62
  ```
162
63
 
163
- Useful repo scripts:
164
-
165
- - `bun run dev`
166
- - `bun run typecheck`
167
- - `bun run format`
168
- - `bun run lint`
169
- - `bun run bump`
170
-
171
64
  ## Telemetry
172
65
 
173
- Published builds may send anonymous usage telemetry to help improve the CLI. It does not include project names, file paths, or database URLs.
174
-
175
- Disable it with any of:
176
-
177
- - `DO_NOT_TRACK`
178
- - `CREATE_PRISMA_DISABLE_TELEMETRY`
179
- - `CREATE_PRISMA_TELEMETRY_DISABLED`
66
+ 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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./create-CHVnIodq.mjs";
2
+ import "./create-DIOWKea-.mjs";
3
3
  import { createCreatePrismaCli } from "./index.mjs";
4
4
 
5
5
  //#region src/cli.ts