create-prisma 0.4.2-pr.34.117.1 → 0.4.2-pr.34.119.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 +33 -0
- package/dist/cli.mjs +1 -1
- package/dist/{create-yihruvVK.mjs → create-Cdb0Ur3z.mjs} +155 -81
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/templates/create/astro/README.md.hbs +11 -0
- package/templates/create/elysia/README.md.hbs +11 -0
- package/templates/create/hono/README.md.hbs +11 -0
- package/templates/create/nest/README.md.hbs +11 -0
- package/templates/create/next/README.md.hbs +11 -0
- package/templates/create/nuxt/README.md.hbs +11 -0
- package/templates/create/svelte/README.md.hbs +11 -0
- package/templates/create/tanstack-start/README.md.hbs +11 -0
- package/templates/create/turborepo/README.md.hbs +11 -0
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Scaffold a new app with Prisma already wired up.
|
|
|
13
13
|
- adds `db:generate`, `db:migrate`, and `db:seed` scripts
|
|
14
14
|
- creates or updates `.env` with `DATABASE_URL`
|
|
15
15
|
- can install dependencies and run `prisma generate` for you
|
|
16
|
+
- can deploy the finished app to Prisma Compute and return a live URL
|
|
16
17
|
|
|
17
18
|
## Quick Start
|
|
18
19
|
|
|
@@ -76,6 +77,14 @@ Use Prisma Postgres auto-provisioning:
|
|
|
76
77
|
create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
|
|
77
78
|
```
|
|
78
79
|
|
|
80
|
+
Deploy a supported app to Prisma Compute:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
create-prisma --name my-api --template hono --provider postgresql --deploy
|
|
84
|
+
```
|
|
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 `.env`, and deploys the app with environment variables loaded from `.env`.
|
|
87
|
+
|
|
79
88
|
## Supported Templates
|
|
80
89
|
|
|
81
90
|
- `hono`
|
|
@@ -88,6 +97,13 @@ create-prisma --name my-app --template nest --provider postgresql --prisma-postg
|
|
|
88
97
|
- `tanstack-start`
|
|
89
98
|
- `turborepo`
|
|
90
99
|
|
|
100
|
+
Prisma Compute deployment is currently supported for:
|
|
101
|
+
|
|
102
|
+
- `hono`
|
|
103
|
+
- `elysia`
|
|
104
|
+
- `next`
|
|
105
|
+
- `tanstack-start`
|
|
106
|
+
|
|
91
107
|
## Supported Databases
|
|
92
108
|
|
|
93
109
|
- `postgresql`
|
|
@@ -111,6 +127,7 @@ create-prisma --name my-app --template nest --provider postgresql --prisma-postg
|
|
|
111
127
|
- `--provider` choose the database provider
|
|
112
128
|
- `--package-manager` choose the package manager/runtime
|
|
113
129
|
- `--schema-preset empty|basic`
|
|
130
|
+
- `--deploy` deploy supported templates to Prisma Compute
|
|
114
131
|
- `--yes` accept defaults and skip prompts
|
|
115
132
|
- `--no-install` scaffold only
|
|
116
133
|
- `--no-generate` skip `prisma generate`
|
|
@@ -129,6 +146,22 @@ create-prisma --name my-app --template nest --provider postgresql --prisma-postg
|
|
|
129
146
|
|
|
130
147
|
These can be selected interactively or enabled with flags.
|
|
131
148
|
|
|
149
|
+
## Deploy to Prisma Compute
|
|
150
|
+
|
|
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`, and `tanstack-start`.
|
|
152
|
+
|
|
153
|
+
Accept the prompt ("Deploy to Prisma Compute now?") when it appears, or pass the flag:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
create-prisma --name my-api --template hono --provider postgresql --deploy
|
|
157
|
+
```
|
|
158
|
+
|
|
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 `.env`, runs the requested Prisma setup, then deploys the app with environment variables loaded from `.env`.
|
|
160
|
+
|
|
161
|
+
A `compute:deploy` script is added to the generated project so you can redeploy app changes later. That script only runs `@prisma/cli@latest app deploy` with `.env`; it does not create a new project, create a new database, run migrations, or seed data.
|
|
162
|
+
|
|
163
|
+
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
|
+
|
|
132
165
|
## Local Development
|
|
133
166
|
|
|
134
167
|
```bash
|
package/dist/cli.mjs
CHANGED
|
@@ -1738,7 +1738,13 @@ function getPrismaCliAppDeployCommand(packageManager) {
|
|
|
1738
1738
|
]);
|
|
1739
1739
|
}
|
|
1740
1740
|
function getComputeDeployScriptMap(context) {
|
|
1741
|
-
const deployArgs = [
|
|
1741
|
+
const deployArgs = [
|
|
1742
|
+
"--prod",
|
|
1743
|
+
"--yes",
|
|
1744
|
+
"--env",
|
|
1745
|
+
".env",
|
|
1746
|
+
...getComputeDeployRuntimeArgs(context)
|
|
1747
|
+
];
|
|
1742
1748
|
const deployCommand = [getPrismaCliAppDeployCommand(context.packageManager), ...deployArgs].join(" ");
|
|
1743
1749
|
return { "compute:deploy": deployCommand };
|
|
1744
1750
|
}
|
|
@@ -1827,7 +1833,7 @@ async function collectComputeDeployContext(input, options) {
|
|
|
1827
1833
|
function redactSecrets(message) {
|
|
1828
1834
|
return message.replace(/(['"])([A-Z0-9_]*(?:DATABASE_URL|DIRECT_URL|TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY|ACCESS_KEY)[A-Z0-9_]*=)(.*?)\1/g, "$1$2<redacted>$1").replace(/\b([A-Z0-9_]*(?:DATABASE_URL|DIRECT_URL|TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY|ACCESS_KEY)[A-Z0-9_]*=)[^\s]+/g, "$1<redacted>");
|
|
1829
1835
|
}
|
|
1830
|
-
function
|
|
1836
|
+
function parseJson(stdout) {
|
|
1831
1837
|
if (typeof stdout !== "string" || stdout.trim().length === 0) return null;
|
|
1832
1838
|
try {
|
|
1833
1839
|
return JSON.parse(stdout);
|
|
@@ -1848,16 +1854,106 @@ function createExplicitDeployError(reason, error) {
|
|
|
1848
1854
|
const detail = error instanceof Error ? `: ${redactSecrets(error.message)}` : "";
|
|
1849
1855
|
return /* @__PURE__ */ new Error(`Deploy requested but ${reason}${detail}`);
|
|
1850
1856
|
}
|
|
1857
|
+
async function runPrismaCliJson(params) {
|
|
1858
|
+
try {
|
|
1859
|
+
const { stdout, exitCode } = await runPrismaCli(params.packageManager, params.args, {
|
|
1860
|
+
cwd: params.cwd,
|
|
1861
|
+
reject: false,
|
|
1862
|
+
stdio: [
|
|
1863
|
+
"ignore",
|
|
1864
|
+
"pipe",
|
|
1865
|
+
"pipe"
|
|
1866
|
+
]
|
|
1867
|
+
});
|
|
1868
|
+
const parsed = parseJson(stdout);
|
|
1869
|
+
if (!parsed) return {
|
|
1870
|
+
ok: false,
|
|
1871
|
+
error: new Error(params.invalidOutputError)
|
|
1872
|
+
};
|
|
1873
|
+
if (exitCode !== 0 || !parsed.ok) return {
|
|
1874
|
+
ok: false,
|
|
1875
|
+
error: createDeployError(parsed.ok ? params.fallbackError : getJsonErrorMessage(parsed.error, params.fallbackError))
|
|
1876
|
+
};
|
|
1877
|
+
return {
|
|
1878
|
+
ok: true,
|
|
1879
|
+
result: parsed.result
|
|
1880
|
+
};
|
|
1881
|
+
} catch (error) {
|
|
1882
|
+
return {
|
|
1883
|
+
ok: false,
|
|
1884
|
+
error: new Error(getErrorMessage(error))
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1851
1888
|
function toComputeDeployResult(data) {
|
|
1852
1889
|
return {
|
|
1853
|
-
appUrl: data.
|
|
1854
|
-
appId: data.
|
|
1855
|
-
appName: data.
|
|
1856
|
-
deploymentId: data.
|
|
1857
|
-
projectId: data.
|
|
1858
|
-
projectName: data.
|
|
1859
|
-
branchName: data.
|
|
1860
|
-
database: data.
|
|
1890
|
+
appUrl: data.deployment.url,
|
|
1891
|
+
appId: data.app.id,
|
|
1892
|
+
appName: data.app.name,
|
|
1893
|
+
deploymentId: data.deployment.id,
|
|
1894
|
+
projectId: data.project.id,
|
|
1895
|
+
projectName: data.project.name,
|
|
1896
|
+
branchName: data.branch.name,
|
|
1897
|
+
database: data.branchDatabase?.database
|
|
1898
|
+
};
|
|
1899
|
+
}
|
|
1900
|
+
async function executeComputeDatabaseSetup(params) {
|
|
1901
|
+
const projectSpinner = spinner();
|
|
1902
|
+
projectSpinner.start("Creating Prisma Compute project...");
|
|
1903
|
+
const projectResult = await runPrismaCliJson({
|
|
1904
|
+
packageManager: params.context.packageManager,
|
|
1905
|
+
args: [
|
|
1906
|
+
"project",
|
|
1907
|
+
"create",
|
|
1908
|
+
params.context.createProjectName,
|
|
1909
|
+
"--json"
|
|
1910
|
+
],
|
|
1911
|
+
cwd: params.projectDir,
|
|
1912
|
+
fallbackError: "Prisma project create failed.",
|
|
1913
|
+
invalidOutputError: "Invalid prisma project create output"
|
|
1914
|
+
});
|
|
1915
|
+
if (!projectResult.ok) {
|
|
1916
|
+
projectSpinner.error(`Project creation failed: ${projectResult.error.message}`);
|
|
1917
|
+
return {
|
|
1918
|
+
ok: false,
|
|
1919
|
+
cancelled: false,
|
|
1920
|
+
error: projectResult.error
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
projectSpinner.stop("Prisma Compute project created.");
|
|
1924
|
+
const databaseSpinner = spinner();
|
|
1925
|
+
databaseSpinner.start("Creating Prisma Postgres database...");
|
|
1926
|
+
const databaseResult = await runPrismaCliJson({
|
|
1927
|
+
packageManager: params.context.packageManager,
|
|
1928
|
+
args: [
|
|
1929
|
+
"database",
|
|
1930
|
+
"create",
|
|
1931
|
+
"main",
|
|
1932
|
+
"--branch",
|
|
1933
|
+
"main",
|
|
1934
|
+
"--json"
|
|
1935
|
+
],
|
|
1936
|
+
cwd: params.projectDir,
|
|
1937
|
+
fallbackError: "Prisma database create failed.",
|
|
1938
|
+
invalidOutputError: "Invalid prisma database create output"
|
|
1939
|
+
});
|
|
1940
|
+
if (!databaseResult.ok) {
|
|
1941
|
+
databaseSpinner.error(`Database creation failed: ${databaseResult.error.message}`);
|
|
1942
|
+
return {
|
|
1943
|
+
ok: false,
|
|
1944
|
+
cancelled: false,
|
|
1945
|
+
error: databaseResult.error
|
|
1946
|
+
};
|
|
1947
|
+
}
|
|
1948
|
+
databaseSpinner.stop("Prisma Postgres database created.");
|
|
1949
|
+
return {
|
|
1950
|
+
ok: true,
|
|
1951
|
+
result: {
|
|
1952
|
+
databaseUrl: databaseResult.result.connectionString,
|
|
1953
|
+
projectId: databaseResult.result.projectId,
|
|
1954
|
+
projectName: databaseResult.result.projectName,
|
|
1955
|
+
database: databaseResult.result.database
|
|
1956
|
+
}
|
|
1861
1957
|
};
|
|
1862
1958
|
}
|
|
1863
1959
|
async function executeComputeDeployContext(params) {
|
|
@@ -1868,71 +1964,32 @@ async function executeComputeDeployContext(params) {
|
|
|
1868
1964
|
"deploy",
|
|
1869
1965
|
"--json",
|
|
1870
1966
|
"--yes",
|
|
1871
|
-
"--
|
|
1872
|
-
|
|
1967
|
+
"--prod",
|
|
1968
|
+
"--env",
|
|
1969
|
+
".env",
|
|
1970
|
+
...params.createProject === false ? [] : ["--create-project", params.context.createProjectName],
|
|
1873
1971
|
...getComputeDeployRuntimeArgs(params.context)
|
|
1874
1972
|
];
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
"pipe"
|
|
1885
|
-
]
|
|
1886
|
-
});
|
|
1887
|
-
const parsed = parseDeployJson(stdout);
|
|
1888
|
-
if (!parsed) {
|
|
1889
|
-
deploySpinner.error("Deploy failed: could not parse prisma app deploy output.");
|
|
1890
|
-
return {
|
|
1891
|
-
ok: false,
|
|
1892
|
-
cancelled: false,
|
|
1893
|
-
error: /* @__PURE__ */ new Error("Invalid prisma app deploy output")
|
|
1894
|
-
};
|
|
1895
|
-
}
|
|
1896
|
-
if (exitCode !== 0 || !parsed.ok) {
|
|
1897
|
-
const error = createDeployError(parsed.ok ? "Prisma app deploy failed." : getJsonErrorMessage(parsed.error, "Prisma app deploy failed."));
|
|
1898
|
-
deploySpinner.error(`Deploy failed: ${error.message}`);
|
|
1899
|
-
return {
|
|
1900
|
-
ok: false,
|
|
1901
|
-
cancelled: false,
|
|
1902
|
-
error
|
|
1903
|
-
};
|
|
1904
|
-
}
|
|
1905
|
-
deploySpinner.stop("Deployed to Prisma Compute.");
|
|
1906
|
-
return {
|
|
1907
|
-
ok: true,
|
|
1908
|
-
result: toComputeDeployResult(parsed)
|
|
1909
|
-
};
|
|
1910
|
-
} catch (error) {
|
|
1911
|
-
const parsed = parseDeployJson(error?.stdout);
|
|
1912
|
-
if (parsed?.ok) {
|
|
1913
|
-
deploySpinner.stop("Deployed to Prisma Compute.");
|
|
1914
|
-
return {
|
|
1915
|
-
ok: true,
|
|
1916
|
-
result: toComputeDeployResult(parsed)
|
|
1917
|
-
};
|
|
1918
|
-
}
|
|
1919
|
-
if (parsed && !parsed.ok) {
|
|
1920
|
-
const deployError = createDeployError(getJsonErrorMessage(parsed.error, "Prisma app deploy failed."));
|
|
1921
|
-
deploySpinner.error(`Deploy failed: ${deployError.message}`);
|
|
1922
|
-
return {
|
|
1923
|
-
ok: false,
|
|
1924
|
-
cancelled: false,
|
|
1925
|
-
error: deployError
|
|
1926
|
-
};
|
|
1927
|
-
}
|
|
1928
|
-
const message = getErrorMessage(error);
|
|
1929
|
-
deploySpinner.error(`Deploy failed${message ? `: ${message}` : "."}`);
|
|
1973
|
+
const deployResult = await runPrismaCliJson({
|
|
1974
|
+
packageManager: params.context.packageManager,
|
|
1975
|
+
args,
|
|
1976
|
+
cwd: params.projectDir,
|
|
1977
|
+
fallbackError: "Prisma app deploy failed.",
|
|
1978
|
+
invalidOutputError: "Invalid prisma app deploy output"
|
|
1979
|
+
});
|
|
1980
|
+
if (!deployResult.ok) {
|
|
1981
|
+
deploySpinner.error(`Deploy failed: ${deployResult.error.message}`);
|
|
1930
1982
|
return {
|
|
1931
1983
|
ok: false,
|
|
1932
1984
|
cancelled: false,
|
|
1933
|
-
error:
|
|
1985
|
+
error: deployResult.error
|
|
1934
1986
|
};
|
|
1935
1987
|
}
|
|
1988
|
+
deploySpinner.stop("Deployed to Prisma Compute.");
|
|
1989
|
+
return {
|
|
1990
|
+
ok: true,
|
|
1991
|
+
result: toComputeDeployResult(deployResult.result)
|
|
1992
|
+
};
|
|
1936
1993
|
}
|
|
1937
1994
|
|
|
1938
1995
|
//#endregion
|
|
@@ -1964,7 +2021,7 @@ async function getAnonymousId() {
|
|
|
1964
2021
|
}
|
|
1965
2022
|
function getCommonProperties() {
|
|
1966
2023
|
return {
|
|
1967
|
-
"cli-version": "0.4.2-pr.34.
|
|
2024
|
+
"cli-version": "0.4.2-pr.34.119.1",
|
|
1968
2025
|
"node-version": process.version,
|
|
1969
2026
|
platform: process.platform,
|
|
1970
2027
|
arch: process.arch
|
|
@@ -2254,10 +2311,7 @@ async function collectCreateContext(input) {
|
|
|
2254
2311
|
});
|
|
2255
2312
|
if (computeDeployContext === void 0) return;
|
|
2256
2313
|
const useComputeDatabase = Boolean(computeDeployContext && prismaSetupInitialContext.databaseProvider === "postgresql" && !prismaSetupInitialContext.databaseUrl && input.prismaPostgres !== false);
|
|
2257
|
-
const prismaSetupContext = await completePrismaSetupContext(input, prismaSetupInitialContext, {
|
|
2258
|
-
useComputePostgres: useComputeDatabase,
|
|
2259
|
-
skipMigrateAndSeedPrompt: useComputeDatabase
|
|
2260
|
-
});
|
|
2314
|
+
const prismaSetupContext = await completePrismaSetupContext(input, prismaSetupInitialContext, { useComputePostgres: useComputeDatabase });
|
|
2261
2315
|
if (!prismaSetupContext) return;
|
|
2262
2316
|
const addonSetupContext = await collectCreateAddonSetupContext(input, {
|
|
2263
2317
|
useDefaults,
|
|
@@ -2333,18 +2387,36 @@ async function executeCreateContext(context) {
|
|
|
2333
2387
|
error
|
|
2334
2388
|
};
|
|
2335
2389
|
}
|
|
2336
|
-
|
|
2390
|
+
let computeDatabaseResult;
|
|
2391
|
+
if (context.useComputeDatabase && context.computeDeployContext) try {
|
|
2392
|
+
const result = await executeComputeDatabaseSetup({
|
|
2393
|
+
context: context.computeDeployContext,
|
|
2394
|
+
projectDir: context.targetDirectory
|
|
2395
|
+
});
|
|
2396
|
+
if (!result.ok && !result.cancelled) return {
|
|
2397
|
+
ok: false,
|
|
2398
|
+
stage: "compute_deploy",
|
|
2399
|
+
error: result.error
|
|
2400
|
+
};
|
|
2401
|
+
if (result.ok) computeDatabaseResult = result.result;
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
return {
|
|
2404
|
+
ok: false,
|
|
2405
|
+
stage: "compute_deploy",
|
|
2406
|
+
error
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
const prismaSetupContext = computeDatabaseResult ? {
|
|
2337
2410
|
...context.prismaSetupContext,
|
|
2338
|
-
|
|
2339
|
-
|
|
2411
|
+
databaseUrl: computeDatabaseResult.databaseUrl,
|
|
2412
|
+
shouldUsePrismaPostgres: false
|
|
2340
2413
|
} : context.prismaSetupContext;
|
|
2341
2414
|
let prismaResult;
|
|
2342
2415
|
try {
|
|
2343
2416
|
prismaResult = await executePrismaSetupContext(prismaSetupContext, {
|
|
2344
2417
|
prependNextSteps: nextSteps,
|
|
2345
2418
|
projectDir: context.targetDirectory,
|
|
2346
|
-
includeDevNextStep: !context.useComputeDatabase
|
|
2347
|
-
includeMigrationAndSeedNextSteps: !context.useComputeDatabase
|
|
2419
|
+
includeDevNextStep: !context.useComputeDatabase
|
|
2348
2420
|
});
|
|
2349
2421
|
if (!prismaResult.ok) return {
|
|
2350
2422
|
ok: false,
|
|
@@ -2362,8 +2434,7 @@ async function executeCreateContext(context) {
|
|
|
2362
2434
|
const result = await executeComputeDeployContext({
|
|
2363
2435
|
context: context.computeDeployContext,
|
|
2364
2436
|
projectDir: context.targetDirectory,
|
|
2365
|
-
|
|
2366
|
-
databaseSetup: context.useComputeDatabase ? "compute-postgres" : void 0
|
|
2437
|
+
createProject: !computeDatabaseResult
|
|
2367
2438
|
});
|
|
2368
2439
|
if (!result.ok && !result.cancelled) return {
|
|
2369
2440
|
ok: false,
|
|
@@ -2383,7 +2454,10 @@ async function executeCreateContext(context) {
|
|
|
2383
2454
|
}
|
|
2384
2455
|
const summaryLines = [];
|
|
2385
2456
|
summaryLines.push(`Setup complete.${prismaResult.warningSection}`);
|
|
2386
|
-
if (deployResult)
|
|
2457
|
+
if (deployResult) {
|
|
2458
|
+
const database = computeDatabaseResult?.database ?? deployResult.database;
|
|
2459
|
+
summaryLines.push("", "Deployed to Prisma Compute:", ...deployResult.appUrl ? [`- App URL: ${deployResult.appUrl}`] : [], `- App: ${deployResult.appName} (${deployResult.appId})`, `- Deployment: ${deployResult.deploymentId}`, ...database ? [`- Database: ${database.name} (${database.id})`] : []);
|
|
2460
|
+
}
|
|
2387
2461
|
summaryLines.push("", "Next steps:", prismaResult.nextSteps.join("\n"));
|
|
2388
2462
|
outro(summaryLines.join("\n"));
|
|
2389
2463
|
return { ok: true };
|
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-Cdb0Ur3z.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.4.2-pr.34.
|
|
7
|
+
const CLI_VERSION = "0.4.2-pr.34.119.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
|
@@ -8,6 +8,9 @@ Generated by `create-prisma` with the Astro template.
|
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - build for production
|
|
9
9
|
- `{{runScriptCommand packageManager "preview"}}` - preview the production build
|
|
10
10
|
- `{{runScriptCommand packageManager "astro"}}` - run Astro CLI commands
|
|
11
|
+
{{#if compute}}
|
|
12
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
13
|
+
{{/if}}
|
|
11
14
|
|
|
12
15
|
## Prisma
|
|
13
16
|
|
|
@@ -33,3 +36,11 @@ The starter page queries a basic `User` model in `src/pages/index.astro`, and `s
|
|
|
33
36
|
|
|
34
37
|
The starter page keeps the official Astro minimal structure and points you to `prisma/schema.prisma` for your first model.
|
|
35
38
|
{{/if}}
|
|
39
|
+
{{#if compute}}
|
|
40
|
+
|
|
41
|
+
## Prisma Compute
|
|
42
|
+
|
|
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
|
+
|
|
45
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
46
|
+
{{/if}}
|
|
@@ -7,6 +7,9 @@ Generated by `create-prisma` with the Elysia template.
|
|
|
7
7
|
- `{{runScriptCommand packageManager "dev"}}` - start local dev server with hot reload
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - {{#if (eq packageManager "deno")}}type-check the app with Deno{{else}}{{#if (eq packageManager "bun")}}type-check the app for Bun{{else}}typecheck and compile{{/if}}{{/if}}
|
|
9
9
|
- `{{runScriptCommand packageManager "start"}}` - {{#if (eq packageManager "deno")}}run the server directly from `src/index.ts` with Deno{{else}}{{#if (eq packageManager "bun")}}run the server directly from `src/index.ts` with Bun{{else}}run compiled server from `dist/`{{/if}}{{/if}}
|
|
10
|
+
{{#if compute}}
|
|
11
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
12
|
+
{{/if}}
|
|
10
13
|
|
|
11
14
|
## Prisma
|
|
12
15
|
|
|
@@ -30,3 +33,11 @@ Generated Prisma files are written to `src/generated/prisma`.
|
|
|
30
33
|
|
|
31
34
|
The template includes a basic `User` model, a sample `GET /users` endpoint, and seed data in `prisma/seed.ts`.
|
|
32
35
|
{{/if}}
|
|
36
|
+
{{#if compute}}
|
|
37
|
+
|
|
38
|
+
## Prisma Compute
|
|
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.
|
|
41
|
+
|
|
42
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
|
+
{{/if}}
|
|
@@ -7,6 +7,9 @@ Generated by `create-prisma` with the Hono template.
|
|
|
7
7
|
- `{{runScriptCommand packageManager "dev"}}` - start local dev server
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - {{#if (eq packageManager "deno")}}type-check the app with Deno{{else}}{{#if (eq packageManager "bun")}}type-check the app for Bun{{else}}typecheck and compile{{/if}}{{/if}}
|
|
9
9
|
- `{{runScriptCommand packageManager "start"}}` - {{#if (eq packageManager "deno")}}run the server directly from `src/index.ts` with Deno{{else}}{{#if (eq packageManager "bun")}}run the server directly from `src/index.ts` with Bun{{else}}run compiled server from `dist/`{{/if}}{{/if}}
|
|
10
|
+
{{#if compute}}
|
|
11
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
12
|
+
{{/if}}
|
|
10
13
|
|
|
11
14
|
## Prisma
|
|
12
15
|
|
|
@@ -30,3 +33,11 @@ Generated Prisma files are written to `src/generated/prisma`.
|
|
|
30
33
|
|
|
31
34
|
The template includes a basic `User` model, a sample `GET /users` endpoint, and seed data in `prisma/seed.ts`.
|
|
32
35
|
{{/if}}
|
|
36
|
+
{{#if compute}}
|
|
37
|
+
|
|
38
|
+
## Prisma Compute
|
|
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.
|
|
41
|
+
|
|
42
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
|
+
{{/if}}
|
|
@@ -7,6 +7,9 @@ Generated by `create-prisma` with the NestJS template.
|
|
|
7
7
|
- `{{runScriptCommand packageManager "dev"}}` - start the Nest dev server with watch mode
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - {{#if (eq packageManager "deno")}}type-check the app with Deno{{else}}{{#if (eq packageManager "bun")}}type-check the app for Bun{{else}}compile the app into `dist/`{{/if}}{{/if}}
|
|
9
9
|
- `{{runScriptCommand packageManager "start"}}` - {{#if (eq packageManager "deno")}}run the server directly from `src/main.ts` with Deno{{else}}{{#if (eq packageManager "bun")}}run the server directly from `src/main.ts` with Bun{{else}}run the compiled server from `dist/main.js`{{/if}}{{/if}}
|
|
10
|
+
{{#if compute}}
|
|
11
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
12
|
+
{{/if}}
|
|
10
13
|
|
|
11
14
|
## Prisma
|
|
12
15
|
|
|
@@ -30,3 +33,11 @@ Generated Prisma files are written to `src/generated/prisma`.
|
|
|
30
33
|
|
|
31
34
|
The template includes a basic `User` model, a sample `GET /users` endpoint, and seed data in `prisma/seed.ts`.
|
|
32
35
|
{{/if}}
|
|
36
|
+
{{#if compute}}
|
|
37
|
+
|
|
38
|
+
## Prisma Compute
|
|
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.
|
|
41
|
+
|
|
42
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
|
+
{{/if}}
|
|
@@ -7,6 +7,9 @@ Generated by `create-prisma` with the Next.js template.
|
|
|
7
7
|
- `{{runScriptCommand packageManager "dev"}}` - start local dev server
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - production build
|
|
9
9
|
- `{{runScriptCommand packageManager "start"}}` - run production server
|
|
10
|
+
{{#if compute}}
|
|
11
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
12
|
+
{{/if}}
|
|
10
13
|
|
|
11
14
|
## Prisma
|
|
12
15
|
|
|
@@ -28,3 +31,11 @@ Database helper scripts are added to `package.json`:
|
|
|
28
31
|
|
|
29
32
|
The starter page in `src/app/page.tsx` reads from a basic `User` model so you can verify queries quickly, and `prisma/seed.ts` inserts starter users.
|
|
30
33
|
{{/if}}
|
|
34
|
+
{{#if compute}}
|
|
35
|
+
|
|
36
|
+
## Prisma Compute
|
|
37
|
+
|
|
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
|
+
|
|
40
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
41
|
+
{{/if}}
|
|
@@ -8,6 +8,9 @@ Generated by `create-prisma` with the Nuxt template.
|
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - build for production
|
|
9
9
|
- `{{runScriptCommand packageManager "preview"}}` - preview the production build
|
|
10
10
|
- `{{runScriptCommand packageManager "typecheck"}}` - run Nuxt type checks
|
|
11
|
+
{{#if compute}}
|
|
12
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
13
|
+
{{/if}}
|
|
11
14
|
|
|
12
15
|
## Prisma
|
|
13
16
|
|
|
@@ -30,3 +33,11 @@ Database helper scripts are added to `package.json`:
|
|
|
30
33
|
|
|
31
34
|
The starter page in `app/pages/index.vue` fetches seeded users from `server/api/users.get.ts`, and `prisma/seed.ts` inserts starter users.
|
|
32
35
|
{{/if}}
|
|
36
|
+
{{#if compute}}
|
|
37
|
+
|
|
38
|
+
## Prisma Compute
|
|
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.
|
|
41
|
+
|
|
42
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
43
|
+
{{/if}}
|
|
@@ -8,6 +8,9 @@ Generated by `create-prisma` with the SvelteKit template.
|
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - build for production
|
|
9
9
|
- `{{runScriptCommand packageManager "preview"}}` - preview the production build
|
|
10
10
|
- `{{runScriptCommand packageManager "check"}}` - run SvelteKit sync and type checks
|
|
11
|
+
{{#if compute}}
|
|
12
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
13
|
+
{{/if}}
|
|
11
14
|
|
|
12
15
|
## Prisma
|
|
13
16
|
|
|
@@ -32,3 +35,11 @@ The starter page loads users in `+page.server.ts`, renders them in `+page.svelte
|
|
|
32
35
|
|
|
33
36
|
The starter page keeps the official SvelteKit minimal structure and points you to `prisma/schema.prisma` for your first model.
|
|
34
37
|
{{/if}}
|
|
38
|
+
{{#if compute}}
|
|
39
|
+
|
|
40
|
+
## Prisma Compute
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
45
|
+
{{/if}}
|
|
@@ -8,6 +8,9 @@ Generated by `create-prisma` with the TanStack Start template.
|
|
|
8
8
|
- `{{runScriptCommand packageManager "build"}}` - build for production
|
|
9
9
|
- `{{runScriptCommand packageManager "preview"}}` - preview the production build
|
|
10
10
|
- `{{runScriptCommand packageManager "typecheck"}}` - run TypeScript checks
|
|
11
|
+
{{#if compute}}
|
|
12
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
13
|
+
{{/if}}
|
|
11
14
|
|
|
12
15
|
## Prisma
|
|
13
16
|
|
|
@@ -29,3 +32,11 @@ Database helper scripts are added to `package.json`:
|
|
|
29
32
|
|
|
30
33
|
The home route uses a TanStack Start server function to load users with the Prisma client from `src/lib/prisma.server.ts`, so you can verify a real database query without adding an API route first.
|
|
31
34
|
{{/if}}
|
|
35
|
+
{{#if compute}}
|
|
36
|
+
|
|
37
|
+
## Prisma Compute
|
|
38
|
+
|
|
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
|
+
|
|
41
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
42
|
+
{{/if}}
|
|
@@ -15,6 +15,9 @@ Generated by `create-prisma` with the Turborepo template.
|
|
|
15
15
|
- `{{runScriptCommand packageManager "db:generate"}}` - generate Prisma Client in `packages/db`
|
|
16
16
|
- `{{runScriptCommand packageManager "db:migrate"}}` - create/apply migrations in `packages/db`
|
|
17
17
|
- `{{runScriptCommand packageManager "db:seed"}}` - run seed script in `packages/db`
|
|
18
|
+
{{#if compute}}
|
|
19
|
+
- `{{runScriptCommand packageManager "compute:deploy"}}` - redeploy to Prisma Compute with environment variables from `.env`
|
|
20
|
+
{{/if}}
|
|
18
21
|
|
|
19
22
|
## Prisma
|
|
20
23
|
|
|
@@ -27,3 +30,11 @@ Prisma is scaffolded inside `packages/db`:
|
|
|
27
30
|
- `packages/db/src/generated/prisma`
|
|
28
31
|
|
|
29
32
|
`apps/api/src/index.ts` imports the shared Prisma client from `@repo/db`.
|
|
33
|
+
{{#if compute}}
|
|
34
|
+
|
|
35
|
+
## Prisma Compute
|
|
36
|
+
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
After local changes, run `{{runScriptCommand packageManager "compute:deploy"}}` to redeploy.
|
|
40
|
+
{{/if}}
|