create-prisma 0.14.2 → 0.14.3

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
@@ -4,9 +4,9 @@ Create a Prisma 8 app with Prisma Composer built in.
4
4
 
5
5
  ## Supported versions
6
6
 
7
- create-prisma supports exactly what Prisma ORM supports: Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 and newer (`^22.18.0 || ^24.11.0 || >=26.0.0`). Node.js 23 and 24.0 to 24.10 are not supported. create-prisma refuses unsupported Node.js versions before it writes any files, and the generated minimal, hono, elysia, nest and turborepo projects declare the same range in `engines.node`.
7
+ create-prisma supports exactly what Prisma ORM supports: Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 and newer (`^22.18.0 || ^24.11.0 || >=26.0.0`). create-prisma refuses unsupported Node.js versions before it writes any files, and the generated minimal, hono, elysia, nest and turborepo projects declare the same range in `engines.node`. The next, svelte, astro and tanstack-start templates declare no `engines` field.
8
8
 
9
- Each supported Node.js release works with the npm it ships, including npm 10 on Node.js 22. pnpm, Yarn 4.10 or newer, Bun and Deno are also supported. Yarn 1 is not supported. When create-prisma runs on Bun or Deno instead of Node.js, it skips the Node.js check.
9
+ Each supported Node.js release works with the npm it ships, including npm 10 on Node.js 22. pnpm, Yarn 4.10 or newer, Bun and Deno (local minimal PostgreSQL apps only, see below) are also supported. Yarn 1 is not supported. When create-prisma runs on Bun or Deno instead of Node.js, it skips the Node.js check. `bunx create-prisma` runs it on Bun, even though `bunx` would otherwise start it with the installed Node.js.
10
10
 
11
11
  The one exception is the `nuxt` template. Nuxt itself requires Node.js `^22.22.3 || ^24.15.0 || >=26.0.0`, so Nuxt projects declare that narrower range.
12
12
 
@@ -59,7 +59,7 @@ workspace. Choosing another workspace also updates the Prisma CLI's active works
59
59
  - `nuxt`
60
60
  - `tanstack-start`
61
61
 
62
- PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring. npm, pnpm, Yarn, and Bun are supported.
62
+ PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring. For supported package managers, see [Supported versions](#supported-versions).
63
63
 
64
64
  Deno is supported for local minimal PostgreSQL apps:
65
65
 
package/dist/cli.mjs CHANGED
@@ -1,8 +1,26 @@
1
1
  #!/usr/bin/env node
2
- import { a as ApplicationLayer, i as runCreatePrismaCli } from "./src-Cg1gEAgT.mjs";
2
+ import { a as shouldRelaunchOnBun, i as runCreatePrismaCli, o as ApplicationLayer } from "./src-NjvSqIR6.mjs";
3
3
  import { Effect } from "effect";
4
4
  import { NodeRuntime } from "@effect/platform-node-shared";
5
+ import { spawn } from "node:child_process";
5
6
  //#region src/cli.ts
6
- runCreatePrismaCli().pipe(Effect.provide(ApplicationLayer), NodeRuntime.runMain({ disableErrorReporting: true }));
7
+ function relaunchOnBun() {
8
+ return new Promise((resolve) => {
9
+ const child = spawn("bun", process.argv.slice(1), { stdio: "inherit" });
10
+ const forward = (signal) => child.kill(signal);
11
+ child.once("error", () => resolve(false));
12
+ child.once("spawn", () => {
13
+ process.on("SIGINT", forward);
14
+ process.on("SIGTERM", forward);
15
+ });
16
+ child.once("exit", (code, signal) => {
17
+ process.off("SIGINT", forward);
18
+ process.off("SIGTERM", forward);
19
+ if (signal) process.kill(process.pid, signal);
20
+ else process.exit(code ?? 1);
21
+ });
22
+ });
23
+ }
24
+ if (!(shouldRelaunchOnBun() && await relaunchOnBun())) runCreatePrismaCli().pipe(Effect.provide(ApplicationLayer), NodeRuntime.runMain({ disableErrorReporting: true }));
7
25
  //#endregion
8
26
  export {};
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { c as AgentSkillTargetSchema, d as CreateTemplateSchema, f as DatabaseProviderSchema, i as runCreatePrismaCli, l as AuthoringStyleSchema, n as createCreatePrismaCli, o as CREATE_PRISMA_RESULT_SCHEMA_VERSION, p as PackageManagerSchema, r as createPrismaCommand, s as CreateCommandResultSchema, t as create, u as CreateCommandInputSchema } from "./src-Cg1gEAgT.mjs";
2
+ import { c as CreateCommandResultSchema, d as CreateCommandInputSchema, f as CreateTemplateSchema, i as runCreatePrismaCli, l as AgentSkillTargetSchema, m as PackageManagerSchema, n as createCreatePrismaCli, p as DatabaseProviderSchema, r as createPrismaCommand, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as create, u as AuthoringStyleSchema } from "./src-NjvSqIR6.mjs";
3
3
  export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
@@ -501,7 +501,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
501
501
  return anonymousId;
502
502
  });
503
503
  const getCommonProperties = () => ({
504
- "cli-version": "0.14.2",
504
+ "cli-version": "0.14.3",
505
505
  "node-version": process.version,
506
506
  platform: process.platform,
507
507
  arch: process.arch
@@ -650,6 +650,7 @@ const dependencyVersionMap = {
650
650
  "@prisma/orm-postgres": "8.0.0-rc.16",
651
651
  "@sveltejs/adapter-node": "^6.0.0",
652
652
  "@types/node": "^26.6.4",
653
+ "@vitejs/devtools": "0.7.6",
653
654
  alchemy: "2.0.0-beta.78",
654
655
  arktype: "^2.2.7",
655
656
  dotenv: "^18.0.6",
@@ -1367,6 +1368,10 @@ const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTempl
1367
1368
  ...packageJson.overrides,
1368
1369
  ...effectPins
1369
1370
  };
1371
+ if (opts.packageManager === "npm") packageJson.overrides = {
1372
+ ...packageJson.overrides,
1373
+ "@vitejs/devtools": dependencyVersionMap["@vitejs/devtools"]
1374
+ };
1370
1375
  yield* writePackageJson(packageJsonPath, packageJson);
1371
1376
  });
1372
1377
  const installProjectDependenciesEffect = Effect.fn("Dependencies.install")(function* (packageManager, projectDir = process.cwd(), options = {}) {
@@ -2302,24 +2307,33 @@ function getCreatePrismaIntro() {
2302
2307
  }
2303
2308
  //#endregion
2304
2309
  //#region src/utils/node-version.ts
2305
- const minimumByMajor = /* @__PURE__ */ new Map([[22, [
2306
- 22,
2307
- 18,
2308
- 0
2309
- ]], [24, [
2310
- 24,
2311
- 11,
2312
- 0
2313
- ]]]);
2310
+ const supportedNodeLines = [{
2311
+ major: 22,
2312
+ minimum: [
2313
+ 22,
2314
+ 18,
2315
+ 0
2316
+ ]
2317
+ }, {
2318
+ major: 24,
2319
+ minimum: [
2320
+ 24,
2321
+ 11,
2322
+ 0
2323
+ ]
2324
+ }];
2314
2325
  const FIRST_MAJOR_WITH_EVERY_RELEASE_SUPPORTED = 26;
2315
- minimumByMajor.get(22);
2316
- function parseVersion(version) {
2317
- const [major = "0", minor = "0", patch = "0"] = version.replace(/^v/, "").split(".");
2318
- return [
2319
- Number(major),
2320
- Number(minor),
2321
- Number.parseInt(patch, 10)
2322
- ];
2326
+ [...supportedNodeLines.map(({ minimum }) => `^${minimum.join(".")}`), `>=${FIRST_MAJOR_WITH_EVERY_RELEASE_SUPPORTED}.0.0`].join(" || ");
2327
+ supportedNodeLines[0].minimum;
2328
+ const SUPPORTED_NODE_DESCRIPTION = `${supportedNodeLines.map(({ major, minimum }) => `${minimum[0]}.${minimum[1]} or newer on the ${major} line`).join(", ")}, or ${FIRST_MAJOR_WITH_EVERY_RELEASE_SUPPORTED} and newer`;
2329
+ const RELEASE_VERSION_PATTERN = /^v?(\d+)\.(\d+)\.(\d+)(?:\+[0-9A-Za-z.-]+)?$/;
2330
+ function parseReleaseVersion(version) {
2331
+ const match = RELEASE_VERSION_PATTERN.exec(version);
2332
+ return match ? [
2333
+ Number(match[1]),
2334
+ Number(match[2]),
2335
+ Number(match[3])
2336
+ ] : void 0;
2323
2337
  }
2324
2338
  function isAtLeast(current, minimum) {
2325
2339
  for (const [index, part] of current.entries()) if (part !== minimum[index]) return part > minimum[index];
@@ -2329,18 +2343,22 @@ function runsOnNode(versions = process.versions) {
2329
2343
  return versions.bun === void 0 && versions.deno === void 0;
2330
2344
  }
2331
2345
  function supportsPrisma(nodeVersion = process.versions.node) {
2332
- const current = parseVersion(nodeVersion);
2346
+ const current = parseReleaseVersion(nodeVersion);
2347
+ if (!current) return false;
2333
2348
  if (current[0] >= FIRST_MAJOR_WITH_EVERY_RELEASE_SUPPORTED) return true;
2334
- const minimum = minimumByMajor.get(current[0]);
2335
- return minimum !== void 0 && isAtLeast(current, minimum);
2349
+ const line = supportedNodeLines.find(({ major }) => major === current[0]);
2350
+ return line !== void 0 && isAtLeast(current, line.minimum);
2336
2351
  }
2337
2352
  function getUnsupportedNodeMessage(nodeVersion = process.versions.node) {
2338
2353
  return [
2339
2354
  `Node.js ${nodeVersion} is unsupported by create-prisma@latest.`,
2340
- "Required: Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 and newer.",
2355
+ `Required: Node.js ${SUPPORTED_NODE_DESCRIPTION}.`,
2341
2356
  "Update Node.js and run the command again."
2342
2357
  ].join("\n");
2343
2358
  }
2359
+ function shouldRelaunchOnBun(env = process.env, versions = process.versions) {
2360
+ return runsOnNode(versions) && env.npm_config_user_agent?.startsWith("bun/") === true;
2361
+ }
2344
2362
  //#endregion
2345
2363
  //#region src/commands/create-context.ts
2346
2364
  const DEFAULT_PROJECT_NAME = "my-app";
@@ -2796,7 +2814,7 @@ function isJsonOutputRequested(argv) {
2796
2814
  const writeJsonResult = Effect.fn("JsonOutput.write")((result) => Effect.sync(() => process.stdout.write(`${JSON.stringify(result)}\n`)));
2797
2815
  //#endregion
2798
2816
  //#region src/index.ts
2799
- const CLI_VERSION = "0.14.2";
2817
+ const CLI_VERSION = "0.14.3";
2800
2818
  const optionalArgument = (name, description) => Argument.String(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
2801
2819
  const optionalBoolean = (name, description) => Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
2802
2820
  const optionalString = (name, description) => Flag.String(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
@@ -2874,4 +2892,4 @@ function create(input = {}) {
2874
2892
  return applicationRuntime.runPromise(runCreateCommandEffect(input).pipe(Effect.asVoid));
2875
2893
  }
2876
2894
  //#endregion
2877
- export { ApplicationLayer as a, AgentSkillTargetSchema as c, CreateTemplateSchema as d, DatabaseProviderSchema as f, runCreatePrismaCli as i, AuthoringStyleSchema as l, createCreatePrismaCli as n, CREATE_PRISMA_RESULT_SCHEMA_VERSION as o, PackageManagerSchema as p, createPrismaCommand as r, CreateCommandResultSchema as s, create as t, CreateCommandInputSchema as u };
2895
+ export { shouldRelaunchOnBun as a, CreateCommandResultSchema as c, CreateCommandInputSchema as d, CreateTemplateSchema as f, runCreatePrismaCli as i, AgentSkillTargetSchema as l, PackageManagerSchema as m, createCreatePrismaCli as n, ApplicationLayer as o, DatabaseProviderSchema as p, createPrismaCommand as r, CREATE_PRISMA_RESULT_SCHEMA_VERSION as s, create as t, AuthoringStyleSchema as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "private": false,
5
5
  "description": "Create Prisma 8 projects with first-party templates and great DX.",
6
6
  "homepage": "https://github.com/prisma/create-prisma",