@metaobjectsdev/cli 1.0.0-rc.3 → 1.0.0-rc.5
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/gen.d.ts +3 -0
- package/dist/src/commands/gen.d.ts.map +1 -1
- package/dist/src/commands/gen.js +5 -3
- 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 +237 -29
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/migrate.d.ts +1 -0
- package/dist/src/commands/migrate.d.ts.map +1 -1
- package/dist/src/commands/migrate.js +1 -1
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/verify.d.ts.map +1 -1
- package/dist/src/commands/verify.js +39 -9
- 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 +30 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/args.d.ts +228 -0
- package/dist/src/lib/args.d.ts.map +1 -1
- package/dist/src/lib/args.js +88 -72
- package/dist/src/lib/args.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 +71 -11
- package/dist/src/lib/docs-drift.js.map +1 -1
- package/dist/src/lib/git-ignore.d.ts +40 -0
- package/dist/src/lib/git-ignore.d.ts.map +1 -0
- package/dist/src/lib/git-ignore.js +77 -0
- package/dist/src/lib/git-ignore.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 +5 -31
- package/dist/src/lib/manifest-ignored-check.js.map +1 -1
- package/dist/src/lib/output.d.ts +10 -1
- package/dist/src/lib/output.d.ts.map +1 -1
- package/dist/src/lib/output.js +15 -6
- package/dist/src/lib/output.js.map +1 -1
- 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/gen.ts +5 -3
- package/src/commands/init.ts +247 -33
- package/src/commands/migrate.ts +1 -1
- package/src/commands/verify.ts +46 -9
- package/src/index.ts +30 -2
- package/src/lib/args.ts +96 -72
- package/src/lib/docs-drift.ts +92 -12
- package/src/lib/git-ignore.ts +115 -0
- package/src/lib/load-metaobjects-config.ts +58 -1
- package/src/lib/manifest-ignored-check.ts +5 -28
- package/src/lib/output.ts +30 -5
- package/src/lib/requirement-lint.ts +26 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,0EAA0E;AAC1E,mEAAmE;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAiD,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,0EAA0E;AAC1E,mEAAmE;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAiD,MAAM,eAAe,CAAC;AAsD9F,MAAM,UAAU,GAAkC;IAChD,GAAG,EAAE,GAAG;IACR,SAAS,EAAE,GAAG;IACd,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;CACb,CAAC;AAEF,MAAM,SAAS,GAAkC;IAC/C,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,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rF,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;
|
|
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,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,
|
|
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;AAC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C,IAAI,EAAE,+BAA+B,EACjD,IAAI,IAAI,4BAA4B,0BAA0B,6BAA6B;gBAC3F,8FAA8F;gBAC9F,8EAA8E,OAAO,CAAC,KAAK,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.5",
|
|
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.5",
|
|
55
|
+
"@metaobjectsdev/codegen-ts-react": "1.0.0-rc.5",
|
|
56
|
+
"@metaobjectsdev/codegen-ts-tanstack": "1.0.0-rc.5",
|
|
57
|
+
"@metaobjectsdev/docs-site": "1.0.0-rc.5",
|
|
58
|
+
"@metaobjectsdev/metadata": "1.0.0-rc.5",
|
|
59
|
+
"@metaobjectsdev/migrate-ts": "1.0.0-rc.5",
|
|
60
|
+
"@metaobjectsdev/render": "1.0.0-rc.5",
|
|
61
|
+
"@metaobjectsdev/runtime-ts": "1.0.0-rc.5",
|
|
62
|
+
"@metaobjectsdev/sdk": "1.0.0-rc.5",
|
|
63
63
|
"@toon-format/toon": "^2.3.0",
|
|
64
64
|
"jiti": "^2.4.0"
|
|
65
65
|
},
|
package/src/commands/gen.ts
CHANGED
|
@@ -17,10 +17,12 @@ 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
19
|
|
|
20
|
-
function mapStatus(s: WriteStatus): GenFileStatus {
|
|
20
|
+
export function mapStatus(s: WriteStatus): GenFileStatus {
|
|
21
21
|
switch (s) {
|
|
22
|
-
case "new":
|
|
23
|
-
|
|
22
|
+
case "new": return "new";
|
|
23
|
+
// NOT folded into "new": an existing artifact being rewritten is a different
|
|
24
|
+
// fact from an entity appearing, and the engine has always distinguished them.
|
|
25
|
+
case "overwrite": return "overwrite";
|
|
24
26
|
case "merged": return "merged";
|
|
25
27
|
case "conflict": return "conflict";
|
|
26
28
|
case "unchanged":
|
package/src/commands/init.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdir, writeFile, readFile, readdir, stat, rm } from "node:fs/promises"
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { basename, dirname } from "node:path";
|
|
4
4
|
import { existsSync as existsSyncWrap, readFileSync as readFileSyncWrap } from "node:fs";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
5
6
|
import { DEFAULT_CONFIG, ConfigSchema, saveConfig, PACKAGE_MANIFEST_FILE, DEFAULT_METADATA_DIR, DEFAULT_METAOBJECTS_DIR } from "@metaobjectsdev/sdk";
|
|
6
7
|
import {
|
|
7
8
|
assemble, resolveAgentContextRoot, planScaffold,
|
|
@@ -137,9 +138,15 @@ export default defineConfig({
|
|
|
137
138
|
barrel(),
|
|
138
139
|
],
|
|
139
140
|
docs: {
|
|
140
|
-
outDir: "./docs", //
|
|
141
|
+
outDir: "./docs", // every surface lands here (run: meta docs)
|
|
141
142
|
layout: "flat", // or "package" for multi-package models
|
|
142
|
-
surfaces
|
|
143
|
+
// surfaces defaults to ["model", "api", "requirements", "agent"] — all four.
|
|
144
|
+
// Deliberately NOT narrowed here: the requirements and agent surfaces emit ZERO
|
|
145
|
+
// files for a project that has nothing for them to describe, and the always-on
|
|
146
|
+
// agent context points at the agent/ pages by name. Scaffolding a narrower list
|
|
147
|
+
// turned that pointer into a pointer at nothing. Narrow it yourself if you want
|
|
148
|
+
// fewer docs — but note it says what your docs ARE, not which of them you commit
|
|
149
|
+
// (a page you do not commit is exempt from verify --docs once it is git-ignored).
|
|
143
150
|
},
|
|
144
151
|
});
|
|
145
152
|
`;
|
|
@@ -473,6 +480,57 @@ async function writeOwnedGenerators(opts: InitOptions, result: InitResult): Prom
|
|
|
473
480
|
await writeFile(abs, readReferenceTemplate(name), "utf8");
|
|
474
481
|
result.created.push(rel);
|
|
475
482
|
}
|
|
483
|
+
await writeCodegenTsconfig(opts, result);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/** The owned codegen tier's own tsconfig — see writeCodegenTsconfig. */
|
|
487
|
+
const CODEGEN_TSCONFIG_REL = "tsconfig.codegen.json";
|
|
488
|
+
|
|
489
|
+
const CODEGEN_TSCONFIG_BODY = `{
|
|
490
|
+
// The owned codegen tier typechecks itself.
|
|
491
|
+
//
|
|
492
|
+
// \`meta gen\` loads metaobjects.config.ts and ./codegen/** through jiti, which
|
|
493
|
+
// TRANSPILES WITHOUT TYPECHECKING. So a generator here can import a symbol the
|
|
494
|
+
// engine no longer exports, or call a method that does not exist, and every gate
|
|
495
|
+
// stays green until the import is evaluated — which for a generator you have not
|
|
496
|
+
// wired into \`generators: [...]\` may be never.
|
|
497
|
+
//
|
|
498
|
+
// A project's app tsconfig usually covers src/ and tests/ and NOT this tier, so
|
|
499
|
+
// without this file nothing compiles the code your build depends on. Run it with:
|
|
500
|
+
// npx tsc -p tsconfig.codegen.json --noEmit
|
|
501
|
+
"compilerOptions": {
|
|
502
|
+
"target": "ES2022",
|
|
503
|
+
"module": "nodenext",
|
|
504
|
+
"moduleResolution": "nodenext",
|
|
505
|
+
"strict": true,
|
|
506
|
+
"noEmit": true,
|
|
507
|
+
"skipLibCheck": true
|
|
508
|
+
},
|
|
509
|
+
"include": ["metaobjects.config.ts", "codegen/**/*.ts"]
|
|
510
|
+
}
|
|
511
|
+
`;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Scaffold a tsconfig that covers the tier `meta init` just handed the adopter.
|
|
515
|
+
*
|
|
516
|
+
* Reported from an estate that found TWO real defects the moment one existed: a
|
|
517
|
+
* generator importing `CODEGEN_ATTR_EMIT_ROUTES` (retired with the `@emit*` family,
|
|
518
|
+
* and invisible because that generator was not in `generators: [...]`), and a wired
|
|
519
|
+
* generator carrying five type errors including `ownFields()` on a node that has no
|
|
520
|
+
* such method. Both found on the first run.
|
|
521
|
+
*
|
|
522
|
+
* Written only when absent, like every other scaffolded file — an adopter who has
|
|
523
|
+
* their own arrangement keeps it, and it is reported as preserved rather than
|
|
524
|
+
* silently skipped.
|
|
525
|
+
*/
|
|
526
|
+
async function writeCodegenTsconfig(opts: InitOptions, result: InitResult): Promise<void> {
|
|
527
|
+
const abs = join(opts.cwd, CODEGEN_TSCONFIG_REL);
|
|
528
|
+
if (await fileExists(abs)) {
|
|
529
|
+
result.preserved.push(CODEGEN_TSCONFIG_REL);
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
await writeFile(abs, CODEGEN_TSCONFIG_BODY, "utf8");
|
|
533
|
+
result.created.push(CODEGEN_TSCONFIG_REL);
|
|
476
534
|
}
|
|
477
535
|
|
|
478
536
|
/**
|
|
@@ -606,6 +664,7 @@ export async function init(opts: InitOptions): Promise<InitResult> {
|
|
|
606
664
|
);
|
|
607
665
|
result.created.push(".metaobjects/AGENTS.md", ".metaobjects/CLAUDE.md", ".claude/skills/metaobjects-*", AGENT_CONTEXT_MANIFEST_PATH);
|
|
608
666
|
for (const name of SCAFFOLDED_GENERATOR_NAMES) result.created.push(`${OWNED_GENERATORS_DIR}/${name}.ts`);
|
|
667
|
+
result.created.push(CODEGEN_TSCONFIG_REL);
|
|
609
668
|
result.created.push("metaobjects.config.ts", DB_STUB_REL_PATH, ".gitignore");
|
|
610
669
|
return result;
|
|
611
670
|
}
|
|
@@ -712,7 +771,7 @@ export async function init(opts: InitOptions): Promise<InitResult> {
|
|
|
712
771
|
result.preserved.push(".gitignore");
|
|
713
772
|
}
|
|
714
773
|
|
|
715
|
-
await
|
|
774
|
+
await prepareManifestForScaffold(opts.cwd, result);
|
|
716
775
|
|
|
717
776
|
return result;
|
|
718
777
|
}
|
|
@@ -733,8 +792,13 @@ export async function init(opts: InitOptions): Promise<InitResult> {
|
|
|
733
792
|
* So set it — but never silently take a real CommonJS project with it. A project
|
|
734
793
|
* that has actual CJS sources gets a loud, specific warning instead of an edit,
|
|
735
794
|
* because changing a module system out from under working code is not ours to do.
|
|
795
|
+
*
|
|
796
|
+
* IT ALSO DECLARES WHAT THE SCAFFOLD AND THE GENERATED OUTPUT IMPORT, and the name it used
|
|
797
|
+
* to carry (`ensureEsmPackageType`) is why that went wrong: a function named for one job
|
|
798
|
+
* accreted a second, and the second silently inherited the first's early returns. The
|
|
799
|
+
* declarations are unconditional on a readable manifest — see the comment at that point.
|
|
736
800
|
*/
|
|
737
|
-
async function
|
|
801
|
+
async function prepareManifestForScaffold(cwd: string, result: InitResult): Promise<void> {
|
|
738
802
|
const pkgPath = join(cwd, "package.json");
|
|
739
803
|
if (!(await fileExists(pkgPath))) {
|
|
740
804
|
// No package.json at all: say what is needed rather than inventing a manifest
|
|
@@ -759,38 +823,59 @@ async function ensureEsmPackageType(cwd: string, result: InitResult): Promise<vo
|
|
|
759
823
|
return;
|
|
760
824
|
}
|
|
761
825
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
826
|
+
// TWO INDEPENDENT JOBS FROM HERE, and they must not share an exit.
|
|
827
|
+
//
|
|
828
|
+
// The module system is one; declaring what the scaffold and the generated output import
|
|
829
|
+
// is the other, and it is true of every project with a readable manifest — including the
|
|
830
|
+
// one that already had `"type": "module"` and needs no module-system edit at all. Those
|
|
831
|
+
// two were folded together, below this function's early returns, and the consequence was
|
|
832
|
+
// that the adopter who had set their project up CORRECTLY got no declarations and no
|
|
833
|
+
// warning: `meta gen` worked (the CLI aliases those specifiers for itself) while `tsc`
|
|
834
|
+
// reported TS2307 on all five files `meta init` had just written. Under a strict
|
|
835
|
+
// installer that is every one of them; npm's hoisting hid roughly half.
|
|
836
|
+
//
|
|
837
|
+
// `moduleSystemNote` is computed first and applied last so the two jobs share ONE write
|
|
838
|
+
// of the manifest, rather than one job's early return deciding the other's fate.
|
|
839
|
+
let moduleSystemNote: string | undefined;
|
|
840
|
+
|
|
841
|
+
if (pkg.type !== "module") {
|
|
842
|
+
if (await hasCommonJsSources(cwd)) {
|
|
843
|
+
// `"type": "module"` is NOT set — changing a module system out from under working
|
|
844
|
+
// CJS code is not ours to do. The dependency declarations below still apply: they
|
|
845
|
+
// are about what the generated code imports, not about how it is loaded.
|
|
846
|
+
result.warnings.push(
|
|
847
|
+
'this project has CommonJS sources, so `"type": "module"` was NOT set for you — ' +
|
|
848
|
+
"but the scaffolded generators and all generated code are ESM and will not " +
|
|
849
|
+
"compile without it. Either migrate the project to ESM, or keep the generated " +
|
|
850
|
+
"code in a sub-directory with its own package.json declaring `\"type\": \"module\"`.",
|
|
851
|
+
);
|
|
852
|
+
} else {
|
|
853
|
+
const declaredType = pkg.type; // read BEFORE the mutation below overwrites it
|
|
854
|
+
pkg.type = "module";
|
|
855
|
+
// Past tense, deliberately: this reports an edit already made. The imperative
|
|
856
|
+
// ("set `\"type\": \"module\"`") read as a TODO on the one line a newcomer sees
|
|
857
|
+
// last, so a scaffold that had just done the right thing looked like it had failed.
|
|
858
|
+
//
|
|
859
|
+
// And it must not claim the manifest was SILENT on the point: `npm init -y` writes
|
|
860
|
+
// `"type": "commonjs"` explicitly (npm 11.x), which is the dominant first-touch path,
|
|
861
|
+
// so "declared no module system" was false exactly where it is read most. Report what
|
|
862
|
+
// was actually there.
|
|
863
|
+
const previous = typeof declaredType === "string" ? declaredType : undefined;
|
|
864
|
+
moduleSystemNote =
|
|
865
|
+
`package.json ${previous === undefined ? "declared no module system" : `declared "type": "${previous}"`} — ` +
|
|
866
|
+
'set `"type": "module"` for you, because MetaObjects scaffolds and generates ESM, ' +
|
|
867
|
+
"which a CommonJS project cannot compile.";
|
|
868
|
+
}
|
|
772
869
|
}
|
|
773
870
|
|
|
774
|
-
const declaredType = pkg.type; // read BEFORE the mutation below overwrites it
|
|
775
|
-
pkg.type = "module";
|
|
776
871
|
const added = addScaffoldDevDependencies(pkg);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
// And it must not claim the manifest was SILENT on the point: `npm init -y` writes
|
|
785
|
-
// `"type": "commonjs"` explicitly (npm 11.x), which is the dominant first-touch path,
|
|
786
|
-
// so "declared no module system" was false exactly where it is read most. Report what
|
|
787
|
-
// was actually there.
|
|
788
|
-
const previous = typeof declaredType === "string" ? declaredType : undefined;
|
|
789
|
-
result.warnings.push(
|
|
790
|
-
`package.json ${previous === undefined ? "declared no module system" : `declared "type": "${previous}"`} — ` +
|
|
791
|
-
'set `"type": "module"` for you, because MetaObjects scaffolds and generates ESM, ' +
|
|
792
|
-
"which a CommonJS project cannot compile.",
|
|
793
|
-
);
|
|
872
|
+
const addedRuntime = addScaffoldRuntimeDependencies(pkg);
|
|
873
|
+
if (moduleSystemNote !== undefined || added.length > 0 || addedRuntime.length > 0) {
|
|
874
|
+
// Preserve the file's existing indentation rather than reformatting someone's manifest.
|
|
875
|
+
const indent = /\n(\s+)"/.exec(raw)?.[1] ?? " ";
|
|
876
|
+
await writeFile(pkgPath, `${JSON.stringify(pkg, null, indent)}\n`, "utf8");
|
|
877
|
+
}
|
|
878
|
+
if (moduleSystemNote !== undefined) result.warnings.push(moduleSystemNote);
|
|
794
879
|
if (added.length > 0) {
|
|
795
880
|
result.warnings.push(
|
|
796
881
|
`added ${added.join(" + ")} to devDependencies — the scaffolded ` +
|
|
@@ -798,6 +883,29 @@ async function ensureEsmPackageType(cwd: string, result: InitResult): Promise<vo
|
|
|
798
883
|
"Run your package manager's install before `meta gen`.",
|
|
799
884
|
);
|
|
800
885
|
}
|
|
886
|
+
if (addedRuntime.length > 0) {
|
|
887
|
+
result.warnings.push(
|
|
888
|
+
`added ${addedRuntime.join(" + ")} to dependencies — the code \`meta gen\` writes ` +
|
|
889
|
+
"imports them, so `npx tsc` reports TS2307 on the generated files until they are " +
|
|
890
|
+
"installed. Run your package manager's install before `meta gen`.",
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
// Never degrade in silence. The first version of this returned `{}` on any failure to
|
|
894
|
+
// read runtime-ts's peer ranges and skipped the three packages that come from them —
|
|
895
|
+
// which is exactly what happened against the published package, and the run looked
|
|
896
|
+
// successful while leaving the project with the six TS2307s this code exists to
|
|
897
|
+
// prevent. A fallback that cannot be observed is indistinguishable from a bug.
|
|
898
|
+
const undeclarable = SCAFFOLD_OUTPUT_PEERS.filter(
|
|
899
|
+
(name) => !declaredDependencyNames(pkg as PackageManifest).has(name),
|
|
900
|
+
);
|
|
901
|
+
if (undeclarable.length > 0) {
|
|
902
|
+
result.warnings.push(
|
|
903
|
+
`could NOT declare ${undeclarable.join(" + ")} — the version ranges are read from ` +
|
|
904
|
+
"@metaobjectsdev/runtime-ts's own peerDependencies and that manifest could not be " +
|
|
905
|
+
"read. Generated code imports them, so add them to dependencies by hand or " +
|
|
906
|
+
"`npx tsc` will report TS2307 on files `meta gen` writes.",
|
|
907
|
+
);
|
|
908
|
+
}
|
|
801
909
|
}
|
|
802
910
|
|
|
803
911
|
/**
|
|
@@ -844,6 +952,112 @@ function addScaffoldDevDependencies(pkg: Record<string, unknown>): string[] {
|
|
|
844
952
|
return added;
|
|
845
953
|
}
|
|
846
954
|
|
|
955
|
+
/**
|
|
956
|
+
* The third-party packages the scaffolded suite's GENERATED OUTPUT imports, each named
|
|
957
|
+
* with the artifact that imports it. This is the set, not the ranges — see
|
|
958
|
+
* `scaffoldRuntimeDependencies` for where those come from.
|
|
959
|
+
*
|
|
960
|
+
* `@metaobjectsdev/runtime-ts` is deliberately not here: its range is the CLI's own
|
|
961
|
+
* version, like the two build-time packages above, not a peer range read off itself.
|
|
962
|
+
*/
|
|
963
|
+
const SCAFFOLD_OUTPUT_PEERS = [
|
|
964
|
+
"drizzle-orm", // <Entity>.ts (the table + column builders) and <Entity>.queries.ts
|
|
965
|
+
"zod", // <Entity>.ts — the Insert/Update schemas
|
|
966
|
+
"fastify", // <Entity>.routes.ts — `import type { FastifyInstance }`
|
|
967
|
+
] as const;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* The runtime dependencies of the code `meta gen` will WRITE, for `dependencies`.
|
|
971
|
+
*
|
|
972
|
+
* `addScaffoldDevDependencies` above fixed this defect one layer in: the generator
|
|
973
|
+
* SOURCES under `codegen/generators/` import `@metaobjectsdev/codegen-ts` and
|
|
974
|
+
* `@metaobjectsdev/metadata`, nothing declared them, and the scaffold arrived
|
|
975
|
+
* un-typecheckable. The same argument reaches one layer further out and was not
|
|
976
|
+
* followed there. Generated `<Entity>.ts` / `.queries.ts` / `.routes.ts` import
|
|
977
|
+
* drizzle-orm, zod, fastify and `@metaobjectsdev/runtime-ts/drizzle-fastify` — five
|
|
978
|
+
* specifiers, none declared — so `npx tsc`, which is the next step `meta gen` itself
|
|
979
|
+
* prints, reported NINE TS2307s on a brand-new project that had done nothing wrong.
|
|
980
|
+
* npm hides four of the five by hoisting them out of the CLI's own tree; pnpm's strict
|
|
981
|
+
* layout, which is the point of testing both, shows all five.
|
|
982
|
+
*
|
|
983
|
+
* `dependencies`, not `devDependencies`: generated routes and queries are application
|
|
984
|
+
* source that runs in production. The two build-time packages stay where they are.
|
|
985
|
+
*
|
|
986
|
+
* The RANGES are read from `@metaobjectsdev/runtime-ts`'s own `peerDependencies` rather
|
|
987
|
+
* than written here. That package already declares the versions its helpers are built
|
|
988
|
+
* against, bounded above (the peer-range gate enforces the bound), so a second copy of
|
|
989
|
+
* those ranges in the scaffolder is a second thing to keep in step — and the failure
|
|
990
|
+
* mode of drift is an adopter installing a major nothing was tested against. If a range
|
|
991
|
+
* cannot be read, the package is SKIPPED rather than guessed at, and `meta gen` still
|
|
992
|
+
* type-checks for anyone whose manifest already declares it.
|
|
993
|
+
*/
|
|
994
|
+
function scaffoldRuntimeDependencies(): Record<string, string> {
|
|
995
|
+
const wanted: Record<string, string> = {
|
|
996
|
+
"@metaobjectsdev/runtime-ts": `^${cliVersion()}`,
|
|
997
|
+
};
|
|
998
|
+
const peers = runtimeTsPeerRanges();
|
|
999
|
+
for (const name of SCAFFOLD_OUTPUT_PEERS) {
|
|
1000
|
+
const range = peers[name];
|
|
1001
|
+
if (range !== undefined) wanted[name] = range;
|
|
1002
|
+
}
|
|
1003
|
+
return wanted;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* `@metaobjectsdev/runtime-ts`'s declared peer ranges, or `{}` if they cannot be read.
|
|
1008
|
+
*
|
|
1009
|
+
* Resolves the package's ENTRY and walks up to the nearest package.json, rather than
|
|
1010
|
+
* asking for `"@metaobjectsdev/runtime-ts/package.json"` directly. That direct form is
|
|
1011
|
+
* the obvious one and it is WRONG: a package's `exports` map gates every subpath, and
|
|
1012
|
+
* runtime-ts's exports are `.` / `./drivers` / `./fastify` / `./drizzle-fastify` /
|
|
1013
|
+
* `./hono` — no `./package.json`. Under real Node it throws
|
|
1014
|
+
* ERR_PACKAGE_PATH_NOT_EXPORTED. It appeared to work here only because the workspace
|
|
1015
|
+
* runs this under bun against a symlinked source tree; against the published package it
|
|
1016
|
+
* failed on the first try, silently, and `meta init` declared one package instead of
|
|
1017
|
+
* four. Resolving the entry is never gated — `.` is the one subpath every package
|
|
1018
|
+
* exports — so this form works under npm, pnpm, bun and a linked checkout alike.
|
|
1019
|
+
*/
|
|
1020
|
+
function runtimeTsPeerRanges(): Record<string, string> {
|
|
1021
|
+
try {
|
|
1022
|
+
const req = createRequire(import.meta.url);
|
|
1023
|
+
let dir = dirname(req.resolve("@metaobjectsdev/runtime-ts"));
|
|
1024
|
+
// The entry sits under dist/; the manifest is at the package root above it.
|
|
1025
|
+
for (let hops = 0; hops < 8; hops++) {
|
|
1026
|
+
const candidate = join(dir, "package.json");
|
|
1027
|
+
if (existsSyncWrap(candidate)) {
|
|
1028
|
+
const manifest = JSON.parse(readFileSyncWrap(candidate, "utf8")) as PackageManifest & { name?: string };
|
|
1029
|
+
// Guard against stopping at a nested manifest that is not the package itself.
|
|
1030
|
+
if (manifest.name === "@metaobjectsdev/runtime-ts") {
|
|
1031
|
+
return (manifest.peerDependencies ?? {}) as Record<string, string>;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
const up = dirname(dir);
|
|
1035
|
+
if (up === dir) break;
|
|
1036
|
+
dir = up;
|
|
1037
|
+
}
|
|
1038
|
+
return {};
|
|
1039
|
+
} catch {
|
|
1040
|
+
return {};
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/** Adds any missing `scaffoldRuntimeDependencies()` to `dependencies`. Only ever ADDS a
|
|
1045
|
+
* missing key — an existing pin, in any of the four dependency fields, is the user's. */
|
|
1046
|
+
function addScaffoldRuntimeDependencies(pkg: Record<string, unknown>): string[] {
|
|
1047
|
+
const deps = (pkg.dependencies ?? {}) as Record<string, string>;
|
|
1048
|
+
const declared = declaredDependencyNames(pkg as PackageManifest);
|
|
1049
|
+
const added: string[] = [];
|
|
1050
|
+
for (const [name, range] of Object.entries(scaffoldRuntimeDependencies())) {
|
|
1051
|
+
if (declared.has(name)) continue;
|
|
1052
|
+
deps[name] = range;
|
|
1053
|
+
added.push(name);
|
|
1054
|
+
}
|
|
1055
|
+
if (added.length > 0) {
|
|
1056
|
+
pkg.dependencies = Object.fromEntries(Object.entries(deps).sort(([a], [b]) => a.localeCompare(b)));
|
|
1057
|
+
}
|
|
1058
|
+
return added;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
847
1061
|
/** True when the project has hand-written CommonJS at the root (excluding tooling dirs). */
|
|
848
1062
|
async function hasCommonJsSources(cwd: string): Promise<boolean> {
|
|
849
1063
|
const SKIP = new Set(["node_modules", ".git", "dist", "build", ".metaobjects", "codegen"]);
|
package/src/commands/migrate.ts
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
import { buildProjectionViews } from "@metaobjectsdev/codegen-ts";
|
|
60
60
|
import { tokensToAllowOptions, describeChange } from "../lib/allow.js";
|
|
61
61
|
|
|
62
|
-
const MIGRATE_HELP_TEXT = `meta migrate — diff metadata vs live DB; emit migration SQL files
|
|
62
|
+
export const MIGRATE_HELP_TEXT = `meta migrate — diff metadata vs live DB; emit migration SQL files
|
|
63
63
|
|
|
64
64
|
USAGE:
|
|
65
65
|
meta migrate [baseline|apply-pending] [flags]
|
package/src/commands/verify.ts
CHANGED
|
@@ -404,12 +404,23 @@ export async function verifyCommand(
|
|
|
404
404
|
return 2;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
// --dialect wins; else migrate's resolved dialect; else
|
|
408
|
-
//
|
|
409
|
-
|
|
407
|
+
// --dialect wins; else migrate's resolved dialect; else the project's DECLARED
|
|
408
|
+
// dialect from metaobjects.config.ts; else refuse. There is no --db to infer
|
|
409
|
+
// from, so guessing would replay a postgres chain through sqlite.
|
|
410
|
+
//
|
|
411
|
+
// The last fallback was missing, and its absence made one fact need two
|
|
412
|
+
// spellings: a TypeScript project declares `dialect: "postgres"` in
|
|
413
|
+
// metaobjects.config.ts, `meta gen`, `meta verify --codegen` and `meta migrate`
|
|
414
|
+
// all honour it, and `--replay` alone refused and demanded `migrate.dialect` in
|
|
415
|
+
// .metaobjects/config.json — the spelling a TypeScript project is least likely
|
|
416
|
+
// to have. migrate's own resolution still WINS where it has an answer, because
|
|
417
|
+
// it is the more specific statement about the chain being replayed.
|
|
418
|
+
const dialect: Dialect | undefined =
|
|
419
|
+
flags.dialect ?? migrateConfig.dialect ?? forgeConfig?.dialect;
|
|
410
420
|
if (dialect === undefined) {
|
|
411
421
|
log.error(
|
|
412
|
-
`meta verify --replay: no dialect — pass --dialect <postgres|sqlite>,
|
|
422
|
+
`meta verify --replay: no dialect — pass --dialect <postgres|sqlite>, ` +
|
|
423
|
+
`set 'dialect' in metaobjects.config.ts, or set migrate.dialect in .metaobjects/config.json`,
|
|
413
424
|
);
|
|
414
425
|
return 2;
|
|
415
426
|
}
|
|
@@ -1226,9 +1237,12 @@ export async function verifyCommand(
|
|
|
1226
1237
|
|
|
1227
1238
|
// -- docs drift -------------------------------------------------------------
|
|
1228
1239
|
// Gated on --docs. Runs `meta docs` into a temp dir and diffs the committed docs
|
|
1229
|
-
// tree. See lib/docs-drift.ts for the
|
|
1230
|
-
//
|
|
1231
|
-
//
|
|
1240
|
+
// tree. See lib/docs-drift.ts for the deliberate differences from --codegen: a byte
|
|
1241
|
+
// difference IS drift here; a committed file a regen would not emit is reported ONLY
|
|
1242
|
+
// under `agent/` and only when it opens with the @generated marker (`docs.outDir` is
|
|
1243
|
+
// otherwise full of files MetaObjects did not write); and a page the project
|
|
1244
|
+
// GIT-IGNORES is exempt, because `docs.outDir` is a directory rather than a namespace
|
|
1245
|
+
// MetaObjects owns.
|
|
1232
1246
|
//
|
|
1233
1247
|
// It needs a config for the same reason `--codegen` does: `docs.outDir` says which
|
|
1234
1248
|
// tree to compare against, and the `agent` surface will not even materialise
|
|
@@ -1264,21 +1278,44 @@ export async function verifyCommand(
|
|
|
1264
1278
|
return 2;
|
|
1265
1279
|
}
|
|
1266
1280
|
|
|
1281
|
+
// What the gate did NOT check, on BOTH the passing and the failing line. A gate
|
|
1282
|
+
// that quietly compared two of 589 pages and reported "no drift" would be
|
|
1283
|
+
// indistinguishable from one that compared everything.
|
|
1284
|
+
const notChecked =
|
|
1285
|
+
result.ignoreReason !== undefined
|
|
1286
|
+
? `; .gitignore not consulted — ${result.ignoreReason} — so every page a fresh run emits was expected to be committed`
|
|
1287
|
+
: result.ignored > 0
|
|
1288
|
+
? `; ${result.ignored} git-ignored page(s) not checked`
|
|
1289
|
+
: "";
|
|
1290
|
+
|
|
1267
1291
|
if (result.clean) {
|
|
1268
1292
|
// The denominator is what was actually COMPARED, so the passing line and the
|
|
1269
1293
|
// failing line below count the same set. A gate whose two halves divide by
|
|
1270
1294
|
// different numbers is how `verify --templates` came to report seven templates
|
|
1271
1295
|
// vanishing between a red run and a green one.
|
|
1272
|
-
say(
|
|
1296
|
+
say(
|
|
1297
|
+
`meta verify — ${result.checked} docs page(s) match a fresh 'meta docs' ` +
|
|
1298
|
+
`(no docs drift${notChecked}).`,
|
|
1299
|
+
);
|
|
1273
1300
|
return 0;
|
|
1274
1301
|
}
|
|
1275
1302
|
|
|
1276
1303
|
log.error(
|
|
1277
1304
|
`meta verify — docs drift (${result.driftedFiles.length} of ${result.checked} page(s) ` +
|
|
1278
|
-
`differ from a fresh 'meta docs'):`,
|
|
1305
|
+
`differ from a fresh 'meta docs'${notChecked}):`,
|
|
1279
1306
|
);
|
|
1280
1307
|
for (const line of result.lines) log.error(` ${line}`);
|
|
1281
1308
|
log.error("Run 'meta docs' to regenerate, then commit the result.");
|
|
1309
|
+
// The one-command path to green, named at the point of conviction — a page reported
|
|
1310
|
+
// as uncommitted is the one case where regenerating is NOT the answer.
|
|
1311
|
+
if (result.lines.some((l) => l.startsWith("+ "))) {
|
|
1312
|
+
log.error(
|
|
1313
|
+
result.ignoreReason === undefined
|
|
1314
|
+
? "A page you deliberately do not commit is exempt once it is git-ignored."
|
|
1315
|
+
: `.gitignore was not consulted (${result.ignoreReason}), so a page you ` +
|
|
1316
|
+
`deliberately do not commit is reported above.`,
|
|
1317
|
+
);
|
|
1318
|
+
}
|
|
1282
1319
|
return 1;
|
|
1283
1320
|
}
|
|
1284
1321
|
}
|