@prisma/cli 3.0.0-alpha.6 → 3.0.0-alpha.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/adapters/local-state.js +1 -1
- package/dist/commands/app/index.js +9 -1
- package/dist/controllers/app.js +690 -57
- package/dist/lib/app/bun-project.js +1 -1
- package/dist/lib/app/deploy-output.js +15 -0
- package/dist/lib/app/local-dev.js +1 -1
- package/dist/lib/app/preview-build.js +1 -1
- package/dist/lib/app/preview-interaction.js +2 -35
- package/dist/lib/app/preview-progress.js +43 -58
- package/dist/lib/app/preview-provider.js +110 -22
- package/dist/lib/auth/client.js +1 -1
- package/dist/lib/project/local-pin.js +51 -0
- package/dist/lib/project/resolution.js +71 -21
- package/dist/presenters/app.js +16 -37
- package/dist/presenters/project.js +3 -0
- package/dist/shell/command-meta.js +4 -4
- package/dist/shell/errors.js +2 -0
- package/dist/shell/output.js +11 -0
- package/dist/shell/prompt.js +12 -2
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ const DESCRIPTORS = [
|
|
|
60
60
|
id: "app",
|
|
61
61
|
path: ["prisma", "app"],
|
|
62
62
|
description: "Manage apps and deployments for a project",
|
|
63
|
-
examples: ["prisma-cli app deploy", "prisma-cli app deploy --app
|
|
63
|
+
examples: ["prisma-cli app deploy", "prisma-cli app deploy --app my-app --framework nextjs --http-port 3000"]
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
id: "branch",
|
|
@@ -182,9 +182,9 @@ const DESCRIPTORS = [
|
|
|
182
182
|
description: "Creates a new deployment for the app",
|
|
183
183
|
examples: [
|
|
184
184
|
"prisma-cli app deploy",
|
|
185
|
-
"prisma-cli app deploy --app
|
|
186
|
-
"prisma-cli app deploy --app
|
|
187
|
-
"prisma-cli app deploy --
|
|
185
|
+
"prisma-cli app deploy --app my-app --env DATABASE_URL=postgresql://example",
|
|
186
|
+
"prisma-cli app deploy --app my-app --framework nextjs --http-port 3000",
|
|
187
|
+
"prisma-cli app deploy --branch feat-login --framework hono"
|
|
188
188
|
]
|
|
189
189
|
},
|
|
190
190
|
{
|
package/dist/shell/errors.js
CHANGED
|
@@ -12,6 +12,7 @@ var CliError = class extends Error {
|
|
|
12
12
|
docsUrl;
|
|
13
13
|
exitCode;
|
|
14
14
|
nextSteps;
|
|
15
|
+
humanLines;
|
|
15
16
|
constructor(options) {
|
|
16
17
|
super(options.summary);
|
|
17
18
|
this.name = "CliError";
|
|
@@ -27,6 +28,7 @@ var CliError = class extends Error {
|
|
|
27
28
|
this.docsUrl = options.docsUrl ?? null;
|
|
28
29
|
this.exitCode = options.exitCode ?? 1;
|
|
29
30
|
this.nextSteps = options.nextSteps ?? [];
|
|
31
|
+
this.humanLines = options.humanLines && options.humanLines.length > 0 ? [...options.humanLines] : null;
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
function usageError(summary, why, fix, nextSteps = [], domain = "cli") {
|
package/dist/shell/output.js
CHANGED
|
@@ -36,6 +36,17 @@ function writeHumanLines(output, lines) {
|
|
|
36
36
|
output.stderr.write(`${lines.join("\n")}\n`);
|
|
37
37
|
}
|
|
38
38
|
function writeHumanError(output, ui, error, options) {
|
|
39
|
+
if (error.humanLines && error.humanLines.length > 0) {
|
|
40
|
+
const lines = [...error.humanLines];
|
|
41
|
+
if (options.trace && error.debug) {
|
|
42
|
+
lines.push("");
|
|
43
|
+
lines.push("Trace:");
|
|
44
|
+
lines.push(...error.debug.trimEnd().split("\n"));
|
|
45
|
+
}
|
|
46
|
+
lines.push(...renderNextSteps(error.nextSteps));
|
|
47
|
+
writeHumanLines(output, lines);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
39
50
|
const lines = [renderSummaryLine(ui, "error", `${error.summary} [${error.code}]`)];
|
|
40
51
|
if (error.where) lines.push(...["", `Where: ${error.where}`]);
|
|
41
52
|
if (error.why) {
|
package/dist/shell/prompt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usageError } from "./errors.js";
|
|
2
|
-
import { isCancel, select, text } from "@clack/prompts";
|
|
2
|
+
import { confirm, isCancel, select, text } from "@clack/prompts";
|
|
3
3
|
//#region src/shell/prompt.ts
|
|
4
4
|
async function selectPrompt(options) {
|
|
5
5
|
const promptOptions = options.choices.map((choice) => ({
|
|
@@ -26,6 +26,16 @@ async function textPrompt(options) {
|
|
|
26
26
|
if (isCancel(response)) throw usageError("Interactive prompt canceled", "The command was canceled before a value was entered.", "Re-run the command and provide a value to continue.");
|
|
27
27
|
return response;
|
|
28
28
|
}
|
|
29
|
+
async function confirmPrompt(options) {
|
|
30
|
+
const response = await confirm({
|
|
31
|
+
input: options.input,
|
|
32
|
+
output: options.output,
|
|
33
|
+
message: options.message,
|
|
34
|
+
initialValue: options.initialValue ?? false
|
|
35
|
+
});
|
|
36
|
+
if (isCancel(response)) throw usageError("Interactive prompt canceled", "The command was canceled before a confirmation was made.", "Re-run the command and choose an option to continue.");
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
29
39
|
function disposePromptState(_input) {}
|
|
30
40
|
//#endregion
|
|
31
|
-
export { disposePromptState, selectPrompt, textPrompt };
|
|
41
|
+
export { confirmPrompt, disposePromptState, selectPrompt, textPrompt };
|