@metaobjectsdev/cli 1.0.0-rc.2 → 1.0.0-rc.4
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/eject.d.ts +2 -3
- package/dist/src/commands/eject.d.ts.map +1 -1
- package/dist/src/commands/eject.js +34 -22
- package/dist/src/commands/eject.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +86 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/lib/owned-copy.d.ts +20 -0
- package/dist/src/lib/owned-copy.d.ts.map +1 -0
- package/dist/src/lib/owned-copy.js +107 -0
- package/dist/src/lib/owned-copy.js.map +1 -0
- package/package.json +12 -10
- package/src/commands/eject.ts +44 -28
- package/src/commands/init.ts +89 -0
- package/src/lib/owned-copy.ts +122 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type OwnedComparison } from "../lib/owned-copy.js";
|
|
1
2
|
/** Every ejectable name, in registry order (stable — matches `meta eject --list`). */
|
|
2
3
|
export declare function ejectableNames(): string[];
|
|
3
4
|
export interface EjectOptions {
|
|
@@ -29,9 +30,7 @@ export interface EjectResult {
|
|
|
29
30
|
* green, because nothing compares an owned copy to anything. Reporting this is the
|
|
30
31
|
* cheapest thing that makes that condition observable.
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
-
/** Lines of the previous file that the reference does not have. Set only when it differs. */
|
|
34
|
-
changedLines?: number | undefined;
|
|
33
|
+
comparison?: OwnedComparison | undefined;
|
|
35
34
|
}
|
|
36
35
|
/**
|
|
37
36
|
* An ejected file is ordinary source in the adopter's repo, so its imports must be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eject.d.ts","sourceRoot":"","sources":["../../../src/commands/eject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eject.d.ts","sourceRoot":"","sources":["../../../src/commands/eject.ts"],"names":[],"mappings":"AAcA,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA+C9E,sFAAsF;AACtF,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AA2CD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb;sFACkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC7C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;CAC1C;AAoBD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBvG;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAsC7E;AAmED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4G/E"}
|
|
@@ -12,6 +12,7 @@ import * as tanstackTpl from "@metaobjectsdev/codegen-ts-tanstack";
|
|
|
12
12
|
import { parseEjectArgs } from "../lib/args.js";
|
|
13
13
|
import { log } from "../lib/log.js";
|
|
14
14
|
import { declaredDependencyNames, readPackageManifest } from "../lib/package-manifest.js";
|
|
15
|
+
import { compareOwnedCopy } from "../lib/owned-copy.js";
|
|
15
16
|
// Mirrors `OWNED_GENERATORS_DIR` in init.ts's `writeOwnedGenerators` — same directory,
|
|
16
17
|
// same never-clobber-without-consent contract. Kept as its own local constant rather
|
|
17
18
|
// than shared: eject is a standalone operation on ANY name, not a byproduct of init,
|
|
@@ -87,11 +88,6 @@ async function fileExists(p) {
|
|
|
87
88
|
return false;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
/** Lines present in `a` and not in `b` — a cheap "how far apart" for a report line. */
|
|
91
|
-
function changedLineCount(a, b) {
|
|
92
|
-
const other = new Set(b.split("\n"));
|
|
93
|
-
return a.split("\n").filter((l) => l.trim() !== "" && !other.has(l)).length;
|
|
94
|
-
}
|
|
95
91
|
/** The `@metaobjectsdev/*` packages an ejected template imports, read from the file
|
|
96
92
|
* itself rather than from a per-name table — the template is the only thing that
|
|
97
93
|
* knows, and a table would drift from it the moment a template gains an import. */
|
|
@@ -163,20 +159,16 @@ export async function ejectGenerator(opts) {
|
|
|
163
159
|
dependencyNotes: notes,
|
|
164
160
|
};
|
|
165
161
|
const existing = (await fileExists(abs)) ? await readFile(abs, "utf8") : undefined;
|
|
166
|
-
const
|
|
167
|
-
const changedLines = local === "differs" && existing !== undefined
|
|
168
|
-
? changedLineCount(existing, templateSource)
|
|
169
|
-
: undefined;
|
|
162
|
+
const comparison = existing === undefined ? undefined : await compareOwnedCopy(existing, templateSource);
|
|
170
163
|
if (!opts.force && existing !== undefined) {
|
|
171
|
-
return { ...common, status: "preserved",
|
|
164
|
+
return { ...common, status: "preserved", comparison };
|
|
172
165
|
}
|
|
173
166
|
await mkdir(join(opts.cwd, OWNED_GENERATORS_DIR), { recursive: true });
|
|
174
167
|
await writeFile(abs, templateSource, "utf8");
|
|
175
168
|
return {
|
|
176
169
|
...common,
|
|
177
170
|
status: existing === undefined ? "created" : "replaced",
|
|
178
|
-
|
|
179
|
-
changedLines,
|
|
171
|
+
comparison,
|
|
180
172
|
};
|
|
181
173
|
}
|
|
182
174
|
/**
|
|
@@ -210,20 +202,27 @@ async function listOutput(cwd) {
|
|
|
210
202
|
continue;
|
|
211
203
|
}
|
|
212
204
|
const owned = await readFile(abs, "utf8");
|
|
213
|
-
|
|
205
|
+
const cmp = await compareOwnedCopy(owned, ref);
|
|
206
|
+
if (cmp.verdict === "identical") {
|
|
214
207
|
lines.push(` ${name} [owned — identical to the reference]`);
|
|
215
208
|
}
|
|
209
|
+
else if (cmp.verdict === "reformatted") {
|
|
210
|
+
lines.push(` ${name} [owned — same content as the reference, your formatting]`);
|
|
211
|
+
}
|
|
216
212
|
else {
|
|
217
213
|
anyStale = true;
|
|
218
|
-
lines.push(` ${name} [owned — DIFFERS
|
|
219
|
-
`${
|
|
214
|
+
lines.push(` ${name} [owned — DIFFERS: ${cmp.referenceOnly} line(s) behind, ` +
|
|
215
|
+
`${cmp.localOnly} line(s) of your own]`);
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
218
|
lines.push("");
|
|
223
219
|
}
|
|
224
220
|
if (anyStale) {
|
|
225
|
-
lines.push("
|
|
226
|
-
"
|
|
221
|
+
lines.push("Both counts ignore formatting: each file is re-formatted and its lines sorted " +
|
|
222
|
+
"before comparing, so re-wrapping and import order never show up here.");
|
|
223
|
+
lines.push(" \"behind\" — lines the reference has that your copy does not. Upstream moved.");
|
|
224
|
+
lines.push(" \"of your own\" — lines your copy has that the reference does not. Your customization.");
|
|
225
|
+
lines.push("`meta eject <name>` prints the diff command that shows which lines they are.");
|
|
227
226
|
lines.push("");
|
|
228
227
|
}
|
|
229
228
|
lines.push("Run: meta eject <name>");
|
|
@@ -253,13 +252,24 @@ export async function ejectCommand(args, cwd) {
|
|
|
253
252
|
// question nobody has. What an owner needs to know is whether their copy still
|
|
254
253
|
// matches what this CLI ships — the only way an owned generator's staleness is
|
|
255
254
|
// ever observable, since no gate compares the two.
|
|
256
|
-
if (result.
|
|
255
|
+
if (result.comparison?.verdict === "identical") {
|
|
257
256
|
log.info(`${result.path} already exists and is IDENTICAL to the ${result.packageName} ` +
|
|
258
257
|
"reference template — nothing to do.");
|
|
259
258
|
}
|
|
259
|
+
else if (result.comparison?.verdict === "reformatted") {
|
|
260
|
+
// Worth its own branch: this is the state a project that formats what it owns
|
|
261
|
+
// is in permanently, and calling it DIFFERS taught every one of them to ignore
|
|
262
|
+
// the line that is supposed to warn them.
|
|
263
|
+
log.info(`${result.path} already exists and has the SAME CONTENT as the ` +
|
|
264
|
+
`${result.packageName} reference template, in your own formatting — ` +
|
|
265
|
+
"nothing to do.");
|
|
266
|
+
}
|
|
260
267
|
else {
|
|
261
268
|
log.info(`${result.path} already exists and DIFFERS from the ${result.packageName} ` +
|
|
262
|
-
`reference template (${result.
|
|
269
|
+
`reference template (${result.comparison?.referenceOnly ?? 0} line(s) behind it, ` +
|
|
270
|
+
`${result.comparison?.localOnly ?? 0} line(s) of your own) — left untouched.`);
|
|
271
|
+
log.info(" Formatting is not counted: both files are re-formatted and their lines " +
|
|
272
|
+
"sorted before comparing, so re-wrapping and import order never show up.");
|
|
263
273
|
log.info(" That difference is either YOUR customization or upstream having moved on. " +
|
|
264
274
|
"See which, before deciding:");
|
|
265
275
|
log.info(` diff -u node_modules/${result.packageName}/src/reference/${flags.name}.ts ${result.path}`);
|
|
@@ -273,9 +283,11 @@ export async function ejectCommand(args, cwd) {
|
|
|
273
283
|
// destroys an adopter's customization, and the file's own header is often the
|
|
274
284
|
// only record that the customization was deliberate.
|
|
275
285
|
log.info(`Ejected "${flags.name}" -> ${result.path}, REPLACING the file that was there` +
|
|
276
|
-
(result.
|
|
277
|
-
? ` and DISCARDING ${result.
|
|
278
|
-
:
|
|
286
|
+
(result.comparison?.verdict === "differs"
|
|
287
|
+
? ` and DISCARDING ${result.comparison.localOnly} line(s) it had that the reference does not.`
|
|
288
|
+
: result.comparison?.verdict === "reformatted"
|
|
289
|
+
? " (its content was already the reference's — only your formatting is gone)."
|
|
290
|
+
: " (it was already identical to the reference)."));
|
|
279
291
|
}
|
|
280
292
|
else {
|
|
281
293
|
log.info(`Ejected "${flags.name}" -> ${result.path}. You own it now (ADR-0034 scaffold-and-own).`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eject.js","sourceRoot":"","sources":["../../../src/commands/eject.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,sFAAsF;AACtF,6FAA6F;AAC7F,wFAAwF;AACxF,uEAAuE;AACvE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,WAAW,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"eject.js","sourceRoot":"","sources":["../../../src/commands/eject.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,sFAAsF;AACtF,6FAA6F;AAC7F,wFAAwF;AACxF,uEAAuE;AACvE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,WAAW,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,eAA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ACjF,oFAAoF;QACpF,oFAAoF;QACpF,gEAAgE;QAChE,EAAE;QACF,sFAAsF;QACtF,uFAAuF;QACvF,uFAAuF;QACvF,uFAAuF;QACvF,sEAAsE;QACtE,GAAG,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,UAAU,8BAA8B,CAAC,CAAC;QACxF,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACnC,GAAG,CAAC,IAAI,CACN,+BAA+B,MAAM,CAAC,WAAW,kCAAkC;YACnF,4EAA4E;YAC5E,oDAAoD,CACrD,CAAC;QACF,GAAG,CAAC,IAAI,CACN,6EAA6E;YAC7E,yDAAyD,CAC1D,CAAC;QACF,GAAG,CAAC,IAAI,CACN,UAAU,MAAM,CAAC,UAAU,wDAAwD;YACnF,gBAAgB,CACjB,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,eAAe;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAqBhG,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAAuD,CAAC;AAkMhI,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4KAA4K;IAC5K,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AA4RD,wBAAsB,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA8KjE;AAkQD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,OAAO,GAAG,MAAM,CAE7D;AAoBD,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuD9E"}
|
|
@@ -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 { assemble, resolveAgentContextRoot, planScaffold, AGENT_CONTEXT_MANIFEST_PATH, } from "@metaobjectsdev/sdk/agent-context";
|
|
7
8
|
import { resolveStack } from "../lib/detect-stack.js";
|
|
@@ -679,6 +680,7 @@ async function ensureEsmPackageType(cwd, result) {
|
|
|
679
680
|
const declaredType = pkg.type; // read BEFORE the mutation below overwrites it
|
|
680
681
|
pkg.type = "module";
|
|
681
682
|
const added = addScaffoldDevDependencies(pkg);
|
|
683
|
+
const addedRuntime = addScaffoldRuntimeDependencies(pkg);
|
|
682
684
|
// Preserve the file's existing indentation rather than reformatting someone's manifest.
|
|
683
685
|
const indent = /\n(\s+)"/.exec(raw)?.[1] ?? " ";
|
|
684
686
|
await writeFile(pkgPath, `${JSON.stringify(pkg, null, indent)}\n`, "utf8");
|
|
@@ -699,6 +701,11 @@ async function ensureEsmPackageType(cwd, result) {
|
|
|
699
701
|
"codegen/generators/ are YOUR source now (ADR-0034) and import them. " +
|
|
700
702
|
"Run your package manager's install before `meta gen`.");
|
|
701
703
|
}
|
|
704
|
+
if (addedRuntime.length > 0) {
|
|
705
|
+
result.warnings.push(`added ${addedRuntime.join(" + ")} to dependencies — the code \`meta gen\` writes ` +
|
|
706
|
+
"imports them, so `npx tsc` reports TS2307 on the generated files until they are " +
|
|
707
|
+
"installed. Run your package manager's install before `meta gen`.");
|
|
708
|
+
}
|
|
702
709
|
}
|
|
703
710
|
/**
|
|
704
711
|
* ADR-0034 scaffold-and-own hands the project real source files under
|
|
@@ -744,6 +751,85 @@ function addScaffoldDevDependencies(pkg) {
|
|
|
744
751
|
}
|
|
745
752
|
return added;
|
|
746
753
|
}
|
|
754
|
+
/**
|
|
755
|
+
* The third-party packages the scaffolded suite's GENERATED OUTPUT imports, each named
|
|
756
|
+
* with the artifact that imports it. This is the set, not the ranges — see
|
|
757
|
+
* `scaffoldRuntimeDependencies` for where those come from.
|
|
758
|
+
*
|
|
759
|
+
* `@metaobjectsdev/runtime-ts` is deliberately not here: its range is the CLI's own
|
|
760
|
+
* version, like the two build-time packages above, not a peer range read off itself.
|
|
761
|
+
*/
|
|
762
|
+
const SCAFFOLD_OUTPUT_PEERS = [
|
|
763
|
+
"drizzle-orm", // <Entity>.ts (the table + column builders) and <Entity>.queries.ts
|
|
764
|
+
"zod", // <Entity>.ts — the Insert/Update schemas
|
|
765
|
+
"fastify", // <Entity>.routes.ts — `import type { FastifyInstance }`
|
|
766
|
+
];
|
|
767
|
+
/**
|
|
768
|
+
* The runtime dependencies of the code `meta gen` will WRITE, for `dependencies`.
|
|
769
|
+
*
|
|
770
|
+
* `addScaffoldDevDependencies` above fixed this defect one layer in: the generator
|
|
771
|
+
* SOURCES under `codegen/generators/` import `@metaobjectsdev/codegen-ts` and
|
|
772
|
+
* `@metaobjectsdev/metadata`, nothing declared them, and the scaffold arrived
|
|
773
|
+
* un-typecheckable. The same argument reaches one layer further out and was not
|
|
774
|
+
* followed there. Generated `<Entity>.ts` / `.queries.ts` / `.routes.ts` import
|
|
775
|
+
* drizzle-orm, zod, fastify and `@metaobjectsdev/runtime-ts/drizzle-fastify` — five
|
|
776
|
+
* specifiers, none declared — so `npx tsc`, which is the next step `meta gen` itself
|
|
777
|
+
* prints, reported NINE TS2307s on a brand-new project that had done nothing wrong.
|
|
778
|
+
* npm hides four of the five by hoisting them out of the CLI's own tree; pnpm's strict
|
|
779
|
+
* layout, which is the point of testing both, shows all five.
|
|
780
|
+
*
|
|
781
|
+
* `dependencies`, not `devDependencies`: generated routes and queries are application
|
|
782
|
+
* source that runs in production. The two build-time packages stay where they are.
|
|
783
|
+
*
|
|
784
|
+
* The RANGES are read from `@metaobjectsdev/runtime-ts`'s own `peerDependencies` rather
|
|
785
|
+
* than written here. That package already declares the versions its helpers are built
|
|
786
|
+
* against, bounded above (the peer-range gate enforces the bound), so a second copy of
|
|
787
|
+
* those ranges in the scaffolder is a second thing to keep in step — and the failure
|
|
788
|
+
* mode of drift is an adopter installing a major nothing was tested against. If a range
|
|
789
|
+
* cannot be read, the package is SKIPPED rather than guessed at, and `meta gen` still
|
|
790
|
+
* type-checks for anyone whose manifest already declares it.
|
|
791
|
+
*/
|
|
792
|
+
function scaffoldRuntimeDependencies() {
|
|
793
|
+
const wanted = {
|
|
794
|
+
"@metaobjectsdev/runtime-ts": `^${cliVersion()}`,
|
|
795
|
+
};
|
|
796
|
+
const peers = runtimeTsPeerRanges();
|
|
797
|
+
for (const name of SCAFFOLD_OUTPUT_PEERS) {
|
|
798
|
+
const range = peers[name];
|
|
799
|
+
if (range !== undefined)
|
|
800
|
+
wanted[name] = range;
|
|
801
|
+
}
|
|
802
|
+
return wanted;
|
|
803
|
+
}
|
|
804
|
+
/** `@metaobjectsdev/runtime-ts`'s declared peer ranges, or `{}` if it cannot be read. */
|
|
805
|
+
function runtimeTsPeerRanges() {
|
|
806
|
+
try {
|
|
807
|
+
const req = createRequire(import.meta.url);
|
|
808
|
+
const manifestPath = req.resolve("@metaobjectsdev/runtime-ts/package.json");
|
|
809
|
+
const manifest = JSON.parse(readFileSyncWrap(manifestPath, "utf8"));
|
|
810
|
+
return (manifest.peerDependencies ?? {});
|
|
811
|
+
}
|
|
812
|
+
catch {
|
|
813
|
+
return {};
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
/** Adds any missing `scaffoldRuntimeDependencies()` to `dependencies`. Only ever ADDS a
|
|
817
|
+
* missing key — an existing pin, in any of the four dependency fields, is the user's. */
|
|
818
|
+
function addScaffoldRuntimeDependencies(pkg) {
|
|
819
|
+
const deps = (pkg.dependencies ?? {});
|
|
820
|
+
const declared = declaredDependencyNames(pkg);
|
|
821
|
+
const added = [];
|
|
822
|
+
for (const [name, range] of Object.entries(scaffoldRuntimeDependencies())) {
|
|
823
|
+
if (declared.has(name))
|
|
824
|
+
continue;
|
|
825
|
+
deps[name] = range;
|
|
826
|
+
added.push(name);
|
|
827
|
+
}
|
|
828
|
+
if (added.length > 0) {
|
|
829
|
+
pkg.dependencies = Object.fromEntries(Object.entries(deps).sort(([a], [b]) => a.localeCompare(b)));
|
|
830
|
+
}
|
|
831
|
+
return added;
|
|
832
|
+
}
|
|
747
833
|
/** True when the project has hand-written CommonJS at the root (excluding tooling dirs). */
|
|
748
834
|
async function hasCommonJsSources(cwd) {
|
|
749
835
|
const SKIP = new Set(["node_modules", ".git", "dist", "build", ".metaobjects", "codegen"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACrJ,OAAO,EACL,QAAQ,EAAE,uBAAuB,EAAE,YAAY,EAC/C,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAwB,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAA+B,MAAM,4BAA4B,CAAC;AAEhG,sFAAsF;AACtF,oFAAoF;AACpF,MAA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AE,GAAa,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type OwnedVerdict =
|
|
2
|
+
/** Byte-for-byte the reference. */
|
|
3
|
+
"identical"
|
|
4
|
+
/** Same content, different layout — a formatter ran over it, nothing else. */
|
|
5
|
+
| "reformatted"
|
|
6
|
+
/** Genuine content difference: your edits, upstream's, or both. */
|
|
7
|
+
| "differs";
|
|
8
|
+
export interface OwnedComparison {
|
|
9
|
+
verdict: OwnedVerdict;
|
|
10
|
+
/** Canonical lines the COPY has that the reference does not — your edits, and what
|
|
11
|
+
* `--force` would destroy. */
|
|
12
|
+
localOnly: number;
|
|
13
|
+
/** Canonical lines the REFERENCE has that the copy does not — how far behind it is. */
|
|
14
|
+
referenceOnly: number;
|
|
15
|
+
}
|
|
16
|
+
/** The canonical line multiset of one file, sorted. Exported for the tests that pin
|
|
17
|
+
* each formatter-insensitivity claim above against real reformatted input. */
|
|
18
|
+
export declare function canonicalLines(src: string): Promise<string[]>;
|
|
19
|
+
export declare function compareOwnedCopy(owned: string, reference: string): Promise<OwnedComparison>;
|
|
20
|
+
//# sourceMappingURL=owned-copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owned-copy.d.ts","sourceRoot":"","sources":["../../../src/lib/owned-copy.ts"],"names":[],"mappings":"AAqCA,MAAM,MAAM,YAAY;AACtB,mCAAmC;AACjC,WAAW;AACb,8EAA8E;GAC5E,aAAa;AACf,mEAAmE;GACjE,SAAS,CAAC;AAEd,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB;mCAC+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,aAAa,EAAE,MAAM,CAAC;CACvB;AAuBD;+EAC+E;AAC/E,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBnE;AAeD,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAUjG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// How an OWNED generator copy compares to the reference template this CLI ships.
|
|
2
|
+
//
|
|
3
|
+
// ADR-0034 hands an adopter a file and then never speaks about it again, so `meta
|
|
4
|
+
// eject` and `meta eject --list` are the only places that condition is ever observable.
|
|
5
|
+
// The first version of this compared BYTES and counted lines the copy had that the
|
|
6
|
+
// reference did not. On a project that runs its own formatter over the code it owns —
|
|
7
|
+
// which is most of them, and it is the whole point that these are ordinary files in
|
|
8
|
+
// their repo — that answer is useless: every copy reads DIFFERS forever, and the count
|
|
9
|
+
// is dominated by re-wrapping and import sorting rather than by anything anyone wrote.
|
|
10
|
+
// One adopter estate had all of its owned copies reporting double-digit differences
|
|
11
|
+
// while being, in content, exactly the reference.
|
|
12
|
+
//
|
|
13
|
+
// So the comparison is made on a CANONICAL form instead, and the verdict grew a third
|
|
14
|
+
// value — `reformatted`, meaning "same content, your layout". The canonical form is
|
|
15
|
+
// produced by re-formatting both sides through the SAME formatter, deliberately at
|
|
16
|
+
// `lineWidth: 1` so every construct explodes onto its own line, then sorting those
|
|
17
|
+
// lines. That composition is what makes it survive each way a formatter rewrites a
|
|
18
|
+
// file without changing it:
|
|
19
|
+
//
|
|
20
|
+
// indentation, wrapping, quote style, semicolons → the formatter normalizes them
|
|
21
|
+
// trailing commas → `trailingCommas: "none"` + the
|
|
22
|
+
// per-line strip below (reordering
|
|
23
|
+
// a list moves which member is last)
|
|
24
|
+
// import statement AND specifier order → exploded one per line, then sorted
|
|
25
|
+
//
|
|
26
|
+
// The cost is deliberate and stated: sorting lines also makes the comparison blind to
|
|
27
|
+
// a pure REORDERING of real code. That is the right trade for a report line whose job
|
|
28
|
+
// is "have you fallen behind upstream" — a reorder with no content change is not
|
|
29
|
+
// staleness — and every message that carries this verdict also prints the `diff`
|
|
30
|
+
// command, which is not blind to anything.
|
|
31
|
+
//
|
|
32
|
+
// Fail-safe: if the formatter is unavailable or rejects the input (an adopter's copy is
|
|
33
|
+
// theirs and may not even parse), canonicalization degrades to trimmed raw lines. The
|
|
34
|
+
// verdict then reads `differs` where it might have read `reformatted` — the pre-existing
|
|
35
|
+
// behaviour, never a false `reformatted`.
|
|
36
|
+
import { Biome, Distribution } from "@biomejs/js-api";
|
|
37
|
+
// One instance, created lazily and shared. Cache the PROMISE so concurrent first calls
|
|
38
|
+
// (--list compares every owned copy) share one in-flight create rather than racing.
|
|
39
|
+
let _biome;
|
|
40
|
+
function getBiome() {
|
|
41
|
+
if (!_biome) {
|
|
42
|
+
_biome = Biome.create({ distribution: Distribution.NODE })
|
|
43
|
+
.then((biome) => {
|
|
44
|
+
biome.applyConfiguration({
|
|
45
|
+
formatter: { enabled: true, indentStyle: "space", indentWidth: 2, lineWidth: 1 },
|
|
46
|
+
javascript: { formatter: { quoteStyle: "double", semicolons: "always", trailingCommas: "none" } },
|
|
47
|
+
});
|
|
48
|
+
return biome;
|
|
49
|
+
})
|
|
50
|
+
// A comparison is a REPORT LINE. If the formatter cannot start, say less — never
|
|
51
|
+
// fail the command the adopter actually ran.
|
|
52
|
+
.catch(() => undefined);
|
|
53
|
+
}
|
|
54
|
+
return _biome;
|
|
55
|
+
}
|
|
56
|
+
/** The canonical line multiset of one file, sorted. Exported for the tests that pin
|
|
57
|
+
* each formatter-insensitivity claim above against real reformatted input. */
|
|
58
|
+
export async function canonicalLines(src) {
|
|
59
|
+
let text = src;
|
|
60
|
+
const biome = await getBiome();
|
|
61
|
+
if (biome !== undefined) {
|
|
62
|
+
try {
|
|
63
|
+
const result = biome.formatContent(src, { filePath: "in-memory.ts" });
|
|
64
|
+
if (result.diagnostics.length === 0)
|
|
65
|
+
text = result.content;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
/* keep the raw text — see the fail-safe note above */
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return text
|
|
72
|
+
.split("\n")
|
|
73
|
+
// The trailing-comma strip is per LINE and only meaningful because every construct
|
|
74
|
+
// is already on its own line: reordering an import list changes which specifier is
|
|
75
|
+
// last, and only the last one lacks a comma.
|
|
76
|
+
.map((l) => l.trim().replace(/,$/, ""))
|
|
77
|
+
.filter((l) => l !== "")
|
|
78
|
+
.sort();
|
|
79
|
+
}
|
|
80
|
+
/** How many members of `a` are not in `b`, counting duplicates. */
|
|
81
|
+
function countMissing(a, b) {
|
|
82
|
+
const remaining = new Map();
|
|
83
|
+
for (const l of b)
|
|
84
|
+
remaining.set(l, (remaining.get(l) ?? 0) + 1);
|
|
85
|
+
let missing = 0;
|
|
86
|
+
for (const l of a) {
|
|
87
|
+
const n = remaining.get(l) ?? 0;
|
|
88
|
+
if (n > 0)
|
|
89
|
+
remaining.set(l, n - 1);
|
|
90
|
+
else
|
|
91
|
+
missing++;
|
|
92
|
+
}
|
|
93
|
+
return missing;
|
|
94
|
+
}
|
|
95
|
+
export async function compareOwnedCopy(owned, reference) {
|
|
96
|
+
if (owned === reference)
|
|
97
|
+
return { verdict: "identical", localOnly: 0, referenceOnly: 0 };
|
|
98
|
+
const [a, b] = await Promise.all([canonicalLines(owned), canonicalLines(reference)]);
|
|
99
|
+
const localOnly = countMissing(a, b);
|
|
100
|
+
const referenceOnly = countMissing(b, a);
|
|
101
|
+
return {
|
|
102
|
+
verdict: localOnly === 0 && referenceOnly === 0 ? "reformatted" : "differs",
|
|
103
|
+
localOnly,
|
|
104
|
+
referenceOnly,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=owned-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owned-copy.js","sourceRoot":"","sources":["../../../src/lib/owned-copy.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,kFAAkF;AAClF,wFAAwF;AACxF,mFAAmF;AACnF,sFA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G,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;;YAC9B,OAAO,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa,EAAE,SAAiB;IACrE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;IACzF,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACrF,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,OAAO;QACL,OAAO,EAAE,SAAS,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;QAC3E,SAAS;QACT,aAAa;KACd,CAAC;AACJ,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.4",
|
|
4
4
|
"description": "CLI for MetaObjects: scaffold, codegen, migrate, and drift-detection commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -48,16 +48,18 @@
|
|
|
48
48
|
"drift-detection"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@biomejs/js-api": "^0.7.0",
|
|
52
|
+
"@biomejs/wasm-nodejs": "^1.9.4",
|
|
51
53
|
"@libsql/kysely-libsql": "^0.4.0",
|
|
52
|
-
"@metaobjectsdev/codegen-ts": "1.0.0-rc.
|
|
53
|
-
"@metaobjectsdev/codegen-ts-react": "1.0.0-rc.
|
|
54
|
-
"@metaobjectsdev/codegen-ts-tanstack": "1.0.0-rc.
|
|
55
|
-
"@metaobjectsdev/docs-site": "1.0.0-rc.
|
|
56
|
-
"@metaobjectsdev/metadata": "1.0.0-rc.
|
|
57
|
-
"@metaobjectsdev/migrate-ts": "1.0.0-rc.
|
|
58
|
-
"@metaobjectsdev/render": "1.0.0-rc.
|
|
59
|
-
"@metaobjectsdev/runtime-ts": "1.0.0-rc.
|
|
60
|
-
"@metaobjectsdev/sdk": "1.0.0-rc.
|
|
54
|
+
"@metaobjectsdev/codegen-ts": "1.0.0-rc.4",
|
|
55
|
+
"@metaobjectsdev/codegen-ts-react": "1.0.0-rc.4",
|
|
56
|
+
"@metaobjectsdev/codegen-ts-tanstack": "1.0.0-rc.4",
|
|
57
|
+
"@metaobjectsdev/docs-site": "1.0.0-rc.4",
|
|
58
|
+
"@metaobjectsdev/metadata": "1.0.0-rc.4",
|
|
59
|
+
"@metaobjectsdev/migrate-ts": "1.0.0-rc.4",
|
|
60
|
+
"@metaobjectsdev/render": "1.0.0-rc.4",
|
|
61
|
+
"@metaobjectsdev/runtime-ts": "1.0.0-rc.4",
|
|
62
|
+
"@metaobjectsdev/sdk": "1.0.0-rc.4",
|
|
61
63
|
"@toon-format/toon": "^2.3.0",
|
|
62
64
|
"jiti": "^2.4.0"
|
|
63
65
|
},
|
package/src/commands/eject.ts
CHANGED
|
@@ -12,6 +12,7 @@ import * as tanstackTpl from "@metaobjectsdev/codegen-ts-tanstack";
|
|
|
12
12
|
import { parseEjectArgs } from "../lib/args.js";
|
|
13
13
|
import { log } from "../lib/log.js";
|
|
14
14
|
import { declaredDependencyNames, readPackageManifest } from "../lib/package-manifest.js";
|
|
15
|
+
import { compareOwnedCopy, type OwnedComparison } from "../lib/owned-copy.js";
|
|
15
16
|
|
|
16
17
|
// Mirrors `OWNED_GENERATORS_DIR` in init.ts's `writeOwnedGenerators` — same directory,
|
|
17
18
|
// same never-clobber-without-consent contract. Kept as its own local constant rather
|
|
@@ -134,15 +135,7 @@ export interface EjectResult {
|
|
|
134
135
|
* green, because nothing compares an owned copy to anything. Reporting this is the
|
|
135
136
|
* cheapest thing that makes that condition observable.
|
|
136
137
|
*/
|
|
137
|
-
|
|
138
|
-
/** Lines of the previous file that the reference does not have. Set only when it differs. */
|
|
139
|
-
changedLines?: number | undefined;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Lines present in `a` and not in `b` — a cheap "how far apart" for a report line. */
|
|
143
|
-
function changedLineCount(a: string, b: string): number {
|
|
144
|
-
const other = new Set(b.split("\n"));
|
|
145
|
-
return a.split("\n").filter((l) => l.trim() !== "" && !other.has(l)).length;
|
|
138
|
+
comparison?: OwnedComparison | undefined;
|
|
146
139
|
}
|
|
147
140
|
|
|
148
141
|
/** The `@metaobjectsdev/*` packages an ejected template imports, read from the file
|
|
@@ -221,15 +214,11 @@ export async function ejectGenerator(opts: EjectOptions): Promise<EjectResult> {
|
|
|
221
214
|
};
|
|
222
215
|
|
|
223
216
|
const existing = (await fileExists(abs)) ? await readFile(abs, "utf8") : undefined;
|
|
224
|
-
const
|
|
225
|
-
existing === undefined ? undefined : existing
|
|
226
|
-
const changedLines =
|
|
227
|
-
local === "differs" && existing !== undefined
|
|
228
|
-
? changedLineCount(existing, templateSource)
|
|
229
|
-
: undefined;
|
|
217
|
+
const comparison =
|
|
218
|
+
existing === undefined ? undefined : await compareOwnedCopy(existing, templateSource);
|
|
230
219
|
|
|
231
220
|
if (!opts.force && existing !== undefined) {
|
|
232
|
-
return { ...common, status: "preserved",
|
|
221
|
+
return { ...common, status: "preserved", comparison };
|
|
233
222
|
}
|
|
234
223
|
|
|
235
224
|
await mkdir(join(opts.cwd, OWNED_GENERATORS_DIR), { recursive: true });
|
|
@@ -237,8 +226,7 @@ export async function ejectGenerator(opts: EjectOptions): Promise<EjectResult> {
|
|
|
237
226
|
return {
|
|
238
227
|
...common,
|
|
239
228
|
status: existing === undefined ? "created" : "replaced",
|
|
240
|
-
|
|
241
|
-
changedLines,
|
|
229
|
+
comparison,
|
|
242
230
|
};
|
|
243
231
|
}
|
|
244
232
|
|
|
@@ -272,13 +260,16 @@ async function listOutput(cwd: string): Promise<string> {
|
|
|
272
260
|
continue;
|
|
273
261
|
}
|
|
274
262
|
const owned = await readFile(abs, "utf8");
|
|
275
|
-
|
|
263
|
+
const cmp = await compareOwnedCopy(owned, ref);
|
|
264
|
+
if (cmp.verdict === "identical") {
|
|
276
265
|
lines.push(` ${name} [owned — identical to the reference]`);
|
|
266
|
+
} else if (cmp.verdict === "reformatted") {
|
|
267
|
+
lines.push(` ${name} [owned — same content as the reference, your formatting]`);
|
|
277
268
|
} else {
|
|
278
269
|
anyStale = true;
|
|
279
270
|
lines.push(
|
|
280
|
-
` ${name} [owned — DIFFERS
|
|
281
|
-
`${
|
|
271
|
+
` ${name} [owned — DIFFERS: ${cmp.referenceOnly} line(s) behind, ` +
|
|
272
|
+
`${cmp.localOnly} line(s) of your own]`,
|
|
282
273
|
);
|
|
283
274
|
}
|
|
284
275
|
}
|
|
@@ -286,8 +277,17 @@ async function listOutput(cwd: string): Promise<string> {
|
|
|
286
277
|
}
|
|
287
278
|
if (anyStale) {
|
|
288
279
|
lines.push(
|
|
289
|
-
"
|
|
290
|
-
"
|
|
280
|
+
"Both counts ignore formatting: each file is re-formatted and its lines sorted " +
|
|
281
|
+
"before comparing, so re-wrapping and import order never show up here.",
|
|
282
|
+
);
|
|
283
|
+
lines.push(
|
|
284
|
+
" \"behind\" — lines the reference has that your copy does not. Upstream moved.",
|
|
285
|
+
);
|
|
286
|
+
lines.push(
|
|
287
|
+
" \"of your own\" — lines your copy has that the reference does not. Your customization.",
|
|
288
|
+
);
|
|
289
|
+
lines.push(
|
|
290
|
+
"`meta eject <name>` prints the diff command that shows which lines they are.",
|
|
291
291
|
);
|
|
292
292
|
lines.push("");
|
|
293
293
|
}
|
|
@@ -321,15 +321,29 @@ export async function ejectCommand(args: string[], cwd: string): Promise<number>
|
|
|
321
321
|
// question nobody has. What an owner needs to know is whether their copy still
|
|
322
322
|
// matches what this CLI ships — the only way an owned generator's staleness is
|
|
323
323
|
// ever observable, since no gate compares the two.
|
|
324
|
-
if (result.
|
|
324
|
+
if (result.comparison?.verdict === "identical") {
|
|
325
325
|
log.info(
|
|
326
326
|
`${result.path} already exists and is IDENTICAL to the ${result.packageName} ` +
|
|
327
327
|
"reference template — nothing to do.",
|
|
328
328
|
);
|
|
329
|
+
} else if (result.comparison?.verdict === "reformatted") {
|
|
330
|
+
// Worth its own branch: this is the state a project that formats what it owns
|
|
331
|
+
// is in permanently, and calling it DIFFERS taught every one of them to ignore
|
|
332
|
+
// the line that is supposed to warn them.
|
|
333
|
+
log.info(
|
|
334
|
+
`${result.path} already exists and has the SAME CONTENT as the ` +
|
|
335
|
+
`${result.packageName} reference template, in your own formatting — ` +
|
|
336
|
+
"nothing to do.",
|
|
337
|
+
);
|
|
329
338
|
} else {
|
|
330
339
|
log.info(
|
|
331
340
|
`${result.path} already exists and DIFFERS from the ${result.packageName} ` +
|
|
332
|
-
`reference template (${result.
|
|
341
|
+
`reference template (${result.comparison?.referenceOnly ?? 0} line(s) behind it, ` +
|
|
342
|
+
`${result.comparison?.localOnly ?? 0} line(s) of your own) — left untouched.`,
|
|
343
|
+
);
|
|
344
|
+
log.info(
|
|
345
|
+
" Formatting is not counted: both files are re-formatted and their lines " +
|
|
346
|
+
"sorted before comparing, so re-wrapping and import order never show up.",
|
|
333
347
|
);
|
|
334
348
|
log.info(
|
|
335
349
|
" That difference is either YOUR customization or upstream having moved on. " +
|
|
@@ -348,9 +362,11 @@ export async function ejectCommand(args: string[], cwd: string): Promise<number>
|
|
|
348
362
|
// only record that the customization was deliberate.
|
|
349
363
|
log.info(
|
|
350
364
|
`Ejected "${flags.name}" -> ${result.path}, REPLACING the file that was there` +
|
|
351
|
-
(result.
|
|
352
|
-
? ` and DISCARDING ${result.
|
|
353
|
-
:
|
|
365
|
+
(result.comparison?.verdict === "differs"
|
|
366
|
+
? ` and DISCARDING ${result.comparison.localOnly} line(s) it had that the reference does not.`
|
|
367
|
+
: result.comparison?.verdict === "reformatted"
|
|
368
|
+
? " (its content was already the reference's — only your formatting is gone)."
|
|
369
|
+
: " (it was already identical to the reference)."),
|
|
354
370
|
);
|
|
355
371
|
} else {
|
|
356
372
|
log.info(`Ejected "${flags.name}" -> ${result.path}. You own it now (ADR-0034 scaffold-and-own).`);
|
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,
|
|
@@ -774,6 +775,7 @@ async function ensureEsmPackageType(cwd: string, result: InitResult): Promise<vo
|
|
|
774
775
|
const declaredType = pkg.type; // read BEFORE the mutation below overwrites it
|
|
775
776
|
pkg.type = "module";
|
|
776
777
|
const added = addScaffoldDevDependencies(pkg);
|
|
778
|
+
const addedRuntime = addScaffoldRuntimeDependencies(pkg);
|
|
777
779
|
// Preserve the file's existing indentation rather than reformatting someone's manifest.
|
|
778
780
|
const indent = /\n(\s+)"/.exec(raw)?.[1] ?? " ";
|
|
779
781
|
await writeFile(pkgPath, `${JSON.stringify(pkg, null, indent)}\n`, "utf8");
|
|
@@ -798,6 +800,13 @@ async function ensureEsmPackageType(cwd: string, result: InitResult): Promise<vo
|
|
|
798
800
|
"Run your package manager's install before `meta gen`.",
|
|
799
801
|
);
|
|
800
802
|
}
|
|
803
|
+
if (addedRuntime.length > 0) {
|
|
804
|
+
result.warnings.push(
|
|
805
|
+
`added ${addedRuntime.join(" + ")} to dependencies — the code \`meta gen\` writes ` +
|
|
806
|
+
"imports them, so `npx tsc` reports TS2307 on the generated files until they are " +
|
|
807
|
+
"installed. Run your package manager's install before `meta gen`.",
|
|
808
|
+
);
|
|
809
|
+
}
|
|
801
810
|
}
|
|
802
811
|
|
|
803
812
|
/**
|
|
@@ -844,6 +853,86 @@ function addScaffoldDevDependencies(pkg: Record<string, unknown>): string[] {
|
|
|
844
853
|
return added;
|
|
845
854
|
}
|
|
846
855
|
|
|
856
|
+
/**
|
|
857
|
+
* The third-party packages the scaffolded suite's GENERATED OUTPUT imports, each named
|
|
858
|
+
* with the artifact that imports it. This is the set, not the ranges — see
|
|
859
|
+
* `scaffoldRuntimeDependencies` for where those come from.
|
|
860
|
+
*
|
|
861
|
+
* `@metaobjectsdev/runtime-ts` is deliberately not here: its range is the CLI's own
|
|
862
|
+
* version, like the two build-time packages above, not a peer range read off itself.
|
|
863
|
+
*/
|
|
864
|
+
const SCAFFOLD_OUTPUT_PEERS = [
|
|
865
|
+
"drizzle-orm", // <Entity>.ts (the table + column builders) and <Entity>.queries.ts
|
|
866
|
+
"zod", // <Entity>.ts — the Insert/Update schemas
|
|
867
|
+
"fastify", // <Entity>.routes.ts — `import type { FastifyInstance }`
|
|
868
|
+
] as const;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* The runtime dependencies of the code `meta gen` will WRITE, for `dependencies`.
|
|
872
|
+
*
|
|
873
|
+
* `addScaffoldDevDependencies` above fixed this defect one layer in: the generator
|
|
874
|
+
* SOURCES under `codegen/generators/` import `@metaobjectsdev/codegen-ts` and
|
|
875
|
+
* `@metaobjectsdev/metadata`, nothing declared them, and the scaffold arrived
|
|
876
|
+
* un-typecheckable. The same argument reaches one layer further out and was not
|
|
877
|
+
* followed there. Generated `<Entity>.ts` / `.queries.ts` / `.routes.ts` import
|
|
878
|
+
* drizzle-orm, zod, fastify and `@metaobjectsdev/runtime-ts/drizzle-fastify` — five
|
|
879
|
+
* specifiers, none declared — so `npx tsc`, which is the next step `meta gen` itself
|
|
880
|
+
* prints, reported NINE TS2307s on a brand-new project that had done nothing wrong.
|
|
881
|
+
* npm hides four of the five by hoisting them out of the CLI's own tree; pnpm's strict
|
|
882
|
+
* layout, which is the point of testing both, shows all five.
|
|
883
|
+
*
|
|
884
|
+
* `dependencies`, not `devDependencies`: generated routes and queries are application
|
|
885
|
+
* source that runs in production. The two build-time packages stay where they are.
|
|
886
|
+
*
|
|
887
|
+
* The RANGES are read from `@metaobjectsdev/runtime-ts`'s own `peerDependencies` rather
|
|
888
|
+
* than written here. That package already declares the versions its helpers are built
|
|
889
|
+
* against, bounded above (the peer-range gate enforces the bound), so a second copy of
|
|
890
|
+
* those ranges in the scaffolder is a second thing to keep in step — and the failure
|
|
891
|
+
* mode of drift is an adopter installing a major nothing was tested against. If a range
|
|
892
|
+
* cannot be read, the package is SKIPPED rather than guessed at, and `meta gen` still
|
|
893
|
+
* type-checks for anyone whose manifest already declares it.
|
|
894
|
+
*/
|
|
895
|
+
function scaffoldRuntimeDependencies(): Record<string, string> {
|
|
896
|
+
const wanted: Record<string, string> = {
|
|
897
|
+
"@metaobjectsdev/runtime-ts": `^${cliVersion()}`,
|
|
898
|
+
};
|
|
899
|
+
const peers = runtimeTsPeerRanges();
|
|
900
|
+
for (const name of SCAFFOLD_OUTPUT_PEERS) {
|
|
901
|
+
const range = peers[name];
|
|
902
|
+
if (range !== undefined) wanted[name] = range;
|
|
903
|
+
}
|
|
904
|
+
return wanted;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/** `@metaobjectsdev/runtime-ts`'s declared peer ranges, or `{}` if it cannot be read. */
|
|
908
|
+
function runtimeTsPeerRanges(): Record<string, string> {
|
|
909
|
+
try {
|
|
910
|
+
const req = createRequire(import.meta.url);
|
|
911
|
+
const manifestPath = req.resolve("@metaobjectsdev/runtime-ts/package.json");
|
|
912
|
+
const manifest = JSON.parse(readFileSyncWrap(manifestPath, "utf8")) as PackageManifest;
|
|
913
|
+
return (manifest.peerDependencies ?? {}) as Record<string, string>;
|
|
914
|
+
} catch {
|
|
915
|
+
return {};
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/** Adds any missing `scaffoldRuntimeDependencies()` to `dependencies`. Only ever ADDS a
|
|
920
|
+
* missing key — an existing pin, in any of the four dependency fields, is the user's. */
|
|
921
|
+
function addScaffoldRuntimeDependencies(pkg: Record<string, unknown>): string[] {
|
|
922
|
+
const deps = (pkg.dependencies ?? {}) as Record<string, string>;
|
|
923
|
+
const declared = declaredDependencyNames(pkg as PackageManifest);
|
|
924
|
+
const added: string[] = [];
|
|
925
|
+
for (const [name, range] of Object.entries(scaffoldRuntimeDependencies())) {
|
|
926
|
+
if (declared.has(name)) continue;
|
|
927
|
+
deps[name] = range;
|
|
928
|
+
added.push(name);
|
|
929
|
+
}
|
|
930
|
+
if (added.length > 0) {
|
|
931
|
+
pkg.dependencies = Object.fromEntries(Object.entries(deps).sort(([a], [b]) => a.localeCompare(b)));
|
|
932
|
+
}
|
|
933
|
+
return added;
|
|
934
|
+
}
|
|
935
|
+
|
|
847
936
|
/** True when the project has hand-written CommonJS at the root (excluding tooling dirs). */
|
|
848
937
|
async function hasCommonJsSources(cwd: string): Promise<boolean> {
|
|
849
938
|
const SKIP = new Set(["node_modules", ".git", "dist", "build", ".metaobjects", "codegen"]);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// How an OWNED generator copy compares to the reference template this CLI ships.
|
|
2
|
+
//
|
|
3
|
+
// ADR-0034 hands an adopter a file and then never speaks about it again, so `meta
|
|
4
|
+
// eject` and `meta eject --list` are the only places that condition is ever observable.
|
|
5
|
+
// The first version of this compared BYTES and counted lines the copy had that the
|
|
6
|
+
// reference did not. On a project that runs its own formatter over the code it owns —
|
|
7
|
+
// which is most of them, and it is the whole point that these are ordinary files in
|
|
8
|
+
// their repo — that answer is useless: every copy reads DIFFERS forever, and the count
|
|
9
|
+
// is dominated by re-wrapping and import sorting rather than by anything anyone wrote.
|
|
10
|
+
// One adopter estate had all of its owned copies reporting double-digit differences
|
|
11
|
+
// while being, in content, exactly the reference.
|
|
12
|
+
//
|
|
13
|
+
// So the comparison is made on a CANONICAL form instead, and the verdict grew a third
|
|
14
|
+
// value — `reformatted`, meaning "same content, your layout". The canonical form is
|
|
15
|
+
// produced by re-formatting both sides through the SAME formatter, deliberately at
|
|
16
|
+
// `lineWidth: 1` so every construct explodes onto its own line, then sorting those
|
|
17
|
+
// lines. That composition is what makes it survive each way a formatter rewrites a
|
|
18
|
+
// file without changing it:
|
|
19
|
+
//
|
|
20
|
+
// indentation, wrapping, quote style, semicolons → the formatter normalizes them
|
|
21
|
+
// trailing commas → `trailingCommas: "none"` + the
|
|
22
|
+
// per-line strip below (reordering
|
|
23
|
+
// a list moves which member is last)
|
|
24
|
+
// import statement AND specifier order → exploded one per line, then sorted
|
|
25
|
+
//
|
|
26
|
+
// The cost is deliberate and stated: sorting lines also makes the comparison blind to
|
|
27
|
+
// a pure REORDERING of real code. That is the right trade for a report line whose job
|
|
28
|
+
// is "have you fallen behind upstream" — a reorder with no content change is not
|
|
29
|
+
// staleness — and every message that carries this verdict also prints the `diff`
|
|
30
|
+
// command, which is not blind to anything.
|
|
31
|
+
//
|
|
32
|
+
// Fail-safe: if the formatter is unavailable or rejects the input (an adopter's copy is
|
|
33
|
+
// theirs and may not even parse), canonicalization degrades to trimmed raw lines. The
|
|
34
|
+
// verdict then reads `differs` where it might have read `reformatted` — the pre-existing
|
|
35
|
+
// behaviour, never a false `reformatted`.
|
|
36
|
+
import { Biome, Distribution } from "@biomejs/js-api";
|
|
37
|
+
|
|
38
|
+
export type OwnedVerdict =
|
|
39
|
+
/** Byte-for-byte the reference. */
|
|
40
|
+
| "identical"
|
|
41
|
+
/** Same content, different layout — a formatter ran over it, nothing else. */
|
|
42
|
+
| "reformatted"
|
|
43
|
+
/** Genuine content difference: your edits, upstream's, or both. */
|
|
44
|
+
| "differs";
|
|
45
|
+
|
|
46
|
+
export interface OwnedComparison {
|
|
47
|
+
verdict: OwnedVerdict;
|
|
48
|
+
/** Canonical lines the COPY has that the reference does not — your edits, and what
|
|
49
|
+
* `--force` would destroy. */
|
|
50
|
+
localOnly: number;
|
|
51
|
+
/** Canonical lines the REFERENCE has that the copy does not — how far behind it is. */
|
|
52
|
+
referenceOnly: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// One instance, created lazily and shared. Cache the PROMISE so concurrent first calls
|
|
56
|
+
// (--list compares every owned copy) share one in-flight create rather than racing.
|
|
57
|
+
let _biome: Promise<Biome | undefined> | undefined;
|
|
58
|
+
|
|
59
|
+
function getBiome(): Promise<Biome | undefined> {
|
|
60
|
+
if (!_biome) {
|
|
61
|
+
_biome = Biome.create({ distribution: Distribution.NODE })
|
|
62
|
+
.then((biome) => {
|
|
63
|
+
biome.applyConfiguration({
|
|
64
|
+
formatter: { enabled: true, indentStyle: "space", indentWidth: 2, lineWidth: 1 },
|
|
65
|
+
javascript: { formatter: { quoteStyle: "double", semicolons: "always", trailingCommas: "none" } },
|
|
66
|
+
});
|
|
67
|
+
return biome;
|
|
68
|
+
})
|
|
69
|
+
// A comparison is a REPORT LINE. If the formatter cannot start, say less — never
|
|
70
|
+
// fail the command the adopter actually ran.
|
|
71
|
+
.catch(() => undefined);
|
|
72
|
+
}
|
|
73
|
+
return _biome;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The canonical line multiset of one file, sorted. Exported for the tests that pin
|
|
77
|
+
* each formatter-insensitivity claim above against real reformatted input. */
|
|
78
|
+
export async function canonicalLines(src: string): Promise<string[]> {
|
|
79
|
+
let text = src;
|
|
80
|
+
const biome = await getBiome();
|
|
81
|
+
if (biome !== undefined) {
|
|
82
|
+
try {
|
|
83
|
+
const result = biome.formatContent(src, { filePath: "in-memory.ts" });
|
|
84
|
+
if (result.diagnostics.length === 0) text = result.content;
|
|
85
|
+
} catch {
|
|
86
|
+
/* keep the raw text — see the fail-safe note above */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return text
|
|
90
|
+
.split("\n")
|
|
91
|
+
// The trailing-comma strip is per LINE and only meaningful because every construct
|
|
92
|
+
// is already on its own line: reordering an import list changes which specifier is
|
|
93
|
+
// last, and only the last one lacks a comma.
|
|
94
|
+
.map((l) => l.trim().replace(/,$/, ""))
|
|
95
|
+
.filter((l) => l !== "")
|
|
96
|
+
.sort();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** How many members of `a` are not in `b`, counting duplicates. */
|
|
100
|
+
function countMissing(a: string[], b: string[]): number {
|
|
101
|
+
const remaining = new Map<string, number>();
|
|
102
|
+
for (const l of b) remaining.set(l, (remaining.get(l) ?? 0) + 1);
|
|
103
|
+
let missing = 0;
|
|
104
|
+
for (const l of a) {
|
|
105
|
+
const n = remaining.get(l) ?? 0;
|
|
106
|
+
if (n > 0) remaining.set(l, n - 1);
|
|
107
|
+
else missing++;
|
|
108
|
+
}
|
|
109
|
+
return missing;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export async function compareOwnedCopy(owned: string, reference: string): Promise<OwnedComparison> {
|
|
113
|
+
if (owned === reference) return { verdict: "identical", localOnly: 0, referenceOnly: 0 };
|
|
114
|
+
const [a, b] = await Promise.all([canonicalLines(owned), canonicalLines(reference)]);
|
|
115
|
+
const localOnly = countMissing(a, b);
|
|
116
|
+
const referenceOnly = countMissing(b, a);
|
|
117
|
+
return {
|
|
118
|
+
verdict: localOnly === 0 && referenceOnly === 0 ? "reformatted" : "differs",
|
|
119
|
+
localOnly,
|
|
120
|
+
referenceOnly,
|
|
121
|
+
};
|
|
122
|
+
}
|