@prisma/cli 3.0.0-beta.7 → 3.0.0-beta.8
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/commands/app/index.js +2 -2
- package/dist/controllers/app-env.js +2 -2
- package/dist/controllers/app.js +39 -5
- package/dist/lib/app/branch-database-deploy.js +115 -66
- package/dist/lib/app/env-file.js +2 -2
- package/dist/lib/app/env-vars.js +28 -2
- package/dist/lib/app/preview-build-settings.js +385 -0
- package/dist/lib/app/preview-build.js +196 -33
- package/dist/lib/app/preview-provider.js +2 -1
- package/dist/lib/app/production-deploy-gate.js +5 -4
- package/dist/presenters/app.js +7 -2
- package/dist/shell/command-meta.js +1 -0
- package/package.json +1 -1
|
@@ -165,7 +165,8 @@ function createPreviewAppProvider(client, options) {
|
|
|
165
165
|
appPath: path.resolve(options.cwd),
|
|
166
166
|
entrypoint: options.entrypoint,
|
|
167
167
|
buildType: options.buildType,
|
|
168
|
-
signal: options.signal
|
|
168
|
+
signal: options.signal,
|
|
169
|
+
buildSettings: options.buildSettings
|
|
169
170
|
}),
|
|
170
171
|
projectId: options.projectId,
|
|
171
172
|
serviceId: resolvedApp.appId,
|
|
@@ -3,22 +3,22 @@ import { canPrompt } from "../../shell/runtime.js";
|
|
|
3
3
|
import { confirmPrompt } from "../../shell/prompt.js";
|
|
4
4
|
//#region src/lib/app/production-deploy-gate.ts
|
|
5
5
|
async function enforceProductionDeployGate(context, provider, options) {
|
|
6
|
-
if (options.branchKind !== "production") return;
|
|
6
|
+
if (options.branchKind !== "production") return { firstProductionDeploy: false };
|
|
7
7
|
if (!options.appId) {
|
|
8
8
|
renderFirstProductionDeployLine(context, options.appName);
|
|
9
|
-
return;
|
|
9
|
+
return { firstProductionDeploy: true };
|
|
10
10
|
}
|
|
11
11
|
const currentLiveDeployment = resolveCurrentProductionDeployment(await provider.listDeployments(options.appId).catch((error) => {
|
|
12
12
|
throw productionDeployInspectionFailedError(error);
|
|
13
13
|
}));
|
|
14
14
|
if (!currentLiveDeployment) {
|
|
15
15
|
renderFirstProductionDeployLine(context, options.appName);
|
|
16
|
-
return;
|
|
16
|
+
return { firstProductionDeploy: true };
|
|
17
17
|
}
|
|
18
18
|
if (!options.prod) throw productionDeployRequiresFlagError();
|
|
19
19
|
if (context.flags.yes) {
|
|
20
20
|
renderProductionDeployYesLine(context);
|
|
21
|
-
return;
|
|
21
|
+
return { firstProductionDeploy: false };
|
|
22
22
|
}
|
|
23
23
|
if (!canPrompt(context)) throw productionDeployConfirmationRequiredError(options.appName);
|
|
24
24
|
renderProductionDeployConfirmation(context, currentLiveDeployment);
|
|
@@ -28,6 +28,7 @@ async function enforceProductionDeployGate(context, provider, options) {
|
|
|
28
28
|
message: "Deploy to production?",
|
|
29
29
|
initialValue: false
|
|
30
30
|
})) throw productionDeployCancelledError();
|
|
31
|
+
return { firstProductionDeploy: false };
|
|
31
32
|
}
|
|
32
33
|
function resolveCurrentProductionDeployment(result) {
|
|
33
34
|
if (result.deployments.length === 0) return null;
|
package/dist/presenters/app.js
CHANGED
|
@@ -43,11 +43,16 @@ function renderAppDeploy(context, descriptor, result) {
|
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
45
|
function serializeAppDeploy(result) {
|
|
46
|
-
const { deploySettings
|
|
46
|
+
const { deploySettings, localPin: _localPin, ...serialized } = result;
|
|
47
47
|
const { id: _branchId, ...branch } = serialized.branch;
|
|
48
48
|
return {
|
|
49
49
|
...serialized,
|
|
50
|
-
branch
|
|
50
|
+
branch,
|
|
51
|
+
deploySettings: {
|
|
52
|
+
config: deploySettings.config,
|
|
53
|
+
buildCommand: deploySettings.buildCommand,
|
|
54
|
+
outputDirectory: deploySettings.outputDirectory
|
|
55
|
+
}
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
function renderBranchDatabaseDeploySummary(context, result) {
|
|
@@ -194,6 +194,7 @@ const DESCRIPTORS = [
|
|
|
194
194
|
"prisma-cli app deploy --project proj_123",
|
|
195
195
|
"prisma-cli app deploy --create-project my-app --yes",
|
|
196
196
|
"prisma-cli app deploy --app my-app --env DATABASE_URL=postgresql://example",
|
|
197
|
+
"prisma-cli app deploy --env .env",
|
|
197
198
|
"prisma-cli app deploy --db",
|
|
198
199
|
"prisma-cli app deploy --db --yes",
|
|
199
200
|
"prisma-cli app deploy --app my-app --framework nextjs --http-port 3000",
|