create-prisma 0.14.0 → 0.14.1-pr.127.418.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 +2 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-3Er57PqW.mjs → src-C8S7t7b0.mjs} +29 -36
- package/package.json +3 -4
package/README.md
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ApplicationLayer, i as runCreatePrismaCli } from "./src-
|
|
2
|
+
import { a as ApplicationLayer, i as runCreatePrismaCli } from "./src-C8S7t7b0.mjs";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
import { NodeRuntime } from "@effect/platform-node-shared";
|
|
5
5
|
//#region src/cli.ts
|
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-
|
|
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-C8S7t7b0.mjs";
|
|
3
3
|
export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
|
|
@@ -10,7 +10,6 @@ import { createInterface } from "node:readline";
|
|
|
10
10
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import os from "node:os";
|
|
13
|
-
import { PostHog } from "posthog-node";
|
|
14
13
|
import Handlebars from "handlebars";
|
|
15
14
|
import { fileURLToPath } from "node:url";
|
|
16
15
|
import { Writable } from "node:stream";
|
|
@@ -465,20 +464,14 @@ function getPackageManagerErrorCode(command, output) {
|
|
|
465
464
|
}
|
|
466
465
|
//#endregion
|
|
467
466
|
//#region src/telemetry/client.ts
|
|
468
|
-
const TELEMETRY_API_KEY = "
|
|
467
|
+
const TELEMETRY_API_KEY = "";
|
|
469
468
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
470
469
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
471
470
|
const TELEMETRY_TIMEOUT_MS = 2e3;
|
|
472
471
|
const AnonymousId = Schema.String.check(Schema.isUUID(4));
|
|
473
472
|
const decodeAnonymousId = Schema.decodeUnknownExit(AnonymousId);
|
|
474
|
-
const isTruthyEnvValue = (value) => [
|
|
475
|
-
"1",
|
|
476
|
-
"true",
|
|
477
|
-
"yes",
|
|
478
|
-
"on"
|
|
479
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
480
473
|
function shouldDisableTelemetry() {
|
|
481
|
-
return
|
|
474
|
+
return true;
|
|
482
475
|
}
|
|
483
476
|
function getTelemetryConfigDir() {
|
|
484
477
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -502,35 +495,35 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
|
|
|
502
495
|
return anonymousId;
|
|
503
496
|
});
|
|
504
497
|
const getCommonProperties = () => ({
|
|
505
|
-
"cli-version": "0.14.
|
|
498
|
+
"cli-version": "0.14.1-pr.127.418.1",
|
|
506
499
|
"node-version": process.version,
|
|
507
500
|
platform: process.platform,
|
|
508
501
|
arch: process.arch
|
|
509
502
|
});
|
|
510
503
|
const sanitizeProperties = (properties) => Object.fromEntries(Object.entries(properties).filter(([, value]) => value !== void 0));
|
|
511
|
-
const shutdownTelemetryClientEffect = (client, timeoutMs = TELEMETRY_TIMEOUT_MS) => Effect.tryPromise({
|
|
512
|
-
try: () => Promise.resolve(client.shutdown(timeoutMs)),
|
|
513
|
-
catch: () => void 0
|
|
514
|
-
}).pipe(Effect.timeout(timeoutMs), Effect.interruptible, Effect.catch(() => Effect.void));
|
|
515
504
|
const trackCliTelemetryEffect = Effect.fn("Telemetry.track")(function* (event, properties) {
|
|
516
505
|
if (shouldDisableTelemetry()) return;
|
|
517
506
|
const distinctId = yield* getAnonymousIdEffect();
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
507
|
+
yield* Effect.tryPromise(async (signal) => {
|
|
508
|
+
await (await fetch(new URL("/i/v0/e/", TELEMETRY_HOST), {
|
|
509
|
+
method: "POST",
|
|
510
|
+
headers: { "content-type": "application/json" },
|
|
511
|
+
redirect: "error",
|
|
512
|
+
body: JSON.stringify({
|
|
513
|
+
api_key: TELEMETRY_API_KEY,
|
|
514
|
+
distinct_id: distinctId,
|
|
515
|
+
event,
|
|
516
|
+
properties: sanitizeProperties({
|
|
517
|
+
...getCommonProperties(),
|
|
518
|
+
...properties,
|
|
519
|
+
$process_person_profile: false,
|
|
520
|
+
$geoip_disable: true
|
|
521
|
+
}),
|
|
522
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
523
|
+
}),
|
|
524
|
+
signal
|
|
525
|
+
})).body?.cancel();
|
|
526
|
+
});
|
|
534
527
|
});
|
|
535
528
|
//#endregion
|
|
536
529
|
//#region src/telemetry/create.ts
|
|
@@ -613,7 +606,7 @@ const trackCreateCompletedEffect = Effect.fn("Telemetry.createCompleted")(functi
|
|
|
613
606
|
yield* trackCliTelemetryEffect(params.context.operation === "orm_init" ? PRISMA_INIT_COMPLETED_EVENT : CREATE_PRISMA_NEXT_COMPLETED_EVENT, {
|
|
614
607
|
...getBaseCreateProperties(params.input, params.context),
|
|
615
608
|
"duration-ms": params.durationMs
|
|
616
|
-
}).pipe(Effect.
|
|
609
|
+
}).pipe(Effect.timeout(TELEMETRY_TIMEOUT_MS), Effect.catch(() => Effect.void));
|
|
617
610
|
});
|
|
618
611
|
const trackCreateFailedEffect = Effect.fn("Telemetry.createFailed")(function* (params) {
|
|
619
612
|
yield* trackCliTelemetryEffect(params.context?.operation === "orm_init" ? PRISMA_INIT_FAILED_EVENT : CREATE_PRISMA_NEXT_FAILED_EVENT, {
|
|
@@ -630,14 +623,14 @@ const trackCreateFailedEffect = Effect.fn("Telemetry.createFailed")(function* (p
|
|
|
630
623
|
"prisma-cli-error-code": getPrismaCliFailureProperty(params.error, "prismaCliErrorCode"),
|
|
631
624
|
"prisma-cli-cause-code": getPrismaCliCauseCodeProperty(params.error),
|
|
632
625
|
"package-manager-error-code": params.stage === "install_dependencies" ? getPackageManagerErrorCodeProperty(params.error) : null
|
|
633
|
-
}).pipe(Effect.
|
|
626
|
+
}).pipe(Effect.timeout(TELEMETRY_TIMEOUT_MS), Effect.catch(() => Effect.void));
|
|
634
627
|
});
|
|
635
628
|
const trackCreateCancelledEffect = Effect.fn("Telemetry.createCancelled")(function* (params) {
|
|
636
629
|
yield* trackCliTelemetryEffect(params.context?.operation === "orm_init" ? PRISMA_INIT_CANCELLED_EVENT : CREATE_PRISMA_NEXT_CANCELLED_EVENT, {
|
|
637
630
|
...getBaseCreateProperties(params.input, params.context),
|
|
638
631
|
"duration-ms": params.durationMs,
|
|
639
632
|
"cancellation-stage": params.stage
|
|
640
|
-
}).pipe(Effect.
|
|
633
|
+
}).pipe(Effect.timeout(TELEMETRY_TIMEOUT_MS), Effect.catch(() => Effect.void));
|
|
641
634
|
});
|
|
642
635
|
//#endregion
|
|
643
636
|
//#region src/constants/dependencies.ts
|
|
@@ -2299,7 +2292,7 @@ function getCreatePrismaIntro() {
|
|
|
2299
2292
|
//#region src/utils/node-version.ts
|
|
2300
2293
|
const MINIMUM_NODE_VERSION = [
|
|
2301
2294
|
22,
|
|
2302
|
-
|
|
2295
|
+
18,
|
|
2303
2296
|
0
|
|
2304
2297
|
];
|
|
2305
2298
|
function parseVersion(version) {
|
|
@@ -2321,7 +2314,7 @@ function supportsPrisma(nodeVersion = process.versions.node) {
|
|
|
2321
2314
|
function getUnsupportedNodeMessage(nodeVersion = process.versions.node) {
|
|
2322
2315
|
return [
|
|
2323
2316
|
`Node.js ${nodeVersion} is unsupported by create-prisma@latest.`,
|
|
2324
|
-
"Required: Node.js 22.
|
|
2317
|
+
"Required: Node.js 22.18 or newer.",
|
|
2325
2318
|
"Update Node.js and run the command again."
|
|
2326
2319
|
].join("\n");
|
|
2327
2320
|
}
|
|
@@ -2779,7 +2772,7 @@ function isJsonOutputRequested(argv) {
|
|
|
2779
2772
|
const writeJsonResult = Effect.fn("JsonOutput.write")((result) => Effect.sync(() => process.stdout.write(`${JSON.stringify(result)}\n`)));
|
|
2780
2773
|
//#endregion
|
|
2781
2774
|
//#region src/index.ts
|
|
2782
|
-
const CLI_VERSION = "0.14.
|
|
2775
|
+
const CLI_VERSION = "0.14.1-pr.127.418.1";
|
|
2783
2776
|
const optionalArgument = (name, description) => Argument.String(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
|
|
2784
2777
|
const optionalBoolean = (name, description) => Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
|
|
2785
2778
|
const optionalString = (name, description) => Flag.String(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1-pr.127.418.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",
|
|
@@ -55,8 +55,7 @@
|
|
|
55
55
|
"@effect/platform-node-shared": "4.0.1",
|
|
56
56
|
"effect": "4.0.1",
|
|
57
57
|
"execa": "^10.0.1",
|
|
58
|
-
"handlebars": "^4.7.10"
|
|
59
|
-
"posthog-node": "^5.55.0"
|
|
58
|
+
"handlebars": "^4.7.10"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
61
|
"@prisma/dev": "0.25.2",
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
},
|
|
72
71
|
"engines": {
|
|
73
72
|
"bun": ">=1.3.0",
|
|
74
|
-
"node": ">=22.
|
|
73
|
+
"node": ">=22.18.0"
|
|
75
74
|
},
|
|
76
75
|
"packageManager": "bun@1.4.1"
|
|
77
76
|
}
|