create-prisma 0.13.4 → 0.13.5
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-kf2v8luZ.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-kf2v8luZ.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";
|
|
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));
|
|
@@ -486,7 +486,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
|
|
|
486
486
|
return anonymousId;
|
|
487
487
|
});
|
|
488
488
|
const getCommonProperties = () => ({
|
|
489
|
-
"cli-version": "0.13.
|
|
489
|
+
"cli-version": "0.13.5",
|
|
490
490
|
"node-version": process.version,
|
|
491
491
|
platform: process.platform,
|
|
492
492
|
arch: process.arch
|
|
@@ -644,6 +644,15 @@ const dependencyVersionMap = {
|
|
|
644
644
|
tsx: "^4.21.0",
|
|
645
645
|
typescript: "^5.9.3"
|
|
646
646
|
};
|
|
647
|
+
const effectPackages = [
|
|
648
|
+
"effect",
|
|
649
|
+
"@effect/platform-bun",
|
|
650
|
+
"@effect/platform-node",
|
|
651
|
+
"@effect/platform-node-shared",
|
|
652
|
+
"@effect/sql-d1",
|
|
653
|
+
"@effect/sql-sqlite-do",
|
|
654
|
+
"@effect/vitest"
|
|
655
|
+
];
|
|
647
656
|
const PRISMA_PLATFORM_CLI_PACKAGE = `prisma@${dependencyVersionMap.prisma}`;
|
|
648
657
|
const PRISMA_DENO_CLI_PACKAGE = PRISMA_PLATFORM_CLI_PACKAGE;
|
|
649
658
|
function getDependencyVersion(packageName) {
|
|
@@ -1242,6 +1251,15 @@ const addPackageDependencyEffect = Effect.fn("Dependencies.add")(function* (opts
|
|
|
1242
1251
|
packageJson.scripts = sortRecord(packageJson.scripts);
|
|
1243
1252
|
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1244
1253
|
});
|
|
1254
|
+
const resolveAlchemyMongoPeerForNpm = Effect.fn("Dependencies.resolveAlchemyMongoPeerForNpm")(function* (projectDir) {
|
|
1255
|
+
const packageJsonPath = path.join(projectDir, "package.json");
|
|
1256
|
+
const packageJson = yield* readPackageJson(packageJsonPath);
|
|
1257
|
+
packageJson.overrides = {
|
|
1258
|
+
...packageJson.overrides,
|
|
1259
|
+
alchemy: { mongodb: dependencyVersionMap.mongodb }
|
|
1260
|
+
};
|
|
1261
|
+
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1262
|
+
});
|
|
1245
1263
|
const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd(), options = {}) {
|
|
1246
1264
|
const databaseDependencies = [getDbPackages(provider)];
|
|
1247
1265
|
const devDependencies = ["@types/node", "prisma"];
|
|
@@ -1262,6 +1280,7 @@ const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(func
|
|
|
1262
1280
|
dependencies: databaseDependencies,
|
|
1263
1281
|
projectDir: path.join(projectDir, "packages/database")
|
|
1264
1282
|
});
|
|
1283
|
+
if (provider === "mongo" && packageManager === "npm") yield* resolveAlchemyMongoPeerForNpm(projectDir);
|
|
1265
1284
|
});
|
|
1266
1285
|
const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTemplate")(function* (opts) {
|
|
1267
1286
|
const projectDir = opts.projectDir ?? process.cwd();
|
|
@@ -1277,13 +1296,14 @@ const writeCreateTemplateDependenciesEffect = Effect.fn("Dependencies.writeTempl
|
|
|
1277
1296
|
const packageJson = yield* readPackageJson(packageJsonPath);
|
|
1278
1297
|
const effectVersion = getDependencyVersion("effect");
|
|
1279
1298
|
if (!effectVersion) return yield* Effect.fail(/* @__PURE__ */ new Error("Dependency effect is missing from the version map."));
|
|
1299
|
+
const effectPins = Object.fromEntries(effectPackages.map((name) => [name, effectVersion]));
|
|
1280
1300
|
if (opts.packageManager === "yarn") packageJson.resolutions = {
|
|
1281
1301
|
...packageJson.resolutions,
|
|
1282
|
-
|
|
1302
|
+
...effectPins
|
|
1283
1303
|
};
|
|
1284
1304
|
else if (opts.packageManager !== "pnpm") packageJson.overrides = {
|
|
1285
1305
|
...packageJson.overrides,
|
|
1286
|
-
|
|
1306
|
+
...effectPins
|
|
1287
1307
|
};
|
|
1288
1308
|
yield* writePackageJson(packageJsonPath, packageJson);
|
|
1289
1309
|
});
|
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}}
|