@prisma/cli 3.0.0-alpha.0 → 3.0.0-alpha.2
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 +1 -16
- package/dist/cli2.js +2 -0
- package/dist/commands/app/index.js +5 -11
- package/dist/commands/auth/index.js +2 -1
- package/dist/commands/branch/index.js +2 -1
- package/dist/commands/project/index.js +2 -1
- package/dist/controllers/app.js +98 -77
- package/dist/controllers/auth.js +7 -7
- package/dist/controllers/branch.js +5 -5
- package/dist/controllers/project.js +14 -14
- package/dist/lib/app/env-vars.js +4 -4
- package/dist/lib/app/local-dev.js +1 -0
- package/dist/lib/app/preview-build.js +45 -186
- package/dist/lib/auth/login.js +115 -4
- package/dist/output/patterns.js +14 -16
- package/dist/shell/command-meta.js +59 -81
- package/dist/shell/errors.js +2 -2
- package/dist/shell/global-flags.js +12 -1
- package/dist/shell/help.js +7 -6
- package/dist/use-cases/auth.js +4 -4
- package/dist/use-cases/create-cli-gateways.js +1 -1
- package/dist/use-cases/project.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,22 +18,7 @@ pnpm prisma-cli app list-env
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
The package exposes `prisma-cli` so it can coexist with the existing `prisma`
|
|
21
|
-
executable.
|
|
22
|
-
add:
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"scripts": {
|
|
27
|
-
"prisma": "prisma-cli"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Then run:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
pnpm prisma app deploy
|
|
36
|
-
```
|
|
21
|
+
executable.
|
|
37
22
|
|
|
38
23
|
Notes:
|
|
39
24
|
|
package/dist/cli2.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { attachCommandDescriptor } from "./shell/command-meta.js";
|
|
2
|
+
import { addCompactGlobalFlags } from "./shell/global-flags.js";
|
|
2
3
|
import { configureRuntimeCommand } from "./shell/runtime.js";
|
|
3
4
|
import "./shell/prompt.js";
|
|
4
5
|
import { createAppCommand } from "./commands/app/index.js";
|
|
@@ -31,6 +32,7 @@ async function runCli(options = {}) {
|
|
|
31
32
|
}
|
|
32
33
|
function createProgram(runtime) {
|
|
33
34
|
const program = attachCommandDescriptor(configureRuntimeCommand(new Command(), runtime), "root");
|
|
35
|
+
addCompactGlobalFlags(program);
|
|
34
36
|
program.name("prisma").showSuggestionAfterError();
|
|
35
37
|
program.addCommand(createAuthCommand(runtime));
|
|
36
38
|
program.addCommand(createBranchCommand(runtime));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
2
|
+
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
3
|
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
+
import { PREVIEW_BUILD_TYPES } from "../../lib/app/preview-build.js";
|
|
4
5
|
import { runAppBuild, runAppDeploy, runAppListDeploys, runAppListEnv, runAppLogs, runAppOpen, runAppPromote, runAppRemove, runAppRollback, runAppRun, runAppShow, runAppShowDeploy, runAppUpdateEnv } from "../../controllers/app.js";
|
|
5
6
|
import { renderAppBuild, renderAppDeploy, renderAppListDeploys, renderAppListEnv, renderAppOpen, renderAppPromote, renderAppRemove, renderAppRollback, renderAppRun, renderAppShow, renderAppShowDeploy, renderAppUpdateEnv, serializeAppBuild, serializeAppDeploy, serializeAppListDeploys, serializeAppListEnv, serializeAppOpen, serializeAppPromote, serializeAppRemove, serializeAppRollback, serializeAppRun, serializeAppShow, serializeAppShowDeploy, serializeAppUpdateEnv } from "../../presenters/app.js";
|
|
6
7
|
import { runCommand } from "../../shell/command-runner.js";
|
|
@@ -8,6 +9,7 @@ import { Command, Option } from "commander";
|
|
|
8
9
|
//#region src/commands/app/index.ts
|
|
9
10
|
function createAppCommand(runtime) {
|
|
10
11
|
const app = attachCommandDescriptor(configureRuntimeCommand(new Command("app"), runtime), "app");
|
|
12
|
+
addCompactGlobalFlags(app);
|
|
11
13
|
app.addCommand(createBuildCommand(runtime));
|
|
12
14
|
app.addCommand(createRunCommand(runtime));
|
|
13
15
|
app.addCommand(createDeployCommand(runtime));
|
|
@@ -25,11 +27,7 @@ function createAppCommand(runtime) {
|
|
|
25
27
|
}
|
|
26
28
|
function createBuildCommand(runtime) {
|
|
27
29
|
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("build"), runtime), "app.build");
|
|
28
|
-
command.addOption(new Option("--entry <path>", "Entrypoint path for Bun or auto builds")).addOption(new Option("--build-type <type>", "Local build type").choices([
|
|
29
|
-
"auto",
|
|
30
|
-
"bun",
|
|
31
|
-
"nextjs"
|
|
32
|
-
]).default("auto"));
|
|
30
|
+
command.addOption(new Option("--entry <path>", "Entrypoint path for Bun or auto builds")).addOption(new Option("--build-type <type>", "Local build type").choices([...PREVIEW_BUILD_TYPES]).default("auto"));
|
|
33
31
|
addGlobalFlags(command);
|
|
34
32
|
command.action(async (options) => {
|
|
35
33
|
const entry = options.entry;
|
|
@@ -62,11 +60,7 @@ function createRunCommand(runtime) {
|
|
|
62
60
|
}
|
|
63
61
|
function createDeployCommand(runtime) {
|
|
64
62
|
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("deploy"), runtime), "app.deploy");
|
|
65
|
-
command.addOption(new Option("--app <name>", "App name")).addOption(new Option("--entry <path>", "Entrypoint path for Bun or auto deploys")).addOption(new Option("--build-type <type>", "Deploy build type").choices([
|
|
66
|
-
"auto",
|
|
67
|
-
"bun",
|
|
68
|
-
"nextjs"
|
|
69
|
-
]).default("auto")).addOption(new Option("--http-port <port>", "HTTP port override for the deployed app")).addOption(new Option("--env <name=value>", "Environment variable").argParser(collectRepeatableValues));
|
|
63
|
+
command.addOption(new Option("--app <name>", "App name")).addOption(new Option("--entry <path>", "Entrypoint path for Bun or auto deploys")).addOption(new Option("--build-type <type>", "Deploy build type").choices([...PREVIEW_BUILD_TYPES]).default("auto")).addOption(new Option("--http-port <port>", "HTTP port override for the deployed app")).addOption(new Option("--env <name=value>", "Environment variable").argParser(collectRepeatableValues));
|
|
70
64
|
addGlobalFlags(command);
|
|
71
65
|
command.action(async (options) => {
|
|
72
66
|
const appName = options.app;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
2
|
+
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
3
|
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
4
|
import { runCommand } from "../../shell/command-runner.js";
|
|
5
5
|
import { runAuthLogin, runAuthLogout, runAuthWhoAmI } from "../../controllers/auth.js";
|
|
@@ -8,6 +8,7 @@ import { Command, Option } from "commander";
|
|
|
8
8
|
//#region src/commands/auth/index.ts
|
|
9
9
|
function createAuthCommand(runtime) {
|
|
10
10
|
const auth = attachCommandDescriptor(configureRuntimeCommand(new Command("auth"), runtime), "auth");
|
|
11
|
+
addCompactGlobalFlags(auth);
|
|
11
12
|
auth.addCommand(createAuthLoginCommand(runtime));
|
|
12
13
|
auth.addCommand(createAuthLogoutCommand(runtime));
|
|
13
14
|
auth.addCommand(createAuthWhoAmICommand(runtime));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
2
|
+
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
3
|
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
4
|
import { runCommand } from "../../shell/command-runner.js";
|
|
5
5
|
import { runBranchList, runBranchShow, runBranchUse } from "../../controllers/branch.js";
|
|
@@ -8,6 +8,7 @@ import { Command } from "commander";
|
|
|
8
8
|
//#region src/commands/branch/index.ts
|
|
9
9
|
function createBranchCommand(runtime) {
|
|
10
10
|
const branch = attachCommandDescriptor(configureRuntimeCommand(new Command("branch"), runtime), "branch");
|
|
11
|
+
addCompactGlobalFlags(branch);
|
|
11
12
|
branch.addCommand(createBranchListCommand(runtime));
|
|
12
13
|
branch.addCommand(createBranchShowCommand(runtime));
|
|
13
14
|
branch.addCommand(createBranchUseCommand(runtime));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
2
|
+
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
3
|
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
4
|
import { runCommand } from "../../shell/command-runner.js";
|
|
5
5
|
import { runProjectLink, runProjectList, runProjectShow } from "../../controllers/project.js";
|
|
@@ -8,6 +8,7 @@ import { Command } from "commander";
|
|
|
8
8
|
//#region src/commands/project/index.ts
|
|
9
9
|
function createProjectCommand(runtime) {
|
|
10
10
|
const project = attachCommandDescriptor(configureRuntimeCommand(new Command("project"), runtime), "project");
|
|
11
|
+
addCompactGlobalFlags(project);
|
|
11
12
|
project.addCommand(createProjectListCommand(runtime));
|
|
12
13
|
project.addCommand(createProjectShowCommand(runtime));
|
|
13
14
|
project.addCommand(createProjectLinkCommand(runtime));
|