create-prisma 0.7.1-pr.51.166.1 → 0.7.1-pr.52.167.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 (62) hide show
  1. package/README.md +14 -12
  2. package/dist/cli.mjs +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/{src-DEsFPSPI.mjs → src-BZW88NIr.mjs} +320 -315
  5. package/package.json +1 -1
  6. package/templates/create/astro/README.md.hbs +9 -7
  7. package/templates/create/astro/astro.config.mjs.hbs +11 -14
  8. package/templates/create/astro/module.ts.hbs +32 -0
  9. package/templates/create/astro/prisma-composer.config.ts.hbs +10 -0
  10. package/templates/create/astro/service.ts.hbs +21 -0
  11. package/templates/create/astro/src/lib/prisma.ts.hbs +23 -0
  12. package/templates/create/elysia/README.md.hbs +9 -9
  13. package/templates/create/elysia/module.ts.hbs +32 -0
  14. package/templates/create/elysia/package.json.hbs +2 -2
  15. package/templates/create/elysia/prisma-composer.config.ts.hbs +10 -0
  16. package/templates/create/elysia/service.ts.hbs +21 -0
  17. package/templates/create/elysia/src/lib/prisma.ts.hbs +23 -0
  18. package/templates/create/hono/README.md.hbs +9 -9
  19. package/templates/create/hono/module.ts.hbs +32 -0
  20. package/templates/create/hono/package.json.hbs +2 -2
  21. package/templates/create/hono/prisma-composer.config.ts.hbs +10 -0
  22. package/templates/create/hono/service.ts.hbs +21 -0
  23. package/templates/create/hono/src/lib/prisma.ts.hbs +23 -0
  24. package/templates/create/nest/README.md.hbs +8 -8
  25. package/templates/create/nest/module.ts.hbs +32 -0
  26. package/templates/create/nest/package.json.hbs +2 -2
  27. package/templates/create/nest/prisma-composer.config.ts.hbs +10 -0
  28. package/templates/create/nest/src/lib/prisma.ts.hbs +23 -0
  29. package/templates/create/nest/src/service.ts.hbs +21 -0
  30. package/templates/create/next/README.md.hbs +9 -7
  31. package/templates/create/next/module.ts.hbs +32 -0
  32. package/templates/create/next/package.json.hbs +2 -2
  33. package/templates/create/next/prisma-composer.config.ts.hbs +10 -0
  34. package/templates/create/next/service.ts.hbs +21 -0
  35. package/templates/create/next/src/lib/prisma.ts.hbs +23 -0
  36. package/templates/create/nuxt/README.md.hbs +9 -7
  37. package/templates/create/nuxt/module.ts.hbs +32 -0
  38. package/templates/create/nuxt/prisma-composer.config.ts.hbs +10 -0
  39. package/templates/create/nuxt/server/utils/prisma.ts.hbs +23 -0
  40. package/templates/create/nuxt/service.ts.hbs +21 -0
  41. package/templates/create/svelte/README.md.hbs +0 -11
  42. package/templates/create/tanstack-start/README.md.hbs +9 -7
  43. package/templates/create/tanstack-start/module.ts.hbs +32 -0
  44. package/templates/create/tanstack-start/prisma-composer.config.ts.hbs +10 -0
  45. package/templates/create/tanstack-start/service.ts.hbs +21 -0
  46. package/templates/create/tanstack-start/src/lib/prisma.server.ts.hbs +23 -0
  47. package/templates/create/turborepo/README.md.hbs +9 -7
  48. package/templates/create/turborepo/apps/api/package.json.hbs +2 -2
  49. package/templates/create/turborepo/apps/api/src/index.ts.hbs +25 -1
  50. package/templates/create/turborepo/apps/api/src/service.ts.hbs +21 -0
  51. package/templates/create/turborepo/module.ts.hbs +32 -0
  52. package/templates/create/turborepo/packages/db/src/client.ts.hbs +3 -11
  53. package/templates/create/turborepo/prisma-composer.config.ts.hbs +10 -0
  54. package/templates/create/turborepo/turbo.json +0 -1
  55. package/templates/create/astro/prisma.compute.ts.hbs +0 -10
  56. package/templates/create/elysia/prisma.compute.ts.hbs +0 -11
  57. package/templates/create/hono/prisma.compute.ts.hbs +0 -10
  58. package/templates/create/nest/prisma.compute.ts.hbs +0 -10
  59. package/templates/create/next/prisma.compute.ts.hbs +0 -9
  60. package/templates/create/nuxt/prisma.compute.ts.hbs +0 -9
  61. package/templates/create/tanstack-start/prisma.compute.ts.hbs +0 -9
  62. package/templates/create/turborepo/prisma.compute.ts.hbs +0 -14
package/README.md CHANGED
@@ -8,12 +8,12 @@ Scaffold a new app with Prisma already wired up.
8
8
 
9
9
  - creates a new app from a supported template
10
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
11
+ - scaffolds `prisma/schema.prisma`, `prisma/seed.ts`, `prisma.config.ts`, and a Composer application graph for supported templates
12
12
  - writes a Prisma client singleton in the right place for the selected template
13
13
  - adds `db:generate`, `db:migrate`, and `db:seed` scripts
14
14
  - creates or updates the template env file with `DATABASE_URL`
15
15
  - can install dependencies and run `prisma generate` for you
16
- - can deploy the finished app to Prisma Compute and return a live URL
16
+ - can deploy the finished app and its Prisma Postgres database with Prisma Composer
17
17
 
18
18
  ## Quick Start
19
19
 
@@ -77,13 +77,13 @@ Use Prisma Postgres auto-provisioning:
77
77
  create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
78
78
  ```
79
79
 
80
- Deploy a supported app to Prisma Compute:
80
+ Deploy a supported app with Prisma Composer:
81
81
 
82
82
  ```bash
83
83
  create-prisma --name my-api --template hono --provider postgresql --deploy
84
84
  ```
85
85
 
86
- With PostgreSQL and no `--database-url`, the Compute flow asks whether to use Prisma Postgres. If accepted, or if `--prisma-postgres` is passed, it creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, and deploys the app with the env file configured in `prisma.compute.ts`. Pass `--no-prisma-postgres` to deploy without provisioning a database.
86
+ With PostgreSQL and no `--database-url`, the deploy flow asks whether to use Prisma Postgres. If accepted, or if `--prisma-postgres` is passed, Composer provisions the database as part of the application graph, injects its connection into the service, and deploys both together. Pass `--no-prisma-postgres` to bind an existing database URL instead.
87
87
 
88
88
  ## Supported Templates
89
89
 
@@ -97,7 +97,7 @@ With PostgreSQL and no `--database-url`, the Compute flow asks whether to use Pr
97
97
  - `tanstack-start`
98
98
  - `turborepo`
99
99
 
100
- Prisma Compute deployment is currently supported for:
100
+ Prisma Composer files are included by default, and deployment is supported for:
101
101
 
102
102
  - `hono`
103
103
  - `elysia`
@@ -124,6 +124,8 @@ Prisma Compute deployment is currently supported for:
124
124
  - `bun`
125
125
  - `deno`
126
126
 
127
+ Composer generation and deployment currently apply to the Node-compatible package manager choices (`npm`, `pnpm`, `yarn`, and `bun`). Deno scaffolding remains available without Composer.
128
+
127
129
  ## Useful Flags
128
130
 
129
131
  - `--name` project name or relative path
@@ -131,7 +133,7 @@ Prisma Compute deployment is currently supported for:
131
133
  - `--provider` choose the database provider
132
134
  - `--package-manager` choose the package manager/runtime
133
135
  - `--schema-preset empty|basic`
134
- - `--deploy` deploy supported templates to Prisma Compute
136
+ - `--deploy` deploy supported templates with Prisma Composer
135
137
  - `--yes` accept defaults and skip prompts
136
138
  - `--no-install` scaffold only
137
139
  - `--no-generate` skip `prisma generate`
@@ -149,11 +151,11 @@ Prisma Compute deployment is currently supported for:
149
151
  - Prisma IDE extension install
150
152
 
151
153
  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.
154
+ When Composer deployment is selected, the skills add-on recommends the `prisma-compute` skill too.
153
155
 
154
- ## Deploy to Prisma Compute
156
+ ## Deploy with Prisma Composer
155
157
 
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`.
158
+ Supported templates include Composer by default: `module.ts` declares the application graph, `service.ts` declares the Compute service and its dependencies, and `prisma-composer.config.ts` selects the Prisma Cloud target. The generated project is ready to deploy whether or not you deploy during creation.
157
159
 
158
160
  Accept the deploy prompt when it appears, or pass the flag:
159
161
 
@@ -161,11 +163,11 @@ Accept the deploy prompt when it appears, or pass the flag:
161
163
  create-prisma --name my-api --template hono --provider postgresql --deploy
162
164
  ```
163
165
 
164
- The deploy step signs you in with the Prisma CLI if you are not signed in yet. With PostgreSQL and no `--database-url`, create-prisma asks whether to use Prisma Postgres. If accepted, or if `--prisma-postgres` is passed, setup creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, runs the requested Prisma setup, then deploys the app with the env file configured in `prisma.compute.ts`. Pass `--no-prisma-postgres` to deploy without provisioning a database.
166
+ Deployment requires `PRISMA_SERVICE_TOKEN` and `PRISMA_WORKSPACE_ID`. With PostgreSQL and no `--database-url`, create-prisma asks whether to use Prisma Postgres. If accepted, Composer provisions the database and passes its connection through `service.load()`. After the first deployment, create-prisma writes a direct connection to the Prisma env file and runs the requested migration and seed. Other database configurations are passed through a secret Composer service input.
165
167
 
166
- A `prisma.compute.ts` file is generated with the app framework, runtime port, target, and env-file defaults. When deployment is selected, a `compute:deploy` script is added to the generated project so you can redeploy app changes later. That script runs `@prisma/cli@latest app deploy` using `prisma.compute.ts`; it does not create a new project, create a new database, run migrations, or seed data.
168
+ A `deploy` script is generated for npm, pnpm, Yarn, and Bun. It applies existing migrations for a Composer-managed database, builds the framework artifact, and runs `prisma-composer deploy module.ts`.
167
169
 
168
- The deploy prompt is skipped in `--yes` runs unless you pass `--deploy`. Browser sign-in may still need a person at the keyboard if no Prisma CLI session exists.
170
+ The only Composer-specific prompt asks whether to deploy immediately. It is skipped in `--yes` runs unless you pass `--deploy`; the Composer files are still generated.
169
171
 
170
172
  ## Local Development
171
173
 
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as createCreatePrismaCli } from "./src-DEsFPSPI.mjs";
2
+ import { n as createCreatePrismaCli } from "./src-BZW88NIr.mjs";
3
3
  //#region src/cli.ts
4
4
  await createCreatePrismaCli().run({ formatError: (error) => error instanceof Error ? error.message : String(error) });
5
5
  if (process.exitCode && process.exitCode !== 0) process.exit(process.exitCode);
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { a as CreateTemplateSchema, c as PackageManagerSchema, i as CreateCommandInputSchema, l as SchemaPresetSchema, n as createCreatePrismaCli, o as DatabaseProviderSchema, r as router, s as DatabaseUrlSchema, t as create } from "./src-DEsFPSPI.mjs";
2
+ import { a as CreateTemplateSchema, c as PackageManagerSchema, i as CreateCommandInputSchema, l as SchemaPresetSchema, n as createCreatePrismaCli, o as DatabaseProviderSchema, r as router, s as DatabaseUrlSchema, t as create } from "./src-BZW88NIr.mjs";
3
3
  export { CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };