@prisma-next/cli 0.3.0-pr.99.6 → 0.3.0
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/LICENSE +201 -0
- package/README.md +381 -128
- package/dist/agent-skill-mongo.md +106 -0
- package/dist/agent-skill-postgres.md +106 -0
- package/dist/cli-errors-BDCYR5ap.mjs +4 -0
- package/dist/cli-errors-DStABy9d.d.mts +3 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.js +1 -2910
- package/dist/cli.mjs +261 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/client-DiUkJAeN.mjs +987 -0
- package/dist/client-DiUkJAeN.mjs.map +1 -0
- package/dist/commands/contract-emit.d.mts +7 -0
- package/dist/commands/contract-emit.d.mts.map +1 -0
- package/dist/commands/contract-emit.mjs +9 -0
- package/dist/commands/contract-infer.d.mts +7 -0
- package/dist/commands/contract-infer.d.mts.map +1 -0
- package/dist/commands/contract-infer.mjs +10 -0
- package/dist/commands/db-init.d.mts +7 -0
- package/dist/commands/db-init.d.mts.map +1 -0
- package/dist/commands/db-init.mjs +126 -0
- package/dist/commands/db-init.mjs.map +1 -0
- package/dist/commands/db-schema.d.mts +7 -0
- package/dist/commands/db-schema.d.mts.map +1 -0
- package/dist/commands/db-schema.mjs +56 -0
- package/dist/commands/db-schema.mjs.map +1 -0
- package/dist/commands/db-sign.d.mts +7 -0
- package/dist/commands/db-sign.d.mts.map +1 -0
- package/dist/commands/db-sign.mjs +137 -0
- package/dist/commands/db-sign.mjs.map +1 -0
- package/dist/commands/db-update.d.mts +7 -0
- package/dist/commands/db-update.d.mts.map +1 -0
- package/dist/commands/db-update.mjs +123 -0
- package/dist/commands/db-update.mjs.map +1 -0
- package/dist/commands/db-verify.d.mts +7 -0
- package/dist/commands/db-verify.d.mts.map +1 -0
- package/dist/commands/db-verify.mjs +323 -0
- package/dist/commands/db-verify.mjs.map +1 -0
- package/dist/commands/migration-apply.d.mts +36 -0
- package/dist/commands/migration-apply.d.mts.map +1 -0
- package/dist/commands/migration-apply.mjs +245 -0
- package/dist/commands/migration-apply.mjs.map +1 -0
- package/dist/commands/migration-new.d.mts +8 -0
- package/dist/commands/migration-new.d.mts.map +1 -0
- package/dist/commands/migration-new.mjs +152 -0
- package/dist/commands/migration-new.mjs.map +1 -0
- package/dist/commands/migration-plan.d.mts +47 -0
- package/dist/commands/migration-plan.d.mts.map +1 -0
- package/dist/commands/migration-plan.mjs +313 -0
- package/dist/commands/migration-plan.mjs.map +1 -0
- package/dist/commands/migration-ref.d.mts +43 -0
- package/dist/commands/migration-ref.d.mts.map +1 -0
- package/dist/commands/migration-ref.mjs +195 -0
- package/dist/commands/migration-ref.mjs.map +1 -0
- package/dist/commands/migration-show.d.mts +28 -0
- package/dist/commands/migration-show.d.mts.map +1 -0
- package/dist/commands/migration-show.mjs +140 -0
- package/dist/commands/migration-show.mjs.map +1 -0
- package/dist/commands/migration-status.d.mts +86 -0
- package/dist/commands/migration-status.d.mts.map +1 -0
- package/dist/commands/migration-status.mjs +9 -0
- package/dist/commands/migration-verify.d.mts +16 -0
- package/dist/commands/migration-verify.d.mts.map +1 -0
- package/dist/commands/migration-verify.mjs +110 -0
- package/dist/commands/migration-verify.mjs.map +1 -0
- package/dist/config-loader-C4VXKl8f.mjs +43 -0
- package/dist/config-loader-C4VXKl8f.mjs.map +1 -0
- package/dist/{config-loader.d.ts → config-loader.d.mts} +8 -3
- package/dist/config-loader.d.mts.map +1 -0
- package/dist/config-loader.mjs +3 -0
- package/dist/contract-emit-D2wDXfyo.mjs +191 -0
- package/dist/contract-emit-D2wDXfyo.mjs.map +1 -0
- package/dist/contract-emit-Zm_sd1wQ.mjs +112 -0
- package/dist/contract-emit-Zm_sd1wQ.mjs.map +1 -0
- package/dist/contract-emit-kN-IkKTE.mjs +6 -0
- package/dist/contract-enrichment-CGW6mm-E.mjs +79 -0
- package/dist/contract-enrichment-CGW6mm-E.mjs.map +1 -0
- package/dist/contract-infer-DozZT511.mjs +90 -0
- package/dist/contract-infer-DozZT511.mjs.map +1 -0
- package/dist/exports/config-types.d.mts +2 -0
- package/dist/exports/config-types.mjs +3 -0
- package/dist/exports/control-api.d.mts +624 -0
- package/dist/exports/control-api.d.mts.map +1 -0
- package/dist/exports/control-api.mjs +8 -0
- package/dist/{load-ts-contract.d.ts → exports/index.d.mts} +12 -7
- package/dist/exports/index.d.mts.map +1 -0
- package/dist/exports/index.mjs +142 -0
- package/dist/exports/index.mjs.map +1 -0
- package/dist/extract-operation-statements-DZUJNmL3.mjs +13 -0
- package/dist/extract-operation-statements-DZUJNmL3.mjs.map +1 -0
- package/dist/extract-sql-ddl-DDMX-9mz.mjs +26 -0
- package/dist/extract-sql-ddl-DDMX-9mz.mjs.map +1 -0
- package/dist/framework-components-BAsliT4V.mjs +59 -0
- package/dist/framework-components-BAsliT4V.mjs.map +1 -0
- package/dist/init-6Pvm_esG.mjs +430 -0
- package/dist/init-6Pvm_esG.mjs.map +1 -0
- package/dist/inspect-live-schema-BYnhztxZ.mjs +91 -0
- package/dist/inspect-live-schema-BYnhztxZ.mjs.map +1 -0
- package/dist/migration-command-scaffold-CntCcntR.mjs +105 -0
- package/dist/migration-command-scaffold-CntCcntR.mjs.map +1 -0
- package/dist/migration-status-CJANY4yr.mjs +1583 -0
- package/dist/migration-status-CJANY4yr.mjs.map +1 -0
- package/dist/migrations-DTZBYXm1.mjs +173 -0
- package/dist/migrations-DTZBYXm1.mjs.map +1 -0
- package/dist/progress-adapter-B-YvmcDu.mjs +43 -0
- package/dist/progress-adapter-B-YvmcDu.mjs.map +1 -0
- package/dist/quick-reference-mongo.md +93 -0
- package/dist/quick-reference-postgres.md +91 -0
- package/dist/result-handler-oK_vA-Fn.mjs +697 -0
- package/dist/result-handler-oK_vA-Fn.mjs.map +1 -0
- package/dist/terminal-ui-C5k88MmW.mjs +274 -0
- package/dist/terminal-ui-C5k88MmW.mjs.map +1 -0
- package/dist/validate-contract-deps-esa-VQ0h.mjs +37 -0
- package/dist/validate-contract-deps-esa-VQ0h.mjs.map +1 -0
- package/dist/verify-DlFQ2FOw.mjs +385 -0
- package/dist/verify-DlFQ2FOw.mjs.map +1 -0
- package/package.json +87 -40
- package/src/cli.ts +118 -58
- package/src/commands/contract-emit.ts +101 -78
- package/src/commands/contract-infer-paths.ts +32 -0
- package/src/commands/contract-infer.ts +143 -0
- package/src/commands/db-init.ts +97 -219
- package/src/commands/db-schema.ts +77 -0
- package/src/commands/db-sign.ts +46 -73
- package/src/commands/db-update.ts +236 -0
- package/src/commands/db-verify.ts +409 -119
- package/src/commands/init/detect-package-manager.ts +47 -0
- package/src/commands/init/index.ts +21 -0
- package/src/commands/init/init.ts +203 -0
- package/src/commands/init/templates/agent-skill-mongo.md +106 -0
- package/src/commands/init/templates/agent-skill-postgres.md +106 -0
- package/src/commands/init/templates/agent-skill.ts +19 -0
- package/src/commands/init/templates/code-templates.ts +168 -0
- package/src/commands/init/templates/quick-reference-mongo.md +93 -0
- package/src/commands/init/templates/quick-reference-postgres.md +91 -0
- package/src/commands/init/templates/quick-reference.ts +19 -0
- package/src/commands/init/templates/render.ts +20 -0
- package/src/commands/init/templates/tsconfig.ts +35 -0
- package/src/commands/inspect-live-schema.ts +170 -0
- package/src/commands/migration-apply.ts +427 -0
- package/src/commands/migration-new.ts +260 -0
- package/src/commands/migration-plan.ts +519 -0
- package/src/commands/migration-ref.ts +305 -0
- package/src/commands/migration-show.ts +246 -0
- package/src/commands/migration-status.ts +864 -0
- package/src/commands/migration-verify.ts +180 -0
- package/src/config-loader.ts +13 -3
- package/src/control-api/client.ts +205 -183
- package/src/control-api/contract-enrichment.ts +119 -0
- package/src/control-api/errors.ts +9 -0
- package/src/control-api/operations/contract-emit.ts +181 -0
- package/src/control-api/operations/db-init.ts +53 -49
- package/src/control-api/operations/db-update.ts +220 -0
- package/src/control-api/operations/extract-operation-statements.ts +14 -0
- package/src/control-api/operations/extract-sql-ddl.ts +47 -0
- package/src/control-api/operations/migration-apply.ts +191 -0
- package/src/control-api/operations/migration-helpers.ts +49 -0
- package/src/control-api/types.ts +274 -52
- package/src/exports/config-types.ts +4 -3
- package/src/exports/control-api.ts +15 -5
- package/src/load-ts-contract.ts +30 -19
- package/src/utils/cli-errors.ts +14 -8
- package/src/utils/command-helpers.ts +302 -3
- package/src/utils/formatters/emit.ts +67 -0
- package/src/utils/formatters/errors.ts +82 -0
- package/src/utils/formatters/graph-migration-mapper.ts +240 -0
- package/src/utils/formatters/graph-render.ts +1323 -0
- package/src/utils/formatters/graph-types.ts +120 -0
- package/src/utils/formatters/help.ts +380 -0
- package/src/utils/formatters/helpers.ts +28 -0
- package/src/utils/formatters/migrations.ts +346 -0
- package/src/utils/formatters/styled.ts +212 -0
- package/src/utils/formatters/verify.ts +621 -0
- package/src/utils/framework-components.ts +13 -10
- package/src/utils/global-flags.ts +41 -23
- package/src/utils/migration-command-scaffold.ts +184 -0
- package/src/utils/migration-types.ts +12 -0
- package/src/utils/progress-adapter.ts +18 -29
- package/src/utils/result-handler.ts +12 -13
- package/src/utils/shutdown.ts +92 -0
- package/src/utils/suggest-command.ts +31 -0
- package/src/utils/terminal-ui.ts +276 -0
- package/src/utils/validate-contract-deps.ts +49 -0
- package/dist/chunk-AGOTG4L3.js +0 -965
- package/dist/chunk-AGOTG4L3.js.map +0 -1
- package/dist/chunk-HLLI4YL7.js +0 -180
- package/dist/chunk-HLLI4YL7.js.map +0 -1
- package/dist/chunk-HWYQOCAJ.js +0 -47
- package/dist/chunk-HWYQOCAJ.js.map +0 -1
- package/dist/chunk-VG2R7DGF.js +0 -735
- package/dist/chunk-VG2R7DGF.js.map +0 -1
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/contract-emit.d.ts +0 -3
- package/dist/commands/contract-emit.d.ts.map +0 -1
- package/dist/commands/contract-emit.js +0 -10
- package/dist/commands/contract-emit.js.map +0 -1
- package/dist/commands/db-init.d.ts +0 -3
- package/dist/commands/db-init.d.ts.map +0 -1
- package/dist/commands/db-init.js +0 -257
- package/dist/commands/db-init.js.map +0 -1
- package/dist/commands/db-introspect.d.ts +0 -3
- package/dist/commands/db-introspect.d.ts.map +0 -1
- package/dist/commands/db-introspect.js +0 -155
- package/dist/commands/db-introspect.js.map +0 -1
- package/dist/commands/db-schema-verify.d.ts +0 -3
- package/dist/commands/db-schema-verify.d.ts.map +0 -1
- package/dist/commands/db-schema-verify.js +0 -171
- package/dist/commands/db-schema-verify.js.map +0 -1
- package/dist/commands/db-sign.d.ts +0 -3
- package/dist/commands/db-sign.d.ts.map +0 -1
- package/dist/commands/db-sign.js +0 -195
- package/dist/commands/db-sign.js.map +0 -1
- package/dist/commands/db-verify.d.ts +0 -3
- package/dist/commands/db-verify.d.ts.map +0 -1
- package/dist/commands/db-verify.js +0 -193
- package/dist/commands/db-verify.js.map +0 -1
- package/dist/config-loader.d.ts.map +0 -1
- package/dist/config-loader.js +0 -7
- package/dist/config-loader.js.map +0 -1
- package/dist/control-api/client.d.ts +0 -13
- package/dist/control-api/client.d.ts.map +0 -1
- package/dist/control-api/operations/db-init.d.ts +0 -29
- package/dist/control-api/operations/db-init.d.ts.map +0 -1
- package/dist/control-api/types.d.ts +0 -387
- package/dist/control-api/types.d.ts.map +0 -1
- package/dist/exports/config-types.d.ts +0 -3
- package/dist/exports/config-types.d.ts.map +0 -1
- package/dist/exports/config-types.js +0 -6
- package/dist/exports/config-types.js.map +0 -1
- package/dist/exports/control-api.d.ts +0 -13
- package/dist/exports/control-api.d.ts.map +0 -1
- package/dist/exports/control-api.js +0 -7
- package/dist/exports/control-api.js.map +0 -1
- package/dist/exports/index.d.ts +0 -4
- package/dist/exports/index.d.ts.map +0 -1
- package/dist/exports/index.js +0 -176
- package/dist/exports/index.js.map +0 -1
- package/dist/load-ts-contract.d.ts.map +0 -1
- package/dist/utils/cli-errors.d.ts +0 -7
- package/dist/utils/cli-errors.d.ts.map +0 -1
- package/dist/utils/command-helpers.d.ts +0 -12
- package/dist/utils/command-helpers.d.ts.map +0 -1
- package/dist/utils/framework-components.d.ts +0 -70
- package/dist/utils/framework-components.d.ts.map +0 -1
- package/dist/utils/global-flags.d.ts +0 -25
- package/dist/utils/global-flags.d.ts.map +0 -1
- package/dist/utils/output.d.ts +0 -142
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/progress-adapter.d.ts +0 -26
- package/dist/utils/progress-adapter.d.ts.map +0 -1
- package/dist/utils/result-handler.d.ts +0 -15
- package/dist/utils/result-handler.d.ts.map +0 -1
- package/src/commands/db-introspect.ts +0 -227
- package/src/commands/db-schema-verify.ts +0 -238
- package/src/utils/output.ts +0 -1471
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { b as formatDim, x as isVerbose, y as createColorFormatter } from "./result-handler-oK_vA-Fn.mjs";
|
|
2
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
3
|
+
import { bold, cyan, dim, green, magenta, red, yellow } from "colorette";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/formatters/verify.ts
|
|
6
|
+
/**
|
|
7
|
+
* Formats human-readable output for database verify.
|
|
8
|
+
*/
|
|
9
|
+
function formatVerifyOutput(result, flags) {
|
|
10
|
+
if (flags.quiet) return "";
|
|
11
|
+
const lines = [];
|
|
12
|
+
const useColor = flags.color !== false;
|
|
13
|
+
const formatGreen = createColorFormatter(useColor, green);
|
|
14
|
+
const formatYellow = createColorFormatter(useColor, yellow);
|
|
15
|
+
const formatDimText = (text) => formatDim(useColor, text);
|
|
16
|
+
const verificationMode = result.mode === "full" ? `marker + schema${result.schema?.strict ? " (strict)" : " (tolerant)"}` : "marker only (--marker-only)";
|
|
17
|
+
lines.push(`${formatGreen("✔")} ${result.summary}`);
|
|
18
|
+
lines.push(`${formatDimText(` verification: ${verificationMode}`)}`);
|
|
19
|
+
lines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);
|
|
20
|
+
if (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);
|
|
21
|
+
if (result.mode === "full" && result.schema && isVerbose(flags, 1)) lines.push(`${formatDimText(` schema: pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`);
|
|
22
|
+
if (result.warning) {
|
|
23
|
+
lines.push("");
|
|
24
|
+
lines.push(`${formatYellow("⚠")} ${result.warning}`);
|
|
25
|
+
}
|
|
26
|
+
if (isVerbose(flags, 1)) {
|
|
27
|
+
if (result.codecCoverageSkipped) lines.push(`${formatDimText(" Codec coverage check skipped (helper returned no supported types)")}`);
|
|
28
|
+
lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
|
|
29
|
+
}
|
|
30
|
+
return lines.join("\n");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Formats JSON output for database verify.
|
|
34
|
+
*/
|
|
35
|
+
function formatVerifyJson(result) {
|
|
36
|
+
const output = {
|
|
37
|
+
ok: result.ok,
|
|
38
|
+
summary: result.summary,
|
|
39
|
+
mode: result.mode,
|
|
40
|
+
contract: result.contract,
|
|
41
|
+
...ifDefined("marker", result.marker),
|
|
42
|
+
target: result.target,
|
|
43
|
+
...ifDefined("missingCodecs", result.missingCodecs),
|
|
44
|
+
...ifDefined("codecCoverageSkipped", result.codecCoverageSkipped),
|
|
45
|
+
...ifDefined("schema", result.schema),
|
|
46
|
+
...ifDefined("warning", result.warning),
|
|
47
|
+
...ifDefined("meta", result.meta),
|
|
48
|
+
timings: result.timings
|
|
49
|
+
};
|
|
50
|
+
return JSON.stringify(output, null, 2);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Formats JSON output for database introspection.
|
|
54
|
+
*/
|
|
55
|
+
function formatIntrospectJson(result) {
|
|
56
|
+
return JSON.stringify(result, null, 2);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders a schema tree structure from CoreSchemaView.
|
|
60
|
+
* Matches the style of renderSchemaVerificationTree for consistency.
|
|
61
|
+
*/
|
|
62
|
+
function renderSchemaTree(node, flags, options) {
|
|
63
|
+
const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;
|
|
64
|
+
const lines = [];
|
|
65
|
+
let formattedLabel = node.label;
|
|
66
|
+
if (useColor) switch (node.kind) {
|
|
67
|
+
case "root":
|
|
68
|
+
formattedLabel = bold(node.label);
|
|
69
|
+
break;
|
|
70
|
+
case "entity": {
|
|
71
|
+
const tableMatch = node.label.match(/^table\s+(.+)$/);
|
|
72
|
+
if (tableMatch?.[1]) {
|
|
73
|
+
const tableName = tableMatch[1];
|
|
74
|
+
formattedLabel = `${dim("table")} ${cyan(tableName)}`;
|
|
75
|
+
} else formattedLabel = cyan(node.label);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case "collection":
|
|
79
|
+
formattedLabel = dim(node.label);
|
|
80
|
+
break;
|
|
81
|
+
case "field": {
|
|
82
|
+
const columnMatch = node.label.match(/^([^:]+):\s*(.+)$/);
|
|
83
|
+
if (columnMatch?.[1] && columnMatch[2]) {
|
|
84
|
+
const columnName = columnMatch[1];
|
|
85
|
+
const rest = columnMatch[2];
|
|
86
|
+
const typeMatch = rest.match(/^([^\s(]+)\s*(\([^)]+\))$/);
|
|
87
|
+
if (typeMatch?.[1] && typeMatch[2]) {
|
|
88
|
+
const typeDisplay = typeMatch[1];
|
|
89
|
+
const nullability = typeMatch[2];
|
|
90
|
+
formattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;
|
|
91
|
+
} else formattedLabel = `${cyan(columnName)}: ${rest}`;
|
|
92
|
+
} else formattedLabel = node.label;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case "index": {
|
|
96
|
+
const pkMatch = node.label.match(/^primary key:\s*(.+)$/);
|
|
97
|
+
if (pkMatch?.[1]) {
|
|
98
|
+
const columnNames = pkMatch[1];
|
|
99
|
+
formattedLabel = `${dim("primary key")}: ${cyan(columnNames)}`;
|
|
100
|
+
} else {
|
|
101
|
+
const uniqueMatch = node.label.match(/^unique\s+(.+)$/);
|
|
102
|
+
if (uniqueMatch?.[1]) {
|
|
103
|
+
const name = uniqueMatch[1];
|
|
104
|
+
formattedLabel = `${dim("unique")} ${cyan(name)}`;
|
|
105
|
+
} else {
|
|
106
|
+
const indexMatch = node.label.match(/^(unique\s+)?index\s+(.+)$/);
|
|
107
|
+
if (indexMatch?.[2]) {
|
|
108
|
+
const indexPrefix = indexMatch[1] ? `${dim("unique")} ` : "";
|
|
109
|
+
const name = indexMatch[2];
|
|
110
|
+
formattedLabel = `${indexPrefix}${dim("index")} ${cyan(name)}`;
|
|
111
|
+
} else formattedLabel = dim(node.label);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "dependency": {
|
|
117
|
+
const extMatch = node.label.match(/^([^\s]+)\s+(extension is enabled)$/);
|
|
118
|
+
if (extMatch?.[1] && extMatch[2]) {
|
|
119
|
+
const extName = extMatch[1];
|
|
120
|
+
const rest = extMatch[2];
|
|
121
|
+
formattedLabel = `${cyan(extName)} ${dim(rest)}`;
|
|
122
|
+
} else formattedLabel = magenta(node.label);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
default:
|
|
126
|
+
formattedLabel = node.label;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (isRoot) lines.push(formattedLabel);
|
|
130
|
+
else {
|
|
131
|
+
const treePrefix = `${formatDimText(isLast ? "└" : "├")}─ `;
|
|
132
|
+
lines.push(`${prefix}${treePrefix}${formattedLabel}`);
|
|
133
|
+
}
|
|
134
|
+
if (node.children && node.children.length > 0) {
|
|
135
|
+
const childPrefix = isRoot ? "" : `${prefix}${isLast ? " " : `${formatDimText("│")} `}`;
|
|
136
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
137
|
+
const child = node.children[i];
|
|
138
|
+
if (!child) continue;
|
|
139
|
+
const childLines = renderSchemaTree(child, flags, {
|
|
140
|
+
isLast: i === node.children.length - 1,
|
|
141
|
+
prefix: childPrefix,
|
|
142
|
+
useColor,
|
|
143
|
+
formatDimText,
|
|
144
|
+
isRoot: false
|
|
145
|
+
});
|
|
146
|
+
lines.push(...childLines);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return lines;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Formats human-readable output for database introspection.
|
|
153
|
+
*/
|
|
154
|
+
function formatIntrospectOutput(result, schemaView, flags) {
|
|
155
|
+
if (flags.quiet) return "";
|
|
156
|
+
const lines = [];
|
|
157
|
+
const useColor = flags.color !== false;
|
|
158
|
+
const formatDimText = (text) => formatDim(useColor, text);
|
|
159
|
+
if (schemaView) {
|
|
160
|
+
const treeLines = renderSchemaTree(schemaView.root, flags, {
|
|
161
|
+
isLast: true,
|
|
162
|
+
prefix: "",
|
|
163
|
+
useColor,
|
|
164
|
+
formatDimText,
|
|
165
|
+
isRoot: true
|
|
166
|
+
});
|
|
167
|
+
lines.push(...treeLines);
|
|
168
|
+
} else {
|
|
169
|
+
lines.push(`✔ ${result.summary}`);
|
|
170
|
+
if (isVerbose(flags, 1)) {
|
|
171
|
+
lines.push(` Target: ${result.target.familyId}/${result.target.id}`);
|
|
172
|
+
if (result.meta?.dbUrl) lines.push(` Database: ${result.meta.dbUrl}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
|
|
176
|
+
return lines.join("\n");
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Renders a schema verification tree structure from SchemaVerificationNode.
|
|
180
|
+
* Similar to renderSchemaTree but for verification nodes with status-based colors and glyphs.
|
|
181
|
+
*/
|
|
182
|
+
function renderSchemaVerificationTree(node, flags, options) {
|
|
183
|
+
const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;
|
|
184
|
+
const lines = [];
|
|
185
|
+
let statusGlyph = "";
|
|
186
|
+
let statusColor = (text) => text;
|
|
187
|
+
if (useColor) switch (node.status) {
|
|
188
|
+
case "pass":
|
|
189
|
+
statusGlyph = "✔";
|
|
190
|
+
statusColor = green;
|
|
191
|
+
break;
|
|
192
|
+
case "warn":
|
|
193
|
+
statusGlyph = "⚠";
|
|
194
|
+
statusColor = (text) => useColor ? yellow(text) : text;
|
|
195
|
+
break;
|
|
196
|
+
case "fail":
|
|
197
|
+
statusGlyph = "✖";
|
|
198
|
+
statusColor = red;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
else switch (node.status) {
|
|
202
|
+
case "pass":
|
|
203
|
+
statusGlyph = "✔";
|
|
204
|
+
break;
|
|
205
|
+
case "warn":
|
|
206
|
+
statusGlyph = "⚠";
|
|
207
|
+
break;
|
|
208
|
+
case "fail":
|
|
209
|
+
statusGlyph = "✖";
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
let labelColor = (text) => text;
|
|
213
|
+
let formattedLabel = node.name;
|
|
214
|
+
if (useColor) switch (node.kind) {
|
|
215
|
+
case "contract":
|
|
216
|
+
case "schema":
|
|
217
|
+
labelColor = bold;
|
|
218
|
+
formattedLabel = labelColor(node.name);
|
|
219
|
+
break;
|
|
220
|
+
case "table": {
|
|
221
|
+
const tableMatch = node.name.match(/^table\s+(.+)$/);
|
|
222
|
+
if (tableMatch?.[1]) {
|
|
223
|
+
const tableName = tableMatch[1];
|
|
224
|
+
formattedLabel = `${dim("table")} ${cyan(tableName)}`;
|
|
225
|
+
} else formattedLabel = dim(node.name);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case "columns":
|
|
229
|
+
labelColor = dim;
|
|
230
|
+
formattedLabel = labelColor(node.name);
|
|
231
|
+
break;
|
|
232
|
+
case "column": {
|
|
233
|
+
const columnMatch = node.name.match(/^([^:]+):\s*(.+)$/);
|
|
234
|
+
if (columnMatch?.[1] && columnMatch[2]) {
|
|
235
|
+
const columnName = columnMatch[1];
|
|
236
|
+
const rest = columnMatch[2];
|
|
237
|
+
const typeMatch = rest.match(/^([^\s→]+)\s*→\s*([^\s(]+)\s*(\([^)]+\))$/);
|
|
238
|
+
if (typeMatch?.[1] && typeMatch[2] && typeMatch[3]) {
|
|
239
|
+
const contractType = typeMatch[1];
|
|
240
|
+
const nativeType = typeMatch[2];
|
|
241
|
+
const nullability = typeMatch[3];
|
|
242
|
+
formattedLabel = `${cyan(columnName)}: ${contractType} → ${dim(nativeType)} ${dim(nullability)}`;
|
|
243
|
+
} else formattedLabel = `${cyan(columnName)}: ${rest}`;
|
|
244
|
+
} else formattedLabel = node.name;
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
case "type":
|
|
248
|
+
case "nullability":
|
|
249
|
+
labelColor = (text) => text;
|
|
250
|
+
formattedLabel = labelColor(node.name);
|
|
251
|
+
break;
|
|
252
|
+
case "primaryKey": {
|
|
253
|
+
const pkMatch = node.name.match(/^primary key:\s*(.+)$/);
|
|
254
|
+
if (pkMatch?.[1]) {
|
|
255
|
+
const columnNames = pkMatch[1];
|
|
256
|
+
formattedLabel = `${dim("primary key")}: ${cyan(columnNames)}`;
|
|
257
|
+
} else formattedLabel = dim(node.name);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
case "foreignKey":
|
|
261
|
+
case "unique":
|
|
262
|
+
case "index":
|
|
263
|
+
labelColor = dim;
|
|
264
|
+
formattedLabel = labelColor(node.name);
|
|
265
|
+
break;
|
|
266
|
+
case "dependency": {
|
|
267
|
+
const dbMatch = node.name.match(/^database is\s+(.+)$/);
|
|
268
|
+
if (dbMatch?.[1]) {
|
|
269
|
+
const dbName = dbMatch[1];
|
|
270
|
+
formattedLabel = `${dim("database is")} ${cyan(dbName)}`;
|
|
271
|
+
} else {
|
|
272
|
+
const extMatch = node.name.match(/^([^\s]+)\s+(extension is enabled)$/);
|
|
273
|
+
if (extMatch?.[1] && extMatch[2]) {
|
|
274
|
+
const extName = extMatch[1];
|
|
275
|
+
const rest = extMatch[2];
|
|
276
|
+
formattedLabel = `${cyan(extName)} ${dim(rest)}`;
|
|
277
|
+
} else {
|
|
278
|
+
labelColor = magenta;
|
|
279
|
+
formattedLabel = labelColor(node.name);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
default:
|
|
285
|
+
formattedLabel = node.name;
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
else formattedLabel = node.name;
|
|
289
|
+
const statusGlyphColored = statusColor(statusGlyph);
|
|
290
|
+
let nodeLabel = formattedLabel;
|
|
291
|
+
if ((node.status === "fail" || node.status === "warn") && node.message && node.message.length > 0) {
|
|
292
|
+
const messageText = formatDimText(`(${node.message})`);
|
|
293
|
+
nodeLabel = `${formattedLabel} ${messageText}`;
|
|
294
|
+
}
|
|
295
|
+
if (isRoot) lines.push(`${statusGlyphColored} ${nodeLabel}`);
|
|
296
|
+
else {
|
|
297
|
+
const treePrefix = `${formatDimText(isLast ? "└" : "├")}─ `;
|
|
298
|
+
lines.push(`${prefix}${treePrefix}${statusGlyphColored} ${nodeLabel}`);
|
|
299
|
+
}
|
|
300
|
+
if (node.children && node.children.length > 0) {
|
|
301
|
+
const childPrefix = isRoot ? "" : `${prefix}${isLast ? " " : `${formatDimText("│")} `}`;
|
|
302
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
303
|
+
const child = node.children[i];
|
|
304
|
+
if (!child) continue;
|
|
305
|
+
const childLines = renderSchemaVerificationTree(child, flags, {
|
|
306
|
+
isLast: i === node.children.length - 1,
|
|
307
|
+
prefix: childPrefix,
|
|
308
|
+
useColor,
|
|
309
|
+
formatDimText,
|
|
310
|
+
isRoot: false
|
|
311
|
+
});
|
|
312
|
+
lines.push(...childLines);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return lines;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Formats human-readable output for database schema verification.
|
|
319
|
+
*/
|
|
320
|
+
function formatSchemaVerifyOutput(result, flags) {
|
|
321
|
+
if (flags.quiet) return "";
|
|
322
|
+
const lines = [];
|
|
323
|
+
const useColor = flags.color !== false;
|
|
324
|
+
const formatGreen = createColorFormatter(useColor, green);
|
|
325
|
+
const formatRed = createColorFormatter(useColor, red);
|
|
326
|
+
const formatDimText = (text) => formatDim(useColor, text);
|
|
327
|
+
const treeLines = renderSchemaVerificationTree(result.schema.root, flags, {
|
|
328
|
+
isLast: true,
|
|
329
|
+
prefix: "",
|
|
330
|
+
useColor,
|
|
331
|
+
formatDimText,
|
|
332
|
+
isRoot: true
|
|
333
|
+
});
|
|
334
|
+
lines.push(...treeLines);
|
|
335
|
+
if (isVerbose(flags, 1)) {
|
|
336
|
+
lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
|
|
337
|
+
lines.push(`${formatDimText(` pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`);
|
|
338
|
+
}
|
|
339
|
+
lines.push("");
|
|
340
|
+
if (result.ok) lines.push(`${formatGreen("✔")} ${result.summary}`);
|
|
341
|
+
else {
|
|
342
|
+
const codeText = result.code ? ` (${result.code})` : "";
|
|
343
|
+
lines.push(`${formatRed("✖")} ${result.summary}${codeText}`);
|
|
344
|
+
}
|
|
345
|
+
return lines.join("\n");
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Formats JSON output for database schema verification.
|
|
349
|
+
*/
|
|
350
|
+
function formatSchemaVerifyJson(result) {
|
|
351
|
+
return JSON.stringify(result, null, 2);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Formats human-readable output for database sign.
|
|
355
|
+
*/
|
|
356
|
+
function formatSignOutput(result, flags) {
|
|
357
|
+
if (flags.quiet) return "";
|
|
358
|
+
const lines = [];
|
|
359
|
+
const useColor = flags.color !== false;
|
|
360
|
+
const formatGreen = createColorFormatter(useColor, green);
|
|
361
|
+
const formatDimText = (text) => formatDim(useColor, text);
|
|
362
|
+
if (result.ok) {
|
|
363
|
+
lines.push(`${formatGreen("✔")} Database signed`);
|
|
364
|
+
const previousHash = result.marker.previous?.storageHash ?? "none";
|
|
365
|
+
const currentHash = result.contract.storageHash;
|
|
366
|
+
lines.push(`${formatDimText(` from: ${previousHash}`)}`);
|
|
367
|
+
lines.push(`${formatDimText(` to: ${currentHash}`)}`);
|
|
368
|
+
if (isVerbose(flags, 1)) {
|
|
369
|
+
if (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);
|
|
370
|
+
if (result.marker.previous?.profileHash) lines.push(`${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`);
|
|
371
|
+
lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return lines.join("\n");
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Formats JSON output for database sign.
|
|
378
|
+
*/
|
|
379
|
+
function formatSignJson(result) {
|
|
380
|
+
return JSON.stringify(result, null, 2);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
//#endregion
|
|
384
|
+
export { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };
|
|
385
|
+
//# sourceMappingURL=verify-DlFQ2FOw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-DlFQ2FOw.mjs","names":["lines: string[]","formattedLabel: string","statusColor: (text: string) => string","labelColor: (text: string) => string"],"sources":["../src/utils/formatters/verify.ts"],"sourcesContent":["import type {\n CoreSchemaView,\n IntrospectSchemaResult,\n SchemaTreeNode,\n SchemaVerificationNode,\n SignDatabaseResult,\n VerifyDatabaseResult,\n VerifyDatabaseSchemaResult,\n} from '@prisma-next/framework-components/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { bold, cyan, dim, green, magenta, red, yellow } from 'colorette';\nimport type { GlobalFlags } from '../global-flags';\nimport { createColorFormatter, formatDim, isVerbose } from './helpers';\n\n// ============================================================================\n// Verify Output Formatters\n// ============================================================================\n\nexport interface DbVerifyCommandSuccessResult {\n readonly ok: true;\n readonly mode: 'full' | 'marker-only';\n readonly summary: string;\n readonly contract: VerifyDatabaseResult['contract'];\n readonly marker?: VerifyDatabaseResult['marker'];\n readonly target: VerifyDatabaseResult['target'];\n readonly missingCodecs?: VerifyDatabaseResult['missingCodecs'];\n readonly codecCoverageSkipped?: VerifyDatabaseResult['codecCoverageSkipped'];\n readonly schema?: {\n readonly summary: string;\n readonly counts: VerifyDatabaseSchemaResult['schema']['counts'];\n readonly strict: boolean;\n };\n readonly warning?: string;\n readonly meta?:\n | (NonNullable<VerifyDatabaseResult['meta']> & {\n readonly schemaVerification: 'performed' | 'skipped';\n })\n | {\n readonly schemaVerification: 'performed' | 'skipped';\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\n/**\n * Formats human-readable output for database verify.\n */\nexport function formatVerifyOutput(\n result: DbVerifyCommandSuccessResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatYellow = createColorFormatter(useColor, yellow);\n const formatDimText = (text: string) => formatDim(useColor, text);\n const verificationMode =\n result.mode === 'full'\n ? `marker + schema${result.schema?.strict ? ' (strict)' : ' (tolerant)'}`\n : 'marker only (--marker-only)';\n\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n lines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n lines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.mode === 'full' && result.schema && isVerbose(flags, 1)) {\n lines.push(\n `${formatDimText(` schema: pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n if (result.warning) {\n lines.push('');\n lines.push(`${formatYellow('⚠')} ${result.warning}`);\n }\n\n if (isVerbose(flags, 1)) {\n if (result.codecCoverageSkipped) {\n lines.push(\n `${formatDimText(' Codec coverage check skipped (helper returned no supported types)')}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database verify.\n */\nexport function formatVerifyJson(result: DbVerifyCommandSuccessResult): string {\n const output = {\n ok: result.ok,\n summary: result.summary,\n mode: result.mode,\n contract: result.contract,\n ...ifDefined('marker', result.marker),\n target: result.target,\n ...ifDefined('missingCodecs', result.missingCodecs),\n ...ifDefined('codecCoverageSkipped', result.codecCoverageSkipped),\n ...ifDefined('schema', result.schema),\n ...ifDefined('warning', result.warning),\n ...ifDefined('meta', result.meta),\n timings: result.timings,\n };\n\n return JSON.stringify(output, null, 2);\n}\n\n/**\n * Formats JSON output for database introspection.\n */\nexport function formatIntrospectJson(result: IntrospectSchemaResult<unknown>): string {\n return JSON.stringify(result, null, 2);\n}\n\n/**\n * Renders a schema tree structure from CoreSchemaView.\n * Matches the style of renderSchemaVerificationTree for consistency.\n */\nfunction renderSchemaTree(\n node: SchemaTreeNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format node label with color based on kind (matching schema-verify style)\n let formattedLabel: string = node.label;\n\n if (useColor) {\n switch (node.kind) {\n case 'root':\n formattedLabel = bold(node.label);\n break;\n case 'entity': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.label.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n // Fallback: color entire label with cyan\n formattedLabel = cyan(node.label);\n }\n break;\n }\n case 'collection': {\n // \"columns\" grouping node - dim the label\n formattedLabel = dim(node.label);\n break;\n }\n case 'field': {\n // Parse column name format: \"columnName: typeDisplay (nullability)\"\n // Color code: column name (cyan), type (default), nullability (dim)\n const columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"typeDisplay (nullability)\"\n const typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2]) {\n const typeDisplay = typeMatch[1];\n const nullability = typeMatch[2];\n formattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.label;\n }\n break;\n }\n case 'index': {\n // Parse index/unique constraint/primary key formats\n // \"primary key: columnName\" -> dim \"primary key\", cyan columnName\n const pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n // \"unique name\" -> dim \"unique\", cyan \"name\"\n const uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n if (uniqueMatch?.[1]) {\n const name = uniqueMatch[1];\n formattedLabel = `${dim('unique')} ${cyan(name)}`;\n } else {\n // \"index name\" or \"unique index name\" -> dim label prefix, cyan name\n const indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n if (indexMatch?.[2]) {\n const indexPrefix = indexMatch[1] ? `${dim('unique')} ` : '';\n const name = indexMatch[2];\n formattedLabel = `${indexPrefix}${dim('index')} ${cyan(name)}`;\n } else {\n formattedLabel = dim(node.label);\n }\n }\n }\n break;\n }\n case 'dependency': {\n // Parse extension message formats similar to schema-verify\n // \"extensionName extension is enabled\" -> cyan extensionName, dim rest\n const extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire label with magenta\n formattedLabel = magenta(node.label);\n }\n break;\n }\n default:\n formattedLabel = node.label;\n break;\n }\n }\n\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(formattedLabel);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${formattedLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database introspection.\n */\nexport function formatIntrospectOutput(\n result: IntrospectSchemaResult<unknown>,\n schemaView: CoreSchemaView | undefined,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (schemaView) {\n // Render tree structure - root node is special (no tree characters)\n const treeLines = renderSchemaTree(schemaView.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n } else {\n // Fallback: print summary when toSchemaView is not available\n lines.push(`✔ ${result.summary}`);\n if (isVerbose(flags, 1)) {\n lines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n if (result.meta?.dbUrl) {\n lines.push(` Database: ${result.meta.dbUrl}`);\n }\n }\n }\n\n // Add timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Renders a schema verification tree structure from SchemaVerificationNode.\n * Similar to renderSchemaTree but for verification nodes with status-based colors and glyphs.\n */\nfunction renderSchemaVerificationTree(\n node: SchemaVerificationNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format status glyph and color based on status\n let statusGlyph = '';\n let statusColor: (text: string) => string = (text) => text;\n if (useColor) {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n statusColor = green;\n break;\n case 'warn':\n statusGlyph = '⚠';\n statusColor = (text) => (useColor ? yellow(text) : text);\n break;\n case 'fail':\n statusGlyph = '✖';\n statusColor = red;\n break;\n }\n } else {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n break;\n case 'warn':\n statusGlyph = '⚠';\n break;\n case 'fail':\n statusGlyph = '✖';\n break;\n }\n }\n\n // Format node label with color based on kind\n // For column nodes, we need to parse the name to color code different parts\n let labelColor: (text: string) => string = (text) => text;\n let formattedLabel: string = node.name;\n\n if (useColor) {\n switch (node.kind) {\n case 'contract':\n case 'schema':\n labelColor = bold;\n formattedLabel = labelColor(node.name);\n break;\n case 'table': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.name.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'columns':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'column': {\n // Parse column name format: \"columnName: contractType -> nativeType (nullability)\"\n // Color code: column name (cyan), contract type (default), native type (dim), nullability (dim)\n const columnMatch = node.name.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"contractType -> nativeType (nullability)\"\n // Match contract type (can contain /, @, etc.), arrow, native type, then nullability in parentheses\n const typeMatch = rest.match(/^([^\\s→]+)\\s*→\\s*([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2] && typeMatch[3]) {\n const contractType = typeMatch[1];\n const nativeType = typeMatch[2];\n const nullability = typeMatch[3];\n formattedLabel = `${cyan(columnName)}: ${contractType} → ${dim(nativeType)} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match (e.g., no native type or no nullability)\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.name;\n }\n break;\n }\n case 'type':\n case 'nullability':\n labelColor = (text) => text; // Default color\n formattedLabel = labelColor(node.name);\n break;\n case 'primaryKey': {\n // Parse \"primary key: columnName\" format - color \"primary key\" dim, columnName cyan\n const pkMatch = node.name.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'foreignKey':\n case 'unique':\n case 'index':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'dependency': {\n // Parse specific extension message formats\n // \"database is postgres\" -> dim \"database is\", cyan \"postgres\"\n const dbMatch = node.name.match(/^database is\\s+(.+)$/);\n if (dbMatch?.[1]) {\n const dbName = dbMatch[1];\n formattedLabel = `${dim('database is')} ${cyan(dbName)}`;\n } else {\n // \"vector extension is enabled\" -> dim everything except extension name\n // Match pattern: \"extensionName extension is enabled\"\n const extMatch = node.name.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire name with magenta\n labelColor = magenta;\n formattedLabel = labelColor(node.name);\n }\n }\n break;\n }\n default:\n formattedLabel = node.name;\n break;\n }\n } else {\n formattedLabel = node.name;\n }\n\n const statusGlyphColored = statusColor(statusGlyph);\n\n // Build the label with optional message for failure/warn nodes\n let nodeLabel = formattedLabel;\n if (\n (node.status === 'fail' || node.status === 'warn') &&\n node.message &&\n node.message.length > 0\n ) {\n // Always show message for failure/warn nodes - it provides crucial context\n // For parent nodes, the message summarizes child failures\n // For leaf nodes, the message explains the specific issue\n const messageText = formatDimText(`(${node.message})`);\n nodeLabel = `${formattedLabel} ${messageText}`;\n }\n\n // Root node renders without tree characters or | prefix\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(`${statusGlyphColored} ${nodeLabel}`);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${statusGlyphColored} ${nodeLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaVerificationTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database schema verification.\n */\nexport function formatSchemaVerifyOutput(\n result: VerifyDatabaseSchemaResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatRed = createColorFormatter(useColor, red);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n // Render verification tree first\n const treeLines = renderSchemaVerificationTree(result.schema.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n\n // Add counts and timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n lines.push(\n `${formatDimText(` pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n\n // Blank line before summary\n lines.push('');\n\n // Summary line at the end: summary with status glyph\n if (result.ok) {\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n } else {\n const codeText = result.code ? ` (${result.code})` : '';\n lines.push(`${formatRed('✖')} ${result.summary}${codeText}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database schema verification.\n */\nexport function formatSchemaVerifyJson(result: VerifyDatabaseSchemaResult): string {\n return JSON.stringify(result, null, 2);\n}\n\n// ============================================================================\n// Sign Output Formatters\n// ============================================================================\n\n/**\n * Formats human-readable output for database sign.\n */\nexport function formatSignOutput(result: SignDatabaseResult, flags: GlobalFlags): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (result.ok) {\n // Main success message in white (not dimmed)\n lines.push(`${formatGreen('✔')} Database signed`);\n\n // Show from -> to hashes with clear labels\n const previousHash = result.marker.previous?.storageHash ?? 'none';\n const currentHash = result.contract.storageHash;\n\n lines.push(`${formatDimText(` from: ${previousHash}`)}`);\n lines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\n if (isVerbose(flags, 1)) {\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.marker.previous?.profileHash) {\n lines.push(\n `${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database sign.\n */\nexport function formatSignJson(result: SignDatabaseResult): string {\n return JSON.stringify(result, null, 2);\n}\n"],"mappings":";;;;;;;;AAgDA,SAAgB,mBACd,QACA,OACQ;AACR,KAAI,MAAM,MACR,QAAO;CAGT,MAAMA,QAAkB,EAAE;CAE1B,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,MAAM;CACzD,MAAM,eAAe,qBAAqB,UAAU,OAAO;CAC3D,MAAM,iBAAiB,SAAiB,UAAU,UAAU,KAAK;CACjE,MAAM,mBACJ,OAAO,SAAS,SACZ,kBAAkB,OAAO,QAAQ,SAAS,cAAc,kBACxD;AAEN,OAAM,KAAK,GAAG,YAAY,IAAI,CAAC,GAAG,OAAO,UAAU;AACnD,OAAM,KAAK,GAAG,cAAc,mBAAmB,mBAAmB,GAAG;AACrE,OAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,cAAc,GAAG;AAC/E,KAAI,OAAO,SAAS,YAClB,OAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,cAAc,GAAG;AAEjF,KAAI,OAAO,SAAS,UAAU,OAAO,UAAU,UAAU,OAAO,EAAE,CAChE,OAAM,KACJ,GAAG,cAAc,kBAAkB,OAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,OAAO,OAAO,OAAO,GACpI;AAEH,KAAI,OAAO,SAAS;AAClB,QAAM,KAAK,GAAG;AACd,QAAM,KAAK,GAAG,aAAa,IAAI,CAAC,GAAG,OAAO,UAAU;;AAGtD,KAAI,UAAU,OAAO,EAAE,EAAE;AACvB,MAAI,OAAO,qBACT,OAAM,KACJ,GAAG,cAAc,sEAAsE,GACxF;AAEH,QAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,IAAI,GAAG;;AAG3E,QAAO,MAAM,KAAK,KAAK;;;;;AAMzB,SAAgB,iBAAiB,QAA8C;CAC7E,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KAAK,KAAK;;;;;AAMzB,SAAgB,uBAAuB,QAA4C;AACjF,QAAO,KAAK,UAAU,QAAQ,MAAM,EAAE;;;;;AAUxC,SAAgB,iBAAiB,QAA4B,OAA4B;AACvF,KAAI,MAAM,MACR,QAAO;CAGT,MAAMA,QAAkB,EAAE;CAE1B,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,MAAM;CACzD,MAAM,iBAAiB,SAAiB,UAAU,UAAU,KAAK;AAEjE,KAAI,OAAO,IAAI;AAEb,QAAM,KAAK,GAAG,YAAY,IAAI,CAAC,kBAAkB;EAGjD,MAAM,eAAe,OAAO,OAAO,UAAU,eAAe;EAC5D,MAAM,cAAc,OAAO,SAAS;AAEpC,QAAM,KAAK,GAAG,cAAc,WAAW,eAAe,GAAG;AACzD,QAAM,KAAK,GAAG,cAAc,WAAW,cAAc,GAAG;AAExD,MAAI,UAAU,OAAO,EAAE,EAAE;AACvB,OAAI,OAAO,SAAS,YAClB,OAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,cAAc,GAAG;AAEjF,OAAI,OAAO,OAAO,UAAU,YAC1B,OAAM,KACJ,GAAG,cAAc,2BAA2B,OAAO,OAAO,SAAS,cAAc,GAClF;AAEH,SAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,IAAI,GAAG;;;AAI7E,QAAO,MAAM,KAAK,KAAK;;;;;AAMzB,SAAgB,eAAe,QAAoC;AACjE,QAAO,KAAK,UAAU,QAAQ,MAAM,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/cli",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -11,83 +11,130 @@
|
|
|
11
11
|
"prisma-next": "./dist/cli.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@clack/prompts": "^1.1.0",
|
|
15
|
+
"@dagrejs/dagre": "^3.0.0",
|
|
14
16
|
"arktype": "^2.0.0",
|
|
15
17
|
"c12": "^3.3.2",
|
|
18
|
+
"closest-match": "^1.3.3",
|
|
16
19
|
"colorette": "^2.0.20",
|
|
17
20
|
"commander": "^12.0.0",
|
|
18
|
-
"esbuild": "^0.
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
+
"esbuild": "^0.25.11",
|
|
22
|
+
"package-manager-detector": "^1.6.0",
|
|
23
|
+
"pathe": "^2.0.3",
|
|
24
|
+
"string-width": "^8.2.0",
|
|
21
25
|
"strip-ansi": "^7.1.2",
|
|
22
|
-
"wrap-ansi": "^
|
|
23
|
-
"@prisma-next/
|
|
24
|
-
"@prisma-next/
|
|
25
|
-
"@prisma-next/emitter": "0.3.0
|
|
26
|
-
"@prisma-next/
|
|
26
|
+
"wrap-ansi": "^10.0.0",
|
|
27
|
+
"@prisma-next/config": "0.3.0",
|
|
28
|
+
"@prisma-next/contract": "0.3.0",
|
|
29
|
+
"@prisma-next/emitter": "0.3.0",
|
|
30
|
+
"@prisma-next/errors": "0.3.0",
|
|
31
|
+
"@prisma-next/framework-components": "0.3.0",
|
|
32
|
+
"@prisma-next/migration-tools": "0.3.0",
|
|
33
|
+
"@prisma-next/psl-printer": "0.3.0",
|
|
34
|
+
"@prisma-next/utils": "0.3.0"
|
|
27
35
|
},
|
|
28
36
|
"devDependencies": {
|
|
29
37
|
"@types/node": "24.10.4",
|
|
30
|
-
"
|
|
38
|
+
"tsdown": "0.18.4",
|
|
31
39
|
"typescript": "5.9.3",
|
|
32
|
-
"vitest": "4.0.
|
|
33
|
-
"@prisma-next/sql-contract": "0.3.0
|
|
34
|
-
"@prisma-next/sql-contract-
|
|
35
|
-
"@prisma-next/sql-
|
|
36
|
-
"@prisma-next/sql-
|
|
37
|
-
"@prisma-next/sql-
|
|
40
|
+
"vitest": "4.0.17",
|
|
41
|
+
"@prisma-next/sql-contract": "0.3.0",
|
|
42
|
+
"@prisma-next/sql-contract-ts": "0.3.0",
|
|
43
|
+
"@prisma-next/sql-operations": "0.3.0",
|
|
44
|
+
"@prisma-next/sql-runtime": "0.3.0",
|
|
45
|
+
"@prisma-next/sql-contract-emitter": "0.3.0",
|
|
38
46
|
"@prisma-next/test-utils": "0.0.1",
|
|
39
|
-
"@prisma-next/tsconfig": "0.0.0"
|
|
47
|
+
"@prisma-next/tsconfig": "0.0.0",
|
|
48
|
+
"@prisma-next/tsdown": "0.0.0"
|
|
40
49
|
},
|
|
41
50
|
"exports": {
|
|
42
51
|
".": {
|
|
43
|
-
"types": "./dist/exports/index.d.
|
|
44
|
-
"import": "./dist/exports/index.
|
|
52
|
+
"types": "./dist/exports/index.d.mts",
|
|
53
|
+
"import": "./dist/exports/index.mjs"
|
|
45
54
|
},
|
|
46
55
|
"./config-types": {
|
|
47
|
-
"types": "./dist/exports/config-types.d.
|
|
48
|
-
"import": "./dist/exports/config-types.
|
|
56
|
+
"types": "./dist/exports/config-types.d.mts",
|
|
57
|
+
"import": "./dist/exports/config-types.mjs"
|
|
49
58
|
},
|
|
50
59
|
"./commands/db-init": {
|
|
51
|
-
"types": "./dist/commands/db-init.d.
|
|
52
|
-
"import": "./dist/commands/db-init.
|
|
60
|
+
"types": "./dist/commands/db-init.d.mts",
|
|
61
|
+
"import": "./dist/commands/db-init.mjs"
|
|
53
62
|
},
|
|
54
|
-
"./commands/db-
|
|
55
|
-
"types": "./dist/commands/db-
|
|
56
|
-
"import": "./dist/commands/db-
|
|
63
|
+
"./commands/db-update": {
|
|
64
|
+
"types": "./dist/commands/db-update.d.mts",
|
|
65
|
+
"import": "./dist/commands/db-update.mjs"
|
|
57
66
|
},
|
|
58
|
-
"./commands/db-schema
|
|
59
|
-
"types": "./dist/commands/db-schema
|
|
60
|
-
"import": "./dist/commands/db-schema
|
|
67
|
+
"./commands/db-schema": {
|
|
68
|
+
"types": "./dist/commands/db-schema.d.mts",
|
|
69
|
+
"import": "./dist/commands/db-schema.mjs"
|
|
61
70
|
},
|
|
62
71
|
"./commands/db-sign": {
|
|
63
|
-
"types": "./dist/commands/db-sign.d.
|
|
64
|
-
"import": "./dist/commands/db-sign.
|
|
72
|
+
"types": "./dist/commands/db-sign.d.mts",
|
|
73
|
+
"import": "./dist/commands/db-sign.mjs"
|
|
65
74
|
},
|
|
66
75
|
"./commands/db-verify": {
|
|
67
|
-
"types": "./dist/commands/db-verify.d.
|
|
68
|
-
"import": "./dist/commands/db-verify.
|
|
76
|
+
"types": "./dist/commands/db-verify.d.mts",
|
|
77
|
+
"import": "./dist/commands/db-verify.mjs"
|
|
69
78
|
},
|
|
70
79
|
"./commands/contract-emit": {
|
|
71
|
-
"types": "./dist/commands/contract-emit.d.
|
|
72
|
-
"import": "./dist/commands/contract-emit.
|
|
80
|
+
"types": "./dist/commands/contract-emit.d.mts",
|
|
81
|
+
"import": "./dist/commands/contract-emit.mjs"
|
|
82
|
+
},
|
|
83
|
+
"./commands/contract-infer": {
|
|
84
|
+
"types": "./dist/commands/contract-infer.d.mts",
|
|
85
|
+
"import": "./dist/commands/contract-infer.mjs"
|
|
86
|
+
},
|
|
87
|
+
"./commands/migration-new": {
|
|
88
|
+
"types": "./dist/commands/migration-new.d.mts",
|
|
89
|
+
"import": "./dist/commands/migration-new.mjs"
|
|
90
|
+
},
|
|
91
|
+
"./commands/migration-plan": {
|
|
92
|
+
"types": "./dist/commands/migration-plan.d.mts",
|
|
93
|
+
"import": "./dist/commands/migration-plan.mjs"
|
|
94
|
+
},
|
|
95
|
+
"./commands/migration-show": {
|
|
96
|
+
"types": "./dist/commands/migration-show.d.mts",
|
|
97
|
+
"import": "./dist/commands/migration-show.mjs"
|
|
98
|
+
},
|
|
99
|
+
"./commands/migration-status": {
|
|
100
|
+
"types": "./dist/commands/migration-status.d.mts",
|
|
101
|
+
"import": "./dist/commands/migration-status.mjs"
|
|
102
|
+
},
|
|
103
|
+
"./commands/migration-verify": {
|
|
104
|
+
"types": "./dist/commands/migration-verify.d.mts",
|
|
105
|
+
"import": "./dist/commands/migration-verify.mjs"
|
|
106
|
+
},
|
|
107
|
+
"./commands/migration-apply": {
|
|
108
|
+
"types": "./dist/commands/migration-apply.d.mts",
|
|
109
|
+
"import": "./dist/commands/migration-apply.mjs"
|
|
110
|
+
},
|
|
111
|
+
"./commands/migration-ref": {
|
|
112
|
+
"types": "./dist/commands/migration-ref.d.mts",
|
|
113
|
+
"import": "./dist/commands/migration-ref.mjs"
|
|
73
114
|
},
|
|
74
115
|
"./config-loader": {
|
|
75
|
-
"types": "./dist/config-loader.d.
|
|
76
|
-
"import": "./dist/config-loader.
|
|
116
|
+
"types": "./dist/config-loader.d.mts",
|
|
117
|
+
"import": "./dist/config-loader.mjs"
|
|
77
118
|
},
|
|
78
119
|
"./control-api": {
|
|
79
|
-
"types": "./dist/exports/control-api.d.
|
|
80
|
-
"import": "./dist/exports/control-api.
|
|
120
|
+
"types": "./dist/exports/control-api.d.mts",
|
|
121
|
+
"import": "./dist/exports/control-api.mjs"
|
|
81
122
|
}
|
|
82
123
|
},
|
|
124
|
+
"repository": {
|
|
125
|
+
"type": "git",
|
|
126
|
+
"url": "https://github.com/prisma/prisma-next.git",
|
|
127
|
+
"directory": "packages/1-framework/3-tooling/cli"
|
|
128
|
+
},
|
|
83
129
|
"scripts": {
|
|
84
|
-
"build": "
|
|
130
|
+
"build": "tsdown && node ./scripts/write-cli-js-compat.mjs",
|
|
85
131
|
"test": "vitest run",
|
|
86
132
|
"test:coverage": "vitest run --coverage",
|
|
87
133
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
88
134
|
"lint": "biome check . --error-on-warnings",
|
|
89
135
|
"lint:fix": "biome check --write .",
|
|
90
136
|
"lint:fix:unsafe": "biome check --write --unsafe .",
|
|
137
|
+
"record": "tsx scripts/record.ts",
|
|
91
138
|
"clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
|
|
92
139
|
}
|
|
93
140
|
}
|