create-prisma 0.5.0 → 0.5.1-pr.44.129.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 +10 -6
- package/dist/cli.mjs +1 -1
- package/dist/{create-DH7xp0g_.mjs → create-DDWns3p4.mjs} +98 -56
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/templates/create/astro/README.md.hbs +2 -1
- package/templates/create/astro/prisma.compute.ts.hbs +9 -0
- package/templates/create/elysia/README.md.hbs +2 -2
- package/templates/create/elysia/prisma.compute.ts.hbs +11 -0
- package/templates/create/hono/README.md.hbs +2 -2
- package/templates/create/hono/prisma.compute.ts.hbs +10 -0
- package/templates/create/next/README.md.hbs +2 -1
- package/templates/create/next/prisma.compute.ts.hbs +9 -0
- package/templates/create/nuxt/README.md.hbs +2 -1
- package/templates/create/nuxt/prisma.compute.ts.hbs +9 -0
- package/templates/create/tanstack-start/README.md.hbs +2 -1
- package/templates/create/tanstack-start/prisma.compute.ts.hbs +9 -0
- package/templates/create/turborepo/README.md.hbs +4 -2
- package/templates/create/turborepo/pnpm-workspace.yaml +3 -0
- package/templates/create/turborepo/prisma.compute.ts.hbs +14 -0
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@ Scaffold a new app with Prisma already wired up.
|
|
|
8
8
|
|
|
9
9
|
- creates a new app from a supported template
|
|
10
10
|
- adds Prisma 7 dependencies for your database
|
|
11
|
-
- scaffolds `prisma/schema.prisma`, `prisma/seed.ts`,
|
|
11
|
+
- scaffolds `prisma/schema.prisma`, `prisma/seed.ts`, `prisma.config.ts`, and Compute deploy defaults for Compute-ready templates
|
|
12
12
|
- writes a Prisma client singleton in the right place for the selected template
|
|
13
13
|
- adds `db:generate`, `db:migrate`, and `db:seed` scripts
|
|
14
|
-
- creates or updates
|
|
14
|
+
- creates or updates the template env file with `DATABASE_URL`
|
|
15
15
|
- can install dependencies and run `prisma generate` for you
|
|
16
16
|
- can deploy the finished app to Prisma Compute and return a live URL
|
|
17
17
|
|
|
@@ -83,7 +83,7 @@ Deploy a supported app to Prisma Compute:
|
|
|
83
83
|
create-prisma --name my-api --template hono --provider postgresql --deploy
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
With PostgreSQL, no `--database-url`, and no `--no-prisma-postgres`, the Compute flow creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to
|
|
86
|
+
With PostgreSQL, no `--database-url`, and no `--no-prisma-postgres`, the Compute flow creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, and deploys the app with the env file configured in `prisma.compute.ts`.
|
|
87
87
|
|
|
88
88
|
## Supported Templates
|
|
89
89
|
|
|
@@ -102,7 +102,10 @@ Prisma Compute deployment is currently supported for:
|
|
|
102
102
|
- `hono`
|
|
103
103
|
- `elysia`
|
|
104
104
|
- `next`
|
|
105
|
+
- `astro`
|
|
106
|
+
- `nuxt`
|
|
105
107
|
- `tanstack-start`
|
|
108
|
+
- `turborepo`
|
|
106
109
|
|
|
107
110
|
## Supported Databases
|
|
108
111
|
|
|
@@ -145,10 +148,11 @@ Prisma Compute deployment is currently supported for:
|
|
|
145
148
|
- Prisma IDE extension install
|
|
146
149
|
|
|
147
150
|
These can be selected interactively or enabled with flags.
|
|
151
|
+
When Prisma Compute deploy is selected, the skills add-on recommends the `prisma-compute` skill too.
|
|
148
152
|
|
|
149
153
|
## Deploy to Prisma Compute
|
|
150
154
|
|
|
151
|
-
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`,
|
|
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`.
|
|
152
156
|
|
|
153
157
|
Accept the prompt ("Deploy to Prisma Compute now?") when it appears, or pass the flag:
|
|
154
158
|
|
|
@@ -156,9 +160,9 @@ Accept the prompt ("Deploy to Prisma Compute now?") when it appears, or pass the
|
|
|
156
160
|
create-prisma --name my-api --template hono --provider postgresql --deploy
|
|
157
161
|
```
|
|
158
162
|
|
|
159
|
-
The deploy step signs you in with the Prisma CLI if you are not signed in yet. With PostgreSQL, no `--database-url`, and no `--no-prisma-postgres`, setup creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to
|
|
163
|
+
The deploy step signs you in with the Prisma CLI if you are not signed in yet. With PostgreSQL, no `--database-url`, and no `--no-prisma-postgres`, setup creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, runs the requested Prisma setup, then deploys the app with the env file configured in `prisma.compute.ts`.
|
|
160
164
|
|
|
161
|
-
A `compute:deploy` script is added to the generated project so you can redeploy app changes later. That script
|
|
165
|
+
A `prisma.compute.ts` file is generated with the app framework, runtime port, target, and env-file defaults. When deployment is selected, a `compute:deploy` script is added to the generated project so you can redeploy app changes later. That script runs `@prisma/cli@latest app deploy` using `prisma.compute.ts`; it does not create a new project, create a new database, run migrations, or seed data.
|
|
162
166
|
|
|
163
167
|
The deploy prompt is skipped in `--yes` runs unless you pass `--deploy`. Browser sign-in may still need a person at the keyboard if no Prisma CLI session exists.
|
|
164
168
|
|
package/dist/cli.mjs
CHANGED
|
@@ -33,11 +33,21 @@ const dependencyVersionMap = {
|
|
|
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
|
+
"@prisma/compute-sdk": "^0.23.0",
|
|
36
37
|
"@types/node": "^24.3.0",
|
|
37
38
|
dotenv: "^17.2.3",
|
|
38
39
|
prisma: "^7.8.0",
|
|
39
40
|
tsx: "^4.21.0"
|
|
40
41
|
};
|
|
42
|
+
const computeConfigTemplates = new Set([
|
|
43
|
+
"hono",
|
|
44
|
+
"elysia",
|
|
45
|
+
"next",
|
|
46
|
+
"astro",
|
|
47
|
+
"nuxt",
|
|
48
|
+
"tanstack-start",
|
|
49
|
+
"turborepo"
|
|
50
|
+
]);
|
|
41
51
|
function getWorkspaceDependencyVersion(packageManager) {
|
|
42
52
|
return packageManager === "npm" ? "*" : "workspace:*";
|
|
43
53
|
}
|
|
@@ -58,10 +68,15 @@ function getCreateTemplateDependencies(template, packageManager) {
|
|
|
58
68
|
}
|
|
59
69
|
if (template === "turborepo") targets.push({
|
|
60
70
|
packageJsonPath: "apps/api/package.json",
|
|
61
|
-
dependencies: [],
|
|
71
|
+
dependencies: ["dotenv"],
|
|
62
72
|
devDependencies: ["tsx"],
|
|
63
73
|
customDependencies: { "@repo/db": getWorkspaceDependencyVersion(packageManager) }
|
|
64
74
|
});
|
|
75
|
+
if (computeConfigTemplates.has(template)) targets.push({
|
|
76
|
+
packageJsonPath: "package.json",
|
|
77
|
+
dependencies: [],
|
|
78
|
+
devDependencies: ["@prisma/compute-sdk"]
|
|
79
|
+
});
|
|
65
80
|
return targets;
|
|
66
81
|
}
|
|
67
82
|
|
|
@@ -107,6 +122,7 @@ const extensionTargets = [
|
|
|
107
122
|
const prismaSkillNames = [
|
|
108
123
|
"prisma-cli",
|
|
109
124
|
"prisma-client-api",
|
|
125
|
+
"prisma-compute",
|
|
110
126
|
"prisma-database-setup",
|
|
111
127
|
"prisma-upgrade-v7",
|
|
112
128
|
"prisma-postgres"
|
|
@@ -148,7 +164,10 @@ const COMPUTE_DEPLOYABLE_TEMPLATES = new Set([
|
|
|
148
164
|
"hono",
|
|
149
165
|
"elysia",
|
|
150
166
|
"next",
|
|
151
|
-
"
|
|
167
|
+
"astro",
|
|
168
|
+
"nuxt",
|
|
169
|
+
"tanstack-start",
|
|
170
|
+
"turborepo"
|
|
152
171
|
]);
|
|
153
172
|
function isComputeDeployableTemplate(template) {
|
|
154
173
|
return COMPUTE_DEPLOYABLE_TEMPLATES.has(template);
|
|
@@ -312,19 +331,27 @@ function getInstallArgs(packageManager) {
|
|
|
312
331
|
args: ["install"]
|
|
313
332
|
};
|
|
314
333
|
}
|
|
315
|
-
function getPackageExecutionArgs(packageManager, commandArgs) {
|
|
334
|
+
function getPackageExecutionArgs(packageManager, commandArgs, options = {}) {
|
|
316
335
|
switch (packageManager) {
|
|
317
336
|
case "pnpm": return {
|
|
318
337
|
command: "pnpm",
|
|
319
|
-
args: [
|
|
338
|
+
args: [
|
|
339
|
+
...options.silent ? ["--silent"] : [],
|
|
340
|
+
"dlx",
|
|
341
|
+
...commandArgs
|
|
342
|
+
]
|
|
320
343
|
};
|
|
321
344
|
case "yarn": return {
|
|
322
345
|
command: "yarn",
|
|
323
|
-
args: [
|
|
346
|
+
args: [
|
|
347
|
+
"dlx",
|
|
348
|
+
...options.silent ? ["--quiet"] : [],
|
|
349
|
+
...commandArgs
|
|
350
|
+
]
|
|
324
351
|
};
|
|
325
352
|
case "bun": return {
|
|
326
353
|
command: "bunx",
|
|
327
|
-
args: [...commandArgs]
|
|
354
|
+
args: [...options.silent ? ["--silent"] : [], ...commandArgs]
|
|
328
355
|
};
|
|
329
356
|
case "deno": {
|
|
330
357
|
const [packageName, ...args] = commandArgs;
|
|
@@ -341,12 +368,12 @@ function getPackageExecutionArgs(packageManager, commandArgs) {
|
|
|
341
368
|
}
|
|
342
369
|
default: return {
|
|
343
370
|
command: "npx",
|
|
344
|
-
args: [...commandArgs]
|
|
371
|
+
args: [...options.silent ? ["--yes"] : [], ...commandArgs]
|
|
345
372
|
};
|
|
346
373
|
}
|
|
347
374
|
}
|
|
348
|
-
function getPackageExecutionCommand(packageManager, commandArgs) {
|
|
349
|
-
const execution = getPackageExecutionArgs(packageManager, commandArgs);
|
|
375
|
+
function getPackageExecutionCommand(packageManager, commandArgs, options = {}) {
|
|
376
|
+
const execution = getPackageExecutionArgs(packageManager, commandArgs, options);
|
|
350
377
|
return [execution.command, ...execution.args].join(" ");
|
|
351
378
|
}
|
|
352
379
|
function getPrismaCliArgs(packageManager, prismaArgs) {
|
|
@@ -360,6 +387,30 @@ function getPrismaCliArgs(packageManager, prismaArgs) {
|
|
|
360
387
|
...prismaArgs
|
|
361
388
|
]
|
|
362
389
|
};
|
|
390
|
+
if (packageManager === "bun") return {
|
|
391
|
+
command: "bun",
|
|
392
|
+
args: [
|
|
393
|
+
"--env-file=.env",
|
|
394
|
+
"./node_modules/.bin/prisma",
|
|
395
|
+
...prismaArgs
|
|
396
|
+
]
|
|
397
|
+
};
|
|
398
|
+
if (packageManager === "pnpm") return {
|
|
399
|
+
command: "pnpm",
|
|
400
|
+
args: [
|
|
401
|
+
"exec",
|
|
402
|
+
"prisma",
|
|
403
|
+
...prismaArgs
|
|
404
|
+
]
|
|
405
|
+
};
|
|
406
|
+
if (packageManager === "yarn") return {
|
|
407
|
+
command: "yarn",
|
|
408
|
+
args: [
|
|
409
|
+
"exec",
|
|
410
|
+
"prisma",
|
|
411
|
+
...prismaArgs
|
|
412
|
+
]
|
|
413
|
+
};
|
|
363
414
|
return getPackageExecutionArgs(packageManager, ["prisma", ...prismaArgs]);
|
|
364
415
|
}
|
|
365
416
|
function getPrismaCliCommand$1(packageManager, prismaArgs) {
|
|
@@ -1382,8 +1433,9 @@ const SHARED_PRISMA_SKILLS = [
|
|
|
1382
1433
|
"prisma-upgrade-v7"
|
|
1383
1434
|
];
|
|
1384
1435
|
function getAvailablePrismaSkills(provider) {
|
|
1385
|
-
|
|
1386
|
-
return [...
|
|
1436
|
+
const skills = [...SHARED_PRISMA_SKILLS, "prisma-compute"];
|
|
1437
|
+
if (provider === "postgresql") return [...skills, "prisma-postgres"];
|
|
1438
|
+
return skills;
|
|
1387
1439
|
}
|
|
1388
1440
|
function getSkillOptions(provider) {
|
|
1389
1441
|
const available = getAvailablePrismaSkills(provider);
|
|
@@ -1398,6 +1450,11 @@ function getSkillOptions(provider) {
|
|
|
1398
1450
|
label: "prisma-client-api",
|
|
1399
1451
|
hint: "Prisma Client query patterns"
|
|
1400
1452
|
},
|
|
1453
|
+
"prisma-compute": {
|
|
1454
|
+
value: "prisma-compute",
|
|
1455
|
+
label: "prisma-compute",
|
|
1456
|
+
hint: "Prisma Compute deploy and hosting workflows"
|
|
1457
|
+
},
|
|
1401
1458
|
"prisma-database-setup": {
|
|
1402
1459
|
value: "prisma-database-setup",
|
|
1403
1460
|
label: "prisma-database-setup",
|
|
@@ -1443,9 +1500,10 @@ const EXTENSION_TARGET_OPTIONS = [
|
|
|
1443
1500
|
function uniqueValues(values) {
|
|
1444
1501
|
return Array.from(new Set(values));
|
|
1445
1502
|
}
|
|
1446
|
-
function getRecommendedPrismaSkills(provider, shouldUsePrismaPostgres) {
|
|
1447
|
-
const skills = [...
|
|
1448
|
-
if (
|
|
1503
|
+
function getRecommendedPrismaSkills(provider, shouldUsePrismaPostgres, shouldUseComputeDeploy) {
|
|
1504
|
+
const skills = [...SHARED_PRISMA_SKILLS];
|
|
1505
|
+
if (provider === "postgresql" && shouldUsePrismaPostgres) skills.push("prisma-postgres");
|
|
1506
|
+
if (shouldUseComputeDeploy) skills.push("prisma-compute");
|
|
1449
1507
|
return uniqueValues(skills);
|
|
1450
1508
|
}
|
|
1451
1509
|
async function promptForAddons() {
|
|
@@ -1543,7 +1601,7 @@ async function collectCreateAddonSetupContext(input, options) {
|
|
|
1543
1601
|
if (addons.length === 0) return null;
|
|
1544
1602
|
const scope = addons.includes("skills") || addons.includes("mcp") ? options.useDefaults ? DEFAULT_ADDON_SCOPE : await promptForAddonScope() : DEFAULT_ADDON_SCOPE;
|
|
1545
1603
|
if (!scope) return;
|
|
1546
|
-
const recommendedSkills = getRecommendedPrismaSkills(options.provider, options.shouldUsePrismaPostgres);
|
|
1604
|
+
const recommendedSkills = getRecommendedPrismaSkills(options.provider, options.shouldUsePrismaPostgres, options.shouldUseComputeDeploy);
|
|
1547
1605
|
const skills = !addons.includes("skills") ? [] : options.useDefaults ? recommendedSkills : await promptForPrismaSkills(options.provider, recommendedSkills);
|
|
1548
1606
|
if (!skills) return;
|
|
1549
1607
|
const skillsAgents = !addons.includes("skills") ? [] : options.useDefaults ? [...DEFAULT_SKILLS_AGENTS] : await promptForSkillsAgents();
|
|
@@ -1715,17 +1773,13 @@ async function executeCreateAddonSetupContext(params) {
|
|
|
1715
1773
|
//#region src/tasks/deploy-to-compute.ts
|
|
1716
1774
|
const PRISMA_CLI_PACKAGE = "@prisma/cli@latest";
|
|
1717
1775
|
const DEPLOY_OPTIONS_BY_TEMPLATE = {
|
|
1718
|
-
hono: {
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
},
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
requiresExplicitFramework: true
|
|
1726
|
-
},
|
|
1727
|
-
next: { framework: "nextjs" },
|
|
1728
|
-
"tanstack-start": { framework: "tanstack-start" }
|
|
1776
|
+
hono: {},
|
|
1777
|
+
elysia: {},
|
|
1778
|
+
next: {},
|
|
1779
|
+
astro: {},
|
|
1780
|
+
nuxt: {},
|
|
1781
|
+
"tanstack-start": {},
|
|
1782
|
+
turborepo: { configTarget: "api" }
|
|
1729
1783
|
};
|
|
1730
1784
|
function getPrismaCliCommand(packageManager) {
|
|
1731
1785
|
return getPackageExecutionCommand(getPrismaCliExecutionPackageManager(packageManager), [PRISMA_CLI_PACKAGE]);
|
|
@@ -1735,25 +1789,24 @@ function getPrismaCliAppDeployCommand(packageManager) {
|
|
|
1735
1789
|
PRISMA_CLI_PACKAGE,
|
|
1736
1790
|
"app",
|
|
1737
1791
|
"deploy"
|
|
1738
|
-
]);
|
|
1792
|
+
], { silent: true });
|
|
1739
1793
|
}
|
|
1740
1794
|
function getComputeDeployScriptMap(context) {
|
|
1741
1795
|
const deployArgs = [
|
|
1796
|
+
...getComputeDeployTargetArgs(context),
|
|
1742
1797
|
"--prod",
|
|
1743
|
-
"--yes"
|
|
1744
|
-
"--env",
|
|
1745
|
-
".env",
|
|
1746
|
-
...getComputeDeployRuntimeArgs(context)
|
|
1798
|
+
"--yes"
|
|
1747
1799
|
];
|
|
1748
1800
|
const deployCommand = [getPrismaCliAppDeployCommand(context.packageManager), ...deployArgs].join(" ");
|
|
1749
1801
|
return { "compute:deploy": deployCommand };
|
|
1750
1802
|
}
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1803
|
+
function getComputeDeployTargetArgs(context) {
|
|
1804
|
+
return context.configTarget ? [context.configTarget] : [];
|
|
1753
1805
|
}
|
|
1754
1806
|
function runPrismaCli(packageManager, args, options = {}) {
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1807
|
+
const { silentPackageRunner, ...execaOptions } = options;
|
|
1808
|
+
const execution = getPackageExecutionArgs(getPrismaCliExecutionPackageManager(packageManager), [PRISMA_CLI_PACKAGE, ...args], { silent: silentPackageRunner });
|
|
1809
|
+
return execa(execution.command, execution.args, execaOptions);
|
|
1757
1810
|
}
|
|
1758
1811
|
function getPrismaCliExecutionPackageManager(packageManager) {
|
|
1759
1812
|
return packageManager === "deno" ? "npm" : packageManager;
|
|
@@ -1825,9 +1878,7 @@ async function collectComputeDeployContext(input, options) {
|
|
|
1825
1878
|
template: options.template,
|
|
1826
1879
|
packageManager: options.packageManager,
|
|
1827
1880
|
createProjectName: options.defaultServiceName,
|
|
1828
|
-
|
|
1829
|
-
httpPort: deployOptions.httpPort,
|
|
1830
|
-
requiresExplicitFramework: deployOptions.requiresExplicitFramework
|
|
1881
|
+
configTarget: deployOptions.configTarget
|
|
1831
1882
|
};
|
|
1832
1883
|
}
|
|
1833
1884
|
function redactSecrets(message) {
|
|
@@ -1863,7 +1914,8 @@ async function runPrismaCliJson(params) {
|
|
|
1863
1914
|
"ignore",
|
|
1864
1915
|
"pipe",
|
|
1865
1916
|
"pipe"
|
|
1866
|
-
]
|
|
1917
|
+
],
|
|
1918
|
+
silentPackageRunner: true
|
|
1867
1919
|
});
|
|
1868
1920
|
const parsed = parseJson(stdout);
|
|
1869
1921
|
if (!parsed) return {
|
|
@@ -1962,13 +2014,11 @@ async function executeComputeDeployContext(params) {
|
|
|
1962
2014
|
const args = [
|
|
1963
2015
|
"app",
|
|
1964
2016
|
"deploy",
|
|
2017
|
+
...getComputeDeployTargetArgs(params.context),
|
|
1965
2018
|
"--json",
|
|
1966
2019
|
"--yes",
|
|
1967
2020
|
"--prod",
|
|
1968
|
-
"--
|
|
1969
|
-
".env",
|
|
1970
|
-
...params.createProject === false ? [] : ["--create-project", params.context.createProjectName],
|
|
1971
|
-
...getComputeDeployRuntimeArgs(params.context)
|
|
2021
|
+
...params.createProject === false ? [] : ["--create-project", params.context.createProjectName]
|
|
1972
2022
|
];
|
|
1973
2023
|
const deployResult = await runPrismaCliJson({
|
|
1974
2024
|
packageManager: params.context.packageManager,
|
|
@@ -1994,21 +2044,12 @@ async function executeComputeDeployContext(params) {
|
|
|
1994
2044
|
|
|
1995
2045
|
//#endregion
|
|
1996
2046
|
//#region src/telemetry/client.ts
|
|
1997
|
-
const TELEMETRY_API_KEY = "
|
|
2047
|
+
const TELEMETRY_API_KEY = "";
|
|
1998
2048
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
1999
2049
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
2000
2050
|
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;
|
|
2001
|
-
function isTruthyEnvValue(value) {
|
|
2002
|
-
return [
|
|
2003
|
-
"1",
|
|
2004
|
-
"true",
|
|
2005
|
-
"yes",
|
|
2006
|
-
"on"
|
|
2007
|
-
].includes(String(value ?? "").trim().toLowerCase());
|
|
2008
|
-
}
|
|
2009
2051
|
function shouldDisableTelemetry() {
|
|
2010
|
-
|
|
2011
|
-
return process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
|
|
2052
|
+
return true;
|
|
2012
2053
|
}
|
|
2013
2054
|
function getTelemetryConfigDir() {
|
|
2014
2055
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -2030,7 +2071,7 @@ async function getAnonymousId() {
|
|
|
2030
2071
|
}
|
|
2031
2072
|
function getCommonProperties() {
|
|
2032
2073
|
return {
|
|
2033
|
-
"cli-version": "0.5.
|
|
2074
|
+
"cli-version": "0.5.1-pr.44.129.1",
|
|
2034
2075
|
"node-version": process.version,
|
|
2035
2076
|
platform: process.platform,
|
|
2036
2077
|
arch: process.arch
|
|
@@ -2325,7 +2366,8 @@ async function collectCreateContext(input) {
|
|
|
2325
2366
|
const addonSetupContext = await collectCreateAddonSetupContext(input, {
|
|
2326
2367
|
useDefaults,
|
|
2327
2368
|
provider: prismaSetupContext.databaseProvider,
|
|
2328
|
-
shouldUsePrismaPostgres: prismaSetupContext.shouldUsePrismaPostgres
|
|
2369
|
+
shouldUsePrismaPostgres: prismaSetupContext.shouldUsePrismaPostgres,
|
|
2370
|
+
shouldUseComputeDeploy: Boolean(computeDeployContext)
|
|
2329
2371
|
});
|
|
2330
2372
|
if (addonSetupContext === void 0) return;
|
|
2331
2373
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-DDWns3p4.mjs";
|
|
3
3
|
import { os } from "@orpc/server";
|
|
4
4
|
import { createCli } from "trpc-cli";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
|
-
const CLI_VERSION = "0.5.
|
|
7
|
+
const CLI_VERSION = "0.5.1-pr.44.129.1";
|
|
8
8
|
const router = os.router({ create: os.meta({
|
|
9
9
|
description: "Create a new project with Prisma setup",
|
|
10
10
|
default: true,
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ Prisma setup is scaffolded automatically in:
|
|
|
21
21
|
- `src/lib/prisma.ts`
|
|
22
22
|
- `src/pages/api/users.ts`
|
|
23
23
|
- `prisma.config.ts`
|
|
24
|
+
- `prisma.compute.ts`
|
|
24
25
|
- `src/generated/prisma`
|
|
25
26
|
|
|
26
27
|
Database helper scripts are added to `package.json`:
|
|
@@ -40,7 +41,7 @@ The starter page keeps the official Astro minimal structure and points you to `p
|
|
|
40
41
|
|
|
41
42
|
## Prisma Compute
|
|
42
43
|
|
|
43
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
44
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
44
45
|
|
|
45
46
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
46
47
|
{{/if}}
|
|
@@ -28,7 +28,7 @@ Generated by `create-prisma` with the Elysia template.
|
|
|
28
28
|
|
|
29
29
|
5. Use the Prisma client from `src/lib/prisma.ts`.
|
|
30
30
|
|
|
31
|
-
Generated Prisma files are written to `src/generated/prisma`.
|
|
31
|
+
Generated Prisma files are written to `src/generated/prisma`. Prisma Compute deploy defaults are written to `prisma.compute.ts`.
|
|
32
32
|
{{#if (eq schemaPreset "basic")}}
|
|
33
33
|
|
|
34
34
|
The template includes a basic `User` model, a sample `GET /users` endpoint, and seed data in `prisma/seed.ts`.
|
|
@@ -37,7 +37,7 @@ The template includes a basic `User` model, a sample `GET /users` endpoint, and
|
|
|
37
37
|
|
|
38
38
|
## Prisma Compute
|
|
39
39
|
|
|
40
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
40
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
41
41
|
|
|
42
42
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
43
|
{{/if}}
|
|
@@ -28,7 +28,7 @@ Generated by `create-prisma` with the Hono template.
|
|
|
28
28
|
|
|
29
29
|
5. Use the Prisma client from `src/lib/prisma.ts`.
|
|
30
30
|
|
|
31
|
-
Generated Prisma files are written to `src/generated/prisma`.
|
|
31
|
+
Generated Prisma files are written to `src/generated/prisma`. Prisma Compute deploy defaults are written to `prisma.compute.ts`.
|
|
32
32
|
{{#if (eq schemaPreset "basic")}}
|
|
33
33
|
|
|
34
34
|
The template includes a basic `User` model, a sample `GET /users` endpoint, and seed data in `prisma/seed.ts`.
|
|
@@ -37,7 +37,7 @@ The template includes a basic `User` model, a sample `GET /users` endpoint, and
|
|
|
37
37
|
|
|
38
38
|
## Prisma Compute
|
|
39
39
|
|
|
40
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
40
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
41
41
|
|
|
42
42
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
43
|
{{/if}}
|
|
@@ -19,6 +19,7 @@ Prisma setup is scaffolded automatically in:
|
|
|
19
19
|
- `prisma/seed.ts`
|
|
20
20
|
- `src/lib/prisma.ts`
|
|
21
21
|
- `prisma.config.ts`
|
|
22
|
+
- `prisma.compute.ts`
|
|
22
23
|
- `src/generated/prisma`
|
|
23
24
|
|
|
24
25
|
Database helper scripts are added to `package.json`:
|
|
@@ -35,7 +36,7 @@ The starter page in `src/app/page.tsx` reads from a basic `User` model so you ca
|
|
|
35
36
|
|
|
36
37
|
## Prisma Compute
|
|
37
38
|
|
|
38
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
39
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
39
40
|
|
|
40
41
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
41
42
|
{{/if}}
|
|
@@ -21,6 +21,7 @@ Prisma setup is scaffolded automatically in:
|
|
|
21
21
|
- `server/utils/prisma.ts`
|
|
22
22
|
- `server/api/users.get.ts`
|
|
23
23
|
- `prisma.config.ts`
|
|
24
|
+
- `prisma.compute.ts`
|
|
24
25
|
- `server/generated/prisma`
|
|
25
26
|
|
|
26
27
|
Database helper scripts are added to `package.json`:
|
|
@@ -37,7 +38,7 @@ The starter page in `app/pages/index.vue` fetches seeded users from `server/api/
|
|
|
37
38
|
|
|
38
39
|
## Prisma Compute
|
|
39
40
|
|
|
40
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
41
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
41
42
|
|
|
42
43
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
44
|
{{/if}}
|
|
@@ -20,6 +20,7 @@ Prisma setup is scaffolded automatically in:
|
|
|
20
20
|
- `prisma/seed.ts`
|
|
21
21
|
- `src/lib/prisma.server.ts`
|
|
22
22
|
- `prisma.config.ts`
|
|
23
|
+
- `prisma.compute.ts`
|
|
23
24
|
- `src/generated/prisma`
|
|
24
25
|
|
|
25
26
|
Database helper scripts are added to `package.json`:
|
|
@@ -36,7 +37,7 @@ The home route uses a TanStack Start server function to load users with the Pris
|
|
|
36
37
|
|
|
37
38
|
## Prisma Compute
|
|
38
39
|
|
|
39
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
40
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
40
41
|
|
|
41
42
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
42
43
|
{{/if}}
|
|
@@ -6,6 +6,7 @@ Generated by `create-prisma` with the Turborepo template.
|
|
|
6
6
|
|
|
7
7
|
- `apps/api` - Hono API app
|
|
8
8
|
- `packages/db` - shared Prisma package
|
|
9
|
+
- `pnpm-workspace.yaml` - pnpm workspace package globs
|
|
9
10
|
|
|
10
11
|
## Scripts
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ Generated by `create-prisma` with the Turborepo template.
|
|
|
16
17
|
- `{{runScriptCommand packageManager "db:migrate"}}` - create/apply migrations in `packages/db`
|
|
17
18
|
- `{{runScriptCommand packageManager "db:seed"}}` - run seed script in `packages/db`
|
|
18
19
|
{{#if compute}}
|
|
19
|
-
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from
|
|
20
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `packages/db/.env`
|
|
20
21
|
{{/if}}
|
|
21
22
|
|
|
22
23
|
## Prisma
|
|
@@ -27,6 +28,7 @@ Prisma is scaffolded inside `packages/db`:
|
|
|
27
28
|
- `packages/db/prisma/seed.ts`
|
|
28
29
|
- `packages/db/src/client.ts`
|
|
29
30
|
- `packages/db/prisma.config.ts`
|
|
31
|
+
- `prisma.compute.ts`
|
|
30
32
|
- `packages/db/src/generated/prisma`
|
|
31
33
|
|
|
32
34
|
`apps/api/src/index.ts` imports the shared Prisma client from `@repo/db`.
|
|
@@ -34,7 +36,7 @@ Prisma is scaffolded inside `packages/db`:
|
|
|
34
36
|
|
|
35
37
|
## Prisma Compute
|
|
36
38
|
|
|
37
|
-
This project includes a Prisma Compute deploy script. Deploys load environment variables from
|
|
39
|
+
This project includes a Prisma Compute deploy script and deploy defaults in `prisma.compute.ts`. Deploys load environment variables from `packages/db/.env`; if setup created a Prisma Postgres database, its `DATABASE_URL` is already written there.
|
|
38
40
|
|
|
39
41
|
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
40
42
|
{{/if}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComputeConfig } from "@prisma/compute-sdk/config";
|
|
2
|
+
|
|
3
|
+
export default defineComputeConfig({
|
|
4
|
+
apps: {
|
|
5
|
+
api: {
|
|
6
|
+
name: "{{projectName}}",
|
|
7
|
+
root: "apps/api",
|
|
8
|
+
framework: "hono",
|
|
9
|
+
entry: "src/index.ts",
|
|
10
|
+
httpPort: 3000,
|
|
11
|
+
env: "packages/db/.env",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|