create-prisma 0.6.0 → 0.7.0-pr.48.149.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 +2 -5
- package/dist/index.d.mts +20 -24
- package/dist/index.mjs +2 -26
- package/dist/{create-CMPeveWE.mjs → src-Df6K24VN.mjs} +55 -65
- 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 +6 -6
- package/templates/create/nest/prisma.compute.ts.hbs +10 -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/README.md
CHANGED
|
@@ -101,6 +101,7 @@ Prisma Compute deployment is currently supported for:
|
|
|
101
101
|
|
|
102
102
|
- `hono`
|
|
103
103
|
- `elysia`
|
|
104
|
+
- `nest`
|
|
104
105
|
- `next`
|
|
105
106
|
- `astro`
|
|
106
107
|
- `nuxt`
|
|
@@ -152,7 +153,7 @@ When Prisma Compute deploy is selected, the skills add-on recommends the `prisma
|
|
|
152
153
|
|
|
153
154
|
## Deploy to Prisma Compute
|
|
154
155
|
|
|
155
|
-
After scaffolding, `create-prisma` can deploy your app to [Prisma Compute](https://www.prisma.io/docs/compute), the serverless hosting for TypeScript apps that runs next to your Prisma Postgres database. It is offered for the templates the Prisma CLI can deploy today: `hono`, `elysia`, `next`, `astro`, `nuxt`, `tanstack-start`, and `turborepo`.
|
|
156
|
+
After scaffolding, `create-prisma` can deploy your app to [Prisma Compute](https://www.prisma.io/docs/compute), the serverless hosting for TypeScript apps that runs next to your Prisma Postgres database. It is offered for the templates the Prisma CLI can deploy today: `hono`, `elysia`, `nest`, `next`, `astro`, `nuxt`, `tanstack-start`, and `turborepo`.
|
|
156
157
|
|
|
157
158
|
Accept the deploy prompt when it appears, or pass the flag:
|
|
158
159
|
|
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-Df6K24VN.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.6.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-Df6K24VN.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,26 +23,26 @@ 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
|
+
"nest",
|
|
45
46
|
"next",
|
|
46
47
|
"astro",
|
|
47
48
|
"nuxt",
|
|
@@ -79,7 +80,6 @@ function getCreateTemplateDependencies(template, packageManager) {
|
|
|
79
80
|
});
|
|
80
81
|
return targets;
|
|
81
82
|
}
|
|
82
|
-
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/types.ts
|
|
85
85
|
const databaseProviders = [
|
|
@@ -131,10 +131,10 @@ const DatabaseProviderSchema = z.enum(databaseProviders);
|
|
|
131
131
|
const PackageManagerSchema = z.enum(packageManagers);
|
|
132
132
|
const SchemaPresetSchema = z.enum(schemaPresets);
|
|
133
133
|
const CreateTemplateSchema = z.enum(createTemplates);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
z.enum(createAddons);
|
|
135
|
+
z.enum(addonInstallScopes);
|
|
136
|
+
z.enum(extensionTargets);
|
|
137
|
+
z.enum(prismaSkillNames);
|
|
138
138
|
const DatabaseUrlSchema = z.string().trim().min(1, "Please enter a valid database URL");
|
|
139
139
|
const CommonCommandOptionsSchema = z.object({
|
|
140
140
|
yes: z.boolean().optional().describe("Skip prompts and accept default choices"),
|
|
@@ -160,9 +160,10 @@ const CreateScaffoldOptionsSchema = z.object({
|
|
|
160
160
|
deploy: z.boolean().optional().describe("Deploy the scaffolded project to Prisma Compute"),
|
|
161
161
|
force: z.boolean().optional().describe("Allow scaffolding into a non-empty target directory")
|
|
162
162
|
});
|
|
163
|
-
const COMPUTE_DEPLOYABLE_TEMPLATES = new Set([
|
|
163
|
+
const COMPUTE_DEPLOYABLE_TEMPLATES = /* @__PURE__ */ new Set([
|
|
164
164
|
"hono",
|
|
165
165
|
"elysia",
|
|
166
|
+
"nest",
|
|
166
167
|
"next",
|
|
167
168
|
"astro",
|
|
168
169
|
"nuxt",
|
|
@@ -173,14 +174,13 @@ function isComputeDeployableTemplate(template) {
|
|
|
173
174
|
return COMPUTE_DEPLOYABLE_TEMPLATES.has(template);
|
|
174
175
|
}
|
|
175
176
|
const CreateCommandInputSchema = PrismaSetupCommandInputSchema.extend(CreateScaffoldOptionsSchema.shape);
|
|
176
|
-
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/utils/package-manager.ts
|
|
179
179
|
const packageManagerManifestValues = {
|
|
180
|
-
npm: "npm@
|
|
181
|
-
pnpm: "pnpm@
|
|
182
|
-
yarn: "yarn@4.
|
|
183
|
-
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"
|
|
184
184
|
};
|
|
185
185
|
function parseUserAgent(userAgent) {
|
|
186
186
|
if (userAgent?.startsWith("pnpm")) return "pnpm";
|
|
@@ -289,7 +289,7 @@ function joinCommandParts(parts) {
|
|
|
289
289
|
return parts.filter((part) => typeof part === "string" && part.length > 0).join(" ");
|
|
290
290
|
}
|
|
291
291
|
function getRuntimeScriptCommand(packageManager, kind, options) {
|
|
292
|
-
const { sourceEntrypoint, builtEntrypoint, denoFlags = [] } = options;
|
|
292
|
+
const { sourceEntrypoint, builtEntrypoint, denoFlags = [], emit = false } = options;
|
|
293
293
|
if (packageManager === "deno") switch (kind) {
|
|
294
294
|
case "dev": return joinCommandParts([
|
|
295
295
|
"deno",
|
|
@@ -312,7 +312,7 @@ function getRuntimeScriptCommand(packageManager, kind, options) {
|
|
|
312
312
|
}
|
|
313
313
|
if (packageManager === "bun") switch (kind) {
|
|
314
314
|
case "dev": return `bun --watch ${sourceEntrypoint}`;
|
|
315
|
-
case "build": return "tsc --noEmit";
|
|
315
|
+
case "build": return emit ? "tsc" : "tsc --noEmit";
|
|
316
316
|
case "start": return `bun ${sourceEntrypoint}`;
|
|
317
317
|
}
|
|
318
318
|
switch (kind) {
|
|
@@ -417,7 +417,6 @@ function getPrismaCliCommand$1(packageManager, prismaArgs) {
|
|
|
417
417
|
const execution = getPrismaCliArgs(packageManager, prismaArgs);
|
|
418
418
|
return [execution.command, ...execution.args].join(" ");
|
|
419
419
|
}
|
|
420
|
-
|
|
421
420
|
//#endregion
|
|
422
421
|
//#region src/templates/shared.ts
|
|
423
422
|
function getOptionalHashString(hash, key) {
|
|
@@ -453,7 +452,8 @@ Handlebars.registerHelper("runtimeScript", (packageManager, kind, sourceEntrypoi
|
|
|
453
452
|
return getRuntimeScriptCommand(packageManager, kind, {
|
|
454
453
|
sourceEntrypoint,
|
|
455
454
|
builtEntrypoint,
|
|
456
|
-
denoFlags: getOptionalHashStringList(hash, "denoFlags")
|
|
455
|
+
denoFlags: getOptionalHashStringList(hash, "denoFlags"),
|
|
456
|
+
emit: hash.emit === true
|
|
457
457
|
});
|
|
458
458
|
});
|
|
459
459
|
function findPackageRoot(startDir) {
|
|
@@ -510,7 +510,6 @@ async function renderTemplateTree(opts) {
|
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
|
|
514
513
|
//#endregion
|
|
515
514
|
//#region src/templates/render-create-template.ts
|
|
516
515
|
function getCreateTemplateDir(template) {
|
|
@@ -533,7 +532,6 @@ async function scaffoldCreateTemplate(opts) {
|
|
|
533
532
|
context: createTemplateContext(projectName, provider, schemaPreset, packageManager, opts.compute === true)
|
|
534
533
|
});
|
|
535
534
|
}
|
|
536
|
-
|
|
537
535
|
//#endregion
|
|
538
536
|
//#region src/constants/db-packages.ts
|
|
539
537
|
function getDbPackages(provider, _packageManager) {
|
|
@@ -543,13 +541,9 @@ function getDbPackages(provider, _packageManager) {
|
|
|
543
541
|
case "mysql": return "@prisma/adapter-mariadb";
|
|
544
542
|
case "sqlite": return "@prisma/adapter-libsql";
|
|
545
543
|
case "sqlserver": return "@prisma/adapter-mssql";
|
|
546
|
-
default: {
|
|
547
|
-
const exhaustiveCheck = provider;
|
|
548
|
-
throw new Error(`Unsupported database provider: ${String(exhaustiveCheck)}`);
|
|
549
|
-
}
|
|
544
|
+
default: throw new Error(`Unsupported database provider: ${String(provider)}`);
|
|
550
545
|
}
|
|
551
546
|
}
|
|
552
|
-
|
|
553
547
|
//#endregion
|
|
554
548
|
//#region src/tasks/install.ts
|
|
555
549
|
function getPrismaScriptMap(packageManager) {
|
|
@@ -671,7 +665,6 @@ async function installProjectDependencies(packageManager, projectDir = process.c
|
|
|
671
665
|
stdio: verbose ? "inherit" : "pipe"
|
|
672
666
|
});
|
|
673
667
|
}
|
|
674
|
-
|
|
675
668
|
//#endregion
|
|
676
669
|
//#region src/tasks/prisma-postgres.ts
|
|
677
670
|
const PRISMA_POSTGRES_TEMPORARY_NOTICE = "Prisma Postgres is temporary for 24 hours. Claim this database before it expires using CLAIM_URL.";
|
|
@@ -726,7 +719,6 @@ async function provisionPrismaPostgres(packageManager, projectDir = process.cwd(
|
|
|
726
719
|
function getCreateDbCommand(packageManager) {
|
|
727
720
|
return getPackageExecutionCommand(packageManager, [...CREATE_DB_COMMAND_ARGS]);
|
|
728
721
|
}
|
|
729
|
-
|
|
730
722
|
//#endregion
|
|
731
723
|
//#region src/tasks/setup-prisma.ts
|
|
732
724
|
const DEFAULT_DATABASE_PROVIDER = "postgresql";
|
|
@@ -919,10 +911,7 @@ function getDefaultDatabaseUrl(provider) {
|
|
|
919
911
|
case "mysql": return "mysql://johndoe:randompassword@localhost:3306/mydb";
|
|
920
912
|
case "sqlite": return "file:./dev.db";
|
|
921
913
|
case "sqlserver": return "sqlserver://localhost:1433;database=mydb;user=SA;password=randompassword;";
|
|
922
|
-
default: {
|
|
923
|
-
const exhaustiveCheck = provider;
|
|
924
|
-
throw new Error(`Unsupported provider: ${String(exhaustiveCheck)}`);
|
|
925
|
-
}
|
|
914
|
+
default: throw new Error(`Unsupported provider: ${String(provider)}`);
|
|
926
915
|
}
|
|
927
916
|
}
|
|
928
917
|
function escapeRegExp(value) {
|
|
@@ -1233,7 +1222,6 @@ async function migrateAndSeedIfRequested(context, projectDir, options) {
|
|
|
1233
1222
|
didSeed
|
|
1234
1223
|
};
|
|
1235
1224
|
}
|
|
1236
|
-
|
|
1237
1225
|
//#endregion
|
|
1238
1226
|
//#region src/tasks/setup-addons.ts
|
|
1239
1227
|
const DEFAULT_ADDON_SCOPE = "project";
|
|
@@ -1688,10 +1676,7 @@ function getExtensionInstallBinary(target) {
|
|
|
1688
1676
|
case "vscode": return "code";
|
|
1689
1677
|
case "cursor": return "cursor";
|
|
1690
1678
|
case "windsurf": return "windsurf";
|
|
1691
|
-
default: {
|
|
1692
|
-
const exhaustiveCheck = target;
|
|
1693
|
-
throw new Error(`Unsupported extension target: ${String(exhaustiveCheck)}`);
|
|
1694
|
-
}
|
|
1679
|
+
default: throw new Error(`Unsupported extension target: ${String(target)}`);
|
|
1695
1680
|
}
|
|
1696
1681
|
}
|
|
1697
1682
|
async function installExtensionAddon(params) {
|
|
@@ -1768,13 +1753,13 @@ async function executeCreateAddonSetupContext(params) {
|
|
|
1768
1753
|
}
|
|
1769
1754
|
addonSpinner.stop("Add-ons applied.");
|
|
1770
1755
|
}
|
|
1771
|
-
|
|
1772
1756
|
//#endregion
|
|
1773
1757
|
//#region src/tasks/deploy-to-compute.ts
|
|
1774
1758
|
const PRISMA_CLI_PACKAGE = "@prisma/cli@latest";
|
|
1775
1759
|
const DEPLOY_OPTIONS_BY_TEMPLATE = {
|
|
1776
1760
|
hono: {},
|
|
1777
1761
|
elysia: {},
|
|
1762
|
+
nest: {},
|
|
1778
1763
|
next: {},
|
|
1779
1764
|
astro: {},
|
|
1780
1765
|
nuxt: {},
|
|
@@ -1797,8 +1782,7 @@ function getComputeDeployScriptMap(context) {
|
|
|
1797
1782
|
"--prod",
|
|
1798
1783
|
"--yes"
|
|
1799
1784
|
];
|
|
1800
|
-
|
|
1801
|
-
return { "compute:deploy": deployCommand };
|
|
1785
|
+
return { "compute:deploy": [getPrismaCliAppDeployCommand(context.packageManager), ...deployArgs].join(" ") };
|
|
1802
1786
|
}
|
|
1803
1787
|
function getComputeDeployTargetArgs(context) {
|
|
1804
1788
|
return context.configTarget ? [context.configTarget] : [];
|
|
@@ -2041,29 +2025,19 @@ async function executeComputeDeployContext(params) {
|
|
|
2041
2025
|
result: toComputeDeployResult(deployResult.result)
|
|
2042
2026
|
};
|
|
2043
2027
|
}
|
|
2044
|
-
|
|
2045
2028
|
//#endregion
|
|
2046
2029
|
//#region src/telemetry/client.ts
|
|
2047
|
-
const TELEMETRY_API_KEY = "
|
|
2030
|
+
const TELEMETRY_API_KEY = "";
|
|
2048
2031
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
2049
2032
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
2050
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;
|
|
2051
|
-
function isTruthyEnvValue(value) {
|
|
2052
|
-
return [
|
|
2053
|
-
"1",
|
|
2054
|
-
"true",
|
|
2055
|
-
"yes",
|
|
2056
|
-
"on"
|
|
2057
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
2058
|
-
}
|
|
2059
2034
|
function shouldDisableTelemetry() {
|
|
2060
|
-
|
|
2061
|
-
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;
|
|
2062
2036
|
}
|
|
2063
2037
|
function getTelemetryConfigDir() {
|
|
2064
|
-
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
2065
|
-
if (process.platform === "win32") return path.join(process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming"), "create-prisma");
|
|
2066
|
-
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");
|
|
2067
2041
|
}
|
|
2068
2042
|
async function getAnonymousId() {
|
|
2069
2043
|
const telemetryConfigPath = path.join(getTelemetryConfigDir(), TELEMETRY_CONFIG_FILE);
|
|
@@ -2080,7 +2054,7 @@ async function getAnonymousId() {
|
|
|
2080
2054
|
}
|
|
2081
2055
|
function getCommonProperties() {
|
|
2082
2056
|
return {
|
|
2083
|
-
"cli-version": "0.
|
|
2057
|
+
"cli-version": "0.7.0-pr.48.149.1",
|
|
2084
2058
|
"node-version": process.version,
|
|
2085
2059
|
platform: process.platform,
|
|
2086
2060
|
arch: process.arch
|
|
@@ -2115,7 +2089,6 @@ async function trackCliTelemetry(event, properties) {
|
|
|
2115
2089
|
if (client) await client.shutdown().catch(() => {});
|
|
2116
2090
|
}
|
|
2117
2091
|
}
|
|
2118
|
-
|
|
2119
2092
|
//#endregion
|
|
2120
2093
|
//#region src/telemetry/create.ts
|
|
2121
2094
|
function getRequestedAddons(input) {
|
|
@@ -2180,14 +2153,12 @@ async function trackCreateFailed(params) {
|
|
|
2180
2153
|
"error-code": getErrorCode(params.error)
|
|
2181
2154
|
});
|
|
2182
2155
|
}
|
|
2183
|
-
|
|
2184
2156
|
//#endregion
|
|
2185
2157
|
//#region src/ui/branding.ts
|
|
2186
2158
|
const prismaTitle = `${styleText(["bold", "cyan"], "Create")} ${styleText(["bold", "magenta"], "Prisma")}`;
|
|
2187
2159
|
function getCreatePrismaIntro() {
|
|
2188
2160
|
return prismaTitle;
|
|
2189
2161
|
}
|
|
2190
|
-
|
|
2191
2162
|
//#endregion
|
|
2192
2163
|
//#region src/commands/create.ts
|
|
2193
2164
|
const DEFAULT_PROJECT_NAME = "my-app";
|
|
@@ -2523,6 +2494,25 @@ async function executeCreateContext(context) {
|
|
|
2523
2494
|
outro(summaryLines.join("\n"));
|
|
2524
2495
|
return { ok: true };
|
|
2525
2496
|
}
|
|
2526
|
-
|
|
2527
2497
|
//#endregion
|
|
2528
|
-
|
|
2498
|
+
//#region src/index.ts
|
|
2499
|
+
const CLI_VERSION = "0.7.0-pr.48.149.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.
|
|
3
|
+
"version": "0.7.0-pr.48.149.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
|
}
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "{{runtimeScript packageManager "dev" "src/main.ts" "dist/main.js"}}",
|
|
10
|
-
"build": "{{runtimeScript packageManager "build" "src/main.ts" "dist/main.js"}}",
|
|
10
|
+
"build": "{{runtimeScript packageManager "build" "src/main.ts" "dist/main.js" emit=true}}",
|
|
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
|
}
|