create-prisma 0.12.0 → 0.12.1-pr.100.340.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-
|
|
2
|
+
import { a as ApplicationLayer } from "./json-output-DjGj83fN.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-
|
|
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-DjGj83fN.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.
|
|
7
|
+
const CLI_VERSION = "0.12.1-pr.100.340.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",
|
|
@@ -351,20 +352,14 @@ const applicationRuntime = ManagedRuntime.make(ApplicationLayer);
|
|
|
351
352
|
|
|
352
353
|
//#endregion
|
|
353
354
|
//#region src/telemetry/client.ts
|
|
354
|
-
const TELEMETRY_API_KEY = "
|
|
355
|
+
const TELEMETRY_API_KEY = "";
|
|
355
356
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
356
357
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
357
358
|
const TELEMETRY_TIMEOUT_MS = 2e3;
|
|
358
359
|
const AnonymousId = Schema.String.check(Schema.isUUID(4));
|
|
359
360
|
const decodeAnonymousId = Schema.decodeUnknownExit(AnonymousId);
|
|
360
|
-
const isTruthyEnvValue = (value) => [
|
|
361
|
-
"1",
|
|
362
|
-
"true",
|
|
363
|
-
"yes",
|
|
364
|
-
"on"
|
|
365
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
366
361
|
function shouldDisableTelemetry() {
|
|
367
|
-
return
|
|
362
|
+
return true;
|
|
368
363
|
}
|
|
369
364
|
function getTelemetryConfigDir() {
|
|
370
365
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -387,7 +382,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
|
|
|
387
382
|
return anonymousId;
|
|
388
383
|
});
|
|
389
384
|
const getCommonProperties = () => ({
|
|
390
|
-
"cli-version": "0.12.
|
|
385
|
+
"cli-version": "0.12.1-pr.100.340.1",
|
|
391
386
|
"node-version": process.version,
|
|
392
387
|
platform: process.platform,
|
|
393
388
|
arch: process.arch
|
|
@@ -426,6 +421,7 @@ const CREATE_PRISMA_NEXT_CANCELLED_EVENT = "cli:create_prisma_next_command_cance
|
|
|
426
421
|
const expectedRejectionReasons = new Set([
|
|
427
422
|
"invalid_input",
|
|
428
423
|
"unsupported_node_version",
|
|
424
|
+
"unsupported_package_manager_version",
|
|
429
425
|
"invalid_project_name",
|
|
430
426
|
"target_path_not_directory",
|
|
431
427
|
"target_directory_not_empty",
|
|
@@ -508,11 +504,27 @@ const trackCreateCancelledEffect = Effect.fn("Telemetry.createCancelled")(functi
|
|
|
508
504
|
//#region src/utils/package-manager.ts
|
|
509
505
|
const DENO_ALLOW_FRESH_DEPENDENCIES = "--minimum-dependency-age=0";
|
|
510
506
|
const packageManagerManifestValues = {
|
|
511
|
-
npm: "npm@
|
|
507
|
+
npm: "npm@11.6.0",
|
|
512
508
|
pnpm: "pnpm@11.21.0",
|
|
513
509
|
yarn: "yarn@4.13.0",
|
|
514
|
-
bun: "bun@1.
|
|
510
|
+
bun: "bun@1.4.1"
|
|
515
511
|
};
|
|
512
|
+
const verifyPackageManagerEffect = Effect.fn("PackageManager.verify")(function* (packageManager) {
|
|
513
|
+
if (packageManager !== "npm") return;
|
|
514
|
+
const version = (yield* (yield* CommandRunner).runChecked({
|
|
515
|
+
command: "npm",
|
|
516
|
+
args: ["--version"],
|
|
517
|
+
cwd: process.cwd()
|
|
518
|
+
})).stdout.trim();
|
|
519
|
+
const parts = version.split(".").map(Number);
|
|
520
|
+
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}`));
|
|
521
|
+
const [major, minor] = parts;
|
|
522
|
+
if (major < 11 || major === 11 && minor < 6) return yield* new CreateFailure({
|
|
523
|
+
stage: "validate_input",
|
|
524
|
+
reason: "unsupported_package_manager_version",
|
|
525
|
+
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.`
|
|
526
|
+
});
|
|
527
|
+
});
|
|
516
528
|
function parseUserAgent(userAgent) {
|
|
517
529
|
if (userAgent?.startsWith("pnpm")) return "pnpm";
|
|
518
530
|
if (userAgent?.startsWith("yarn")) return "yarn";
|
|
@@ -2172,6 +2184,7 @@ const createProjectEffect = Effect.fn("Create.project")(function* (rawInput, inp
|
|
|
2172
2184
|
yield* Effect.sync(() => intro(getCreatePrismaIntro(), { output }));
|
|
2173
2185
|
const context = yield* atCreateStage(collectCreateContext(input), "collect_context", "unexpected_error");
|
|
2174
2186
|
yield* Ref.set(contextRef, Option.some(context));
|
|
2187
|
+
yield* atCreateStage(verifyPackageManagerEffect(context.prismaSetupContext.packageManager), "install_dependencies", "dependency_install_failed");
|
|
2175
2188
|
return {
|
|
2176
2189
|
input,
|
|
2177
2190
|
context,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1-pr.100.340.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.
|
|
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}}
|