create-prisma 0.13.4 → 0.13.5-pr.117.396.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/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-CQS0oU1x.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.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ type CommandSpec = {
|
|
|
14
14
|
args: readonly string[];
|
|
15
15
|
cwd: string;
|
|
16
16
|
env?: NodeJS.ProcessEnv;
|
|
17
|
-
stdio?: "pipe" | "inherit";
|
|
17
|
+
stdio?: "pipe" | "inherit" | ["inherit", "pipe", "inherit"];
|
|
18
18
|
onStderrLine?: (line: string) => void;
|
|
19
19
|
};
|
|
20
20
|
type CommandResult = {
|
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-CQS0oU1x.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.13.
|
|
7
|
+
const CLI_VERSION = "0.13.5-pr.117.396.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));
|
|
@@ -450,20 +450,14 @@ function getPackageManagerErrorCode(command, output) {
|
|
|
450
450
|
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/telemetry/client.ts
|
|
453
|
-
const TELEMETRY_API_KEY = "
|
|
453
|
+
const TELEMETRY_API_KEY = "";
|
|
454
454
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
455
455
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
456
456
|
const TELEMETRY_TIMEOUT_MS = 2e3;
|
|
457
457
|
const AnonymousId = Schema.String.check(Schema.isUUID(4));
|
|
458
458
|
const decodeAnonymousId = Schema.decodeUnknownExit(AnonymousId);
|
|
459
|
-
const isTruthyEnvValue = (value) => [
|
|
460
|
-
"1",
|
|
461
|
-
"true",
|
|
462
|
-
"yes",
|
|
463
|
-
"on"
|
|
464
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
465
459
|
function shouldDisableTelemetry() {
|
|
466
|
-
return
|
|
460
|
+
return true;
|
|
467
461
|
}
|
|
468
462
|
function getTelemetryConfigDir() {
|
|
469
463
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -486,7 +480,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
|
|
|
486
480
|
return anonymousId;
|
|
487
481
|
});
|
|
488
482
|
const getCommonProperties = () => ({
|
|
489
|
-
"cli-version": "0.13.
|
|
483
|
+
"cli-version": "0.13.5-pr.117.396.1",
|
|
490
484
|
"node-version": process.version,
|
|
491
485
|
platform: process.platform,
|
|
492
486
|
arch: process.arch
|
|
@@ -623,11 +617,11 @@ const trackCreateCancelledEffect = Effect.fn("Telemetry.createCancelled")(functi
|
|
|
623
617
|
const dependencyVersionMap = {
|
|
624
618
|
"@astrojs/node": "^10.0.2",
|
|
625
619
|
"@elysiajs/node": "^1.4.5",
|
|
626
|
-
"@prisma/composer": "0.
|
|
627
|
-
"@prisma/composer-prisma-cloud": "0.
|
|
620
|
+
"@prisma/composer": "0.25.0",
|
|
621
|
+
"@prisma/composer-prisma-cloud": "0.25.0",
|
|
628
622
|
"@prisma/dev": "0.25.2",
|
|
629
|
-
"@prisma/orm-mongo": "8.0.0-rc.
|
|
630
|
-
"@prisma/orm-postgres": "8.0.0-rc.
|
|
623
|
+
"@prisma/orm-mongo": "8.0.0-rc.13",
|
|
624
|
+
"@prisma/orm-postgres": "8.0.0-rc.13",
|
|
631
625
|
"@sveltejs/adapter-node": "^5.3.2",
|
|
632
626
|
"@types/node": "^25.6.2",
|
|
633
627
|
alchemy: "2.0.0-beta.78",
|
|
@@ -637,13 +631,22 @@ const dependencyVersionMap = {
|
|
|
637
631
|
mongodb: "^7.1.0",
|
|
638
632
|
"mongodb-memory-server": "^11.1.0",
|
|
639
633
|
nitro: "^3.0.260610-beta",
|
|
640
|
-
prisma: "8.0.0-rc.
|
|
634
|
+
prisma: "8.0.0-rc.19",
|
|
641
635
|
"temporal-polyfill": "^1.0.4",
|
|
642
636
|
tsdown: "^0.22.14",
|
|
643
637
|
turbo: "2.10.12",
|
|
644
638
|
tsx: "^4.21.0",
|
|
645
639
|
typescript: "^5.9.3"
|
|
646
640
|
};
|
|
641
|
+
const effectPackages = [
|
|
642
|
+
"effect",
|
|
643
|
+
"@effect/platform-bun",
|
|
644
|
+
"@effect/platform-node",
|
|
645
|
+
"@effect/platform-node-shared",
|
|
646
|
+
"@effect/sql-d1",
|
|
647
|
+
"@effect/sql-sqlite-do",
|
|
648
|
+
"@effect/vitest"
|
|
649
|
+
];
|
|
647
650
|
const PRISMA_PLATFORM_CLI_PACKAGE = `prisma@${dependencyVersionMap.prisma}`;
|
|
648
651
|
const PRISMA_DENO_CLI_PACKAGE = PRISMA_PLATFORM_CLI_PACKAGE;
|
|
649
652
|
function getDependencyVersion(packageName) {
|
|
@@ -1242,6 +1245,15 @@ const addPackageDependencyEffect = Effect.fn("Dependencies.add")(function* (opts
|
|
|
1242
1245
|
packageJson.scripts = sortRecord(packageJson.scripts);
|
|
1243
1246
|
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1244
1247
|
});
|
|
1248
|
+
const resolveAlchemyMongoPeerForNpm = Effect.fn("Dependencies.resolveAlchemyMongoPeerForNpm")(function* (projectDir) {
|
|
1249
|
+
const packageJsonPath = path.join(projectDir, "package.json");
|
|
1250
|
+
const packageJson = yield* readPackageJson(packageJsonPath);
|
|
1251
|
+
packageJson.overrides = {
|
|
1252
|
+
...packageJson.overrides,
|
|
1253
|
+
alchemy: { mongodb: dependencyVersionMap.mongodb }
|
|
1254
|
+
};
|
|
1255
|
+
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1256
|
+
});
|
|
1245
1257
|
const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd(), options = {}) {
|
|
1246
1258
|
const databaseDependencies = [getDbPackages(provider)];
|
|
1247
1259
|
const devDependencies = ["@types/node", "prisma"];
|
|
@@ -1262,6 +1274,7 @@ const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(func
|
|
|
1262
1274
|
dependencies: databaseDependencies,
|
|
1263
1275
|
projectDir: path.join(projectDir, "packages/database")
|
|
1264
1276
|
});
|
|
1277
|
+
if (provider === "mongo" && packageManager === "npm") yield* resolveAlchemyMongoPeerForNpm(projectDir);
|
|
1265
1278
|
});
|
|
1266
1279
|
const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTemplate")(function* (opts) {
|
|
1267
1280
|
const projectDir = opts.projectDir ?? process.cwd();
|
|
@@ -1277,13 +1290,14 @@ const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTempl
|
|
|
1277
1290
|
const packageJson = yield* readPackageJson(packageJsonPath);
|
|
1278
1291
|
const effectVersion = getDependencyVersion("effect");
|
|
1279
1292
|
if (!effectVersion) return yield* Effect.fail(/* @__PURE__ */ new Error("Dependency effect is missing from the version map."));
|
|
1293
|
+
const effectPins = Object.fromEntries(effectPackages.map((name) => [name, effectVersion]));
|
|
1280
1294
|
if (opts.packageManager === "yarn") packageJson.resolutions = {
|
|
1281
1295
|
...packageJson.resolutions,
|
|
1282
|
-
|
|
1296
|
+
...effectPins
|
|
1283
1297
|
};
|
|
1284
1298
|
else if (opts.packageManager !== "pnpm") packageJson.overrides = {
|
|
1285
1299
|
...packageJson.overrides,
|
|
1286
|
-
|
|
1300
|
+
...effectPins
|
|
1287
1301
|
};
|
|
1288
1302
|
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1289
1303
|
});
|
|
@@ -1337,13 +1351,18 @@ const runPrismaJsonCommandEffect = Effect.fn("PrismaCli.runJson")(function* (opt
|
|
|
1337
1351
|
const invocation = getLocalPackageBinaryArgs(options.packageManager, "prisma", [
|
|
1338
1352
|
...options.args,
|
|
1339
1353
|
"--json",
|
|
1340
|
-
"--no-interactive"
|
|
1354
|
+
...options.interactive ? [] : ["--no-interactive"]
|
|
1341
1355
|
]);
|
|
1342
1356
|
const result = yield* runner.run({
|
|
1343
1357
|
command: invocation.command,
|
|
1344
1358
|
args: invocation.args,
|
|
1345
1359
|
cwd: options.projectDir,
|
|
1346
1360
|
env: options.env ?? process.env,
|
|
1361
|
+
...options.interactive ? { stdio: [
|
|
1362
|
+
"inherit",
|
|
1363
|
+
"pipe",
|
|
1364
|
+
"inherit"
|
|
1365
|
+
] } : {},
|
|
1347
1366
|
...options.onStderrLine ? { onStderrLine: options.onStderrLine } : {}
|
|
1348
1367
|
});
|
|
1349
1368
|
let envelope;
|
|
@@ -1406,15 +1425,12 @@ const ensureAuthentication = Effect.fn("Deployment.ensureAuthentication")(functi
|
|
|
1406
1425
|
options.beforeInteractiveLogin?.();
|
|
1407
1426
|
log.info("Sign in to Prisma to deploy.", { output: options.output });
|
|
1408
1427
|
});
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
env: process.env,
|
|
1416
|
-
stdio: "inherit"
|
|
1417
|
-
}).pipe(Effect.mapError((error) => error.childProcessFailure === "interrupted" || error.childProcessFailure === "cancelled" ? new CreateCancellationError({ stage: "authenticate" }) : error));
|
|
1428
|
+
yield* runPrismaJsonCommandEffect({
|
|
1429
|
+
packageManager: options.packageManager,
|
|
1430
|
+
projectDir: options.projectDir,
|
|
1431
|
+
args: ["auth", "login"],
|
|
1432
|
+
interactive: true
|
|
1433
|
+
}).pipe(Effect.mapError((error) => error instanceof PrismaCliCommandError && (error.code === "AUTH.LOGIN_DENIED" || error.code === "CLI.PROMPT_CANCELLED" || error.code === "CLI.ABORTED") || error.childProcessFailure === "interrupted" || error.childProcessFailure === "cancelled" ? new CreateCancellationError({ stage: "authenticate" }) : error));
|
|
1418
1434
|
const authenticatedState = yield* whoami();
|
|
1419
1435
|
if (!authenticatedState.authenticated) return yield* new CreateFailure({
|
|
1420
1436
|
stage: "authenticate",
|
package/package.json
CHANGED
|
@@ -18,4 +18,15 @@ minimumReleaseAgeExclude:
|
|
|
18
18
|
- "@prisma/*"
|
|
19
19
|
overrides:
|
|
20
20
|
effect: "4.0.0-rc.115"
|
|
21
|
+
"@effect/platform-bun": "4.0.0-rc.115"
|
|
22
|
+
"@effect/platform-node": "4.0.0-rc.115"
|
|
23
|
+
"@effect/platform-node-shared": "4.0.0-rc.115"
|
|
24
|
+
"@effect/sql-d1": "4.0.0-rc.115"
|
|
25
|
+
"@effect/sql-sqlite-do": "4.0.0-rc.115"
|
|
26
|
+
"@effect/vitest": "4.0.0-rc.115"
|
|
27
|
+
{{#if (eq provider "mongo")}}
|
|
28
|
+
peerDependencyRules:
|
|
29
|
+
allowedVersions:
|
|
30
|
+
"alchemy>mongodb": "7"
|
|
31
|
+
{{/if}}
|
|
21
32
|
{{/if}}
|