create-prisma 0.14.2 → 0.14.3-pr.133.433.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 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-CzGBwMiY.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-CzGBwMiY.mjs";
3
3
  export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
@@ -464,20 +464,14 @@ function getPackageManagerErrorCode(command, output) {
464
464
  }
465
465
  //#endregion
466
466
  //#region src/telemetry/client.ts
467
- const TELEMETRY_API_KEY = "phc_cmc85avbWyuJ2JyKdGPdv7dxXli8xLdWDBPbvIXWJfs";
467
+ const TELEMETRY_API_KEY = "";
468
468
  const TELEMETRY_HOST = "https://us.i.posthog.com";
469
469
  const TELEMETRY_CONFIG_FILE = "telemetry.json";
470
470
  const TELEMETRY_TIMEOUT_MS = 2e3;
471
471
  const AnonymousId = Schema.String.check(Schema.isUUID(4));
472
472
  const decodeAnonymousId = Schema.decodeUnknownExit(AnonymousId);
473
- const isTruthyEnvValue = (value) => [
474
- "1",
475
- "true",
476
- "yes",
477
- "on"
478
- ].includes(String(value ?? "").trim().toLowerCase());
479
473
  function shouldDisableTelemetry() {
480
- return isTruthyEnvValue(process.env.CI) || isTruthyEnvValue(process.env.GITHUB_ACTIONS) || process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
474
+ return true;
481
475
  }
482
476
  function getTelemetryConfigDir() {
483
477
  if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
@@ -501,7 +495,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
501
495
  return anonymousId;
502
496
  });
503
497
  const getCommonProperties = () => ({
504
- "cli-version": "0.14.2",
498
+ "cli-version": "0.14.3-pr.133.433.1",
505
499
  "node-version": process.version,
506
500
  platform: process.platform,
507
501
  arch: process.arch
@@ -650,6 +644,7 @@ const dependencyVersionMap = {
650
644
  "@prisma/orm-postgres": "8.0.0-rc.16",
651
645
  "@sveltejs/adapter-node": "^6.0.0",
652
646
  "@types/node": "^26.6.4",
647
+ "@vitejs/devtools": "0.7.6",
653
648
  alchemy: "2.0.0-beta.78",
654
649
  arktype: "^2.2.7",
655
650
  dotenv: "^18.0.6",
@@ -1367,6 +1362,10 @@ const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTempl
1367
1362
  ...packageJson.overrides,
1368
1363
  ...effectPins
1369
1364
  };
1365
+ if (opts.packageManager === "npm") packageJson.overrides = {
1366
+ ...packageJson.overrides,
1367
+ "@vitejs/devtools": dependencyVersionMap["@vitejs/devtools"]
1368
+ };
1370
1369
  yield* writePackageJson(packageJsonPath, packageJson);
1371
1370
  });
1372
1371
  const installProjectDependenciesEffect = Effect.fn("Dependencies.install")(function* (packageManager, projectDir = process.cwd(), options = {}) {
@@ -2302,24 +2301,33 @@ function getCreatePrismaIntro() {
2302
2301
  }
2303
2302
  //#endregion
2304
2303
  //#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
- ]]]);
2304
+ const supportedNodeLines = [{
2305
+ major: 22,
2306
+ minimum: [
2307
+ 22,
2308
+ 18,
2309
+ 0
2310
+ ]
2311
+ }, {
2312
+ major: 24,
2313
+ minimum: [
2314
+ 24,
2315
+ 11,
2316
+ 0
2317
+ ]
2318
+ }];
2314
2319
  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
- ];
2320
+ [...supportedNodeLines.map(({ minimum }) => `^${minimum.join(".")}`), `>=${FIRST_MAJOR_WITH_EVERY_RELEASE_SUPPORTED}.0.0`].join(" || ");
2321
+ supportedNodeLines[0].minimum;
2322
+ 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`;
2323
+ const RELEASE_VERSION_PATTERN = /^v?(\d+)\.(\d+)\.(\d+)(?:\+[0-9A-Za-z.-]+)?$/;
2324
+ function parseReleaseVersion(version) {
2325
+ const match = RELEASE_VERSION_PATTERN.exec(version);
2326
+ return match ? [
2327
+ Number(match[1]),
2328
+ Number(match[2]),
2329
+ Number(match[3])
2330
+ ] : void 0;
2323
2331
  }
2324
2332
  function isAtLeast(current, minimum) {
2325
2333
  for (const [index, part] of current.entries()) if (part !== minimum[index]) return part > minimum[index];
@@ -2329,18 +2337,22 @@ function runsOnNode(versions = process.versions) {
2329
2337
  return versions.bun === void 0 && versions.deno === void 0;
2330
2338
  }
2331
2339
  function supportsPrisma(nodeVersion = process.versions.node) {
2332
- const current = parseVersion(nodeVersion);
2340
+ const current = parseReleaseVersion(nodeVersion);
2341
+ if (!current) return false;
2333
2342
  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);
2343
+ const line = supportedNodeLines.find(({ major }) => major === current[0]);
2344
+ return line !== void 0 && isAtLeast(current, line.minimum);
2336
2345
  }
2337
2346
  function getUnsupportedNodeMessage(nodeVersion = process.versions.node) {
2338
2347
  return [
2339
2348
  `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.",
2349
+ `Required: Node.js ${SUPPORTED_NODE_DESCRIPTION}.`,
2341
2350
  "Update Node.js and run the command again."
2342
2351
  ].join("\n");
2343
2352
  }
2353
+ function shouldRelaunchOnBun(env = process.env, versions = process.versions) {
2354
+ return runsOnNode(versions) && env.npm_config_user_agent?.startsWith("bun/") === true;
2355
+ }
2344
2356
  //#endregion
2345
2357
  //#region src/commands/create-context.ts
2346
2358
  const DEFAULT_PROJECT_NAME = "my-app";
@@ -2796,7 +2808,7 @@ function isJsonOutputRequested(argv) {
2796
2808
  const writeJsonResult = Effect.fn("JsonOutput.write")((result) => Effect.sync(() => process.stdout.write(`${JSON.stringify(result)}\n`)));
2797
2809
  //#endregion
2798
2810
  //#region src/index.ts
2799
- const CLI_VERSION = "0.14.2";
2811
+ const CLI_VERSION = "0.14.3-pr.133.433.1";
2800
2812
  const optionalArgument = (name, description) => Argument.String(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
2801
2813
  const optionalBoolean = (name, description) => Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
2802
2814
  const optionalString = (name, description) => Flag.String(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
@@ -2874,4 +2886,4 @@ function create(input = {}) {
2874
2886
  return applicationRuntime.runPromise(runCreateCommandEffect(input).pipe(Effect.asVoid));
2875
2887
  }
2876
2888
  //#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 };
2889
+ 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-pr.133.433.1",
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",