@prisma/cli 3.0.0-beta.15 → 3.0.0-beta.17
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 +0 -13
- package/dist/controllers/app.js +28 -28
- package/dist/lib/app/app-provider.js +56 -56
- package/dist/lib/app/build.js +13 -11
- package/dist/lib/app/deploy-progress.js +7 -7
- package/dist/shell/command-meta.js +0 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -98,19 +98,6 @@ npx prisma-cli app promote <deployment-id>
|
|
|
98
98
|
- Stable command groups, flags, and error codes for scripts and agents.
|
|
99
99
|
- Environment variable values are not printed back to the terminal.
|
|
100
100
|
|
|
101
|
-
### Agent skills
|
|
102
|
-
|
|
103
|
-
For agent-guided Next.js deploys, install the Prisma CLI skill cluster at the
|
|
104
|
-
project level. Match the skill ref to the installed CLI version:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
npx prisma-cli version
|
|
108
|
-
pnpm dlx skills@latest add prisma/prisma-cli/skills#cli-v<cli-version> --all
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
The skills teach agents how to prepare a Next.js app, run `app deploy`, verify
|
|
112
|
-
the result, and route CLI / Compute feedback to the right Prisma channel.
|
|
113
|
-
|
|
114
101
|
---
|
|
115
102
|
|
|
116
103
|
## Beta notes
|
package/dist/controllers/app.js
CHANGED
|
@@ -4,7 +4,7 @@ import { CliError, authRequiredError, featureUnavailableError, usageError, works
|
|
|
4
4
|
import { confirmPrompt, selectPrompt, textPrompt } from "../shell/prompt.js";
|
|
5
5
|
import { DEFAULT_REGION } from "../lib/app/app-interaction.js";
|
|
6
6
|
import { PRISMA_APP_CONFIG_FILENAME, detectLegacyBuildSettings, resolveConfiguredAppBuildSettings, resolveInferredAppBuildSettings } from "../lib/app/build-settings.js";
|
|
7
|
-
import { APP_BUILD_TYPES, RESOLVED_APP_BUILD_TYPES, executeAppBuild } from "../lib/app/build.js";
|
|
7
|
+
import { APP_BUILD_TYPES, APP_BUILD_TYPE_LABELS, RESOLVED_APP_BUILD_TYPES, executeAppBuild } from "../lib/app/build.js";
|
|
8
8
|
import { envVarNames, parseEnvInputs } from "../lib/app/env-vars.js";
|
|
9
9
|
import { DomainApiError, createAppProvider } from "../lib/app/app-provider.js";
|
|
10
10
|
import { renderCommandHeader } from "../shell/ui.js";
|
|
@@ -407,7 +407,7 @@ async function runSingleAppDeploy(context, appName, options, preloadedConfig) {
|
|
|
407
407
|
name: framework.displayName,
|
|
408
408
|
source: framework.annotation
|
|
409
409
|
},
|
|
410
|
-
entrypoint: entrypoint ?? null,
|
|
410
|
+
entrypoint: entrypoint ?? buildSettingsResolution.settings.entrypoint ?? null,
|
|
411
411
|
httpPort: runtime.port,
|
|
412
412
|
region: selectedApp.region ?? null,
|
|
413
413
|
envVars: envVarNames(envVars)
|
|
@@ -1996,11 +1996,6 @@ function frameworkFromUserFacingValue(value, annotation) {
|
|
|
1996
1996
|
annotation
|
|
1997
1997
|
};
|
|
1998
1998
|
}
|
|
1999
|
-
/**
|
|
2000
|
-
* The nuxt and astro strategies build with their framework CLI and stage
|
|
2001
|
-
* fixed output, so a compute config `build` block has nothing to apply to.
|
|
2002
|
-
* Erroring beats silently ignoring committed settings.
|
|
2003
|
-
*/
|
|
2004
1999
|
function assertConfigBackedBuildSettings(buildType) {
|
|
2005
2000
|
if (isConfigBackedBuildType(buildType)) return;
|
|
2006
2001
|
const displayName = FRAMEWORKS.find((framework) => framework.buildType === buildType)?.displayName ?? buildType;
|
|
@@ -2042,15 +2037,23 @@ function maybeRenderDeployBuildSettings(context, resolution) {
|
|
|
2042
2037
|
if (context.flags.json || context.flags.quiet) return;
|
|
2043
2038
|
const settings = resolution.settings;
|
|
2044
2039
|
const title = resolution.status === "config" ? `Using ${resolution.relativeConfigPath}` : "Build settings";
|
|
2045
|
-
context.output.stderr.write(`${title}\n${renderDeployOutputRows(context.ui, [
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2040
|
+
context.output.stderr.write(`${title}\n${renderDeployOutputRows(context.ui, [
|
|
2041
|
+
{
|
|
2042
|
+
label: "Build Command",
|
|
2043
|
+
value: settings.buildCommand ?? "none",
|
|
2044
|
+
origin: settings.buildCommandSource ?? void 0
|
|
2045
|
+
},
|
|
2046
|
+
{
|
|
2047
|
+
label: "Output Directory",
|
|
2048
|
+
value: settings.outputDirectory,
|
|
2049
|
+
origin: settings.outputDirectorySource ?? void 0
|
|
2050
|
+
},
|
|
2051
|
+
...settings.entrypoint ? [{
|
|
2052
|
+
label: "Entrypoint",
|
|
2053
|
+
value: settings.entrypoint,
|
|
2054
|
+
origin: settings.entrypointSource ?? void 0
|
|
2055
|
+
}] : []
|
|
2056
|
+
]).join("\n")}\n\n`);
|
|
2054
2057
|
}
|
|
2055
2058
|
function maybeRenderProjectLinked(context, directory, projectName, localPinPath) {
|
|
2056
2059
|
if (context.flags.json || context.flags.quiet) return;
|
|
@@ -2149,7 +2152,7 @@ async function readCurrentWorkspaceId(context) {
|
|
|
2149
2152
|
function normalizeBuildType(requestedBuildType) {
|
|
2150
2153
|
if (!requestedBuildType) return "auto";
|
|
2151
2154
|
if (isPreviewBuildType(requestedBuildType)) return requestedBuildType;
|
|
2152
|
-
throw usageError(`Unsupported build type "${requestedBuildType}"`, `Only ${
|
|
2155
|
+
throw usageError(`Unsupported build type "${requestedBuildType}"`, `Only ${APP_BUILD_TYPE_LABELS} are supported in the current preview.`, "Pass a supported --build-type value.", getBuildTypeExamples("build"), "app");
|
|
2153
2156
|
}
|
|
2154
2157
|
function isPreviewBuildType(value) {
|
|
2155
2158
|
return APP_BUILD_TYPES.includes(value);
|
|
@@ -2251,7 +2254,7 @@ function appDeployFailedError(error, progress) {
|
|
|
2251
2254
|
}
|
|
2252
2255
|
if (!progress.buildStarted) return deployFailedError("App deploy failed", error, ["prisma-cli app deploy"]);
|
|
2253
2256
|
const phaseHeadline = progress.containerLive ? "The deployment started, but the app is not ready yet." : "Deploy failed after the build completed.";
|
|
2254
|
-
const recoveryLines = progress.
|
|
2257
|
+
const recoveryLines = progress.deploymentId ? ["See what happened", `prisma-cli app logs --deployment ${progress.deploymentId}`] : ["Fix", "Retry the command, or rerun with --trace for more detailed diagnostics."];
|
|
2255
2258
|
const urlLines = progress.deploymentUrl ? [
|
|
2256
2259
|
"",
|
|
2257
2260
|
"URL",
|
|
@@ -2277,11 +2280,11 @@ function appDeployFailedError(error, progress) {
|
|
|
2277
2280
|
domain: "app",
|
|
2278
2281
|
summary: phaseHeadline,
|
|
2279
2282
|
why,
|
|
2280
|
-
fix: progress.
|
|
2283
|
+
fix: progress.deploymentId ? `Inspect logs with prisma-cli app logs --deployment ${progress.deploymentId}.` : "Retry the command, or rerun with --trace for more detailed diagnostics.",
|
|
2281
2284
|
debug,
|
|
2282
2285
|
meta: {
|
|
2283
2286
|
phase: progress.containerLive ? "runtime_ready" : "deploy",
|
|
2284
|
-
deploymentId: progress.
|
|
2287
|
+
deploymentId: progress.deploymentId,
|
|
2285
2288
|
deploymentUrl: progress.deploymentUrl
|
|
2286
2289
|
},
|
|
2287
2290
|
humanLines,
|
|
@@ -2395,15 +2398,12 @@ function isAutoBuildDetectionError(error) {
|
|
|
2395
2398
|
return error instanceof Error && error.message.startsWith("Entrypoint is required.");
|
|
2396
2399
|
}
|
|
2397
2400
|
function formatBuildTypeName(buildType) {
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
case "nestjs": return "NestJS";
|
|
2403
|
-
case "tanstack-start": return "TanStack Start";
|
|
2404
|
-
case "bun": return "Bun";
|
|
2405
|
-
case "auto": return "Auto";
|
|
2401
|
+
if (buildType === "auto") return "Auto";
|
|
2402
|
+
for (let index = FRAMEWORKS.length - 1; index >= 0; index -= 1) {
|
|
2403
|
+
const framework = FRAMEWORKS[index];
|
|
2404
|
+
if (framework?.buildType === buildType) return framework.displayName;
|
|
2406
2405
|
}
|
|
2406
|
+
return buildType;
|
|
2407
2407
|
}
|
|
2408
2408
|
function removeFailedError(summary, error, nextSteps) {
|
|
2409
2409
|
return new CliError({
|
|
@@ -68,14 +68,14 @@ function createAppProvider(client, options) {
|
|
|
68
68
|
return deleteEnvironmentVariable(client, options);
|
|
69
69
|
},
|
|
70
70
|
async removeApp(appId, options) {
|
|
71
|
-
const appResult = await sdk.
|
|
72
|
-
|
|
71
|
+
const appResult = await sdk.showApp({
|
|
72
|
+
appId,
|
|
73
73
|
signal: options?.signal
|
|
74
74
|
});
|
|
75
75
|
if (appResult.isErr()) throw new Error(appResult.error.message);
|
|
76
|
-
const destroyResult = await sdk.
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const destroyResult = await sdk.destroyApp({
|
|
77
|
+
appId,
|
|
78
|
+
keepApp: false,
|
|
79
79
|
timeoutSeconds: 120,
|
|
80
80
|
pollIntervalMs: 2e3,
|
|
81
81
|
signal: options?.signal
|
|
@@ -90,8 +90,8 @@ function createAppProvider(client, options) {
|
|
|
90
90
|
return listComputeServiceDomains(client, appId, options?.signal);
|
|
91
91
|
},
|
|
92
92
|
async addDomain(options) {
|
|
93
|
-
const result = await client.POST("/v1/
|
|
94
|
-
params: { path: {
|
|
93
|
+
const result = await client.POST("/v1/apps/{appId}/domains", {
|
|
94
|
+
params: { path: { appId: options.appId } },
|
|
95
95
|
body: { hostname: options.hostname },
|
|
96
96
|
signal: options.signal
|
|
97
97
|
});
|
|
@@ -135,8 +135,8 @@ function createAppProvider(client, options) {
|
|
|
135
135
|
},
|
|
136
136
|
async promoteDeployment(options) {
|
|
137
137
|
const promoteResult = await sdk.promote({
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
appId: options.appId,
|
|
139
|
+
deploymentId: options.deploymentId,
|
|
140
140
|
timeoutSeconds: 120,
|
|
141
141
|
pollIntervalMs: 2e3,
|
|
142
142
|
signal: options.signal,
|
|
@@ -169,8 +169,8 @@ function createAppProvider(client, options) {
|
|
|
169
169
|
buildSettings: options.buildSettings
|
|
170
170
|
}),
|
|
171
171
|
projectId: options.projectId,
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
appId: resolvedApp.appId,
|
|
173
|
+
appName: resolvedApp.appName,
|
|
174
174
|
region: resolvedApp.region,
|
|
175
175
|
portMapping: options.portMapping,
|
|
176
176
|
envVars: options.envVars,
|
|
@@ -185,22 +185,22 @@ function createAppProvider(client, options) {
|
|
|
185
185
|
return {
|
|
186
186
|
projectId: deployed.projectId,
|
|
187
187
|
app: {
|
|
188
|
-
id: deployed.
|
|
189
|
-
name: deployed.
|
|
188
|
+
id: deployed.appId,
|
|
189
|
+
name: deployed.appName,
|
|
190
190
|
region: deployed.region ?? null,
|
|
191
|
-
liveDeploymentId: deployed.
|
|
192
|
-
liveUrl: toAbsoluteUrl(deployed.
|
|
191
|
+
liveDeploymentId: deployed.deploymentId,
|
|
192
|
+
liveUrl: toAbsoluteUrl(deployed.appEndpointDomain ?? null)
|
|
193
193
|
},
|
|
194
194
|
deployment: {
|
|
195
|
-
id: deployed.
|
|
195
|
+
id: deployed.deploymentId,
|
|
196
196
|
status: "running",
|
|
197
|
-
url: toAbsoluteUrl(deployed.
|
|
197
|
+
url: toAbsoluteUrl(deployed.appEndpointDomain ?? deployed.deploymentEndpointDomain ?? null)
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
},
|
|
201
201
|
async updateAppEnv(options) {
|
|
202
202
|
const updateResult = await sdk.updateEnv({
|
|
203
|
-
|
|
203
|
+
appId: options.appId,
|
|
204
204
|
envVars: options.envVars,
|
|
205
205
|
timeoutSeconds: 120,
|
|
206
206
|
pollIntervalMs: 2e3,
|
|
@@ -209,19 +209,19 @@ function createAppProvider(client, options) {
|
|
|
209
209
|
});
|
|
210
210
|
if (updateResult.isErr()) throw new Error(updateResult.error.message);
|
|
211
211
|
const promoteResult = await sdk.promote({
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
appId: options.appId,
|
|
213
|
+
deploymentId: updateResult.value.deploymentId,
|
|
214
214
|
timeoutSeconds: 120,
|
|
215
215
|
pollIntervalMs: 2e3,
|
|
216
216
|
signal: options.signal,
|
|
217
217
|
progress: options.promoteProgress
|
|
218
218
|
});
|
|
219
219
|
if (promoteResult.isErr()) throw new Error(promoteResult.error.message);
|
|
220
|
-
const [serviceResult, versionResult] = await Promise.all([sdk.
|
|
221
|
-
|
|
220
|
+
const [serviceResult, versionResult] = await Promise.all([sdk.showApp({
|
|
221
|
+
appId: options.appId,
|
|
222
222
|
signal: options.signal
|
|
223
|
-
}), sdk.
|
|
224
|
-
|
|
223
|
+
}), sdk.showDeployment({
|
|
224
|
+
deploymentId: updateResult.value.deploymentId,
|
|
225
225
|
signal: options.signal
|
|
226
226
|
})]);
|
|
227
227
|
if (serviceResult.isErr()) throw new Error(serviceResult.error.message);
|
|
@@ -232,25 +232,25 @@ function createAppProvider(client, options) {
|
|
|
232
232
|
id: serviceResult.value.id,
|
|
233
233
|
name: serviceResult.value.name,
|
|
234
234
|
region: serviceResult.value.region ?? null,
|
|
235
|
-
liveDeploymentId: serviceResult.value.
|
|
236
|
-
liveUrl: toAbsoluteUrl(serviceResult.value.
|
|
235
|
+
liveDeploymentId: serviceResult.value.latestDeploymentId ?? null,
|
|
236
|
+
liveUrl: toAbsoluteUrl(serviceResult.value.appEndpointDomain ?? null)
|
|
237
237
|
},
|
|
238
238
|
deployment: {
|
|
239
239
|
id: versionResult.value.id,
|
|
240
240
|
status: versionResult.value.status,
|
|
241
241
|
createdAt: versionResult.value.createdAt,
|
|
242
|
-
url: toAbsoluteUrl(serviceResult.value.
|
|
242
|
+
url: toAbsoluteUrl(serviceResult.value.appEndpointDomain ?? versionResult.value.previewDomain ?? null),
|
|
243
243
|
live: true
|
|
244
244
|
},
|
|
245
245
|
variables: envVarNames(versionResult.value.envVars)
|
|
246
246
|
};
|
|
247
247
|
},
|
|
248
248
|
async listAppEnvNames(options) {
|
|
249
|
-
const [serviceResult, versionResult] = await Promise.all([sdk.
|
|
250
|
-
|
|
249
|
+
const [serviceResult, versionResult] = await Promise.all([sdk.showApp({
|
|
250
|
+
appId: options.appId,
|
|
251
251
|
signal: options.signal
|
|
252
|
-
}), sdk.
|
|
253
|
-
|
|
252
|
+
}), sdk.showDeployment({
|
|
253
|
+
deploymentId: options.deploymentId,
|
|
254
254
|
signal: options.signal
|
|
255
255
|
})]);
|
|
256
256
|
if (serviceResult.isErr()) throw new Error(serviceResult.error.message);
|
|
@@ -261,25 +261,25 @@ function createAppProvider(client, options) {
|
|
|
261
261
|
id: serviceResult.value.id,
|
|
262
262
|
name: serviceResult.value.name,
|
|
263
263
|
region: serviceResult.value.region ?? null,
|
|
264
|
-
liveDeploymentId: serviceResult.value.
|
|
265
|
-
liveUrl: toAbsoluteUrl(serviceResult.value.
|
|
264
|
+
liveDeploymentId: serviceResult.value.latestDeploymentId ?? null,
|
|
265
|
+
liveUrl: toAbsoluteUrl(serviceResult.value.appEndpointDomain ?? null)
|
|
266
266
|
},
|
|
267
267
|
deployment: {
|
|
268
268
|
id: versionResult.value.id,
|
|
269
269
|
status: versionResult.value.status,
|
|
270
270
|
createdAt: versionResult.value.createdAt,
|
|
271
271
|
url: toAbsoluteUrl(versionResult.value.previewDomain ?? null),
|
|
272
|
-
live: serviceResult.value.
|
|
272
|
+
live: serviceResult.value.latestDeploymentId === versionResult.value.id
|
|
273
273
|
},
|
|
274
274
|
variables: envVarNames(versionResult.value.envVars)
|
|
275
275
|
};
|
|
276
276
|
},
|
|
277
277
|
async listDeployments(appId, options) {
|
|
278
|
-
const [appResult, versionsResult] = await Promise.all([sdk.
|
|
279
|
-
|
|
278
|
+
const [appResult, versionsResult] = await Promise.all([sdk.showApp({
|
|
279
|
+
appId,
|
|
280
280
|
signal: options?.signal
|
|
281
|
-
}), sdk.
|
|
282
|
-
|
|
281
|
+
}), sdk.listDeployments({
|
|
282
|
+
appId,
|
|
283
283
|
signal: options?.signal
|
|
284
284
|
})]);
|
|
285
285
|
if (appResult.isErr()) throw new Error(appResult.error.message);
|
|
@@ -289,8 +289,8 @@ function createAppProvider(client, options) {
|
|
|
289
289
|
id: appResult.value.id,
|
|
290
290
|
name: appResult.value.name,
|
|
291
291
|
region: appResult.value.region ?? null,
|
|
292
|
-
liveDeploymentId: appResult.value.
|
|
293
|
-
liveUrl: toAbsoluteUrl(appResult.value.
|
|
292
|
+
liveDeploymentId: appResult.value.latestDeploymentId ?? null,
|
|
293
|
+
liveUrl: toAbsoluteUrl(appResult.value.appEndpointDomain ?? null)
|
|
294
294
|
},
|
|
295
295
|
deployments: versionsResult.value.slice().sort((left, right) => {
|
|
296
296
|
const byDate = right.createdAt.localeCompare(left.createdAt);
|
|
@@ -305,8 +305,8 @@ function createAppProvider(client, options) {
|
|
|
305
305
|
};
|
|
306
306
|
},
|
|
307
307
|
async showDeployment(deploymentId, options) {
|
|
308
|
-
const deploymentResult = await sdk.
|
|
309
|
-
|
|
308
|
+
const deploymentResult = await sdk.showDeployment({
|
|
309
|
+
deploymentId,
|
|
310
310
|
signal: options?.signal
|
|
311
311
|
});
|
|
312
312
|
if (deploymentResult.isErr()) {
|
|
@@ -329,7 +329,7 @@ function createAppProvider(client, options) {
|
|
|
329
329
|
const result = await streamLogs({
|
|
330
330
|
baseUrl: options.baseUrl,
|
|
331
331
|
token: await options.getToken(),
|
|
332
|
-
|
|
332
|
+
deploymentId: streamOptions.deploymentId,
|
|
333
333
|
signal: streamOptions.signal
|
|
334
334
|
}, streamOptions.onRecord);
|
|
335
335
|
if (result.isErr()) {
|
|
@@ -382,7 +382,7 @@ async function listComputeServices(client, options) {
|
|
|
382
382
|
const services = [];
|
|
383
383
|
let cursor;
|
|
384
384
|
while (true) {
|
|
385
|
-
const result = await client.GET("/v1/
|
|
385
|
+
const result = await client.GET("/v1/apps", {
|
|
386
386
|
params: { query: {
|
|
387
387
|
projectId: options.projectId,
|
|
388
388
|
branchGitName: options.branchGitName,
|
|
@@ -400,13 +400,13 @@ async function listComputeServices(client, options) {
|
|
|
400
400
|
name: service.name,
|
|
401
401
|
region: service.region.id ?? null,
|
|
402
402
|
branchId: service.branchId,
|
|
403
|
-
liveDeploymentId: service.
|
|
404
|
-
liveUrl: toAbsoluteUrl(service.
|
|
403
|
+
liveDeploymentId: service.latestDeploymentId ?? null,
|
|
404
|
+
liveUrl: toAbsoluteUrl(service.appEndpointDomain ?? null)
|
|
405
405
|
}));
|
|
406
406
|
}
|
|
407
407
|
async function listComputeServiceDomains(client, computeServiceId, signal) {
|
|
408
|
-
const result = await client.GET("/v1/
|
|
409
|
-
params: { path: { computeServiceId } },
|
|
408
|
+
const result = await client.GET("/v1/apps/{appId}/domains", {
|
|
409
|
+
params: { path: { appId: computeServiceId } },
|
|
410
410
|
signal
|
|
411
411
|
});
|
|
412
412
|
if (result.error || !result.data) throw domainApiCallError("Failed to list custom domains", result.response, result.error);
|
|
@@ -453,7 +453,7 @@ async function createBranchApp(client, options) {
|
|
|
453
453
|
gitName: options.branchName,
|
|
454
454
|
signal: options.signal
|
|
455
455
|
});
|
|
456
|
-
const result = await client.POST("/v1/
|
|
456
|
+
const result = await client.POST("/v1/apps", {
|
|
457
457
|
body: {
|
|
458
458
|
projectId: options.projectId,
|
|
459
459
|
branchId: branch.id,
|
|
@@ -503,7 +503,7 @@ async function findAppForDeployment(sdk, deploymentId, signal) {
|
|
|
503
503
|
const projectsResult = await sdk.listProjects({ signal });
|
|
504
504
|
if (projectsResult.isErr()) throw new Error(projectsResult.error.message);
|
|
505
505
|
for (const project of projectsResult.value) {
|
|
506
|
-
const servicesResult = await sdk.
|
|
506
|
+
const servicesResult = await sdk.listApps({
|
|
507
507
|
projectId: project.id,
|
|
508
508
|
signal
|
|
509
509
|
});
|
|
@@ -516,8 +516,8 @@ async function findAppForDeployment(sdk, deploymentId, signal) {
|
|
|
516
516
|
return null;
|
|
517
517
|
}
|
|
518
518
|
async function findServiceAppForDeployment(sdk, serviceId, deploymentId, signal) {
|
|
519
|
-
const detailResult = await sdk.
|
|
520
|
-
serviceId,
|
|
519
|
+
const detailResult = await sdk.showApp({
|
|
520
|
+
appId: serviceId,
|
|
521
521
|
signal
|
|
522
522
|
});
|
|
523
523
|
if (detailResult.isErr()) throw new Error(detailResult.error.message);
|
|
@@ -525,12 +525,12 @@ async function findServiceAppForDeployment(sdk, serviceId, deploymentId, signal)
|
|
|
525
525
|
id: detailResult.value.id,
|
|
526
526
|
name: detailResult.value.name,
|
|
527
527
|
region: detailResult.value.region ?? null,
|
|
528
|
-
liveDeploymentId: detailResult.value.
|
|
529
|
-
liveUrl: toAbsoluteUrl(detailResult.value.
|
|
528
|
+
liveDeploymentId: detailResult.value.latestDeploymentId ?? null,
|
|
529
|
+
liveUrl: toAbsoluteUrl(detailResult.value.appEndpointDomain ?? null)
|
|
530
530
|
};
|
|
531
531
|
if (app.liveDeploymentId === deploymentId) return app;
|
|
532
|
-
const versionsResult = await sdk.
|
|
533
|
-
serviceId,
|
|
532
|
+
const versionsResult = await sdk.listDeployments({
|
|
533
|
+
appId: serviceId,
|
|
534
534
|
signal
|
|
535
535
|
});
|
|
536
536
|
if (versionsResult.isErr()) throw new Error(versionsResult.error.message);
|
package/dist/lib/app/build.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import "./build-settings.js";
|
|
2
|
+
import { FRAMEWORKS } from "@prisma/compute-sdk/config";
|
|
2
3
|
import "node:fs/promises";
|
|
3
4
|
import "node:path";
|
|
4
5
|
import { normalizeArtifactSymlinks, resolveBuildStrategy } from "@prisma/compute-sdk";
|
|
5
6
|
//#region src/lib/app/build.ts
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const RESOLVED_APP_BUILD_TYPES = [...frameworkBuildTypesByLastOccurrence()];
|
|
8
|
+
const APP_BUILD_TYPES = ["auto", ...RESOLVED_APP_BUILD_TYPES];
|
|
9
|
+
const APP_BUILD_TYPE_LABELS = APP_BUILD_TYPES.join(", ");
|
|
10
|
+
function frameworkBuildTypesByLastOccurrence() {
|
|
11
|
+
const buildTypes = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const framework of FRAMEWORKS) {
|
|
13
|
+
if (buildTypes.has(framework.buildType)) buildTypes.delete(framework.buildType);
|
|
14
|
+
buildTypes.add(framework.buildType);
|
|
15
|
+
}
|
|
16
|
+
return buildTypes;
|
|
17
|
+
}
|
|
16
18
|
var AppBuildStrategy = class {
|
|
17
19
|
#appPath;
|
|
18
20
|
#entrypoint;
|
|
@@ -77,4 +79,4 @@ async function resolveAppBuildStrategy(options) {
|
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
//#endregion
|
|
80
|
-
export { APP_BUILD_TYPES, AppBuildStrategy, RESOLVED_APP_BUILD_TYPES, executeAppBuild };
|
|
82
|
+
export { APP_BUILD_TYPES, APP_BUILD_TYPE_LABELS, AppBuildStrategy, RESOLVED_APP_BUILD_TYPES, executeAppBuild };
|
|
@@ -6,7 +6,7 @@ function createDeployProgressState() {
|
|
|
6
6
|
buildCompleted: false,
|
|
7
7
|
archiveReady: false,
|
|
8
8
|
uploadCompleted: false,
|
|
9
|
-
|
|
9
|
+
deploymentId: null,
|
|
10
10
|
startRequested: false,
|
|
11
11
|
containerLive: false,
|
|
12
12
|
deploymentUrl: null,
|
|
@@ -39,8 +39,8 @@ function createDeployProgress(output, ui, enabled, state = createDeployProgressS
|
|
|
39
39
|
onUploadStart() {
|
|
40
40
|
write("Uploading...");
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
state.
|
|
42
|
+
onDeploymentCreated(deploymentId) {
|
|
43
|
+
state.deploymentId = deploymentId;
|
|
44
44
|
},
|
|
45
45
|
onUploadComplete() {
|
|
46
46
|
state.uploadCompleted = true;
|
|
@@ -69,16 +69,16 @@ function createPromoteProgress(output, enabled) {
|
|
|
69
69
|
output.write(`${line}\n`);
|
|
70
70
|
};
|
|
71
71
|
return {
|
|
72
|
-
|
|
73
|
-
write(`Starting deployment ${
|
|
72
|
+
onDeploymentStarting(deploymentId) {
|
|
73
|
+
write(`Starting deployment ${deploymentId}...`);
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
onDeploymentStartRequested() {
|
|
76
76
|
write("Requesting deployment start...");
|
|
77
77
|
},
|
|
78
78
|
onStatusChange(status) {
|
|
79
79
|
write(`Status: ${status}`);
|
|
80
80
|
},
|
|
81
|
-
|
|
81
|
+
onDeploymentRunning() {
|
|
82
82
|
write("Deployment is running.");
|
|
83
83
|
},
|
|
84
84
|
onPromoteStart() {
|
|
@@ -341,7 +341,6 @@ const DESCRIPTORS = [
|
|
|
341
341
|
"deploy"
|
|
342
342
|
],
|
|
343
343
|
description: "Creates a new deployment for the app",
|
|
344
|
-
longDescription: "Agent skills for guided Next.js deploys are available from the Prisma CLI skill cluster.",
|
|
345
344
|
examples: [
|
|
346
345
|
"prisma-cli app deploy",
|
|
347
346
|
"prisma-cli app deploy --project proj_123",
|
|
@@ -353,7 +352,6 @@ const DESCRIPTORS = [
|
|
|
353
352
|
"prisma-cli app deploy --app my-app --framework nextjs --http-port 3000",
|
|
354
353
|
"prisma-cli app deploy --branch feat-login --framework hono",
|
|
355
354
|
"prisma-cli app deploy --prod --yes",
|
|
356
|
-
"pnpm dlx skills@latest add prisma/prisma-cli/skills#cli-v<cli-version> --all",
|
|
357
355
|
"prisma-cli app deploy --framework bun --entry src/server.ts"
|
|
358
356
|
]
|
|
359
357
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.17",
|
|
4
4
|
"description": "Command-line interface for the Prisma Developer Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@clack/prompts": "^1.5.0",
|
|
47
|
-
"@prisma/compute-sdk": "
|
|
47
|
+
"@prisma/compute-sdk": "0.30.0",
|
|
48
48
|
"@prisma/credentials-store": "^7.8.0",
|
|
49
|
-
"@prisma/management-api-sdk": "^1.
|
|
49
|
+
"@prisma/management-api-sdk": "^1.44.0",
|
|
50
50
|
"better-result": "^2.9.2",
|
|
51
51
|
"colorette": "^2.0.20",
|
|
52
52
|
"commander": "^14.0.3",
|