@metaobjectsdev/cli 1.0.0-rc.4 → 1.0.0-rc.6
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/src/commands/docs.d.ts.map +1 -1
- package/dist/src/commands/docs.js +41 -9
- package/dist/src/commands/docs.js.map +1 -1
- package/dist/src/commands/gen.d.ts +8 -0
- package/dist/src/commands/gen.d.ts.map +1 -1
- package/dist/src/commands/gen.js +17 -4
- package/dist/src/commands/gen.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +181 -35
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/migrate.d.ts +6 -0
- package/dist/src/commands/migrate.d.ts.map +1 -1
- package/dist/src/commands/migrate.js +11 -5
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/prompt-snapshot.d.ts.map +1 -1
- package/dist/src/commands/prompt-snapshot.js +2 -1
- package/dist/src/commands/prompt-snapshot.js.map +1 -1
- package/dist/src/commands/types.d.ts.map +1 -1
- package/dist/src/commands/types.js +12 -3
- package/dist/src/commands/types.js.map +1 -1
- package/dist/src/commands/upgrade.d.ts.map +1 -1
- package/dist/src/commands/upgrade.js +38 -4
- package/dist/src/commands/upgrade.js.map +1 -1
- package/dist/src/commands/verify.d.ts.map +1 -1
- package/dist/src/commands/verify.js +108 -30
- package/dist/src/commands/verify.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +55 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/advisory.d.ts +6 -0
- package/dist/src/lib/advisory.d.ts.map +1 -1
- package/dist/src/lib/advisory.js +13 -0
- package/dist/src/lib/advisory.js.map +1 -1
- package/dist/src/lib/anti-patterns.d.ts.map +1 -1
- package/dist/src/lib/anti-patterns.js +2 -4
- package/dist/src/lib/anti-patterns.js.map +1 -1
- package/dist/src/lib/args.d.ts +251 -12
- package/dist/src/lib/args.d.ts.map +1 -1
- package/dist/src/lib/args.js +119 -92
- package/dist/src/lib/args.js.map +1 -1
- package/dist/src/lib/base-url-advisory.d.ts +37 -0
- package/dist/src/lib/base-url-advisory.d.ts.map +1 -0
- package/dist/src/lib/base-url-advisory.js +162 -0
- package/dist/src/lib/base-url-advisory.js.map +1 -0
- package/dist/src/lib/codegen-drift.d.ts +8 -0
- package/dist/src/lib/codegen-drift.d.ts.map +1 -1
- package/dist/src/lib/codegen-drift.js +43 -10
- package/dist/src/lib/codegen-drift.js.map +1 -1
- package/dist/src/lib/detect-stack.d.ts +17 -0
- package/dist/src/lib/detect-stack.d.ts.map +1 -1
- package/dist/src/lib/detect-stack.js +64 -2
- package/dist/src/lib/detect-stack.js.map +1 -1
- package/dist/src/lib/docs-drift.d.ts +12 -1
- package/dist/src/lib/docs-drift.d.ts.map +1 -1
- package/dist/src/lib/docs-drift.js +85 -16
- package/dist/src/lib/docs-drift.js.map +1 -1
- package/dist/src/lib/git-ignore.d.ts +59 -0
- package/dist/src/lib/git-ignore.d.ts.map +1 -0
- package/dist/src/lib/git-ignore.js +120 -0
- package/dist/src/lib/git-ignore.js.map +1 -0
- package/dist/src/lib/ignored-scaffold-check.d.ts +12 -0
- package/dist/src/lib/ignored-scaffold-check.d.ts.map +1 -0
- package/dist/src/lib/ignored-scaffold-check.js +75 -0
- package/dist/src/lib/ignored-scaffold-check.js.map +1 -0
- package/dist/src/lib/load-error.d.ts +46 -0
- package/dist/src/lib/load-error.d.ts.map +1 -0
- package/dist/src/lib/load-error.js +51 -0
- package/dist/src/lib/load-error.js.map +1 -0
- package/dist/src/lib/load-metaobjects-config.d.ts.map +1 -1
- package/dist/src/lib/load-metaobjects-config.js +65 -1
- package/dist/src/lib/load-metaobjects-config.js.map +1 -1
- package/dist/src/lib/manifest-ignored-check.d.ts.map +1 -1
- package/dist/src/lib/manifest-ignored-check.js +23 -36
- package/dist/src/lib/manifest-ignored-check.js.map +1 -1
- package/dist/src/lib/output.d.ts +22 -1
- package/dist/src/lib/output.d.ts.map +1 -1
- package/dist/src/lib/output.js +39 -12
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/rel-posix.d.ts +5 -0
- package/dist/src/lib/rel-posix.d.ts.map +1 -0
- package/dist/src/lib/rel-posix.js +23 -0
- package/dist/src/lib/rel-posix.js.map +1 -0
- package/dist/src/lib/replay-remedy.d.ts +2 -0
- package/dist/src/lib/replay-remedy.d.ts.map +1 -0
- package/dist/src/lib/replay-remedy.js +69 -0
- package/dist/src/lib/replay-remedy.js.map +1 -0
- package/dist/src/lib/requirement-lint.d.ts.map +1 -1
- package/dist/src/lib/requirement-lint.js +25 -5
- package/dist/src/lib/requirement-lint.js.map +1 -1
- package/package.json +10 -10
- package/src/commands/docs.ts +51 -12
- package/src/commands/gen.ts +19 -4
- package/src/commands/init.ts +188 -39
- package/src/commands/migrate.ts +13 -5
- package/src/commands/prompt-snapshot.ts +2 -1
- package/src/commands/types.ts +12 -3
- package/src/commands/upgrade.ts +44 -4
- package/src/commands/verify.ts +120 -32
- package/src/index.ts +55 -8
- package/src/lib/advisory.ts +15 -0
- package/src/lib/anti-patterns.ts +2 -5
- package/src/lib/args.ts +154 -109
- package/src/lib/base-url-advisory.ts +173 -0
- package/src/lib/codegen-drift.ts +52 -9
- package/src/lib/detect-stack.ts +73 -2
- package/src/lib/docs-drift.ts +107 -17
- package/src/lib/git-ignore.ts +159 -0
- package/src/lib/ignored-scaffold-check.ts +78 -0
- package/src/lib/load-error.ts +89 -0
- package/src/lib/load-metaobjects-config.ts +58 -1
- package/src/lib/manifest-ignored-check.ts +25 -33
- package/src/lib/output.ts +64 -11
- package/src/lib/rel-posix.ts +25 -0
- package/src/lib/replay-remedy.ts +78 -0
- package/src/lib/requirement-lint.ts +26 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,E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OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAuDA;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAE1E"}
|
package/dist/src/lib/output.js
CHANGED
|
@@ -6,18 +6,22 @@ import { toonEncode } from "./format.js";
|
|
|
6
6
|
import { skippedSection } from "./advisory.js";
|
|
7
7
|
const GEN_GLYPHS = {
|
|
8
8
|
new: "✓",
|
|
9
|
+
overwrite: "↻",
|
|
9
10
|
merged: "↺",
|
|
10
11
|
conflict: "✗",
|
|
11
12
|
unchanged: "=",
|
|
12
13
|
refused: "⚠",
|
|
14
|
+
adopted: "⊕",
|
|
13
15
|
removed: "−",
|
|
14
16
|
};
|
|
15
17
|
const GEN_WORDS = {
|
|
16
18
|
new: "NEW",
|
|
19
|
+
overwrite: "OVERWRITE",
|
|
17
20
|
merged: "MERGED",
|
|
18
21
|
conflict: "CONFLICT",
|
|
19
22
|
unchanged: "UNCHANGED",
|
|
20
23
|
refused: "REFUSED",
|
|
24
|
+
adopted: "ADOPTED",
|
|
21
25
|
removed: "REMOVED",
|
|
22
26
|
};
|
|
23
27
|
export function formatGenResult(result, opts) {
|
|
@@ -43,10 +47,14 @@ export function formatGenResult(result, opts) {
|
|
|
43
47
|
const counts = result.files.reduce((acc, f) => {
|
|
44
48
|
acc[f.status] = (acc[f.status] ?? 0) + 1;
|
|
45
49
|
return acc;
|
|
46
|
-
}, { new: 0, merged: 0, conflict: 0, unchanged: 0, refused: 0, removed: 0 });
|
|
50
|
+
}, { new: 0, overwrite: 0, merged: 0, conflict: 0, unchanged: 0, refused: 0, adopted: 0, removed: 0 });
|
|
47
51
|
const parts = [];
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
// "written" stays the sum of new + overwrite: that number was always correct and
|
|
53
|
+
// adopters read it. Splitting the SUMMARY as well would change a line nothing was
|
|
54
|
+
// wrong with; the per-file status is the one that was lying.
|
|
55
|
+
const written = counts.new + counts.overwrite;
|
|
56
|
+
if (written > 0)
|
|
57
|
+
parts.push(`${written} written`);
|
|
50
58
|
if (counts.merged > 0)
|
|
51
59
|
parts.push(`${counts.merged} merged`);
|
|
52
60
|
if (counts.conflict > 0)
|
|
@@ -55,6 +63,11 @@ export function formatGenResult(result, opts) {
|
|
|
55
63
|
parts.push(`${counts.unchanged} unchanged`);
|
|
56
64
|
if (counts.refused > 0)
|
|
57
65
|
parts.push(`${counts.refused} refused`);
|
|
66
|
+
// `--baseline=adopt`: recorded as the merge base, nothing written. Counted separately
|
|
67
|
+
// from `unchanged` because the run's product is the manifest, and an adopter who cannot
|
|
68
|
+
// see how many files it now covers has no way to review what they are about to commit.
|
|
69
|
+
if (counts.adopted > 0)
|
|
70
|
+
parts.push(`${counts.adopted} adopted`);
|
|
58
71
|
if (counts.removed > 0)
|
|
59
72
|
parts.push(`${counts.removed} removed`);
|
|
60
73
|
lines.push("", ` ${parts.join(", ")}`, "");
|
|
@@ -104,10 +117,13 @@ export function formatMigrateResult(result, _opts) {
|
|
|
104
117
|
// gen TOON/JSON formatters (axi)
|
|
105
118
|
// ---------------------------------------------------------------------------
|
|
106
119
|
export function genResultToData(result) {
|
|
107
|
-
const counts = result.files.reduce((a, f) => ((a[f.status] = (a[f.status] ?? 0) + 1), a), { new: 0, merged: 0, conflict: 0, unchanged: 0, refused: 0, removed: 0 });
|
|
120
|
+
const counts = result.files.reduce((a, f) => ((a[f.status] = (a[f.status] ?? 0) + 1), a), { new: 0, overwrite: 0, merged: 0, conflict: 0, unchanged: 0, refused: 0, adopted: 0, removed: 0 });
|
|
108
121
|
const parts = [];
|
|
109
|
-
|
|
110
|
-
|
|
122
|
+
// Same split as the text formatter: `written` is new + overwrite, and the
|
|
123
|
+
// per-file rows carry which one each was.
|
|
124
|
+
const written = counts.new + counts.overwrite;
|
|
125
|
+
if (written)
|
|
126
|
+
parts.push(`${written} written`);
|
|
111
127
|
if (counts.merged)
|
|
112
128
|
parts.push(`${counts.merged} merged`);
|
|
113
129
|
if (counts.conflict)
|
|
@@ -116,14 +132,25 @@ export function genResultToData(result) {
|
|
|
116
132
|
parts.push(`${counts.unchanged} unchanged`);
|
|
117
133
|
if (counts.refused)
|
|
118
134
|
parts.push(`${counts.refused} refused`);
|
|
135
|
+
if (counts.adopted)
|
|
136
|
+
parts.push(`${counts.adopted} adopted`);
|
|
119
137
|
if (counts.removed)
|
|
120
138
|
parts.push(`${counts.removed} removed`);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
139
|
+
// Two ways to emit nothing, and they send the reader to different files. Name the
|
|
140
|
+
// one that is actually true: a config wiring no generators cannot produce output
|
|
141
|
+
// however good the metadata is, and telling its author to go write entities is a
|
|
142
|
+
// false statement about a project that already has them.
|
|
143
|
+
const noGenerators = result.generatorCount === 0;
|
|
144
|
+
const summary = result.files.length !== 0
|
|
145
|
+
? parts.join(", ")
|
|
146
|
+
: noGenerators
|
|
147
|
+
? "no generators are wired in metaobjects.config.ts, so nothing was generated"
|
|
148
|
+
: `no entities to generate in ${result.outDir}`;
|
|
149
|
+
const help = result.files.length !== 0
|
|
150
|
+
? ["typecheck the generated code with `npx tsc`", "create your database tables with `meta migrate --from-db --db <url> --dialect <sqlite|postgres> --slug init --apply`"]
|
|
151
|
+
: noGenerators
|
|
152
|
+
? ["add generators to the `generators: []` array in metaobjects.config.ts — `meta eject --list` names every generator you can own, and `meta init` scaffolds the usual set"]
|
|
153
|
+
: ["author entities in this project's metadata sources then re-run `meta gen`"];
|
|
127
154
|
// An absent section is STATED, never omitted: a reader must be able to tell
|
|
128
155
|
// "the scan found nothing" from "the scan never ran".
|
|
129
156
|
const antiPatterns = result.antiPatterns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EA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AM,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,GAAG,GAAG,MAAM,SAAS,MAAM,CAAC,YAAY,CAAC,MAAM,oBAAoB,CAAC;QAC3E,IAAI,GAAG,MAAM,CAAC,MAAM,KAAK,QAAQ;YAC/B,CAAC,CAAC,CAAC,wEAAwE,CAAC;YAC5E,uEAAuE;YACvE,uEAAuE;YACvE,oEAAoE;YACpE,CAAC,CAAC,CAAC,oDAAoD,CAAC,CAAC;IAC7D,CAAC;SAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO,GAAG,mBAAmB,CAAC;QAC9B,IAAI,GAAG,CAAC,iDAAiD,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,GAAG,aAAa,eAAe,CAAC;QAC1C,IAAI,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAA0B;IAChE,OAAO,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A path with the platform separator replaced by "/" — a no-op on POSIX. */
|
|
2
|
+
export declare function toPosix(p: string): string;
|
|
3
|
+
/** `abs` relative to `root`, forward-slashed. */
|
|
4
|
+
export declare function relPosix(root: string, abs: string): string;
|
|
5
|
+
//# sourceMappingURL=rel-posix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rel-posix.d.ts","sourceRoot":"","sources":["../../../src/lib/rel-posix.ts"],"names":[],"mappings":"AAgBA,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,iDAAiD;AACjD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// One spelling of "a path, with forward slashes".
|
|
2
|
+
//
|
|
3
|
+
// Six modules under lib/ carried this rule inline — `git-ignore`, `docs-drift` (twice),
|
|
4
|
+
// `anti-patterns`, `base-url-advisory` and `ignored-scaffold-check` — and one of the six
|
|
5
|
+
// was spelled differently: `.split("\\").join("/")` rather than `.split(sep).join("/")`.
|
|
6
|
+
// On Windows those agree, because `sep` IS a backslash. On POSIX they do not: `sep` is
|
|
7
|
+
// already "/" so the correct form is a no-op, while splitting on a literal backslash
|
|
8
|
+
// rewrites a filename that legitimately CONTAINS one. That is the drift six copies of a
|
|
9
|
+
// one-line rule invite, and it had already happened.
|
|
10
|
+
//
|
|
11
|
+
// Comparisons against git's output are the reason the rule exists at all: `git check-ignore`
|
|
12
|
+
// and `git ls-files` speak forward slashes on every platform, so a Windows path has to be
|
|
13
|
+
// normalized before it can be looked up in a set built from git's answer.
|
|
14
|
+
import { relative, sep } from "node:path";
|
|
15
|
+
/** A path with the platform separator replaced by "/" — a no-op on POSIX. */
|
|
16
|
+
export function toPosix(p) {
|
|
17
|
+
return p.split(sep).join("/");
|
|
18
|
+
}
|
|
19
|
+
/** `abs` relative to `root`, forward-slashed. */
|
|
20
|
+
export function relPosix(root, abs) {
|
|
21
|
+
return toPosix(relative(root, abs));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=rel-posix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rel-posix.js","sourceRoot":"","sources":["../../../src/lib/rel-posix.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,wFAAwF;AACxF,yFAAyF;AACzF,yFAAyF;AACzF,uFAAuF;AACvF,qFAAqF;AACrF,wFAAwF;AACxF,qDAAqD;AACrD,EAAE;AACF,6FAA6F;AAC7F,0FAA0F;AAC1F,0EAA0E;AAE1E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAW;IAChD,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-remedy.d.ts","sourceRoot":"","sources":["../../../src/lib/replay-remedy.ts"],"names":[],"mappings":"AAgDA,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CA6BnD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { MigrationApplyError } from "@metaobjectsdev/migrate-ts";
|
|
2
|
+
/**
|
|
3
|
+
* What to tell someone whose committed chain will not apply to an empty database.
|
|
4
|
+
*
|
|
5
|
+
* The message this replaces prescribed ONE fix — *"fix this with a NEW migration that
|
|
6
|
+
* creates the missing object"* — and it cannot work, in any case. Migrations apply in
|
|
7
|
+
* timestamp order, so anything authored now sorts AFTER the migration that failed; the
|
|
8
|
+
* object is still missing when that file runs. Two estates found it from opposite
|
|
9
|
+
* directions and it is the same defect both times:
|
|
10
|
+
*
|
|
11
|
+
* - a chain whose FIRST migration needs a schema an out-of-band script creates (the third
|
|
12
|
+
* migration emits `CREATE SCHEMA IF NOT EXISTS`, the first predates it). A new migration
|
|
13
|
+
* sorts last, after the one that needs the schema.
|
|
14
|
+
* - a project where **another tool owns schema creation** — drizzle-kit's chain builds the
|
|
15
|
+
* tables, `.metaobjects/migrations/` holds later incremental patches. Following the
|
|
16
|
+
* printed remedy literally means hand-authoring every `CREATE TABLE` into the MetaObjects
|
|
17
|
+
* chain, i.e. duplicating a schema this project does not own, which is the opposite of
|
|
18
|
+
* what the agent context teaches two paragraphs into its own Principles.
|
|
19
|
+
*
|
|
20
|
+
* The old message assumed MetaObjects is the only schema authority and offered no third
|
|
21
|
+
* possibility. These name the fixes that exist, and the head-of-chain case gets the extra
|
|
22
|
+
* sentence that is only true there: nothing in this chain could have created what the
|
|
23
|
+
* first migration needs, so the base schema comes from outside it.
|
|
24
|
+
*
|
|
25
|
+
* "Applied migrations are immutable" is kept, because it is true and it is the reason the
|
|
26
|
+
* obvious fix is not offered first — but it is stated as the CONDITION it actually is
|
|
27
|
+
* (a checksum guard on databases that already ran the file), not as a blanket ban, because
|
|
28
|
+
* a migration no database has applied yet is edited in place every day.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Is this the migrate engine's own apply failure?
|
|
32
|
+
*
|
|
33
|
+
* By NAME, not `instanceof`. Two physical copies of `@metaobjectsdev/migrate-ts` in one
|
|
34
|
+
* process — a globally-installed or linked `meta` alongside a project-local dependency —
|
|
35
|
+
* give the class object and the instance different identities, so `instanceof` returns
|
|
36
|
+
* false for a real error and the remedy silently degrades to its un-positioned form. That
|
|
37
|
+
* is the same class-identity defect that split ts-poet's `Code` in 0.21.6 and drove the
|
|
38
|
+
* exported node guards in `metadata`. Unreachable through today's single import; costs one
|
|
39
|
+
* line to make unreachable by construction.
|
|
40
|
+
*/
|
|
41
|
+
function isApplyError(err) {
|
|
42
|
+
return err instanceof MigrationApplyError
|
|
43
|
+
|| (err instanceof Error && err.name === "MigrationApplyError"
|
|
44
|
+
&& typeof err.migration === "string"
|
|
45
|
+
&& typeof err.index === "number");
|
|
46
|
+
}
|
|
47
|
+
export function replayRemedy(err) {
|
|
48
|
+
const applyErr = isApplyError(err) ? err : undefined;
|
|
49
|
+
const head = applyErr !== undefined && applyErr.index === 0;
|
|
50
|
+
const which = applyErr === undefined
|
|
51
|
+
? "the committed chain does not apply to an empty database."
|
|
52
|
+
: `'${applyErr.migration}' (migration ${applyErr.index + 1} of ${applyErr.pendingCount}) ` +
|
|
53
|
+
`does not apply to an empty database.`;
|
|
54
|
+
const out = [which];
|
|
55
|
+
if (head) {
|
|
56
|
+
out.push("It is the FIRST migration in the chain, so nothing here could have created what it " +
|
|
57
|
+
"needs — this chain has never built a database from empty, and its base schema comes " +
|
|
58
|
+
"from outside it.");
|
|
59
|
+
}
|
|
60
|
+
out.push("A NEW migration cannot fix this: migrations apply in timestamp order, so anything you " +
|
|
61
|
+
"author now sorts after the file that failed.");
|
|
62
|
+
out.push("The fixes that do work: if another tool or an out-of-band script owns schema creation " +
|
|
63
|
+
"for this project, --replay asserts a property this chain does not have — don't wire " +
|
|
64
|
+
"it. Otherwise correct the migration in place if no database has applied it yet " +
|
|
65
|
+
"(the ledger's checksum guard is what stops you once one has), or re-baseline from a " +
|
|
66
|
+
"live database with `meta migrate baseline --from-db --db <url>`.");
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=replay-remedy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-remedy.js","sourceRoot":"","sources":["../../../src/lib/replay-remedy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;;;;;;;;;;GAUG;AACH,SAAS,YAAY,CAAC,GAAY;IAChC,OAAO,GAAG,YAAY,mBAAmB;WACpC,CAAC,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB;eACvD,OAAQ,GAA2B,CAAC,SAAS,KAAK,QAAQ;eAC1D,OAAQ,GAA2B,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG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AC;
|
|
1
|
+
{"version":3,"file":"requirement-lint.d.ts","sourceRoot":"","sources":["../../../src/lib/requirement-lint.ts"],"names":[],"mappings":"AAoCA,OAAO,EAcL,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EACyB,KAAK,oBAAoB,EAAE,KAAK,UAAU,EACzE,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,qCAAqC,0CAA0C,CAAC;AAC7F,eAAO,MAAM,oCAAoC,yCAAyC,CAAC;AAC3F,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AACnG,eAAO,MAAM,iCAAiC,sCAAsC,CAAC;AACrF,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AA+KjF;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ;AACd;;;2DAG2D;AAC3D,SAAS,GAAE,SAAS,oBAAoB,EAAuC,GAC9E,UAAU,EAAE,CAkHd"}
|
|
@@ -138,6 +138,25 @@ const INERT_SLOTS = [DOC_ATTR_SUMMARY];
|
|
|
138
138
|
* split rather than move.
|
|
139
139
|
*/
|
|
140
140
|
const TITLE_IS_AN_ID = /^[A-Z]{2,}[- ]?\d+/;
|
|
141
|
+
/**
|
|
142
|
+
* What is LEFT of a title once a leading catalogue id and its separator are removed.
|
|
143
|
+
*
|
|
144
|
+
* The rule fires only when that remainder is empty — when the label IS the id and
|
|
145
|
+
* nothing else. A title that carries an id AND a noun phrase is not "an id"; it is a
|
|
146
|
+
* label with a citation prefix, which is a house style, and the warning's own name is
|
|
147
|
+
* false for it.
|
|
148
|
+
*
|
|
149
|
+
* Measured on a 323-node adopter ledger that uses `@title` deliberately as its bridge
|
|
150
|
+
* to a spec catalogue: the un-narrowed rule fired **203 times**, on every run, telling
|
|
151
|
+
* that author their entire convention was wrong and offering a 203-entry edit. That is
|
|
152
|
+
* the "355 findings, all false" shape the 0.24.2 narrowing exists to avoid, reproduced
|
|
153
|
+
* by the check that narrowing shipped alongside. A lint people argue with is a lint
|
|
154
|
+
* people mute, and muting takes the six useful checks with it.
|
|
155
|
+
*
|
|
156
|
+
* `@title: "REQ-1234"` — a slot holding only a citation, with no label anywhere — is
|
|
157
|
+
* still caught, and that is the case the rule was written for.
|
|
158
|
+
*/
|
|
159
|
+
const TITLE_ID_ONLY = /^[A-Z]{2,}[- ]?\d+[\s\-–—:.]*$/;
|
|
141
160
|
/** Lowercase, drop everything that is not alphanumeric, collapse the gaps.
|
|
142
161
|
* Two slots "say the same thing" only if they survive this identically — no
|
|
143
162
|
* similarity score, no threshold. A fuzzy match on prose produces findings the
|
|
@@ -306,11 +325,12 @@ addressed = collectAddressedRequirements(root)) {
|
|
|
306
325
|
}
|
|
307
326
|
// -- an id is not a label -------------------------------------------------
|
|
308
327
|
const title = readOwnSlot(node, DOC_ATTR_TITLE);
|
|
309
|
-
if (title !== undefined &&
|
|
310
|
-
out.push(warn(path, WARN_REQUIREMENT_TITLE_IS_AN_ID, `@title
|
|
311
|
-
`an id is not a name, so this
|
|
312
|
-
`@${REQUIREMENT_ATTR_TRACKED_BY}, which is the free-form reference slot and IS read, and
|
|
313
|
-
`
|
|
328
|
+
if (title !== undefined && TITLE_ID_ONLY.test(title.trim())) {
|
|
329
|
+
out.push(warn(path, WARN_REQUIREMENT_TITLE_IS_AN_ID, `@title holds only a catalogue or ticket id: ${excerpt(title)}. A title is the entry's ` +
|
|
330
|
+
`LABEL and an id is not a name, so this slot says nothing a reader can use. Put the id in ` +
|
|
331
|
+
`@${REQUIREMENT_ATTR_TRACKED_BY}, which is the free-form reference slot and IS read, and ` +
|
|
332
|
+
`give @${DOC_ATTR_TITLE} a noun phrase. A title that carries an id AND a phrase ` +
|
|
333
|
+
`("FR-448 — prompt construction as typed payloads") is a house style and is NOT flagged.`));
|
|
314
334
|
}
|
|
315
335
|
}
|
|
316
336
|
return out;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement-lint.js","sourceRoot":"","sources":["../../../src/lib/requirement-lint.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,gDAAgD;AAChD,iFAAiF;AACjF,mFAAmF;AACnF,gFAAgF;AAChF,mFAAmF;AACnF,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,qFAAqF;AACrF,iDAAiD;AACjD,EAAE;AACF,oFAAoF;AACpF,gFAAgF;AAChF,qFAAqF;AACrF,kFAAkF;AAClF,EAAE;AACF,qFAAqF;AACrF,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,iFAAiF;AACjF,iFAAiF;AACjF,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,sFAAsF;AACtF,oFAAoF;AACpF,2EAA2E;AAE3E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B;AAC3B,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,+DAA+D;AAC/D,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAClC,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,iFAAiF;AACjF,uDAAuD;AACvD,OAAO,EACL,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,qCAAqC,GAAG,uCAAuC,CAAC;AAC7F,MAAM,CAAC,MAAM,oCAAoC,GAAG,sCAAsC,CAAC;AAC3F,MAAM,CAAC,MAAM,wCAAwC,GAAG,0CAA0C,CAAC;AACnG,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AACrF,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAC3E,M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,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAChD,IAAI,KAAK,KAAK,SAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"requirement-lint.js","sourceRoot":"","sources":["../../../src/lib/requirement-lint.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,gDAAgD;AAChD,iFAAiF;AACjF,mFAAmF;AACnF,gFAAgF;AAChF,mFAAmF;AACnF,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,qFAAqF;AACrF,iDAAiD;AACjD,EAAE;AACF,oFAAoF;AACpF,gFAAgF;AAChF,qFAAqF;AACrF,kFAAkF;AAClF,EAAE;AACF,qFAAqF;AACrF,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,iFAAiF;AACjF,iFAAiF;AACjF,EAAE;AACF,mFAAmF;AACnF,qFAAqF;AACrF,sFAAsF;AACtF,oFAAoF;AACpF,2EAA2E;AAE3E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B;AAC3B,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,+DAA+D;AAC/D,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAClC,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,iFAAiF;AACjF,uDAAuD;AACvD,OAAO,EACL,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,qCAAqC,GAAG,uCAAuC,CAAC;AAC7F,MAAM,CAAC,MAAM,oCAAoC,GAAG,sCAAsC,CAAC;AAC3F,MAAM,CAAC,MAAM,wCAAwC,GAAG,0CAA0C,CAAC;AACnG,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AACrF,MAAM,CA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CAAC,IAAI;gBAChG,4FAA4F;gBAC5F,iDAAiD,CAAC,CAAC,CAAC;QACxD,CAAC;QAED,4EAA4E;QAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAChD,IAAI,KAAK,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAC5D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,+BAA+B,EACjD,+CAA+C,OAAO,CAAC,KAAK,CAAC,2BAA2B;gBACxF,2FAA2F;gBAC3F,IAAI,2BAA2B,2DAA2D;gBAC1F,SAAS,cAAc,0DAA0D;gBACjF,yFAAyF,CAAC,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metaobjectsdev/cli",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.6",
|
|
4
4
|
"description": "CLI for MetaObjects: scaffold, codegen, migrate, and drift-detection commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"@biomejs/js-api": "^0.7.0",
|
|
52
52
|
"@biomejs/wasm-nodejs": "^1.9.4",
|
|
53
53
|
"@libsql/kysely-libsql": "^0.4.0",
|
|
54
|
-
"@metaobjectsdev/codegen-ts": "1.0.0-rc.
|
|
55
|
-
"@metaobjectsdev/codegen-ts-react": "1.0.0-rc.
|
|
56
|
-
"@metaobjectsdev/codegen-ts-tanstack": "1.0.0-rc.
|
|
57
|
-
"@metaobjectsdev/docs-site": "1.0.0-rc.
|
|
58
|
-
"@metaobjectsdev/metadata": "1.0.0-rc.
|
|
59
|
-
"@metaobjectsdev/migrate-ts": "1.0.0-rc.
|
|
60
|
-
"@metaobjectsdev/render": "1.0.0-rc.
|
|
61
|
-
"@metaobjectsdev/runtime-ts": "1.0.0-rc.
|
|
62
|
-
"@metaobjectsdev/sdk": "1.0.0-rc.
|
|
54
|
+
"@metaobjectsdev/codegen-ts": "1.0.0-rc.6",
|
|
55
|
+
"@metaobjectsdev/codegen-ts-react": "1.0.0-rc.6",
|
|
56
|
+
"@metaobjectsdev/codegen-ts-tanstack": "1.0.0-rc.6",
|
|
57
|
+
"@metaobjectsdev/docs-site": "1.0.0-rc.6",
|
|
58
|
+
"@metaobjectsdev/metadata": "1.0.0-rc.6",
|
|
59
|
+
"@metaobjectsdev/migrate-ts": "1.0.0-rc.6",
|
|
60
|
+
"@metaobjectsdev/render": "1.0.0-rc.6",
|
|
61
|
+
"@metaobjectsdev/runtime-ts": "1.0.0-rc.6",
|
|
62
|
+
"@metaobjectsdev/sdk": "1.0.0-rc.6",
|
|
63
63
|
"@toon-format/toon": "^2.3.0",
|
|
64
64
|
"jiti": "^2.4.0"
|
|
65
65
|
},
|
package/src/commands/docs.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
import type {
|
|
30
30
|
GenContext,
|
|
31
31
|
EmittedFile,
|
|
32
|
+
Generator,
|
|
32
33
|
ResolvedDocsConfig,
|
|
33
34
|
DocsSurface,
|
|
34
35
|
Dialect,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
DEFAULT_COLUMN_NAMING_STRATEGY,
|
|
42
43
|
renderCoreMetamodelDocs,
|
|
43
44
|
} from "@metaobjectsdev/metadata";
|
|
44
|
-
import { dbEmittingObjects, DEFAULT_DIALECT, missingDialectMessage } from "@metaobjectsdev/codegen-ts";
|
|
45
|
+
import { dbEmittingObjects, DEFAULT_DIALECT, DEFAULT_DOCS_DIR, missingDialectMessage, resolveGenerators, runEmitsHonoRoutes, runEmitsUiTier } from "@metaobjectsdev/codegen-ts";
|
|
45
46
|
import type { MetaDataTypeProvider, MetaRoot } from "@metaobjectsdev/metadata";
|
|
46
47
|
import { generateSite, SITE_TEMPLATE_NAMES, SITE_ASSET_NAMES, readSiteFile } from "@metaobjectsdev/docs-site";
|
|
47
48
|
// The `agent` schema surface takes the physical schema as an ARGUMENT with its resolvers
|
|
@@ -53,6 +54,14 @@ import {
|
|
|
53
54
|
qualifiedDbName,
|
|
54
55
|
} from "@metaobjectsdev/migrate-ts";
|
|
55
56
|
import type { AgentSchemaInput, SchemaColumnLike } from "@metaobjectsdev/codegen-ts";
|
|
57
|
+
import { reportLoadError } from "../lib/load-error.js";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Print a load failure with everything the loader's ADR-0009 envelope carried — the stable
|
|
61
|
+
* code, the file, the json path, and the loader's own next steps — instead of the bare
|
|
62
|
+
* `err.message` five commands used to print. See `lib/load-error.ts`.
|
|
63
|
+
*/
|
|
64
|
+
|
|
56
65
|
|
|
57
66
|
type DocsLayout = "flat" | "package";
|
|
58
67
|
|
|
@@ -202,9 +211,14 @@ function parseDocsArgs(argv: string[], cwd: string): DocsFlags {
|
|
|
202
211
|
// cwd (mirrors how migrate/gen treat the working directory as the root).
|
|
203
212
|
projectRoot: projectRoot ?? cwd,
|
|
204
213
|
projectRootProvided: projectRoot !== undefined,
|
|
205
|
-
// Default out dir, resolved against the project root below.
|
|
206
|
-
//
|
|
207
|
-
|
|
214
|
+
// Default out dir, resolved against the project root below. ONE spelling of the
|
|
215
|
+
// default, shared with resolveDocsConfig — two spellings is how a flag default and
|
|
216
|
+
// a config default come to disagree about where the pages are.
|
|
217
|
+
//
|
|
218
|
+
// --metamodel keeps its own sub-path: the renderer writes under <out>/metamodel/,
|
|
219
|
+
// and it is a different artifact (the metamodel reference, not this project's
|
|
220
|
+
// pages), so it is not swept into the generated-docs directory.
|
|
221
|
+
out: out ?? (wantMetamodel ? "./docs/metamodel" : DEFAULT_DOCS_DIR),
|
|
208
222
|
// Default flat preserves today's single-package output (+ existing goldens).
|
|
209
223
|
layout: layout ?? "flat",
|
|
210
224
|
metamodel: wantMetamodel,
|
|
@@ -464,7 +478,7 @@ export async function docsCommand(
|
|
|
464
478
|
|
|
465
479
|
// Merge the config `docs:` block with CLI overrides over documented defaults.
|
|
466
480
|
// CLI --out/--layout only override when explicitly passed; surfaces/baseUrl
|
|
467
|
-
// override whenever present. The resolver supplies defaults (outDir ./docs,
|
|
481
|
+
// override whenever present. The resolver supplies defaults (outDir ./docs/generated,
|
|
468
482
|
// layout = fallback, surfaces = both) so config-less + flag-less runs are
|
|
469
483
|
// unchanged.
|
|
470
484
|
const cliOverrides: Partial<ResolvedDocsConfig> = {
|
|
@@ -505,7 +519,7 @@ export async function docsCommand(
|
|
|
505
519
|
...configLoadOptions,
|
|
506
520
|
});
|
|
507
521
|
} catch (err) {
|
|
508
|
-
log
|
|
522
|
+
reportLoadError(log, "docs: failed to load metadata", err);
|
|
509
523
|
return 2;
|
|
510
524
|
}
|
|
511
525
|
|
|
@@ -527,6 +541,29 @@ export async function docsCommand(
|
|
|
527
541
|
pkMap: buildPkMap(root),
|
|
528
542
|
relationMap: buildRelationMap(root),
|
|
529
543
|
});
|
|
544
|
+
// The generator suite, with stable-name STRINGS resolved to the generators they name
|
|
545
|
+
// (ADR-0021 #1 allows `generators: ["routes-hono"]`). Both aggregations below read a
|
|
546
|
+
// generator MARKER, and a string carries none — so reading the raw array answered
|
|
547
|
+
// "no Hono routes / no UI tier" for a project that wires them by name, which is the
|
|
548
|
+
// same two-doors-one-question defect these flags exist to close. `meta gen` resolves
|
|
549
|
+
// the identical array through `normalizeConfig`.
|
|
550
|
+
//
|
|
551
|
+
// An unknown name throws (the message names it and lists the valid ones). `meta gen`
|
|
552
|
+
// fails on it; `meta docs` has never had to load the suite at all, so it degrades to
|
|
553
|
+
// the already-typed entries rather than becoming a new failure — and SAYS it did,
|
|
554
|
+
// because a page quietly losing a section is exactly what this whole fix is about.
|
|
555
|
+
let suite: Generator[];
|
|
556
|
+
try {
|
|
557
|
+
suite = resolveGenerators(loadedConfig?.generators ?? []);
|
|
558
|
+
} catch (err) {
|
|
559
|
+
log.warn(
|
|
560
|
+
`docs: could not resolve the generator suite (${(err as Error).message}) — the agent ` +
|
|
561
|
+
`pages fall back to the generators declared as values, so a tier wired by name may ` +
|
|
562
|
+
`be missing from them.`,
|
|
563
|
+
);
|
|
564
|
+
suite = (loadedConfig?.generators ?? []).filter((g): g is Generator => typeof g !== "string");
|
|
565
|
+
}
|
|
566
|
+
|
|
530
567
|
const ctx: GenContext = {
|
|
531
568
|
entities: root.objects(),
|
|
532
569
|
loadedRoot: root,
|
|
@@ -541,12 +578,14 @@ export async function docsCommand(
|
|
|
541
578
|
// surface. Aggregate it from the generator set exactly as the gen runner
|
|
542
579
|
// does (a generator opts in via emitsHonoRoutes), so `meta docs` auto-detects
|
|
543
580
|
// routesFileHono() rather than relying on a field users don't normally set.
|
|
544
|
-
includeHonoRoutes:
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
581
|
+
includeHonoRoutes: loadedConfig?.includeHonoRoutes ?? runEmitsHonoRoutes(suite),
|
|
582
|
+
// `agent/ui.md` describes forms, grids and the endpoints their hooks call. Whether
|
|
583
|
+
// any of that is emitted is a GENERATOR fact — the page's own predicate is
|
|
584
|
+
// metadata-only and answered "could a UI be generated?", so a project with
|
|
585
|
+
// `generators: []` got a confident page naming endpoints nothing serves. Aggregate
|
|
586
|
+
// it through the same helper the gen runner uses, so `meta docs` and `meta gen` —
|
|
587
|
+
// the two doors onto this page — cannot answer it differently.
|
|
588
|
+
includeUiTier: loadedConfig?.includeUiTier ?? runEmitsUiTier(suite),
|
|
550
589
|
} as never,
|
|
551
590
|
renderContext,
|
|
552
591
|
projectRoot,
|
package/src/commands/gen.ts
CHANGED
|
@@ -16,16 +16,30 @@ import {
|
|
|
16
16
|
import { loadMemory, resolveCollection } from "@metaobjectsdev/sdk";
|
|
17
17
|
import { runGen, listGenerators } from "@metaobjectsdev/codegen-ts";
|
|
18
18
|
import type { WriteStatus } from "@metaobjectsdev/codegen-ts";
|
|
19
|
+
import { reportLoadError } from "../lib/load-error.js";
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Print a load failure with everything the loader's ADR-0009 envelope carried — the stable
|
|
23
|
+
* code, the file, the json path, and the loader's own next steps — instead of the bare
|
|
24
|
+
* `err.message` five commands used to print. See `lib/load-error.ts`.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export function mapStatus(s: WriteStatus): GenFileStatus {
|
|
21
29
|
switch (s) {
|
|
22
|
-
case "new":
|
|
23
|
-
|
|
30
|
+
case "new": return "new";
|
|
31
|
+
// NOT folded into "new": an existing artifact being rewritten is a different
|
|
32
|
+
// fact from an entity appearing, and the engine has always distinguished them.
|
|
33
|
+
case "overwrite": return "overwrite";
|
|
24
34
|
case "merged": return "merged";
|
|
25
35
|
case "conflict": return "conflict";
|
|
26
36
|
case "unchanged":
|
|
27
37
|
case "skipped": return "unchanged";
|
|
28
38
|
case "refused": return "refused";
|
|
39
|
+
// --baseline=adopt — recorded as the merge base, nothing written. Its own word,
|
|
40
|
+
// for the same reason "overwrite" is not "new": the adopter has to know a manifest
|
|
41
|
+
// now exists to commit.
|
|
42
|
+
case "adopted": return "adopted";
|
|
29
43
|
// FR-038 §8 — a generated file deleted because it is no longer generated.
|
|
30
44
|
// Shown as its own outcome, not folded into "unchanged": a run summary that
|
|
31
45
|
// lists writes but hides deletions is how a silent deletion happens.
|
|
@@ -112,7 +126,7 @@ export async function genCommand(args: string[], cwd: string, fmt: OutputFormat
|
|
|
112
126
|
...loadMemoryOptionsFrom(forgeConfig),
|
|
113
127
|
});
|
|
114
128
|
} catch (err) {
|
|
115
|
-
log
|
|
129
|
+
reportLoadError(log, "failed to load metadata", err);
|
|
116
130
|
return 2;
|
|
117
131
|
}
|
|
118
132
|
|
|
@@ -170,6 +184,7 @@ export async function genCommand(args: string[], cwd: string, fmt: OutputFormat
|
|
|
170
184
|
dryRun: cliConfig.dryRun,
|
|
171
185
|
warnings: [],
|
|
172
186
|
antiPatterns,
|
|
187
|
+
generatorCount: forgeConfig.generators?.length ?? 0,
|
|
173
188
|
};
|
|
174
189
|
const output =
|
|
175
190
|
fmt === "toon" ? formatGenResultToon(genResult)
|