create-prisma 0.7.0 → 0.7.1-pr.49.151.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 +2 -5
- package/dist/index.d.mts +20 -24
- package/dist/index.mjs +2 -26
- package/dist/{create-DGKeNID3.mjs → src-f-JavxLp.mjs} +48 -62
- package/package.json +17 -17
- package/templates/create/astro/package.json.hbs +5 -5
- package/templates/create/astro/prisma.compute.ts.hbs +1 -0
- package/templates/create/elysia/package.json.hbs +3 -3
- package/templates/create/hono/package.json.hbs +4 -4
- package/templates/create/nest/package.json.hbs +5 -5
- package/templates/create/nest/prisma.compute.ts.hbs +1 -0
- package/templates/create/nest/src/main.ts.hbs +1 -1
- package/templates/create/nest/tsconfig.json +1 -0
- package/templates/create/next/package.json.hbs +10 -10
- package/templates/create/next/src/app/page.tsx.hbs +0 -3
- package/templates/create/nuxt/package.json.hbs +7 -6
- package/templates/create/svelte/package.json.hbs +9 -9
- package/templates/create/tanstack-start/package.json.hbs +12 -13
- package/templates/create/tanstack-start/tsconfig.json +0 -1
- package/templates/create/turborepo/apps/api/package.json.hbs +4 -4
- package/templates/create/turborepo/package.json.hbs +1 -1
- package/templates/create/turborepo/packages/db/package.json.hbs +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./
|
|
3
|
-
import { createCreatePrismaCli } from "./index.mjs";
|
|
4
|
-
|
|
2
|
+
import { n as createCreatePrismaCli } from "./src-f-JavxLp.mjs";
|
|
5
3
|
//#region src/cli.ts
|
|
6
4
|
createCreatePrismaCli().run();
|
|
7
|
-
|
|
8
5
|
//#endregion
|
|
9
|
-
export {
|
|
6
|
+
export {};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import * as _orpc_server0 from "@orpc/server";
|
|
3
|
-
import * as trpc_cli0 from "trpc-cli";
|
|
4
|
-
import * as zod from "zod";
|
|
5
2
|
import { z } from "zod";
|
|
6
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
3
|
|
|
8
4
|
//#region node_modules/@orpc/client/dist/index.d.mts
|
|
9
5
|
declare const COMMON_ORPC_ERROR_DEFS: {
|
|
@@ -255,34 +251,34 @@ type CreateCommandInput = z.infer<typeof CreateCommandInputSchema>;
|
|
|
255
251
|
//#endregion
|
|
256
252
|
//#region src/index.d.ts
|
|
257
253
|
declare const router: {
|
|
258
|
-
create:
|
|
259
|
-
yes: zod.ZodOptional<zod.ZodBoolean>;
|
|
260
|
-
verbose: zod.ZodOptional<zod.ZodBoolean>;
|
|
261
|
-
provider: zod.ZodOptional<zod.ZodEnum<{
|
|
254
|
+
create: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, import("zod").ZodOptional<import("zod").ZodObject<{
|
|
255
|
+
yes: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
256
|
+
verbose: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
257
|
+
provider: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
262
258
|
postgresql: "postgresql";
|
|
263
259
|
mysql: "mysql";
|
|
264
260
|
sqlite: "sqlite";
|
|
265
261
|
sqlserver: "sqlserver";
|
|
266
262
|
cockroachdb: "cockroachdb";
|
|
267
263
|
}>>;
|
|
268
|
-
packageManager: zod.ZodOptional<zod.ZodEnum<{
|
|
264
|
+
packageManager: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
269
265
|
npm: "npm";
|
|
270
266
|
pnpm: "pnpm";
|
|
271
267
|
yarn: "yarn";
|
|
272
268
|
bun: "bun";
|
|
273
269
|
deno: "deno";
|
|
274
270
|
}>>;
|
|
275
|
-
prismaPostgres: zod.ZodOptional<zod.ZodBoolean>;
|
|
276
|
-
databaseUrl: zod.ZodOptional<zod.ZodString>;
|
|
277
|
-
install: zod.ZodOptional<zod.ZodBoolean>;
|
|
278
|
-
generate: zod.ZodOptional<zod.ZodBoolean>;
|
|
279
|
-
migrateAndSeed: zod.ZodOptional<zod.ZodBoolean>;
|
|
280
|
-
schemaPreset: zod.ZodOptional<zod.ZodEnum<{
|
|
271
|
+
prismaPostgres: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
272
|
+
databaseUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
273
|
+
install: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
274
|
+
generate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
275
|
+
migrateAndSeed: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
276
|
+
schemaPreset: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
281
277
|
empty: "empty";
|
|
282
278
|
basic: "basic";
|
|
283
279
|
}>>;
|
|
284
|
-
name: zod.ZodOptional<zod.ZodString>;
|
|
285
|
-
template: zod.ZodOptional<zod.ZodEnum<{
|
|
280
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
281
|
+
template: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
286
282
|
hono: "hono";
|
|
287
283
|
elysia: "elysia";
|
|
288
284
|
nest: "nest";
|
|
@@ -293,14 +289,14 @@ declare const router: {
|
|
|
293
289
|
"tanstack-start": "tanstack-start";
|
|
294
290
|
turborepo: "turborepo";
|
|
295
291
|
}>>;
|
|
296
|
-
skills: zod.ZodOptional<zod.ZodBoolean>;
|
|
297
|
-
mcp: zod.ZodOptional<zod.ZodBoolean>;
|
|
298
|
-
extension: zod.ZodOptional<zod.ZodBoolean>;
|
|
299
|
-
deploy: zod.ZodOptional<zod.ZodBoolean>;
|
|
300
|
-
force: zod.ZodOptional<zod.ZodBoolean>;
|
|
301
|
-
},
|
|
292
|
+
skills: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
293
|
+
mcp: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
294
|
+
extension: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
295
|
+
deploy: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
296
|
+
force: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
297
|
+
}, import("zod/v4/core").$strip>>, Schema<void, void>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
302
298
|
};
|
|
303
|
-
declare function createCreatePrismaCli():
|
|
299
|
+
declare function createCreatePrismaCli(): import("trpc-cli").TrpcCli;
|
|
304
300
|
declare function create(input?: CreateCommandInput): Promise<void>;
|
|
305
301
|
//#endregion
|
|
306
302
|
export { type CreateCommandInput, CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };
|
package/dist/index.mjs
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
import { createCli } from "trpc-cli";
|
|
5
|
-
|
|
6
|
-
//#region src/index.ts
|
|
7
|
-
const CLI_VERSION = "0.7.0";
|
|
8
|
-
const router = os.router({ create: os.meta({
|
|
9
|
-
description: "Create a new project with Prisma setup",
|
|
10
|
-
default: true,
|
|
11
|
-
negateBooleans: true
|
|
12
|
-
}).input(CreateCommandInputSchema.optional()).handler(async ({ input }) => {
|
|
13
|
-
await runCreateCommand(input ?? {});
|
|
14
|
-
}) });
|
|
15
|
-
function createCreatePrismaCli() {
|
|
16
|
-
return createCli({
|
|
17
|
-
router,
|
|
18
|
-
name: "create-prisma",
|
|
19
|
-
version: CLI_VERSION
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
async function create(input = {}) {
|
|
23
|
-
await runCreateCommand(input);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };
|
|
2
|
+
import { a as CreateTemplateSchema, c as PackageManagerSchema, i as CreateCommandInputSchema, l as SchemaPresetSchema, n as createCreatePrismaCli, o as DatabaseProviderSchema, r as router, s as DatabaseUrlSchema, t as create } from "./src-f-JavxLp.mjs";
|
|
3
|
+
export { CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { os } from "@orpc/server";
|
|
3
|
+
import { createCli } from "trpc-cli";
|
|
2
4
|
import { cancel, confirm, intro, isCancel, log, multiselect, outro, select, spinner, text } from "@clack/prompts";
|
|
3
5
|
import fs from "fs-extra";
|
|
4
6
|
import path from "node:path";
|
|
@@ -8,10 +10,9 @@ import { fileURLToPath } from "node:url";
|
|
|
8
10
|
import { z } from "zod";
|
|
9
11
|
import { execa } from "execa";
|
|
10
12
|
import { randomUUID } from "node:crypto";
|
|
11
|
-
import os from "node:os";
|
|
13
|
+
import os$1 from "node:os";
|
|
12
14
|
import { PostHog } from "posthog-node";
|
|
13
15
|
import { styleText } from "node:util";
|
|
14
|
-
|
|
15
16
|
//#region src/utils/runtime.ts
|
|
16
17
|
function usesNodeStyleRuntime(packageManager) {
|
|
17
18
|
return packageManager !== void 0 && packageManager !== "bun" && packageManager !== "deno";
|
|
@@ -22,24 +23,23 @@ function requiresDotenvConfigImport(packageManager) {
|
|
|
22
23
|
function requiresPrismaConfigDotenvImport(packageManager) {
|
|
23
24
|
return packageManager !== "deno";
|
|
24
25
|
}
|
|
25
|
-
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/constants/dependencies.ts
|
|
28
28
|
const dependencyVersionMap = {
|
|
29
29
|
"@elysiajs/node": "^1.4.5",
|
|
30
|
-
"@libsql/client": "^0.17.
|
|
30
|
+
"@libsql/client": "^0.17.4",
|
|
31
31
|
"@prisma/client": "^7.8.0",
|
|
32
32
|
"@prisma/adapter-pg": "^7.8.0",
|
|
33
33
|
"@prisma/adapter-libsql": "^7.8.0",
|
|
34
34
|
"@prisma/adapter-mariadb": "^7.8.0",
|
|
35
35
|
"@prisma/adapter-mssql": "^7.8.0",
|
|
36
36
|
"@prisma/compute-sdk": "latest",
|
|
37
|
-
"@types/node": "^
|
|
38
|
-
dotenv: "^17.2
|
|
37
|
+
"@types/node": "^26.0.0",
|
|
38
|
+
dotenv: "^17.4.2",
|
|
39
39
|
prisma: "^7.8.0",
|
|
40
|
-
tsx: "^4.
|
|
40
|
+
tsx: "^4.22.4"
|
|
41
41
|
};
|
|
42
|
-
const computeConfigTemplates = new Set([
|
|
42
|
+
const computeConfigTemplates = /* @__PURE__ */ new Set([
|
|
43
43
|
"hono",
|
|
44
44
|
"elysia",
|
|
45
45
|
"nest",
|
|
@@ -80,7 +80,6 @@ function getCreateTemplateDependencies(template, packageManager) {
|
|
|
80
80
|
});
|
|
81
81
|
return targets;
|
|
82
82
|
}
|
|
83
|
-
|
|
84
83
|
//#endregion
|
|
85
84
|
//#region src/types.ts
|
|
86
85
|
const databaseProviders = [
|
|
@@ -132,10 +131,10 @@ const DatabaseProviderSchema = z.enum(databaseProviders);
|
|
|
132
131
|
const PackageManagerSchema = z.enum(packageManagers);
|
|
133
132
|
const SchemaPresetSchema = z.enum(schemaPresets);
|
|
134
133
|
const CreateTemplateSchema = z.enum(createTemplates);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
z.enum(createAddons);
|
|
135
|
+
z.enum(addonInstallScopes);
|
|
136
|
+
z.enum(extensionTargets);
|
|
137
|
+
z.enum(prismaSkillNames);
|
|
139
138
|
const DatabaseUrlSchema = z.string().trim().min(1, "Please enter a valid database URL");
|
|
140
139
|
const CommonCommandOptionsSchema = z.object({
|
|
141
140
|
yes: z.boolean().optional().describe("Skip prompts and accept default choices"),
|
|
@@ -161,7 +160,7 @@ const CreateScaffoldOptionsSchema = z.object({
|
|
|
161
160
|
deploy: z.boolean().optional().describe("Deploy the scaffolded project to Prisma Compute"),
|
|
162
161
|
force: z.boolean().optional().describe("Allow scaffolding into a non-empty target directory")
|
|
163
162
|
});
|
|
164
|
-
const COMPUTE_DEPLOYABLE_TEMPLATES = new Set([
|
|
163
|
+
const COMPUTE_DEPLOYABLE_TEMPLATES = /* @__PURE__ */ new Set([
|
|
165
164
|
"hono",
|
|
166
165
|
"elysia",
|
|
167
166
|
"nest",
|
|
@@ -175,14 +174,13 @@ function isComputeDeployableTemplate(template) {
|
|
|
175
174
|
return COMPUTE_DEPLOYABLE_TEMPLATES.has(template);
|
|
176
175
|
}
|
|
177
176
|
const CreateCommandInputSchema = PrismaSetupCommandInputSchema.extend(CreateScaffoldOptionsSchema.shape);
|
|
178
|
-
|
|
179
177
|
//#endregion
|
|
180
178
|
//#region src/utils/package-manager.ts
|
|
181
179
|
const packageManagerManifestValues = {
|
|
182
|
-
npm: "npm@
|
|
183
|
-
pnpm: "pnpm@
|
|
184
|
-
yarn: "yarn@4.
|
|
185
|
-
bun: "bun@1.3.
|
|
180
|
+
npm: "npm@11.17.0",
|
|
181
|
+
pnpm: "pnpm@11.8.0",
|
|
182
|
+
yarn: "yarn@4.17.0",
|
|
183
|
+
bun: "bun@1.3.14"
|
|
186
184
|
};
|
|
187
185
|
function parseUserAgent(userAgent) {
|
|
188
186
|
if (userAgent?.startsWith("pnpm")) return "pnpm";
|
|
@@ -419,7 +417,6 @@ function getPrismaCliCommand$1(packageManager, prismaArgs) {
|
|
|
419
417
|
const execution = getPrismaCliArgs(packageManager, prismaArgs);
|
|
420
418
|
return [execution.command, ...execution.args].join(" ");
|
|
421
419
|
}
|
|
422
|
-
|
|
423
420
|
//#endregion
|
|
424
421
|
//#region src/templates/shared.ts
|
|
425
422
|
function getOptionalHashString(hash, key) {
|
|
@@ -513,7 +510,6 @@ async function renderTemplateTree(opts) {
|
|
|
513
510
|
});
|
|
514
511
|
}
|
|
515
512
|
}
|
|
516
|
-
|
|
517
513
|
//#endregion
|
|
518
514
|
//#region src/templates/render-create-template.ts
|
|
519
515
|
function getCreateTemplateDir(template) {
|
|
@@ -536,7 +532,6 @@ async function scaffoldCreateTemplate(opts) {
|
|
|
536
532
|
context: createTemplateContext(projectName, provider, schemaPreset, packageManager, opts.compute === true)
|
|
537
533
|
});
|
|
538
534
|
}
|
|
539
|
-
|
|
540
535
|
//#endregion
|
|
541
536
|
//#region src/constants/db-packages.ts
|
|
542
537
|
function getDbPackages(provider, _packageManager) {
|
|
@@ -546,13 +541,9 @@ function getDbPackages(provider, _packageManager) {
|
|
|
546
541
|
case "mysql": return "@prisma/adapter-mariadb";
|
|
547
542
|
case "sqlite": return "@prisma/adapter-libsql";
|
|
548
543
|
case "sqlserver": return "@prisma/adapter-mssql";
|
|
549
|
-
default: {
|
|
550
|
-
const exhaustiveCheck = provider;
|
|
551
|
-
throw new Error(`Unsupported database provider: ${String(exhaustiveCheck)}`);
|
|
552
|
-
}
|
|
544
|
+
default: throw new Error(`Unsupported database provider: ${String(provider)}`);
|
|
553
545
|
}
|
|
554
546
|
}
|
|
555
|
-
|
|
556
547
|
//#endregion
|
|
557
548
|
//#region src/tasks/install.ts
|
|
558
549
|
function getPrismaScriptMap(packageManager) {
|
|
@@ -674,7 +665,6 @@ async function installProjectDependencies(packageManager, projectDir = process.c
|
|
|
674
665
|
stdio: verbose ? "inherit" : "pipe"
|
|
675
666
|
});
|
|
676
667
|
}
|
|
677
|
-
|
|
678
668
|
//#endregion
|
|
679
669
|
//#region src/tasks/prisma-postgres.ts
|
|
680
670
|
const PRISMA_POSTGRES_TEMPORARY_NOTICE = "Prisma Postgres is temporary for 24 hours. Claim this database before it expires using CLAIM_URL.";
|
|
@@ -729,7 +719,6 @@ async function provisionPrismaPostgres(packageManager, projectDir = process.cwd(
|
|
|
729
719
|
function getCreateDbCommand(packageManager) {
|
|
730
720
|
return getPackageExecutionCommand(packageManager, [...CREATE_DB_COMMAND_ARGS]);
|
|
731
721
|
}
|
|
732
|
-
|
|
733
722
|
//#endregion
|
|
734
723
|
//#region src/tasks/setup-prisma.ts
|
|
735
724
|
const DEFAULT_DATABASE_PROVIDER = "postgresql";
|
|
@@ -922,10 +911,7 @@ function getDefaultDatabaseUrl(provider) {
|
|
|
922
911
|
case "mysql": return "mysql://johndoe:randompassword@localhost:3306/mydb";
|
|
923
912
|
case "sqlite": return "file:./dev.db";
|
|
924
913
|
case "sqlserver": return "sqlserver://localhost:1433;database=mydb;user=SA;password=randompassword;";
|
|
925
|
-
default: {
|
|
926
|
-
const exhaustiveCheck = provider;
|
|
927
|
-
throw new Error(`Unsupported provider: ${String(exhaustiveCheck)}`);
|
|
928
|
-
}
|
|
914
|
+
default: throw new Error(`Unsupported provider: ${String(provider)}`);
|
|
929
915
|
}
|
|
930
916
|
}
|
|
931
917
|
function escapeRegExp(value) {
|
|
@@ -1236,7 +1222,6 @@ async function migrateAndSeedIfRequested(context, projectDir, options) {
|
|
|
1236
1222
|
didSeed
|
|
1237
1223
|
};
|
|
1238
1224
|
}
|
|
1239
|
-
|
|
1240
1225
|
//#endregion
|
|
1241
1226
|
//#region src/tasks/setup-addons.ts
|
|
1242
1227
|
const DEFAULT_ADDON_SCOPE = "project";
|
|
@@ -1691,10 +1676,7 @@ function getExtensionInstallBinary(target) {
|
|
|
1691
1676
|
case "vscode": return "code";
|
|
1692
1677
|
case "cursor": return "cursor";
|
|
1693
1678
|
case "windsurf": return "windsurf";
|
|
1694
|
-
default: {
|
|
1695
|
-
const exhaustiveCheck = target;
|
|
1696
|
-
throw new Error(`Unsupported extension target: ${String(exhaustiveCheck)}`);
|
|
1697
|
-
}
|
|
1679
|
+
default: throw new Error(`Unsupported extension target: ${String(target)}`);
|
|
1698
1680
|
}
|
|
1699
1681
|
}
|
|
1700
1682
|
async function installExtensionAddon(params) {
|
|
@@ -1771,7 +1753,6 @@ async function executeCreateAddonSetupContext(params) {
|
|
|
1771
1753
|
}
|
|
1772
1754
|
addonSpinner.stop("Add-ons applied.");
|
|
1773
1755
|
}
|
|
1774
|
-
|
|
1775
1756
|
//#endregion
|
|
1776
1757
|
//#region src/tasks/deploy-to-compute.ts
|
|
1777
1758
|
const PRISMA_CLI_PACKAGE = "@prisma/cli@latest";
|
|
@@ -1801,8 +1782,7 @@ function getComputeDeployScriptMap(context) {
|
|
|
1801
1782
|
"--prod",
|
|
1802
1783
|
"--yes"
|
|
1803
1784
|
];
|
|
1804
|
-
|
|
1805
|
-
return { "compute:deploy": deployCommand };
|
|
1785
|
+
return { "compute:deploy": [getPrismaCliAppDeployCommand(context.packageManager), ...deployArgs].join(" ") };
|
|
1806
1786
|
}
|
|
1807
1787
|
function getComputeDeployTargetArgs(context) {
|
|
1808
1788
|
return context.configTarget ? [context.configTarget] : [];
|
|
@@ -2045,29 +2025,19 @@ async function executeComputeDeployContext(params) {
|
|
|
2045
2025
|
result: toComputeDeployResult(deployResult.result)
|
|
2046
2026
|
};
|
|
2047
2027
|
}
|
|
2048
|
-
|
|
2049
2028
|
//#endregion
|
|
2050
2029
|
//#region src/telemetry/client.ts
|
|
2051
|
-
const TELEMETRY_API_KEY = "
|
|
2030
|
+
const TELEMETRY_API_KEY = "";
|
|
2052
2031
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
2053
2032
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
2054
2033
|
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;
|
|
2055
|
-
function isTruthyEnvValue(value) {
|
|
2056
|
-
return [
|
|
2057
|
-
"1",
|
|
2058
|
-
"true",
|
|
2059
|
-
"yes",
|
|
2060
|
-
"on"
|
|
2061
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
2062
|
-
}
|
|
2063
2034
|
function shouldDisableTelemetry() {
|
|
2064
|
-
|
|
2065
|
-
return process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
|
|
2035
|
+
return true;
|
|
2066
2036
|
}
|
|
2067
2037
|
function getTelemetryConfigDir() {
|
|
2068
|
-
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
2069
|
-
if (process.platform === "win32") return path.join(process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming"), "create-prisma");
|
|
2070
|
-
return path.join(process.env.XDG_CONFIG_HOME ?? path.join(os.homedir(), ".config"), "create-prisma");
|
|
2038
|
+
if (process.platform === "darwin") return path.join(os$1.homedir(), "Library", "Application Support", "create-prisma");
|
|
2039
|
+
if (process.platform === "win32") return path.join(process.env.APPDATA ?? path.join(os$1.homedir(), "AppData", "Roaming"), "create-prisma");
|
|
2040
|
+
return path.join(process.env.XDG_CONFIG_HOME ?? path.join(os$1.homedir(), ".config"), "create-prisma");
|
|
2071
2041
|
}
|
|
2072
2042
|
async function getAnonymousId() {
|
|
2073
2043
|
const telemetryConfigPath = path.join(getTelemetryConfigDir(), TELEMETRY_CONFIG_FILE);
|
|
@@ -2084,7 +2054,7 @@ async function getAnonymousId() {
|
|
|
2084
2054
|
}
|
|
2085
2055
|
function getCommonProperties() {
|
|
2086
2056
|
return {
|
|
2087
|
-
"cli-version": "0.7.
|
|
2057
|
+
"cli-version": "0.7.1-pr.49.151.1",
|
|
2088
2058
|
"node-version": process.version,
|
|
2089
2059
|
platform: process.platform,
|
|
2090
2060
|
arch: process.arch
|
|
@@ -2119,7 +2089,6 @@ async function trackCliTelemetry(event, properties) {
|
|
|
2119
2089
|
if (client) await client.shutdown().catch(() => {});
|
|
2120
2090
|
}
|
|
2121
2091
|
}
|
|
2122
|
-
|
|
2123
2092
|
//#endregion
|
|
2124
2093
|
//#region src/telemetry/create.ts
|
|
2125
2094
|
function getRequestedAddons(input) {
|
|
@@ -2184,14 +2153,12 @@ async function trackCreateFailed(params) {
|
|
|
2184
2153
|
"error-code": getErrorCode(params.error)
|
|
2185
2154
|
});
|
|
2186
2155
|
}
|
|
2187
|
-
|
|
2188
2156
|
//#endregion
|
|
2189
2157
|
//#region src/ui/branding.ts
|
|
2190
2158
|
const prismaTitle = `${styleText(["bold", "cyan"], "Create")} ${styleText(["bold", "magenta"], "Prisma")}`;
|
|
2191
2159
|
function getCreatePrismaIntro() {
|
|
2192
2160
|
return prismaTitle;
|
|
2193
2161
|
}
|
|
2194
|
-
|
|
2195
2162
|
//#endregion
|
|
2196
2163
|
//#region src/commands/create.ts
|
|
2197
2164
|
const DEFAULT_PROJECT_NAME = "my-app";
|
|
@@ -2527,6 +2494,25 @@ async function executeCreateContext(context) {
|
|
|
2527
2494
|
outro(summaryLines.join("\n"));
|
|
2528
2495
|
return { ok: true };
|
|
2529
2496
|
}
|
|
2530
|
-
|
|
2531
2497
|
//#endregion
|
|
2532
|
-
|
|
2498
|
+
//#region src/index.ts
|
|
2499
|
+
const CLI_VERSION = "0.7.1-pr.49.151.1";
|
|
2500
|
+
const router = os.router({ create: os.meta({
|
|
2501
|
+
description: "Create a new project with Prisma setup",
|
|
2502
|
+
default: true,
|
|
2503
|
+
negateBooleans: true
|
|
2504
|
+
}).input(CreateCommandInputSchema.optional()).handler(async ({ input }) => {
|
|
2505
|
+
await runCreateCommand(input ?? {});
|
|
2506
|
+
}) });
|
|
2507
|
+
function createCreatePrismaCli() {
|
|
2508
|
+
return createCli({
|
|
2509
|
+
router,
|
|
2510
|
+
name: "create-prisma",
|
|
2511
|
+
version: CLI_VERSION
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
async function create(input = {}) {
|
|
2515
|
+
await runCreateCommand(input);
|
|
2516
|
+
}
|
|
2517
|
+
//#endregion
|
|
2518
|
+
export { CreateTemplateSchema as a, PackageManagerSchema as c, CreateCommandInputSchema as i, SchemaPresetSchema as l, createCreatePrismaCli as n, DatabaseProviderSchema as o, router as r, DatabaseUrlSchema as s, create as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1-pr.49.151.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Create Prisma 7 projects with first-party templates and great DX.",
|
|
6
6
|
"homepage": "https://github.com/prisma/create-prisma",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "tsdown",
|
|
37
|
-
"dev": "tsdown --watch",
|
|
36
|
+
"build": "tsdown --config-loader native",
|
|
37
|
+
"dev": "tsdown --config-loader native --watch",
|
|
38
38
|
"start": "bun run ./dist/cli.mjs",
|
|
39
39
|
"check": "bun run format:check && bun run lint",
|
|
40
40
|
"lint": "oxlint . --deny-warnings",
|
|
@@ -47,28 +47,28 @@
|
|
|
47
47
|
"release-notes": "bunx changelogithub"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@clack/prompts": "^1.0
|
|
51
|
-
"@orpc/server": "^1.
|
|
50
|
+
"@clack/prompts": "^1.6.0",
|
|
51
|
+
"@orpc/server": "^1.14.6",
|
|
52
52
|
"execa": "^9.6.1",
|
|
53
|
-
"fs-extra": "^11.3.
|
|
54
|
-
"handlebars": "^4.7.
|
|
55
|
-
"posthog-node": "^5.
|
|
56
|
-
"trpc-cli": "^0.
|
|
57
|
-
"zod": "^4.3
|
|
53
|
+
"fs-extra": "^11.3.5",
|
|
54
|
+
"handlebars": "^4.7.9",
|
|
55
|
+
"posthog-node": "^5.38.2",
|
|
56
|
+
"trpc-cli": "^0.15.1",
|
|
57
|
+
"zod": "^4.4.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/bun": "^1.3.
|
|
60
|
+
"@types/bun": "^1.3.14",
|
|
61
61
|
"@types/fs-extra": "^11.0.4",
|
|
62
|
-
"@types/node": "^
|
|
62
|
+
"@types/node": "^26.0.0",
|
|
63
63
|
"changelogithub": "^14.0.0",
|
|
64
|
-
"oxfmt": "^0.
|
|
65
|
-
"oxlint": "^1.
|
|
66
|
-
"tsdown": "^0.
|
|
67
|
-
"typescript": "^
|
|
64
|
+
"oxfmt": "^0.56.0",
|
|
65
|
+
"oxlint": "^1.71.0",
|
|
66
|
+
"tsdown": "^0.22.3",
|
|
67
|
+
"typescript": "^6.0.3"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"bun": ">=1.3.0",
|
|
71
71
|
"node": ">=18.0.0"
|
|
72
72
|
},
|
|
73
|
-
"packageManager": "bun@1.3.
|
|
73
|
+
"packageManager": "bun@1.3.14"
|
|
74
74
|
}
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"astro": "astro"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"@astrojs/node": "^11.0.0",
|
|
16
|
+
"astro": "^7.0.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^
|
|
20
|
-
"tsx": "^4.
|
|
21
|
-
"typescript": "^
|
|
19
|
+
"@types/node": "^26.0.0",
|
|
20
|
+
"tsx": "^4.22.4",
|
|
21
|
+
"typescript": "^6.0.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"start": "{{runtimeScript packageManager "start" "src/index.ts" "dist/src/index.js" denoFlags="--unstable-net"}}"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sinclair/typebox": "^0.34.
|
|
16
|
-
"elysia": "^1.4.
|
|
15
|
+
"@sinclair/typebox": "^0.34.49",
|
|
16
|
+
"elysia": "^1.4.29",
|
|
17
17
|
"openapi-types": "^12.1.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"typescript": "^
|
|
20
|
+
"typescript": "^6.0.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"start": "{{runtimeScript packageManager "start" "src/index.ts" "dist/src/index.js"}}"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@hono/node-server": "^
|
|
16
|
-
"hono": "^4.12.
|
|
15
|
+
"@hono/node-server": "^2.0.6",
|
|
16
|
+
"hono": "^4.12.27"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^
|
|
20
|
-
"typescript": "^
|
|
19
|
+
"@types/node": "^26.0.0",
|
|
20
|
+
"typescript": "^6.0.3"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"start": "{{runtimeScript packageManager "start" "src/main.ts" "dist/main.js"}}"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@nestjs/common": "^11.1.
|
|
15
|
-
"@nestjs/core": "^11.1.
|
|
16
|
-
"@nestjs/platform-express": "^11.1.
|
|
14
|
+
"@nestjs/common": "^11.1.27",
|
|
15
|
+
"@nestjs/core": "^11.1.27",
|
|
16
|
+
"@nestjs/platform-express": "^11.1.27",
|
|
17
17
|
"reflect-metadata": "^0.2.2",
|
|
18
18
|
"rxjs": "^7.8.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/node": "^
|
|
22
|
-
"typescript": "^
|
|
21
|
+
"@types/node": "^26.0.0",
|
|
22
|
+
"typescript": "^6.0.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -13,7 +13,7 @@ async function bootstrap() {
|
|
|
13
13
|
const parsedPort = rawPort.length > 0 ? Number(rawPort) : Number.NaN;
|
|
14
14
|
const port =
|
|
15
15
|
Number.isFinite(parsedPort) && parsedPort >= 0 && parsedPort <= 65535 ? parsedPort : 3000;
|
|
16
|
-
await app.listen(port);
|
|
16
|
+
await app.listen(port, "0.0.0.0");
|
|
17
17
|
console.log(`Server running at http://localhost:${port}`);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"lint": "eslint"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"next": "16.
|
|
17
|
-
"react": "19.2.
|
|
18
|
-
"react-dom": "19.2.
|
|
16
|
+
"next": "16.2.9",
|
|
17
|
+
"react": "19.2.7",
|
|
18
|
+
"react-dom": "19.2.7"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/node": "^
|
|
22
|
-
"@types/react": "^19",
|
|
23
|
-
"@types/react-dom": "^19",
|
|
24
|
-
"eslint": "^
|
|
25
|
-
"eslint-config-next": "16.
|
|
26
|
-
"tsx": "^4.
|
|
27
|
-
"typescript": "^
|
|
21
|
+
"@types/node": "^26.0.0",
|
|
22
|
+
"@types/react": "^19.2.17",
|
|
23
|
+
"@types/react-dom": "^19.2.3",
|
|
24
|
+
"eslint": "^10.5.0",
|
|
25
|
+
"eslint-config-next": "16.2.9",
|
|
26
|
+
"tsx": "^4.22.4",
|
|
27
|
+
"typescript": "^6.0.3"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
"typecheck": "nuxt typecheck"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"nuxt": "^4.
|
|
19
|
-
"vue": "^3.5.
|
|
20
|
-
"vue-router": "^
|
|
18
|
+
"nuxt": "^4.4.8",
|
|
19
|
+
"vue": "^3.5.38",
|
|
20
|
+
"vue-router": "^5.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^
|
|
24
|
-
"tsx": "^4.
|
|
25
|
-
"typescript": "^
|
|
23
|
+
"@types/node": "^26.0.0",
|
|
24
|
+
"tsx": "^4.22.4",
|
|
25
|
+
"typescript": "^6.0.3",
|
|
26
|
+
"vue-tsc": "^3.3.5"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"db:generate": "svelte-kit sync && {{prismaCommand packageManager "generate"}}"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@sveltejs/adapter-auto": "^7.0.
|
|
20
|
-
"@sveltejs/kit": "^2.
|
|
21
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
22
|
-
"@types/node": "^
|
|
23
|
-
"svelte": "^5.
|
|
24
|
-
"svelte-check": "^4.
|
|
25
|
-
"tsx": "^4.
|
|
26
|
-
"typescript": "^
|
|
27
|
-
"vite": "^
|
|
19
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
20
|
+
"@sveltejs/kit": "^2.67.0",
|
|
21
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
22
|
+
"@types/node": "^26.0.0",
|
|
23
|
+
"svelte": "^5.56.3",
|
|
24
|
+
"svelte-check": "^4.6.0",
|
|
25
|
+
"tsx": "^4.22.4",
|
|
26
|
+
"typescript": "^6.0.3",
|
|
27
|
+
"vite": "^8.0.16"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -14,20 +14,19 @@
|
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@tanstack/react-router": "^1.
|
|
18
|
-
"@tanstack/react-start": "^1.
|
|
19
|
-
"nitro": "^3.0.
|
|
20
|
-
"react": "^19.2.
|
|
21
|
-
"react-dom": "^19.2.
|
|
17
|
+
"@tanstack/react-router": "^1.170.16",
|
|
18
|
+
"@tanstack/react-start": "^1.168.26",
|
|
19
|
+
"nitro": "^3.0.260610-beta",
|
|
20
|
+
"react": "^19.2.7",
|
|
21
|
+
"react-dom": "^19.2.7"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"@types/react": "^19.2.
|
|
26
|
-
"@types/react-dom": "^19.2.
|
|
27
|
-
"@vitejs/plugin-react": "^6.0.
|
|
28
|
-
"tsx": "^4.
|
|
29
|
-
"typescript": "^
|
|
30
|
-
"vite": "^8.0.
|
|
24
|
+
"@types/node": "^26.0.0",
|
|
25
|
+
"@types/react": "^19.2.17",
|
|
26
|
+
"@types/react-dom": "^19.2.3",
|
|
27
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
28
|
+
"tsx": "^4.22.4",
|
|
29
|
+
"typescript": "^6.0.3",
|
|
30
|
+
"vite": "^8.0.16"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
{{/if}}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@hono/node-server": "^
|
|
20
|
-
"hono": "^4.12.
|
|
19
|
+
"@hono/node-server": "^2.0.6",
|
|
20
|
+
"hono": "^4.12.27"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^
|
|
24
|
-
"typescript": "^
|
|
23
|
+
"@types/node": "^26.0.0",
|
|
24
|
+
"typescript": "^6.0.3"
|
|
25
25
|
}
|
|
26
26
|
}
|