@prisma-next/cli 0.5.0-dev.24 → 0.5.0-dev.26
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 +2 -0
- package/dist/cli-errors-By1iVE3z.mjs.map +1 -1
- package/dist/cli.mjs +5 -11
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/contract-emit.mjs +0 -5
- package/dist/commands/contract-infer.mjs +0 -6
- package/dist/commands/db-init.mjs +0 -1
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.mjs +0 -3
- package/dist/commands/db-schema.mjs.map +1 -1
- package/dist/commands/db-sign.mjs +0 -1
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.mjs +0 -1
- package/dist/commands/db-update.mjs.map +1 -1
- package/dist/commands/db-verify.mjs +0 -1
- package/dist/commands/db-verify.mjs.map +1 -1
- package/dist/commands/migration-apply.mjs +0 -1
- package/dist/commands/migration-apply.mjs.map +1 -1
- package/dist/commands/migration-status.mjs +0 -5
- package/dist/{contract-emit-DS5NzZh2.mjs → contract-emit-LjzCoicC.mjs} +0 -2
- package/dist/exports/control-api.mjs +0 -2
- package/dist/exports/index.mjs +0 -5
- package/dist/exports/index.mjs.map +1 -1
- package/dist/{init-C-H-if1m.mjs → init-BKgjxw6r.mjs} +2 -2
- package/dist/{init-C-H-if1m.mjs.map → init-BKgjxw6r.mjs.map} +1 -1
- package/dist/migration-cli.d.mts +41 -11
- package/dist/migration-cli.d.mts.map +1 -1
- package/dist/migration-cli.mjs +281 -72
- package/dist/migration-cli.mjs.map +1 -1
- package/package.json +17 -16
- package/src/cli.ts +32 -6
- package/src/migration-cli.ts +414 -106
- package/src/utils/cli-errors.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/cli",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@dagrejs/dagre": "^3.0.0",
|
|
16
16
|
"arktype": "^2.0.0",
|
|
17
17
|
"c12": "^3.3.2",
|
|
18
|
+
"clipanion": "4.0.0-rc.4",
|
|
18
19
|
"closest-match": "^1.3.3",
|
|
19
20
|
"colorette": "^2.0.20",
|
|
20
21
|
"commander": "^12.0.0",
|
|
@@ -25,28 +26,28 @@
|
|
|
25
26
|
"string-width": "^8.2.0",
|
|
26
27
|
"strip-ansi": "^7.1.2",
|
|
27
28
|
"wrap-ansi": "^10.0.0",
|
|
28
|
-
"@prisma-next/config": "0.5.0-dev.
|
|
29
|
-
"@prisma-next/
|
|
30
|
-
"@prisma-next/contract": "0.5.0-dev.
|
|
31
|
-
"@prisma-next/errors": "0.5.0-dev.
|
|
32
|
-
"@prisma-next/
|
|
33
|
-
"@prisma-next/
|
|
34
|
-
"@prisma-next/
|
|
35
|
-
"@prisma-next/
|
|
29
|
+
"@prisma-next/config": "0.5.0-dev.26",
|
|
30
|
+
"@prisma-next/emitter": "0.5.0-dev.26",
|
|
31
|
+
"@prisma-next/contract": "0.5.0-dev.26",
|
|
32
|
+
"@prisma-next/errors": "0.5.0-dev.26",
|
|
33
|
+
"@prisma-next/framework-components": "0.5.0-dev.26",
|
|
34
|
+
"@prisma-next/psl-printer": "0.5.0-dev.26",
|
|
35
|
+
"@prisma-next/migration-tools": "0.5.0-dev.26",
|
|
36
|
+
"@prisma-next/utils": "0.5.0-dev.26"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/node": "24.10.4",
|
|
39
40
|
"tsdown": "0.18.4",
|
|
40
41
|
"typescript": "5.9.3",
|
|
41
42
|
"vitest": "4.0.17",
|
|
42
|
-
"@prisma-next/sql-contract": "0.5.0-dev.
|
|
43
|
-
"@prisma-next/sql-contract-
|
|
44
|
-
"@prisma-next/sql-contract-
|
|
45
|
-
"@prisma-next/sql-operations": "0.5.0-dev.
|
|
46
|
-
"@prisma-next/sql-runtime": "0.5.0-dev.
|
|
43
|
+
"@prisma-next/sql-contract": "0.5.0-dev.26",
|
|
44
|
+
"@prisma-next/sql-contract-emitter": "0.5.0-dev.26",
|
|
45
|
+
"@prisma-next/sql-contract-ts": "0.5.0-dev.26",
|
|
46
|
+
"@prisma-next/sql-operations": "0.5.0-dev.26",
|
|
47
|
+
"@prisma-next/sql-runtime": "0.5.0-dev.26",
|
|
47
48
|
"@prisma-next/test-utils": "0.0.1",
|
|
48
|
-
"@prisma-next/
|
|
49
|
-
"@prisma-next/
|
|
49
|
+
"@prisma-next/tsconfig": "0.0.0",
|
|
50
|
+
"@prisma-next/tsdown": "0.0.0"
|
|
50
51
|
},
|
|
51
52
|
"exports": {
|
|
52
53
|
".": {
|
package/src/cli.ts
CHANGED
|
@@ -50,8 +50,18 @@ program.configureOutput({
|
|
|
50
50
|
writeErr: () => {
|
|
51
51
|
// Suppress all default error output - we handle errors in exitOverride
|
|
52
52
|
},
|
|
53
|
-
writeOut: () => {
|
|
54
|
-
//
|
|
53
|
+
writeOut: (str) => {
|
|
54
|
+
// Commander routes explicitly-requested `--help` (success-path help)
|
|
55
|
+
// through writeOut; per the Style Guide § Output Conventions rule 8,
|
|
56
|
+
// user-requested help is data and goes to stdout. Error-path help
|
|
57
|
+
// (e.g. usage shown after an unknown command) goes through writeErr,
|
|
58
|
+
// which stays suppressed because we render that ourselves with the
|
|
59
|
+
// matching error envelope.
|
|
60
|
+
//
|
|
61
|
+
// Explicit `--version` is short-circuited before `program.parse()`
|
|
62
|
+
// (see the argv pre-scan at the bottom of this file), so it does not
|
|
63
|
+
// reach this writer.
|
|
64
|
+
process.stdout.write(str);
|
|
55
65
|
},
|
|
56
66
|
});
|
|
57
67
|
|
|
@@ -261,14 +271,25 @@ const helpCommand = new Command('help')
|
|
|
261
271
|
.action(() => {
|
|
262
272
|
const flags = parseGlobalFlags({});
|
|
263
273
|
const helpText = formatRootHelp({ program, flags });
|
|
264
|
-
//
|
|
265
|
-
|
|
274
|
+
// The `help` command was invoked explicitly: help is the data the
|
|
275
|
+
// caller asked for. Per Style Guide § Output Conventions rule 8,
|
|
276
|
+
// explicit help goes to stdout with exit code 0.
|
|
277
|
+
process.stdout.write(`${helpText}\n`);
|
|
266
278
|
process.exit(0);
|
|
267
279
|
});
|
|
268
280
|
|
|
269
281
|
program.addCommand(helpCommand);
|
|
270
282
|
|
|
271
|
-
// Set help as the default action when no command is provided
|
|
283
|
+
// Set help as the default action when no command is provided. The user
|
|
284
|
+
// did not invoke `--help`; we are voluntarily showing usage to help them
|
|
285
|
+
// recover from an underspecified invocation, so the help text is
|
|
286
|
+
// decoration around an implicit "what did you want me to do?" and goes
|
|
287
|
+
// to stderr (Style Guide § Output Conventions rule 8).
|
|
288
|
+
//
|
|
289
|
+
// FOLLOW-UP: the exit code here is 0 today, but a no-arg invocation is
|
|
290
|
+
// arguably a usage error (PRECONDITION → exit 2) for consistency with
|
|
291
|
+
// the unknown-command path. Out of scope for the explicit-help routing
|
|
292
|
+
// work; revisit when tightening exit-code semantics across the CLI.
|
|
272
293
|
program.action(() => {
|
|
273
294
|
const flags = parseGlobalFlags({});
|
|
274
295
|
const helpText = formatRootHelp({ program, flags });
|
|
@@ -304,7 +325,12 @@ if (args.length > 0) {
|
|
|
304
325
|
process.stderr.write(`${helpText}\n`);
|
|
305
326
|
process.exit(2);
|
|
306
327
|
} else if (command.commands.length > 0 && args.length === 1) {
|
|
307
|
-
// Parent command called with no subcommand
|
|
328
|
+
// Parent command called with no subcommand. Same shape as the
|
|
329
|
+
// no-args case above: the user did not request help, we are
|
|
330
|
+
// voluntarily rendering it as decoration around an underspecified
|
|
331
|
+
// invocation, so it goes to stderr per Style Guide § Output
|
|
332
|
+
// Conventions rule 8. Exit code 0 today; the FOLLOW-UP note on
|
|
333
|
+
// `program.action` applies here too (arguably should be 2).
|
|
308
334
|
const flags = parseGlobalFlags({});
|
|
309
335
|
const helpText = formatCommandHelp({ command, flags });
|
|
310
336
|
process.stderr.write(`${helpText}\n`);
|