create-prisma 0.4.2-pr.34.113.1 → 0.4.2-pr.34.115.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs
CHANGED
|
@@ -1714,7 +1714,8 @@ const DEPLOY_OPTIONS_BY_TEMPLATE = {
|
|
|
1714
1714
|
},
|
|
1715
1715
|
elysia: {
|
|
1716
1716
|
framework: "bun",
|
|
1717
|
-
httpPort: 8080
|
|
1717
|
+
httpPort: 8080,
|
|
1718
|
+
requiresExplicitFramework: true
|
|
1718
1719
|
},
|
|
1719
1720
|
next: { framework: "nextjs" },
|
|
1720
1721
|
"tanstack-start": { framework: "tanstack-start" }
|
|
@@ -1722,6 +1723,24 @@ const DEPLOY_OPTIONS_BY_TEMPLATE = {
|
|
|
1722
1723
|
function getPrismaCliCommand(packageManager) {
|
|
1723
1724
|
return getPackageExecutionCommand(getPrismaCliExecutionPackageManager(packageManager), [PRISMA_CLI_PACKAGE]);
|
|
1724
1725
|
}
|
|
1726
|
+
function getPrismaCliAppDeployCommand(packageManager) {
|
|
1727
|
+
return getPackageExecutionCommand(getPrismaCliExecutionPackageManager(packageManager), [
|
|
1728
|
+
PRISMA_CLI_PACKAGE,
|
|
1729
|
+
"app",
|
|
1730
|
+
"deploy"
|
|
1731
|
+
]);
|
|
1732
|
+
}
|
|
1733
|
+
function getComputeDeployScriptMap(context) {
|
|
1734
|
+
const deployArgs = ["--prod", ...getComputeDeployRuntimeArgs(context)];
|
|
1735
|
+
const deployCommand = [getPrismaCliAppDeployCommand(context.packageManager), ...deployArgs].join(" ");
|
|
1736
|
+
return {
|
|
1737
|
+
"compute:deploy": deployCommand,
|
|
1738
|
+
"compute:deploy:ci": `${deployCommand} --yes`
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
function getComputeDeployRuntimeArgs(context) {
|
|
1742
|
+
return [...context.requiresExplicitFramework ? ["--framework", context.framework] : [], ...context.httpPort ? ["--http-port", String(context.httpPort)] : []];
|
|
1743
|
+
}
|
|
1725
1744
|
function runPrismaCli(packageManager, args, options = {}) {
|
|
1726
1745
|
const execution = getPackageExecutionArgs(getPrismaCliExecutionPackageManager(packageManager), [PRISMA_CLI_PACKAGE, ...args]);
|
|
1727
1746
|
return execa(execution.command, execution.args, options);
|
|
@@ -1797,7 +1816,8 @@ async function collectComputeDeployContext(input, options) {
|
|
|
1797
1816
|
packageManager: options.packageManager,
|
|
1798
1817
|
createProjectName: options.defaultServiceName,
|
|
1799
1818
|
framework: deployOptions.framework,
|
|
1800
|
-
httpPort: deployOptions.httpPort
|
|
1819
|
+
httpPort: deployOptions.httpPort,
|
|
1820
|
+
requiresExplicitFramework: deployOptions.requiresExplicitFramework
|
|
1801
1821
|
};
|
|
1802
1822
|
}
|
|
1803
1823
|
function redactSecrets(message) {
|
|
@@ -1843,10 +1863,9 @@ async function executeComputeDeployContext(params) {
|
|
|
1843
1863
|
"deploy",
|
|
1844
1864
|
"--json",
|
|
1845
1865
|
"--yes",
|
|
1846
|
-
"--framework",
|
|
1847
|
-
params.context.framework,
|
|
1848
1866
|
"--create-project",
|
|
1849
|
-
params.context.createProjectName
|
|
1867
|
+
params.context.createProjectName,
|
|
1868
|
+
...getComputeDeployRuntimeArgs(params.context)
|
|
1850
1869
|
];
|
|
1851
1870
|
try {
|
|
1852
1871
|
for (const [key, value] of Object.entries(params.envVars ?? {})) args.push("--env", `${key}=${value}`);
|
|
@@ -1940,7 +1959,7 @@ async function getAnonymousId() {
|
|
|
1940
1959
|
}
|
|
1941
1960
|
function getCommonProperties() {
|
|
1942
1961
|
return {
|
|
1943
|
-
"cli-version": "0.4.2-pr.34.
|
|
1962
|
+
"cli-version": "0.4.2-pr.34.115.1",
|
|
1944
1963
|
"node-version": process.version,
|
|
1945
1964
|
platform: process.platform,
|
|
1946
1965
|
arch: process.arch
|
|
@@ -2274,6 +2293,11 @@ async function executeCreateContext(context) {
|
|
|
2274
2293
|
packageManager: context.prismaSetupContext.packageManager,
|
|
2275
2294
|
projectDir: context.targetDirectory
|
|
2276
2295
|
});
|
|
2296
|
+
if (context.computeDeployContext) await addPackageDependency({
|
|
2297
|
+
scripts: getComputeDeployScriptMap(context.computeDeployContext),
|
|
2298
|
+
scriptMode: "if-missing",
|
|
2299
|
+
projectDir: context.targetDirectory
|
|
2300
|
+
});
|
|
2277
2301
|
} catch (error) {
|
|
2278
2302
|
return {
|
|
2279
2303
|
ok: false,
|
|
@@ -2327,7 +2351,10 @@ async function executeCreateContext(context) {
|
|
|
2327
2351
|
stage: "compute_deploy",
|
|
2328
2352
|
error: result.error
|
|
2329
2353
|
};
|
|
2330
|
-
if (result.ok)
|
|
2354
|
+
if (result.ok) {
|
|
2355
|
+
deployResult = result.result;
|
|
2356
|
+
prismaResult.nextSteps.push(`- ${getRunScriptCommand(context.prismaSetupContext.packageManager, "compute:deploy")}`);
|
|
2357
|
+
}
|
|
2331
2358
|
} catch (error) {
|
|
2332
2359
|
return {
|
|
2333
2360
|
ok: false,
|
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-C6wQ1yYn.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.115.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