@prisma/cli 8.0.0-rc.1 → 8.0.0-rc.2-dev.49
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.js +15410 -16
- package/dist/deploy-framework-C7bQM00A.js +23 -0
- package/dist/{v8/sender.js → sender.js} +2 -2
- package/package.json +11 -15
- package/dist/adapters/git.js +0 -54
- package/dist/adapters/local-state.js +0 -155
- package/dist/auth/client.js +0 -30
- package/dist/auth/errors.js +0 -50
- package/dist/auth/guard.js +0 -39
- package/dist/auth/login.js +0 -471
- package/dist/auth/operations.js +0 -208
- package/dist/auth/recipient.js +0 -42
- package/dist/auth/token-storage.js +0 -439
- package/dist/auth/workspaces.js +0 -171
- package/dist/cli-command.js +0 -14
- package/dist/cli-name.js +0 -12
- package/dist/cli2.js +0 -136
- package/dist/command-arguments.js +0 -12
- package/dist/commands/agent/index.js +0 -60
- package/dist/commands/app/index.js +0 -350
- package/dist/commands/auth/index.js +0 -95
- package/dist/commands/branch/index.js +0 -27
- package/dist/commands/bucket/index.js +0 -123
- package/dist/commands/build/index.js +0 -29
- package/dist/commands/database/index.js +0 -249
- package/dist/commands/env.js +0 -99
- package/dist/commands/feedback/index.js +0 -20
- package/dist/commands/git/index.js +0 -36
- package/dist/commands/init/index.js +0 -33
- package/dist/commands/project/index.js +0 -118
- package/dist/commands/version/index.js +0 -18
- package/dist/controllers/agent-setup.js +0 -52
- package/dist/controllers/agent.js +0 -228
- package/dist/controllers/app-env-api.js +0 -55
- package/dist/controllers/app-env-file.js +0 -181
- package/dist/controllers/app-env.js +0 -502
- package/dist/controllers/app.js +0 -2508
- package/dist/controllers/auth.js +0 -124
- package/dist/controllers/branch.js +0 -92
- package/dist/controllers/bucket.js +0 -184
- package/dist/controllers/build.js +0 -88
- package/dist/controllers/database.js +0 -463
- package/dist/controllers/feedback.js +0 -90
- package/dist/controllers/init.js +0 -814
- package/dist/controllers/project.js +0 -892
- package/dist/controllers/select-prompt-port.js +0 -13
- package/dist/controllers/version.js +0 -12
- package/dist/errors.js +0 -102
- package/dist/lib/agent/cli-command.js +0 -20
- package/dist/lib/agent/constants.js +0 -12
- package/dist/lib/agent/package-manager.js +0 -99
- package/dist/lib/agent/setup-status.js +0 -83
- package/dist/lib/app/app-provider.js +0 -617
- package/dist/lib/app/branch-database-api.js +0 -102
- package/dist/lib/app/branch-database-deploy.js +0 -353
- package/dist/lib/app/branch-database.js +0 -234
- package/dist/lib/app/build-settings.js +0 -98
- package/dist/lib/app/build.js +0 -82
- package/dist/lib/app/bun-project.js +0 -45
- package/dist/lib/app/compute-config.js +0 -145
- package/dist/lib/app/deploy-output.js +0 -24
- package/dist/lib/app/deploy-plan.js +0 -59
- package/dist/lib/app/deploy-progress.js +0 -100
- package/dist/lib/app/domain-guidance.js +0 -14
- package/dist/lib/app/env-config.js +0 -67
- package/dist/lib/app/env-file.js +0 -82
- package/dist/lib/app/env-vars.js +0 -50
- package/dist/lib/app/local-dev.js +0 -109
- package/dist/lib/app/production-deploy-gate.js +0 -162
- package/dist/lib/app/read-branch.js +0 -30
- package/dist/lib/bucket/provider.js +0 -139
- package/dist/lib/database/provider.js +0 -385
- package/dist/lib/diagnostics.js +0 -16
- package/dist/lib/feedback.js +0 -15
- package/dist/lib/fs/home-path.js +0 -24
- package/dist/lib/git/local-branch.js +0 -53
- package/dist/lib/git/local-status.js +0 -57
- package/dist/lib/project/interactive-setup.js +0 -57
- package/dist/lib/project/local-pin.js +0 -200
- package/dist/lib/project/provider.js +0 -93
- package/dist/lib/project/resolution.js +0 -389
- package/dist/lib/project/setup.js +0 -138
- package/dist/lib/version.js +0 -56
- package/dist/lib/workspace-id.js +0 -18
- package/dist/output/patterns.js +0 -90
- package/dist/presenters/agent.js +0 -74
- package/dist/presenters/app-env.js +0 -265
- package/dist/presenters/app.js +0 -672
- package/dist/presenters/auth.js +0 -184
- package/dist/presenters/branch.js +0 -46
- package/dist/presenters/bucket.js +0 -174
- package/dist/presenters/database.js +0 -462
- package/dist/presenters/feedback.js +0 -26
- package/dist/presenters/init.js +0 -30
- package/dist/presenters/project.js +0 -268
- package/dist/presenters/verbose-context.js +0 -64
- package/dist/presenters/version.js +0 -29
- package/dist/shell/cli-command.js +0 -2
- package/dist/shell/command-meta.js +0 -923
- package/dist/shell/command-runner.js +0 -119
- package/dist/shell/diagnostics-output.js +0 -57
- package/dist/shell/global-flags.js +0 -37
- package/dist/shell/help.js +0 -90
- package/dist/shell/output.js +0 -144
- package/dist/shell/prompt.js +0 -48
- package/dist/shell/runtime.js +0 -38
- package/dist/shell/ui.js +0 -116
- package/dist/state-dir.js +0 -12
- package/dist/update-check.js +0 -248
- package/dist/v8/cli.js +0 -14699
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runBranchList } from "../../controllers/branch.js";
|
|
6
|
-
import { renderBranchList, serializeBranchList } from "../../presenters/branch.js";
|
|
7
|
-
import { Command } from "commander";
|
|
8
|
-
//#region src/commands/branch/index.ts
|
|
9
|
-
function createBranchCommand(runtime) {
|
|
10
|
-
const branch = attachCommandDescriptor(configureRuntimeCommand(new Command("branch"), runtime), "branch");
|
|
11
|
-
addCompactGlobalFlags(branch);
|
|
12
|
-
branch.addCommand(createBranchListCommand(runtime));
|
|
13
|
-
return branch;
|
|
14
|
-
}
|
|
15
|
-
function createBranchListCommand(runtime) {
|
|
16
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "branch.list");
|
|
17
|
-
addGlobalFlags(command);
|
|
18
|
-
command.action(async (options) => {
|
|
19
|
-
await runCommand(runtime, "branch.list", options, (context) => runBranchList(context), {
|
|
20
|
-
renderHuman: (context, descriptor, result) => renderBranchList(context, descriptor, result),
|
|
21
|
-
renderJson: (result) => serializeBranchList(result)
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
return command;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { createBranchCommand };
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runBucketCreate, runBucketDelete, runBucketKeyCreate, runBucketKeyDelete, runBucketKeyList, runBucketList } from "../../controllers/bucket.js";
|
|
6
|
-
import { renderBucketCreate, renderBucketDelete, renderBucketKeyCreate, renderBucketKeyCreateStdout, renderBucketKeyDelete, renderBucketKeyList, renderBucketList, serializeBucketCreate, serializeBucketDelete, serializeBucketKeyCreate, serializeBucketKeyDelete, serializeBucketKeyList, serializeBucketList } from "../../presenters/bucket.js";
|
|
7
|
-
import { Command, Option } from "commander";
|
|
8
|
-
//#region src/commands/bucket/index.ts
|
|
9
|
-
function createBucketCommand(runtime) {
|
|
10
|
-
const bucket = attachCommandDescriptor(configureRuntimeCommand(new Command("bucket"), runtime), "bucket");
|
|
11
|
-
addCompactGlobalFlags(bucket);
|
|
12
|
-
bucket.addCommand(createBucketListCommand(runtime));
|
|
13
|
-
bucket.addCommand(createBucketCreateCommand(runtime));
|
|
14
|
-
bucket.addCommand(createBucketDeleteCommand(runtime));
|
|
15
|
-
bucket.addCommand(createBucketKeyCommand(runtime));
|
|
16
|
-
return bucket;
|
|
17
|
-
}
|
|
18
|
-
function addProjectAndBranchOptions(command) {
|
|
19
|
-
return command.addOption(new Option("--project <id-or-name>", "Project id or name")).addOption(new Option("--branch <git-name>", "Branch git name"));
|
|
20
|
-
}
|
|
21
|
-
function createBucketListCommand(runtime) {
|
|
22
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "bucket.list");
|
|
23
|
-
addProjectAndBranchOptions(command);
|
|
24
|
-
addGlobalFlags(command);
|
|
25
|
-
command.action(async (options) => {
|
|
26
|
-
const projectRef = options.project;
|
|
27
|
-
const branchName = options.branch;
|
|
28
|
-
await runCommand(runtime, "bucket.list", options, (context) => runBucketList(context, {
|
|
29
|
-
projectRef,
|
|
30
|
-
branchName
|
|
31
|
-
}), {
|
|
32
|
-
renderHuman: (context, descriptor, result) => renderBucketList(context, descriptor, result),
|
|
33
|
-
renderJson: (result) => serializeBucketList(result)
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
return command;
|
|
37
|
-
}
|
|
38
|
-
function createBucketCreateCommand(runtime) {
|
|
39
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("create"), runtime), "bucket.create");
|
|
40
|
-
command.addOption(new Option("--name <name>", "Bucket display name (auto-generated if omitted)"));
|
|
41
|
-
addProjectAndBranchOptions(command);
|
|
42
|
-
addGlobalFlags(command);
|
|
43
|
-
command.action(async (options) => {
|
|
44
|
-
const projectRef = options.project;
|
|
45
|
-
const branchName = options.branch;
|
|
46
|
-
const name = options.name;
|
|
47
|
-
await runCommand(runtime, "bucket.create", options, (context) => runBucketCreate(context, {
|
|
48
|
-
projectRef,
|
|
49
|
-
branchName,
|
|
50
|
-
name
|
|
51
|
-
}), {
|
|
52
|
-
renderHuman: (context, descriptor, result) => renderBucketCreate(context, descriptor, result),
|
|
53
|
-
renderJson: (result) => serializeBucketCreate(result)
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
return command;
|
|
57
|
-
}
|
|
58
|
-
function createBucketDeleteCommand(runtime) {
|
|
59
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("delete"), runtime), "bucket.delete");
|
|
60
|
-
command.argument("<bucketId>", "Bucket id");
|
|
61
|
-
command.addOption(new Option("--confirm <bucket-id>", "Exact bucket id to confirm deletion"));
|
|
62
|
-
addGlobalFlags(command);
|
|
63
|
-
command.action(async (bucketId, options) => {
|
|
64
|
-
const confirm = options.confirm;
|
|
65
|
-
await runCommand(runtime, "bucket.delete", options, (context) => runBucketDelete(context, bucketId, { confirm }), {
|
|
66
|
-
renderHuman: (context, descriptor, result) => renderBucketDelete(context, descriptor, result),
|
|
67
|
-
renderJson: (result) => serializeBucketDelete(result)
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
return command;
|
|
71
|
-
}
|
|
72
|
-
function createBucketKeyCommand(runtime) {
|
|
73
|
-
const key = attachCommandDescriptor(configureRuntimeCommand(new Command("key"), runtime), "bucket.key");
|
|
74
|
-
addCompactGlobalFlags(key);
|
|
75
|
-
key.addCommand(createBucketKeyListCommand(runtime));
|
|
76
|
-
key.addCommand(createBucketKeyCreateCommand(runtime));
|
|
77
|
-
key.addCommand(createBucketKeyDeleteCommand(runtime));
|
|
78
|
-
return key;
|
|
79
|
-
}
|
|
80
|
-
function createBucketKeyListCommand(runtime) {
|
|
81
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "bucket.key.list");
|
|
82
|
-
command.argument("<bucketId>", "Bucket id");
|
|
83
|
-
addGlobalFlags(command);
|
|
84
|
-
command.action(async (bucketId, options) => {
|
|
85
|
-
await runCommand(runtime, "bucket.key.list", options, (context) => runBucketKeyList(context, bucketId), {
|
|
86
|
-
renderHuman: (context, descriptor, result) => renderBucketKeyList(context, descriptor, result),
|
|
87
|
-
renderJson: (result) => serializeBucketKeyList(result)
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
return command;
|
|
91
|
-
}
|
|
92
|
-
function createBucketKeyCreateCommand(runtime) {
|
|
93
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("create"), runtime), "bucket.key.create");
|
|
94
|
-
command.argument("<bucketId>", "Bucket id").addOption(new Option("--role <role>", "Access role (default: read_write)").choices(["read", "read_write"])).addOption(new Option("--name <name>", "Key display name (auto-generated if omitted)"));
|
|
95
|
-
addGlobalFlags(command);
|
|
96
|
-
command.action(async (bucketId, options) => {
|
|
97
|
-
const role = options.role;
|
|
98
|
-
const name = options.name;
|
|
99
|
-
await runCommand(runtime, "bucket.key.create", options, (context) => runBucketKeyCreate(context, bucketId, {
|
|
100
|
-
role,
|
|
101
|
-
name
|
|
102
|
-
}), {
|
|
103
|
-
renderStdout: (context, descriptor, result) => renderBucketKeyCreateStdout(context, descriptor, result),
|
|
104
|
-
renderHuman: (context, descriptor, result) => renderBucketKeyCreate(context, descriptor, result),
|
|
105
|
-
renderJson: (result) => serializeBucketKeyCreate(result)
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
return command;
|
|
109
|
-
}
|
|
110
|
-
function createBucketKeyDeleteCommand(runtime) {
|
|
111
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("delete"), runtime), "bucket.key.delete");
|
|
112
|
-
command.argument("<bucketId>", "Bucket id").argument("<keyId>", "Key id");
|
|
113
|
-
addGlobalFlags(command);
|
|
114
|
-
command.action(async (bucketId, keyId, options) => {
|
|
115
|
-
await runCommand(runtime, "bucket.key.delete", options, (context) => runBucketKeyDelete(context, bucketId, keyId), {
|
|
116
|
-
renderHuman: (context, descriptor, result) => renderBucketKeyDelete(context, descriptor, result),
|
|
117
|
-
renderJson: (result) => serializeBucketKeyDelete(result)
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
return command;
|
|
121
|
-
}
|
|
122
|
-
//#endregion
|
|
123
|
-
export { createBucketCommand };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runStreamingCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runBuildLogs } from "../../controllers/build.js";
|
|
6
|
-
import { Command, Option } from "commander";
|
|
7
|
-
//#region src/commands/build/index.ts
|
|
8
|
-
function createBuildCommand(runtime) {
|
|
9
|
-
const build = attachCommandDescriptor(configureRuntimeCommand(new Command("build"), runtime), "build");
|
|
10
|
-
addCompactGlobalFlags(build);
|
|
11
|
-
build.addCommand(createLogsCommand(runtime));
|
|
12
|
-
return build;
|
|
13
|
-
}
|
|
14
|
-
function createLogsCommand(runtime) {
|
|
15
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("logs"), runtime), "build.logs");
|
|
16
|
-
command.argument("<buildId>", "Build id from a git-push or Console deploy").addOption(new Option("--follow", "Keep the connection open and stream new logs as the build runs")).addOption(new Option("--cursor <cursor>", "Resume from a prior terminal cursor"));
|
|
17
|
-
addGlobalFlags(command);
|
|
18
|
-
command.action(async (buildId, options) => {
|
|
19
|
-
const follow = options.follow;
|
|
20
|
-
const cursor = options.cursor;
|
|
21
|
-
await runStreamingCommand(runtime, "build.logs", options, (context) => runBuildLogs(context, buildId, {
|
|
22
|
-
follow,
|
|
23
|
-
cursor
|
|
24
|
-
}), { emitJsonSuccessEvent: false });
|
|
25
|
-
});
|
|
26
|
-
return command;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { createBuildCommand };
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runDatabaseBackupList, runDatabaseConnectionCreate, runDatabaseConnectionList, runDatabaseConnectionRemove, runDatabaseConnectionRotate, runDatabaseCreate, runDatabaseList, runDatabaseRemove, runDatabaseRestore, runDatabaseShow, runDatabaseUsage } from "../../controllers/database.js";
|
|
6
|
-
import { renderDatabaseBackupList, renderDatabaseConnectionCreate, renderDatabaseConnectionCreateStdout, renderDatabaseConnectionList, renderDatabaseConnectionRemove, renderDatabaseConnectionRotate, renderDatabaseConnectionRotateStdout, renderDatabaseCreate, renderDatabaseCreateStdout, renderDatabaseList, renderDatabaseRemove, renderDatabaseRestore, renderDatabaseShow, renderDatabaseUsage, serializeDatabaseBackupList, serializeDatabaseConnectionCreate, serializeDatabaseConnectionList, serializeDatabaseConnectionRemove, serializeDatabaseConnectionRotate, serializeDatabaseCreate, serializeDatabaseList, serializeDatabaseRemove, serializeDatabaseRestore, serializeDatabaseShow, serializeDatabaseUsage } from "../../presenters/database.js";
|
|
7
|
-
import { Command, Option } from "commander";
|
|
8
|
-
//#region src/commands/database/index.ts
|
|
9
|
-
function createDatabaseCommand(runtime) {
|
|
10
|
-
const database = attachCommandDescriptor(configureRuntimeCommand(new Command("database"), runtime), "database");
|
|
11
|
-
addCompactGlobalFlags(database);
|
|
12
|
-
database.addCommand(createDatabaseListCommand(runtime));
|
|
13
|
-
database.addCommand(createDatabaseShowCommand(runtime));
|
|
14
|
-
database.addCommand(createDatabaseCreateCommand(runtime));
|
|
15
|
-
database.addCommand(createDatabaseUsageCommand(runtime));
|
|
16
|
-
database.addCommand(createDatabaseRestoreCommand(runtime));
|
|
17
|
-
database.addCommand(createDatabaseRemoveCommand(runtime));
|
|
18
|
-
database.addCommand(createDatabaseBackupCommand(runtime));
|
|
19
|
-
database.addCommand(createDatabaseConnectionCommand(runtime));
|
|
20
|
-
return database;
|
|
21
|
-
}
|
|
22
|
-
function addProjectAndBranchOptions(command) {
|
|
23
|
-
return command.addOption(new Option("--project <id-or-name>", "Project id or name")).addOption(new Option("--branch <git-name>", "Branch git name"));
|
|
24
|
-
}
|
|
25
|
-
function createDatabaseListCommand(runtime) {
|
|
26
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "database.list");
|
|
27
|
-
addProjectAndBranchOptions(command);
|
|
28
|
-
addGlobalFlags(command);
|
|
29
|
-
command.action(async (options) => {
|
|
30
|
-
const projectRef = options.project;
|
|
31
|
-
const branchName = options.branch;
|
|
32
|
-
await runCommand(runtime, "database.list", options, (context) => runDatabaseList(context, {
|
|
33
|
-
projectRef,
|
|
34
|
-
branchName
|
|
35
|
-
}), {
|
|
36
|
-
renderHuman: (context, descriptor, result) => renderDatabaseList(context, descriptor, result),
|
|
37
|
-
renderJson: (result) => serializeDatabaseList(result)
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
return command;
|
|
41
|
-
}
|
|
42
|
-
function createDatabaseShowCommand(runtime) {
|
|
43
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("show"), runtime), "database.show");
|
|
44
|
-
command.argument("<database>", "Database id or name");
|
|
45
|
-
addProjectAndBranchOptions(command);
|
|
46
|
-
addGlobalFlags(command);
|
|
47
|
-
command.action(async (databaseRef, options) => {
|
|
48
|
-
const projectRef = options.project;
|
|
49
|
-
const branchName = options.branch;
|
|
50
|
-
await runCommand(runtime, "database.show", options, (context) => runDatabaseShow(context, databaseRef, {
|
|
51
|
-
projectRef,
|
|
52
|
-
branchName
|
|
53
|
-
}), {
|
|
54
|
-
renderHuman: (context, descriptor, result) => renderDatabaseShow(context, descriptor, result),
|
|
55
|
-
renderJson: (result) => serializeDatabaseShow(result)
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
return command;
|
|
59
|
-
}
|
|
60
|
-
function createDatabaseCreateCommand(runtime) {
|
|
61
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("create"), runtime), "database.create");
|
|
62
|
-
command.argument("<name>", "Database name").addOption(new Option("--region <region>", "Prisma Postgres region id"));
|
|
63
|
-
addProjectAndBranchOptions(command);
|
|
64
|
-
addGlobalFlags(command);
|
|
65
|
-
command.action(async (name, options) => {
|
|
66
|
-
const projectRef = options.project;
|
|
67
|
-
const branchName = options.branch;
|
|
68
|
-
const region = options.region;
|
|
69
|
-
await runCommand(runtime, "database.create", options, (context) => runDatabaseCreate(context, name, {
|
|
70
|
-
projectRef,
|
|
71
|
-
branchName,
|
|
72
|
-
region
|
|
73
|
-
}), {
|
|
74
|
-
renderStdout: (context, descriptor, result) => renderDatabaseCreateStdout(context, descriptor, result),
|
|
75
|
-
renderHuman: (context, descriptor, result) => renderDatabaseCreate(context, descriptor, result),
|
|
76
|
-
renderJson: (result) => serializeDatabaseCreate(result)
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
return command;
|
|
80
|
-
}
|
|
81
|
-
function createDatabaseUsageCommand(runtime) {
|
|
82
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("usage"), runtime), "database.usage");
|
|
83
|
-
command.argument("<database>", "Database id or name").addOption(new Option("--from <iso-date>", "Start of the usage period")).addOption(new Option("--to <iso-date>", "End of the usage period"));
|
|
84
|
-
addProjectAndBranchOptions(command);
|
|
85
|
-
addGlobalFlags(command);
|
|
86
|
-
command.action(async (databaseRef, options) => {
|
|
87
|
-
const projectRef = options.project;
|
|
88
|
-
const branchName = options.branch;
|
|
89
|
-
const from = options.from;
|
|
90
|
-
const to = options.to;
|
|
91
|
-
await runCommand(runtime, "database.usage", options, (context) => runDatabaseUsage(context, databaseRef, {
|
|
92
|
-
projectRef,
|
|
93
|
-
branchName,
|
|
94
|
-
from,
|
|
95
|
-
to
|
|
96
|
-
}), {
|
|
97
|
-
renderHuman: (context, descriptor, result) => renderDatabaseUsage(context, descriptor, result),
|
|
98
|
-
renderJson: (result) => serializeDatabaseUsage(result)
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
return command;
|
|
102
|
-
}
|
|
103
|
-
function createDatabaseRestoreCommand(runtime) {
|
|
104
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("restore"), runtime), "database.restore");
|
|
105
|
-
command.argument("<database>", "Target database id or name").addOption(new Option("--backup <backup-id>", "Backup to restore from")).addOption(new Option("--source-database <database>", "Database the backup belongs to (defaults to the target)")).addOption(new Option("--confirm <database-id>", "Exact target database id required to restore"));
|
|
106
|
-
addProjectAndBranchOptions(command);
|
|
107
|
-
addGlobalFlags(command);
|
|
108
|
-
command.action(async (databaseRef, options) => {
|
|
109
|
-
const projectRef = options.project;
|
|
110
|
-
const branchName = options.branch;
|
|
111
|
-
const backupId = options.backup;
|
|
112
|
-
const sourceDatabaseRef = options.sourceDatabase;
|
|
113
|
-
const confirm = options.confirm;
|
|
114
|
-
await runCommand(runtime, "database.restore", options, (context) => runDatabaseRestore(context, databaseRef, {
|
|
115
|
-
projectRef,
|
|
116
|
-
branchName,
|
|
117
|
-
backupId,
|
|
118
|
-
sourceDatabaseRef,
|
|
119
|
-
confirm
|
|
120
|
-
}), {
|
|
121
|
-
renderHuman: (context, descriptor, result) => renderDatabaseRestore(context, descriptor, result),
|
|
122
|
-
renderJson: (result) => serializeDatabaseRestore(result)
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
return command;
|
|
126
|
-
}
|
|
127
|
-
function createDatabaseBackupCommand(runtime) {
|
|
128
|
-
const backup = attachCommandDescriptor(configureRuntimeCommand(new Command("backup"), runtime), "database.backup");
|
|
129
|
-
addCompactGlobalFlags(backup);
|
|
130
|
-
backup.addCommand(createDatabaseBackupListCommand(runtime));
|
|
131
|
-
return backup;
|
|
132
|
-
}
|
|
133
|
-
function createDatabaseBackupListCommand(runtime) {
|
|
134
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "database.backup.list");
|
|
135
|
-
command.argument("<database>", "Database id or name").addOption(new Option("--limit <n>", "Maximum number of backups to return"));
|
|
136
|
-
addProjectAndBranchOptions(command);
|
|
137
|
-
addGlobalFlags(command);
|
|
138
|
-
command.action(async (databaseRef, options) => {
|
|
139
|
-
const projectRef = options.project;
|
|
140
|
-
const branchName = options.branch;
|
|
141
|
-
const limit = options.limit;
|
|
142
|
-
await runCommand(runtime, "database.backup.list", options, (context) => runDatabaseBackupList(context, databaseRef, {
|
|
143
|
-
projectRef,
|
|
144
|
-
branchName,
|
|
145
|
-
limit
|
|
146
|
-
}), {
|
|
147
|
-
renderHuman: (context, descriptor, result) => renderDatabaseBackupList(context, descriptor, result),
|
|
148
|
-
renderJson: (result) => serializeDatabaseBackupList(result)
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
return command;
|
|
152
|
-
}
|
|
153
|
-
function createDatabaseRemoveCommand(runtime) {
|
|
154
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("remove"), runtime), "database.remove");
|
|
155
|
-
command.argument("<database>", "Database id or name").addOption(new Option("--confirm <database-id>", "Exact database id required to remove"));
|
|
156
|
-
addProjectAndBranchOptions(command);
|
|
157
|
-
addGlobalFlags(command);
|
|
158
|
-
command.action(async (databaseRef, options) => {
|
|
159
|
-
const projectRef = options.project;
|
|
160
|
-
const branchName = options.branch;
|
|
161
|
-
const confirm = options.confirm;
|
|
162
|
-
await runCommand(runtime, "database.remove", options, (context) => runDatabaseRemove(context, databaseRef, {
|
|
163
|
-
projectRef,
|
|
164
|
-
branchName,
|
|
165
|
-
confirm
|
|
166
|
-
}), {
|
|
167
|
-
renderHuman: (context, descriptor, result) => renderDatabaseRemove(context, descriptor, result),
|
|
168
|
-
renderJson: (result) => serializeDatabaseRemove(result)
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
return command;
|
|
172
|
-
}
|
|
173
|
-
function createDatabaseConnectionCommand(runtime) {
|
|
174
|
-
const connection = attachCommandDescriptor(configureRuntimeCommand(new Command("connection"), runtime), "database.connection");
|
|
175
|
-
addCompactGlobalFlags(connection);
|
|
176
|
-
connection.addCommand(createDatabaseConnectionListCommand(runtime));
|
|
177
|
-
connection.addCommand(createDatabaseConnectionCreateCommand(runtime));
|
|
178
|
-
connection.addCommand(createDatabaseConnectionRotateCommand(runtime));
|
|
179
|
-
connection.addCommand(createDatabaseConnectionRemoveCommand(runtime));
|
|
180
|
-
return connection;
|
|
181
|
-
}
|
|
182
|
-
function createDatabaseConnectionRotateCommand(runtime) {
|
|
183
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("rotate"), runtime), "database.connection.rotate");
|
|
184
|
-
command.argument("<connection>", "Connection id").addOption(new Option("--confirm <connection-id>", "Exact connection id required to rotate"));
|
|
185
|
-
addGlobalFlags(command);
|
|
186
|
-
command.action(async (connectionRef, options) => {
|
|
187
|
-
const confirm = options.confirm;
|
|
188
|
-
await runCommand(runtime, "database.connection.rotate", options, (context) => runDatabaseConnectionRotate(context, connectionRef, { confirm }), {
|
|
189
|
-
renderStdout: (context, descriptor, result) => renderDatabaseConnectionRotateStdout(context, descriptor, result),
|
|
190
|
-
renderHuman: (context, descriptor, result) => renderDatabaseConnectionRotate(context, descriptor, result),
|
|
191
|
-
renderJson: (result) => serializeDatabaseConnectionRotate(result)
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
return command;
|
|
195
|
-
}
|
|
196
|
-
function createDatabaseConnectionListCommand(runtime) {
|
|
197
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "database.connection.list");
|
|
198
|
-
command.argument("<database>", "Database id or name");
|
|
199
|
-
addProjectAndBranchOptions(command);
|
|
200
|
-
addGlobalFlags(command);
|
|
201
|
-
command.action(async (databaseRef, options) => {
|
|
202
|
-
const projectRef = options.project;
|
|
203
|
-
const branchName = options.branch;
|
|
204
|
-
await runCommand(runtime, "database.connection.list", options, (context) => runDatabaseConnectionList(context, databaseRef, {
|
|
205
|
-
projectRef,
|
|
206
|
-
branchName
|
|
207
|
-
}), {
|
|
208
|
-
renderHuman: (context, descriptor, result) => renderDatabaseConnectionList(context, descriptor, result),
|
|
209
|
-
renderJson: (result) => serializeDatabaseConnectionList(result)
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
return command;
|
|
213
|
-
}
|
|
214
|
-
function createDatabaseConnectionCreateCommand(runtime) {
|
|
215
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("create"), runtime), "database.connection.create");
|
|
216
|
-
command.argument("<database>", "Database id or name").addOption(new Option("--name <name>", "Connection name"));
|
|
217
|
-
addProjectAndBranchOptions(command);
|
|
218
|
-
addGlobalFlags(command);
|
|
219
|
-
command.action(async (databaseRef, options) => {
|
|
220
|
-
const projectRef = options.project;
|
|
221
|
-
const branchName = options.branch;
|
|
222
|
-
const name = options.name;
|
|
223
|
-
await runCommand(runtime, "database.connection.create", options, (context) => runDatabaseConnectionCreate(context, databaseRef, {
|
|
224
|
-
projectRef,
|
|
225
|
-
branchName,
|
|
226
|
-
name
|
|
227
|
-
}), {
|
|
228
|
-
renderStdout: (context, descriptor, result) => renderDatabaseConnectionCreateStdout(context, descriptor, result),
|
|
229
|
-
renderHuman: (context, descriptor, result) => renderDatabaseConnectionCreate(context, descriptor, result),
|
|
230
|
-
renderJson: (result) => serializeDatabaseConnectionCreate(result)
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
return command;
|
|
234
|
-
}
|
|
235
|
-
function createDatabaseConnectionRemoveCommand(runtime) {
|
|
236
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("remove"), runtime), "database.connection.remove");
|
|
237
|
-
command.argument("<connection>", "Connection id").addOption(new Option("--confirm <connection-id>", "Exact connection id required to remove"));
|
|
238
|
-
addGlobalFlags(command);
|
|
239
|
-
command.action(async (connectionRef, options) => {
|
|
240
|
-
const confirm = options.confirm;
|
|
241
|
-
await runCommand(runtime, "database.connection.remove", options, (context) => runDatabaseConnectionRemove(context, connectionRef, { confirm }), {
|
|
242
|
-
renderHuman: (context, descriptor, result) => renderDatabaseConnectionRemove(context, descriptor, result),
|
|
243
|
-
renderJson: (result) => serializeDatabaseConnectionRemove(result)
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
return command;
|
|
247
|
-
}
|
|
248
|
-
//#endregion
|
|
249
|
-
export { createDatabaseCommand };
|
package/dist/commands/env.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../shell/command-runner.js";
|
|
5
|
-
import { runEnvAdd, runEnvList, runEnvRemove, runEnvUpdate } from "../controllers/app-env.js";
|
|
6
|
-
import { renderEnvAdd, renderEnvList, renderEnvRm, renderEnvUpdate, serializeEnvAdd, serializeEnvList, serializeEnvRm, serializeEnvUpdate } from "../presenters/app-env.js";
|
|
7
|
-
import { Command, Option } from "commander";
|
|
8
|
-
//#region src/commands/env.ts
|
|
9
|
-
function createEnvCommand(runtime) {
|
|
10
|
-
const env = attachCommandDescriptor(configureRuntimeCommand(new Command("env"), runtime), "project.env");
|
|
11
|
-
env.description("Manage environment variables for the active project");
|
|
12
|
-
env.addCommand(createEnvAddCommand(runtime));
|
|
13
|
-
env.addCommand(createEnvUpdateCommand(runtime));
|
|
14
|
-
env.addCommand(createEnvListCommand(runtime));
|
|
15
|
-
env.addCommand(createEnvRemoveCommand(runtime));
|
|
16
|
-
return env;
|
|
17
|
-
}
|
|
18
|
-
function createEnvAddCommand(runtime) {
|
|
19
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("add"), runtime), "project.env.add");
|
|
20
|
-
command.argument("[assignment]", "Variable assignment as KEY=VALUE or KEY from the current environment").addOption(new Option("--file <path>", "Read KEY=VALUE assignments from a dotenv file")).addOption(new Option("--role <role>", "Project template scope (production or preview)").choices(["production", "preview"])).addOption(new Option("--branch <git-name>", "Preview branch override scope")).addOption(new Option("--project <id-or-name>", "Project id or name"));
|
|
21
|
-
addGlobalFlags(command);
|
|
22
|
-
command.action(async (assignment, options) => {
|
|
23
|
-
const roleName = options.role;
|
|
24
|
-
const branchName = options.branch;
|
|
25
|
-
const projectRef = options.project;
|
|
26
|
-
const filePath = options.file;
|
|
27
|
-
await runCommand(runtime, "project.env.add", options, (context) => runEnvAdd(context, assignment, {
|
|
28
|
-
roleName,
|
|
29
|
-
branchName,
|
|
30
|
-
projectRef,
|
|
31
|
-
filePath
|
|
32
|
-
}), {
|
|
33
|
-
renderHuman: (context, descriptor, result) => renderEnvAdd(context, descriptor, result),
|
|
34
|
-
renderJson: (result) => serializeEnvAdd(result)
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
return command;
|
|
38
|
-
}
|
|
39
|
-
function createEnvUpdateCommand(runtime) {
|
|
40
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("update"), runtime), "project.env.update");
|
|
41
|
-
command.argument("[assignment]", "Variable assignment as KEY=VALUE or KEY from the current environment").addOption(new Option("--file <path>", "Read KEY=VALUE assignments from a dotenv file")).addOption(new Option("--role <role>", "Project template scope (production or preview)").choices(["production", "preview"])).addOption(new Option("--branch <git-name>", "Preview branch override scope")).addOption(new Option("--project <id-or-name>", "Project id or name"));
|
|
42
|
-
addGlobalFlags(command);
|
|
43
|
-
command.action(async (assignment, options) => {
|
|
44
|
-
const roleName = options.role;
|
|
45
|
-
const branchName = options.branch;
|
|
46
|
-
const projectRef = options.project;
|
|
47
|
-
const filePath = options.file;
|
|
48
|
-
await runCommand(runtime, "project.env.update", options, (context) => runEnvUpdate(context, assignment, {
|
|
49
|
-
roleName,
|
|
50
|
-
branchName,
|
|
51
|
-
projectRef,
|
|
52
|
-
filePath
|
|
53
|
-
}), {
|
|
54
|
-
renderHuman: (context, descriptor, result) => renderEnvUpdate(context, descriptor, result),
|
|
55
|
-
renderJson: (result) => serializeEnvUpdate(result)
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
return command;
|
|
59
|
-
}
|
|
60
|
-
function createEnvListCommand(runtime) {
|
|
61
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("list"), runtime), "project.env.list");
|
|
62
|
-
command.addOption(new Option("--role <role>", "Project template scope").choices(["production", "preview"])).addOption(new Option("--branch <git-name>", "Preview branch resolved scope")).addOption(new Option("--project <id-or-name>", "Project id or name"));
|
|
63
|
-
addGlobalFlags(command);
|
|
64
|
-
command.action(async (options) => {
|
|
65
|
-
const roleName = options.role;
|
|
66
|
-
const branchName = options.branch;
|
|
67
|
-
const projectRef = options.project;
|
|
68
|
-
await runCommand(runtime, "project.env.list", options, (context) => runEnvList(context, {
|
|
69
|
-
roleName,
|
|
70
|
-
branchName,
|
|
71
|
-
projectRef
|
|
72
|
-
}), {
|
|
73
|
-
renderHuman: (context, descriptor, result) => renderEnvList(context, descriptor, result),
|
|
74
|
-
renderJson: (result) => serializeEnvList(result)
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
return command;
|
|
78
|
-
}
|
|
79
|
-
function createEnvRemoveCommand(runtime) {
|
|
80
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("remove"), runtime), "project.env.remove");
|
|
81
|
-
command.alias("rm").argument("<key>", "Variable key to remove").addOption(new Option("--role <role>", "Project template scope (production or preview)").choices(["production", "preview"])).addOption(new Option("--branch <git-name>", "Preview branch override scope")).addOption(new Option("--project <id-or-name>", "Project id or name"));
|
|
82
|
-
addGlobalFlags(command);
|
|
83
|
-
command.action(async (key, options) => {
|
|
84
|
-
const roleName = options.role;
|
|
85
|
-
const branchName = options.branch;
|
|
86
|
-
const projectRef = options.project;
|
|
87
|
-
await runCommand(runtime, "project.env.remove", options, (context) => runEnvRemove(context, key, {
|
|
88
|
-
roleName,
|
|
89
|
-
branchName,
|
|
90
|
-
projectRef
|
|
91
|
-
}), {
|
|
92
|
-
renderHuman: (context, descriptor, result) => renderEnvRm(context, descriptor, result),
|
|
93
|
-
renderJson: (result) => serializeEnvRm(result)
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
return command;
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
export { createEnvCommand };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runFeedback } from "../../controllers/feedback.js";
|
|
6
|
-
import { renderFeedbackSuccess } from "../../presenters/feedback.js";
|
|
7
|
-
import { Command, Option } from "commander";
|
|
8
|
-
//#region src/commands/feedback/index.ts
|
|
9
|
-
function createFeedbackCommand(runtime) {
|
|
10
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("feedback"), runtime), "feedback");
|
|
11
|
-
command.argument("<message>", "Feedback text (up to 4000 characters)").addOption(new Option("--email <address>", "Contact email if you want a reply; feedback is anonymous without it"));
|
|
12
|
-
addGlobalFlags(command);
|
|
13
|
-
command.action(async (message, options) => {
|
|
14
|
-
const flags = options;
|
|
15
|
-
await runCommand(runtime, "feedback", options, (context) => runFeedback(context, message, { email: flags.email }), { renderHuman: (context, descriptor, result) => renderFeedbackSuccess(context, descriptor, result) });
|
|
16
|
-
});
|
|
17
|
-
return command;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { createFeedbackCommand };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addCompactGlobalFlags, addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runGitConnect, runGitDisconnect } from "../../controllers/project.js";
|
|
6
|
-
import { renderGitConnect, renderGitDisconnect } from "../../presenters/project.js";
|
|
7
|
-
import { Command } from "commander";
|
|
8
|
-
//#region src/commands/git/index.ts
|
|
9
|
-
function createGitCommand(runtime) {
|
|
10
|
-
const git = attachCommandDescriptor(configureRuntimeCommand(new Command("git"), runtime), "git");
|
|
11
|
-
addCompactGlobalFlags(git);
|
|
12
|
-
git.addCommand(createGitConnectCommand(runtime));
|
|
13
|
-
git.addCommand(createGitDisconnectCommand(runtime));
|
|
14
|
-
return git;
|
|
15
|
-
}
|
|
16
|
-
function createGitConnectCommand(runtime) {
|
|
17
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("connect"), runtime), "git.connect");
|
|
18
|
-
command.argument("[git-url]", "GitHub repository URL");
|
|
19
|
-
command.option("--project <id-or-name>", "Project id or name");
|
|
20
|
-
addGlobalFlags(command);
|
|
21
|
-
command.action(async (gitUrl, options) => {
|
|
22
|
-
await runCommand(runtime, "git.connect", options, (context) => runGitConnect(context, gitUrl, { project: typeof options.project === "string" ? options.project : void 0 }), { renderHuman: (context, descriptor, result) => renderGitConnect(context, descriptor, result) });
|
|
23
|
-
});
|
|
24
|
-
return command;
|
|
25
|
-
}
|
|
26
|
-
function createGitDisconnectCommand(runtime) {
|
|
27
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("disconnect"), runtime), "git.disconnect");
|
|
28
|
-
command.option("--project <id-or-name>", "Project id or name");
|
|
29
|
-
addGlobalFlags(command);
|
|
30
|
-
command.action(async (options) => {
|
|
31
|
-
await runCommand(runtime, "git.disconnect", options, (context) => runGitDisconnect(context, { project: typeof options.project === "string" ? options.project : void 0 }), { renderHuman: (context, descriptor, result) => renderGitDisconnect(context, descriptor, result) });
|
|
32
|
-
});
|
|
33
|
-
return command;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { createGitCommand };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { attachCommandDescriptor } from "../../shell/command-meta.js";
|
|
2
|
-
import { addGlobalFlags } from "../../shell/global-flags.js";
|
|
3
|
-
import { configureRuntimeCommand } from "../../shell/runtime.js";
|
|
4
|
-
import { runCommand } from "../../shell/command-runner.js";
|
|
5
|
-
import { runInit } from "../../controllers/init.js";
|
|
6
|
-
import { renderInit, serializeInit } from "../../presenters/init.js";
|
|
7
|
-
import { Command, Option } from "commander";
|
|
8
|
-
//#region src/commands/init/index.ts
|
|
9
|
-
function createInitCommand(runtime) {
|
|
10
|
-
const command = attachCommandDescriptor(configureRuntimeCommand(new Command("init"), runtime), "init");
|
|
11
|
-
command.addOption(new Option("--framework <framework>", "Framework override; detected when omitted")).addOption(new Option("--entry <path>", "Source entrypoint for entrypoint frameworks (Bun, Hono)")).addOption(new Option("--http-port <port>", "HTTP port the app listens on")).addOption(new Option("--region <region>", "Region used when deploy creates the app")).addOption(new Option("--name <app-name>", "App name")).addOption(new Option("--link", "Link this directory to a Project")).addOption(new Option("--no-link", "Skip the Project link step")).addOption(new Option("--project <id-or-name>", "Project to link this directory to")).addOption(new Option("--install", "Install @prisma/compute-sdk for config types")).addOption(new Option("--no-install", "Skip the types install step")).addOption(new Option("--format <ts|json>", "Config file format: ts (default) writes prisma.compute.ts, json writes dependency-free prisma.compute.json; --format ts converts an existing prisma.compute.json"));
|
|
12
|
-
addGlobalFlags(command);
|
|
13
|
-
command.action(async (options) => {
|
|
14
|
-
const flags = options;
|
|
15
|
-
await runCommand(runtime, "init", options, (context) => runInit(context, {
|
|
16
|
-
framework: flags.framework,
|
|
17
|
-
entry: flags.entry,
|
|
18
|
-
httpPort: flags.httpPort,
|
|
19
|
-
region: flags.region,
|
|
20
|
-
name: flags.name,
|
|
21
|
-
link: flags.link,
|
|
22
|
-
project: flags.project,
|
|
23
|
-
install: flags.install,
|
|
24
|
-
format: flags.format
|
|
25
|
-
}), {
|
|
26
|
-
renderHuman: (context, descriptor, result) => renderInit(context, descriptor, result),
|
|
27
|
-
renderJson: (result) => serializeInit(result)
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
return command;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { createInitCommand };
|