create-prisma 0.12.0 → 0.12.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
@@ -15,6 +15,11 @@ bunx create-prisma@latest my-app
15
15
 
16
16
  The CLI initializes Prisma 8 with `prisma@latest`, 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.
17
17
 
18
+ For npm, use 11.6.0 or newer, which includes the [upstream resolver fix](https://github.com/npm/cli/pull/8448).
19
+ Older npm releases can crash resolving the dependency tree (`Cannot read properties of null (reading 'edgesOut')`). Run
20
+ `npm install --global npm@11` to update. create-prisma checks the selected npm
21
+ version before writing project files and never upgrades your package manager automatically.
22
+
18
23
  The deployment prompt is:
19
24
 
20
25
  ```text
@@ -23,6 +28,11 @@ Deploy to Prisma now?
23
28
 
24
29
  Choose no to deploy later with the generated `deploy` script.
25
30
 
31
+ New apps explicitly use `us-east-1` in `prisma-composer.config.ts`. Change the
32
+ `prismaCloud({ region })` option before deploying if you need another region.
33
+ Composer requires a region when creating a new project; leaving it unspecified
34
+ only works when deploying into an existing project whose region can be inherited.
35
+
26
36
  When multiple Prisma workspace sessions are available, the CLI asks which workspace should receive
27
37
  the deployment. For unattended usage, pass `--workspace <id-or-name>` or omit it to use the active
28
38
  workspace. Choosing another workspace also updates the Prisma CLI's active workspace session.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as ApplicationLayer } from "./json-output-CH9M3gTl.mjs";
2
+ import { a as ApplicationLayer } from "./json-output-BEzP-dBw.mjs";
3
3
  import { runCreatePrismaCli } from "./index.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { NodeRuntime } from "@effect/platform-node-shared";
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { _ as authoringStyles, b as normalizeDatabaseProvider, c as CreateCommandResultSchema, d as AuthoringStyleSchema, f as CreateCommandInputSchema, g as agentSkillTargets, h as PackageManagerSchema, i as getErrorMessage, l as createCommandFailureResult, m as DatabaseProviderSchema, n as writeJsonResult, o as applicationRuntime, p as CreateTemplateSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AgentSkillTargetSchema, v as createTemplates, x as packageManagers, y as databaseProviderInputs } from "./json-output-CH9M3gTl.mjs";
2
+ import { _ as authoringStyles, b as normalizeDatabaseProvider, c as CreateCommandResultSchema, d as AuthoringStyleSchema, f as CreateCommandInputSchema, g as agentSkillTargets, h as PackageManagerSchema, i as getErrorMessage, l as createCommandFailureResult, m as DatabaseProviderSchema, n as writeJsonResult, o as applicationRuntime, p as CreateTemplateSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AgentSkillTargetSchema, v as createTemplates, x as packageManagers, y as databaseProviderInputs } from "./json-output-BEzP-dBw.mjs";
3
3
  import { Console, Effect, Option } from "effect";
4
4
  import { Argument, CliError, Command, Flag } from "effect/unstable/cli";
5
5
 
6
6
  //#region src/index.ts
7
- const CLI_VERSION = "0.12.0";
7
+ const CLI_VERSION = "0.12.1";
8
8
  const optionalArgument = (name, description) => Argument.string(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
9
9
  const optionalBoolean = (name, description) => Flag.boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
10
10
  const optionalString = (name, description) => Flag.string(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
@@ -35,6 +35,7 @@ const CreateFailureStageSchema = Schema.Literals([
35
35
  const CreateFailureReasonSchema = Schema.Literals([
36
36
  "invalid_input",
37
37
  "unsupported_node_version",
38
+ "unsupported_package_manager_version",
38
39
  "invalid_project_name",
39
40
  "target_path_not_directory",
40
41
  "target_directory_not_empty",
@@ -387,7 +388,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
387
388
  return anonymousId;
388
389
  });
389
390
  const getCommonProperties = () => ({
390
- "cli-version": "0.12.0",
391
+ "cli-version": "0.12.1",
391
392
  "node-version": process.version,
392
393
  platform: process.platform,
393
394
  arch: process.arch
@@ -426,6 +427,7 @@ const CREATE_PRISMA_NEXT_CANCELLED_EVENT = "cli:create_prisma_next_command_cance
426
427
  const expectedRejectionReasons = new Set([
427
428
  "invalid_input",
428
429
  "unsupported_node_version",
430
+ "unsupported_package_manager_version",
429
431
  "invalid_project_name",
430
432
  "target_path_not_directory",
431
433
  "target_directory_not_empty",
@@ -508,11 +510,27 @@ const trackCreateCancelledEffect = Effect.fn("Telemetry.createCancelled")(functi
508
510
  //#region src/utils/package-manager.ts
509
511
  const DENO_ALLOW_FRESH_DEPENDENCIES = "--minimum-dependency-age=0";
510
512
  const packageManagerManifestValues = {
511
- npm: "npm@10.9.0",
513
+ npm: "npm@11.6.0",
512
514
  pnpm: "pnpm@11.21.0",
513
515
  yarn: "yarn@4.13.0",
514
- bun: "bun@1.3.9"
516
+ bun: "bun@1.4.1"
515
517
  };
518
+ const verifyPackageManagerEffect = Effect.fn("PackageManager.verify")(function* (packageManager) {
519
+ if (packageManager !== "npm") return;
520
+ const version = (yield* (yield* CommandRunner).runChecked({
521
+ command: "npm",
522
+ args: ["--version"],
523
+ cwd: process.cwd()
524
+ })).stdout.trim();
525
+ const parts = version.split(".").map(Number);
526
+ if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version) || parts.some((part) => !Number.isInteger(part))) return yield* Effect.fail(/* @__PURE__ */ new Error(`Could not determine the installed npm version: ${version}`));
527
+ const [major, minor] = parts;
528
+ if (major < 11 || major === 11 && minor < 6) return yield* new CreateFailure({
529
+ stage: "validate_input",
530
+ reason: "unsupported_package_manager_version",
531
+ message: `npm ${version} is unsupported. Required: npm 11.6.0 or newer. Older npm releases can crash while resolving Prisma dependencies. Run npm install --global npm@11, then retry create-prisma.`
532
+ });
533
+ });
516
534
  function parseUserAgent(userAgent) {
517
535
  if (userAgent?.startsWith("pnpm")) return "pnpm";
518
536
  if (userAgent?.startsWith("yarn")) return "yarn";
@@ -2172,6 +2190,7 @@ const createProjectEffect = Effect.fn("Create.project")(function* (rawInput, inp
2172
2190
  yield* Effect.sync(() => intro(getCreatePrismaIntro(), { output }));
2173
2191
  const context = yield* atCreateStage(collectCreateContext(input), "collect_context", "unexpected_error");
2174
2192
  yield* Ref.set(contextRef, Option.some(context));
2193
+ yield* atCreateStage(verifyPackageManagerEffect(context.prismaSetupContext.packageManager), "install_dependencies", "dependency_install_failed");
2175
2194
  return {
2176
2195
  input,
2177
2196
  context,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.12.0",
3
+ "version": "0.12.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",
@@ -72,5 +72,5 @@
72
72
  "bun": ">=1.3.0",
73
73
  "node": ">=22.18.0"
74
74
  },
75
- "packageManager": "bun@1.3.9"
75
+ "packageManager": "bun@1.4.1"
76
76
  }
@@ -7,7 +7,7 @@ import { nextjsBuild } from "@prisma/composer/nextjs/control";
7
7
  import { prismaCloud, prismaState } from "@prisma/composer-prisma-cloud/control";
8
8
 
9
9
  export default defineConfig({
10
- extensions: [prismaCloud(), nodeBuild(){{#if (eq template "next")}}, nextjsBuild(){{/if}}],
10
+ extensions: [prismaCloud({ region: "us-east-1" }), nodeBuild(){{#if (eq template "next")}}, nextjsBuild(){{/if}}],
11
11
  state: prismaState(),
12
12
  });
13
13
  {{/unless}}