create-prisma 0.9.1-pr.61.227.1 → 0.9.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 +1 -1
- package/dist/{create-MGePOqH1.mjs → create-C2KUxZsd.mjs} +24 -35
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/templates/create/_shared/pnpm-workspace.yaml.hbs +1 -1
- package/templates/create/_shared/prisma.config.ts.hbs +1 -4
- package/templates/create/nuxt/package.json.hbs +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -13,12 +13,21 @@ import { execa } from "execa";
|
|
|
13
13
|
import { styleText } from "node:util";
|
|
14
14
|
|
|
15
15
|
//#region src/telemetry/client.ts
|
|
16
|
-
const TELEMETRY_API_KEY = "";
|
|
16
|
+
const TELEMETRY_API_KEY = "phc_cmc85avbWyuJ2JyKdGPdv7dxXli8xLdWDBPbvIXWJfs";
|
|
17
17
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
18
18
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
19
19
|
const UUID_V4_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
20
|
+
function isTruthyEnvValue(value) {
|
|
21
|
+
return [
|
|
22
|
+
"1",
|
|
23
|
+
"true",
|
|
24
|
+
"yes",
|
|
25
|
+
"on"
|
|
26
|
+
].includes(String(value ?? "").trim().toLowerCase());
|
|
27
|
+
}
|
|
20
28
|
function shouldDisableTelemetry() {
|
|
21
|
-
return true;
|
|
29
|
+
if (isTruthyEnvValue(process.env.CI) || isTruthyEnvValue(process.env.GITHUB_ACTIONS)) return true;
|
|
30
|
+
return process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
|
|
22
31
|
}
|
|
23
32
|
function getTelemetryConfigDir() {
|
|
24
33
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -40,7 +49,7 @@ async function getAnonymousId() {
|
|
|
40
49
|
}
|
|
41
50
|
function getCommonProperties() {
|
|
42
51
|
return {
|
|
43
|
-
"cli-version": "0.9.1
|
|
52
|
+
"cli-version": "0.9.1",
|
|
44
53
|
"node-version": process.version,
|
|
45
54
|
platform: process.platform,
|
|
46
55
|
arch: process.arch
|
|
@@ -470,21 +479,21 @@ async function scaffoldCreateFrameworkTemplate(opts) {
|
|
|
470
479
|
const dependencyVersionMap = {
|
|
471
480
|
"@astrojs/node": "^10.0.2",
|
|
472
481
|
"@elysiajs/node": "^1.4.5",
|
|
473
|
-
"@prisma/
|
|
474
|
-
"@prisma/composer
|
|
482
|
+
"@prisma/cli-engine": "0.2.0",
|
|
483
|
+
"@prisma/composer": "0.10.0",
|
|
484
|
+
"@prisma/composer-prisma-cloud": "0.10.0",
|
|
475
485
|
"@prisma/orm-mongo": "8.0.0-rc.4",
|
|
476
486
|
"@prisma/orm-postgres": "8.0.0-rc.4",
|
|
477
487
|
"@sveltejs/adapter-node": "^5.3.2",
|
|
478
488
|
"@types/node": "^25.6.2",
|
|
479
|
-
alchemy: "2.0.0-beta.
|
|
489
|
+
alchemy: "2.0.0-beta.67",
|
|
480
490
|
arktype: "^2.2.3",
|
|
481
491
|
dotenv: "^17.4.2",
|
|
482
492
|
esbuild: "^0.28.1",
|
|
483
|
-
effect: "4.0.0-
|
|
493
|
+
effect: "4.0.0-beta.103",
|
|
484
494
|
mongodb: "^7.1.0",
|
|
485
495
|
"mongodb-memory-server": "^11.1.0",
|
|
486
496
|
nitro: "^3.0.260610-beta",
|
|
487
|
-
prisma: "next",
|
|
488
497
|
tsx: "^4.21.0",
|
|
489
498
|
typescript: "^5.9.3"
|
|
490
499
|
};
|
|
@@ -502,7 +511,7 @@ function getCreateTemplateDependencies(template, _packageManager) {
|
|
|
502
511
|
"@prisma/composer-prisma-cloud",
|
|
503
512
|
"alchemy"
|
|
504
513
|
];
|
|
505
|
-
const devDependencies = [];
|
|
514
|
+
const devDependencies = ["@prisma/cli-engine"];
|
|
506
515
|
if (usesEsbuild(template)) devDependencies.push("esbuild");
|
|
507
516
|
if (template === "minimal" || usesEsbuild(template)) devDependencies.push("tsx");
|
|
508
517
|
if (template === "minimal") devDependencies.push("typescript");
|
|
@@ -550,7 +559,7 @@ function getPrismaScriptMap(packageManager) {
|
|
|
550
559
|
"migration:show": prismaCommand(true, "migration", "show")
|
|
551
560
|
};
|
|
552
561
|
}
|
|
553
|
-
const prismaCommand = (...args) => [
|
|
562
|
+
const prismaCommand = (...args) => getPackageExecutionCommand(packageManager, [PRISMA_PLATFORM_CLI_PACKAGE, ...args]);
|
|
554
563
|
return {
|
|
555
564
|
"contract:emit": prismaCommand("contract", "emit"),
|
|
556
565
|
"db:init": prismaCommand("db", "init"),
|
|
@@ -559,17 +568,16 @@ function getPrismaScriptMap(packageManager) {
|
|
|
559
568
|
"migration:plan": prismaCommand("migration", "plan"),
|
|
560
569
|
migrate: prismaCommand("db", "migrate"),
|
|
561
570
|
"migration:status": prismaCommand("migration", "status"),
|
|
562
|
-
"migration:show": prismaCommand("migration", "show")
|
|
563
|
-
"skills:sync": `${prismaCommand("skills", "sync")} || exit 0`
|
|
571
|
+
"migration:show": prismaCommand("migration", "show")
|
|
564
572
|
};
|
|
565
573
|
}
|
|
566
574
|
function getComposerScriptMap(packageManager) {
|
|
567
575
|
if (packageManager === "deno") return {};
|
|
568
|
-
const composerCommand = (subcommand) => [
|
|
569
|
-
|
|
576
|
+
const composerCommand = (subcommand) => getPackageExecutionCommand(packageManager, [
|
|
577
|
+
PRISMA_PLATFORM_CLI_PACKAGE,
|
|
570
578
|
subcommand,
|
|
571
579
|
"module.ts"
|
|
572
|
-
]
|
|
580
|
+
]);
|
|
573
581
|
return {
|
|
574
582
|
"composer:dev": composerCommand("dev"),
|
|
575
583
|
"composer:deploy": composerCommand("deploy"),
|
|
@@ -617,7 +625,7 @@ async function writePrismaDependencies(provider, packageManager, _authoring, pro
|
|
|
617
625
|
if (packageManager === "deno") dependencies.push("dotenv");
|
|
618
626
|
await addPackageDependency({
|
|
619
627
|
dependencies,
|
|
620
|
-
devDependencies: packageManager === "deno" ? ["@types/node"] : ["@
|
|
628
|
+
devDependencies: packageManager === "deno" ? ["@types/node"] : ["@prisma/cli-engine", "@types/node"],
|
|
621
629
|
scripts: getPrismaScriptMap(packageManager),
|
|
622
630
|
projectDir
|
|
623
631
|
});
|
|
@@ -1069,23 +1077,6 @@ async function runPrismaInit(context, projectDir) {
|
|
|
1069
1077
|
});
|
|
1070
1078
|
if (context.packageManager === "deno") await fs.remove(path.join(projectDir, "prisma-next.md"));
|
|
1071
1079
|
}
|
|
1072
|
-
async function initializeAgentSkills(context, projectDir) {
|
|
1073
|
-
if (context.packageManager === "deno") return;
|
|
1074
|
-
const invocation = getPrismaCliInvocation(context.packageManager, [
|
|
1075
|
-
"init",
|
|
1076
|
-
"--yes",
|
|
1077
|
-
"--no-interactive"
|
|
1078
|
-
]);
|
|
1079
|
-
if (context.verbose) log.step(`Running ${[invocation.command, ...invocation.args].join(" ")}`);
|
|
1080
|
-
await execa(invocation.command, invocation.args, {
|
|
1081
|
-
cwd: projectDir,
|
|
1082
|
-
stdio: context.verbose ? "inherit" : "pipe",
|
|
1083
|
-
env: {
|
|
1084
|
-
...process.env,
|
|
1085
|
-
CI: "1"
|
|
1086
|
-
}
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
1080
|
async function ensureGitignoreEntry(projectDir, entry) {
|
|
1090
1081
|
const gitignorePath = path.join(projectDir, ".gitignore");
|
|
1091
1082
|
const existing = await fs.pathExists(gitignorePath) ? await fs.readFile(gitignorePath, "utf8") : "";
|
|
@@ -1174,8 +1165,6 @@ async function executePrismaSetupContext(context, options = {}) {
|
|
|
1174
1165
|
if (context.databaseProvider === "mongo") await ensureMongoEnvironment(projectDir);
|
|
1175
1166
|
progress?.message(`Installing dependencies with ${getInstallCommand(context.packageManager)}...`);
|
|
1176
1167
|
await installProjectDependencies(context.packageManager, projectDir, { verbose: context.verbose });
|
|
1177
|
-
progress?.message("Installing Prisma agent skills...");
|
|
1178
|
-
await initializeAgentSkills(context, projectDir);
|
|
1179
1168
|
progress?.message("Generating Prisma 8 contract artifacts...");
|
|
1180
1169
|
await emitContract(context, projectDir);
|
|
1181
1170
|
progress?.stop("Prisma 8 project ready.");
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-C2KUxZsd.mjs";
|
|
3
3
|
import { os } from "@orpc/server";
|
|
4
4
|
import { createCli } from "trpc-cli";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/index.ts
|
|
8
|
-
const CLI_VERSION = "0.9.1
|
|
8
|
+
const CLI_VERSION = "0.9.1";
|
|
9
9
|
const CreateCliInputSchema = z.tuple([z.string().trim().min(1, "Please enter a valid project name").optional().describe("Project name / directory"), CreateCommandInputSchema]);
|
|
10
10
|
function normalizeCreateCliInput(input) {
|
|
11
11
|
const [projectName, options] = input;
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{{#unless (eq packageManager "deno")}}
|
|
2
|
-
import { definePrismaConfig } from "prisma/
|
|
2
|
+
import { definePrismaConfig } from "@prisma/cli-engine";
|
|
3
3
|
import { defineConfig as ormConfig } from "@prisma/orm-{{#if (eq provider "postgres")}}postgres{{else}}mongo{{/if}}/config";
|
|
4
4
|
|
|
5
5
|
export default definePrismaConfig({
|
|
6
|
-
skills: {
|
|
7
|
-
agents: ["claude", "cursor", "agents", "devin"],
|
|
8
|
-
},
|
|
9
6
|
orm: ormConfig({
|
|
10
7
|
contract: "./src/prisma/contract{{#if (eq authoring "typescript")}}.ts{{else}}.prisma{{/if}}",
|
|
11
8
|
{{#if (eq authoring "typescript")}}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dev": "nuxt dev",
|
|
12
12
|
"generate": "nuxt generate",
|
|
13
13
|
"preview": "nuxt preview",
|
|
14
|
-
"postinstall": "nuxt prepare
|
|
14
|
+
"postinstall": "nuxt prepare",
|
|
15
15
|
"typecheck": "nuxt typecheck"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|