@metaobjectsdev/codegen-ts 0.7.0-rc.9 → 0.8.0-rc.1
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/generator.d.ts +9 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js.map +1 -1
- package/dist/generators/docs-data-builder.d.ts +16 -0
- package/dist/generators/docs-data-builder.d.ts.map +1 -0
- package/dist/generators/docs-data-builder.js +381 -0
- package/dist/generators/docs-data-builder.js.map +1 -0
- package/dist/generators/docs-data.d.ts +98 -0
- package/dist/generators/docs-data.d.ts.map +1 -0
- package/dist/generators/docs-data.js +43 -0
- package/dist/generators/docs-data.js.map +1 -0
- package/dist/generators/docs-file.d.ts +8 -0
- package/dist/generators/docs-file.d.ts.map +1 -0
- package/dist/generators/docs-file.js +77 -0
- package/dist/generators/docs-file.js.map +1 -0
- package/dist/generators/entity-file.d.ts.map +1 -1
- package/dist/generators/entity-file.js +7 -0
- package/dist/generators/entity-file.js.map +1 -1
- package/dist/generators/index.d.ts +5 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +4 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/output-prompt-file.d.ts +9 -0
- package/dist/generators/output-prompt-file.d.ts.map +1 -0
- package/dist/generators/output-prompt-file.js +51 -0
- package/dist/generators/output-prompt-file.js.map +1 -0
- package/dist/generators/template-generator.d.ts +41 -0
- package/dist/generators/template-generator.d.ts.map +1 -0
- package/dist/generators/template-generator.js +62 -0
- package/dist/generators/template-generator.js.map +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/instance-artifacts.d.ts +29 -0
- package/dist/instance-artifacts.d.ts.map +1 -0
- package/dist/instance-artifacts.js +57 -0
- package/dist/instance-artifacts.js.map +1 -0
- package/dist/metaobjects-config.d.ts +10 -0
- package/dist/metaobjects-config.d.ts.map +1 -1
- package/dist/metaobjects-config.js +1 -0
- package/dist/metaobjects-config.js.map +1 -1
- package/dist/overwrite-policy.d.ts +39 -2
- package/dist/overwrite-policy.d.ts.map +1 -1
- package/dist/overwrite-policy.js +233 -13
- package/dist/overwrite-policy.js.map +1 -1
- package/dist/render-context.d.ts +4 -1
- package/dist/render-context.d.ts.map +1 -1
- package/dist/render-context.js +1 -0
- package/dist/render-context.js.map +1 -1
- package/dist/render-engine/framework-provider.d.ts +28 -0
- package/dist/render-engine/framework-provider.d.ts.map +1 -0
- package/dist/render-engine/framework-provider.js +104 -0
- package/dist/render-engine/framework-provider.js.map +1 -0
- package/dist/runner.d.ts +15 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +45 -6
- package/dist/runner.js.map +1 -1
- package/dist/templates/docs-file.d.ts +17 -0
- package/dist/templates/docs-file.d.ts.map +1 -0
- package/dist/templates/docs-file.js +37 -0
- package/dist/templates/docs-file.js.map +1 -0
- package/dist/templates/entity-file.d.ts.map +1 -1
- package/dist/templates/entity-file.js +12 -0
- package/dist/templates/entity-file.js.map +1 -1
- package/dist/templates/fr010-field-mapping.d.ts +28 -0
- package/dist/templates/fr010-field-mapping.d.ts.map +1 -0
- package/dist/templates/fr010-field-mapping.js +170 -0
- package/dist/templates/fr010-field-mapping.js.map +1 -0
- package/dist/templates/output-format-spec-emitter.d.ts +4 -0
- package/dist/templates/output-format-spec-emitter.d.ts.map +1 -0
- package/dist/templates/output-format-spec-emitter.js +60 -0
- package/dist/templates/output-format-spec-emitter.js.map +1 -0
- package/dist/templates/output-parser.d.ts.map +1 -1
- package/dist/templates/output-parser.js +69 -4
- package/dist/templates/output-parser.js.map +1 -1
- package/dist/templates/output-prompt.d.ts +10 -0
- package/dist/templates/output-prompt.d.ts.map +1 -0
- package/dist/templates/output-prompt.js +75 -0
- package/dist/templates/output-prompt.js.map +1 -0
- package/dist/templates/recover-schema-emitter.d.ts +8 -0
- package/dist/templates/recover-schema-emitter.d.ts.map +1 -0
- package/dist/templates/recover-schema-emitter.js +64 -0
- package/dist/templates/recover-schema-emitter.js.map +1 -0
- package/package.json +5 -5
- package/src/generator.ts +9 -0
- package/src/generators/docs-data-builder.ts +470 -0
- package/src/generators/docs-data.ts +154 -0
- package/src/generators/docs-file.ts +87 -0
- package/src/generators/entity-file.ts +7 -0
- package/src/generators/index.ts +17 -0
- package/src/generators/output-prompt-file.ts +66 -0
- package/src/generators/template-generator.ts +106 -0
- package/src/index.ts +34 -2
- package/src/instance-artifacts.ts +61 -0
- package/src/metaobjects-config.ts +11 -0
- package/src/overwrite-policy.ts +325 -14
- package/src/render-context.ts +5 -1
- package/src/render-engine/framework-provider.ts +107 -0
- package/src/runner.ts +66 -6
- package/src/templates/docs-file.ts +51 -0
- package/src/templates/entity-file.ts +13 -0
- package/src/templates/fr010-field-mapping.ts +191 -0
- package/src/templates/output-format-spec-emitter.ts +97 -0
- package/src/templates/output-parser.ts +77 -2
- package/src/templates/output-prompt.ts +88 -0
- package/src/templates/recover-schema-emitter.ts +91 -0
- package/templates/docs/entity-page.md.mustache +54 -0
|
@@ -1,8 +1,45 @@
|
|
|
1
|
-
export type WriteStatus = "new" | "overwrite" | "refused" | "skipped";
|
|
1
|
+
export type WriteStatus = "new" | "unchanged" | "overwrite" | "merged" | "conflict" | "refused" | "skipped";
|
|
2
|
+
/**
|
|
3
|
+
* "overwrite" — default; three-way merge if .gen-state exists, else write-if-
|
|
4
|
+
* different / first-time-existing flow.
|
|
5
|
+
* "skip-existing" — never write over an existing file; status "skipped".
|
|
6
|
+
* Useful for `meta gen --dry-run` style flows.
|
|
7
|
+
*/
|
|
2
8
|
export type MergeStrategy = "overwrite" | "skip-existing";
|
|
9
|
+
/** "default" — the standard three-way merge flow described in the file header.
|
|
10
|
+
* "fresh" — opt-in via `meta gen --baseline=fresh`. When .gen-state is absent
|
|
11
|
+
* but the file exists, OVERWRITE with fresh content and seed .gen-state from
|
|
12
|
+
* the fresh content (caveat 3 escape hatch). */
|
|
13
|
+
export type BaselineMode = "default" | "fresh";
|
|
14
|
+
export interface DecideAndWriteOpts {
|
|
15
|
+
strategy?: MergeStrategy;
|
|
16
|
+
/** Absolute path to the .gen-state/ root for this project. When undefined,
|
|
17
|
+
* we fall back to a process-isolated tmpdir — fine for tests but the CLI
|
|
18
|
+
* always supplies the real project value via runGen(). */
|
|
19
|
+
genStateDir?: string;
|
|
20
|
+
/** Path the snapshot is keyed by — usually the path relative to the
|
|
21
|
+
* project root, but ANY stable identifier works. When undefined, derived
|
|
22
|
+
* from `path` (so unit tests can call without supplying it). */
|
|
23
|
+
outputRelPath?: string;
|
|
24
|
+
/** First-time-existing-file behavior. */
|
|
25
|
+
baseline?: BaselineMode;
|
|
26
|
+
}
|
|
3
27
|
export interface WriteResult {
|
|
4
28
|
path: string;
|
|
5
29
|
status: WriteStatus;
|
|
30
|
+
/** Present when status is "conflict" — human-readable hint identifying the
|
|
31
|
+
* file the user must resolve. */
|
|
32
|
+
conflictHint?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Thrown when git is unavailable. Surfaces as a clear CLI error rather than
|
|
35
|
+
* a generic ENOENT halfway through a regen. */
|
|
36
|
+
export declare class GitMissingError extends Error {
|
|
37
|
+
constructor();
|
|
6
38
|
}
|
|
7
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The main entry point. Backward-compatible with the rc.11 signature: passing
|
|
41
|
+
* a `MergeStrategy` string as the third argument continues to work; passing
|
|
42
|
+
* an options object opts into three-way merge.
|
|
43
|
+
*/
|
|
44
|
+
export declare function decideAndWrite(path: string, content: string, optsOrStrategy?: DecideAndWriteOpts | MergeStrategy): WriteResult;
|
|
8
45
|
//# sourceMappingURL=overwrite-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overwrite-policy.d.ts","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overwrite-policy.d.ts","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"AAqCA,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;AAE1D;;;iDAGiD;AACjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;+DAE2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;qEAEiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB;sCACkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoED;gDACgD;AAChD,qBAAa,eAAgB,SAAQ,KAAK;;CAQzC;AAsFD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,kBAAkB,GAAG,aAAkB,GACtD,WAAW,CAgGb"}
|
package/dist/overwrite-policy.js
CHANGED
|
@@ -1,23 +1,243 @@
|
|
|
1
|
-
// Overwrite policy:
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
// Overwrite policy: per-file write decision using three-way merge against a
|
|
2
|
+
// canonical snapshot kept under `.metaobjects/.gen-state/`.
|
|
3
|
+
//
|
|
4
|
+
// Replaces the rc.11 marker-based clobber-or-refuse policy (strategy (a) from
|
|
5
|
+
// spike 002) with strategy (b) — git-merge-file-driven three-way merge. The
|
|
6
|
+
// `@generated` marker becomes purely informational (templates may still emit
|
|
7
|
+
// it for human readers); the policy no longer consults it.
|
|
8
|
+
//
|
|
9
|
+
// Per-file flow:
|
|
10
|
+
//
|
|
11
|
+
// 1. Render fresh content to a tmpfile.
|
|
12
|
+
// 2. If the output doesn't exist → write + copy to .gen-state/.
|
|
13
|
+
// 3. If .gen-state/<relPath> exists → run `git merge-file --diff3` against
|
|
14
|
+
// (current, .gen-state snapshot, fresh tmpfile). Exit 0 → clean merge,
|
|
15
|
+
// advance .gen-state to fresh content. Exit > 0 → leave conflict markers
|
|
16
|
+
// in the output file, do NOT advance .gen-state; status "conflict".
|
|
17
|
+
// 4. If .gen-state/<relPath> is absent but the file exists ("first-time
|
|
18
|
+
// regen on an existing file") → write-if-different against the existing
|
|
19
|
+
// file as the baseline (no merge, no clobber). The `baseline: "fresh"`
|
|
20
|
+
// flag opts into "overwrite from fresh and re-baseline".
|
|
21
|
+
//
|
|
22
|
+
// Integrity (caveat 2 from the spike): we keep a sha-256 of each canonical
|
|
23
|
+
// snapshot at `.gen-state/.hashes.json`. On load, mismatch → fall back to
|
|
24
|
+
// first-time semantics and warn naming the file so the user can investigate.
|
|
25
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync, } from "node:fs";
|
|
26
|
+
import { dirname, join, isAbsolute, relative, resolve } from "node:path";
|
|
27
|
+
import { spawnSync } from "node:child_process";
|
|
28
|
+
import { tmpdir } from "node:os";
|
|
29
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
30
|
+
const HASHES_FILE = ".hashes.json";
|
|
31
|
+
function sha256(content) {
|
|
32
|
+
return createHash("sha256").update(content).digest("hex");
|
|
33
|
+
}
|
|
34
|
+
function loadHashes(genStateDir) {
|
|
35
|
+
const f = join(genStateDir, HASHES_FILE);
|
|
36
|
+
if (!existsSync(f))
|
|
37
|
+
return {};
|
|
38
|
+
try {
|
|
39
|
+
const txt = readFileSync(f, "utf-8");
|
|
40
|
+
const parsed = JSON.parse(txt);
|
|
41
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function saveHashes(genStateDir, hashes) {
|
|
51
|
+
mkdirSync(genStateDir, { recursive: true });
|
|
52
|
+
writeFileSync(join(genStateDir, HASHES_FILE), JSON.stringify(hashes, null, 2) + "\n");
|
|
53
|
+
}
|
|
54
|
+
function snapshotPath(genStateDir, relPath) {
|
|
55
|
+
// `.hashes.json` is reserved at the top of .gen-state/; relPath must never
|
|
56
|
+
// collide with it. Output paths derived from entity names ("Post.ts" etc.)
|
|
57
|
+
// are JS-identifier-shape so this is a non-issue in practice.
|
|
58
|
+
return join(genStateDir, relPath);
|
|
59
|
+
}
|
|
60
|
+
/** Synchronously copy `src` content into the snapshot at `<genStateDir>/<relPath>`
|
|
61
|
+
* and refresh the hash for `relPath`. */
|
|
62
|
+
function advanceSnapshot(genStateDir, relPath, content) {
|
|
63
|
+
const dest = snapshotPath(genStateDir, relPath);
|
|
64
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
65
|
+
writeFileSync(dest, content);
|
|
66
|
+
const hashes = loadHashes(genStateDir);
|
|
67
|
+
hashes[relPath] = sha256(content);
|
|
68
|
+
saveHashes(genStateDir, hashes);
|
|
69
|
+
}
|
|
70
|
+
/** Return the snapshot text iff present AND the hash matches; else undefined. */
|
|
71
|
+
function readSnapshotChecked(genStateDir, relPath) {
|
|
72
|
+
const path = snapshotPath(genStateDir, relPath);
|
|
73
|
+
if (!existsSync(path))
|
|
74
|
+
return undefined;
|
|
75
|
+
const text = readFileSync(path, "utf-8");
|
|
76
|
+
const hashes = loadHashes(genStateDir);
|
|
77
|
+
const expected = hashes[relPath];
|
|
78
|
+
if (expected !== undefined && expected !== sha256(text)) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
return { text };
|
|
82
|
+
}
|
|
83
|
+
/** Thrown when git is unavailable. Surfaces as a clear CLI error rather than
|
|
84
|
+
* a generic ENOENT halfway through a regen. */
|
|
85
|
+
export class GitMissingError extends Error {
|
|
86
|
+
constructor() {
|
|
87
|
+
super("meta gen: `git` binary not found on PATH. Three-way-merge regen " +
|
|
88
|
+
"requires git (any modern version). Install git and re-run.");
|
|
89
|
+
this.name = "GitMissingError";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Run `git merge-file --diff3 -L<...> <out> <base> <fresh>`. The output is
|
|
93
|
+
* written in-place into `outPath`. Returns the exit code (0 = clean, > 0 =
|
|
94
|
+
* conflicts) and the resulting file contents.
|
|
95
|
+
*
|
|
96
|
+
* The git binary is "git" by default; set `META_GEN_GIT` in the environment
|
|
97
|
+
* to a different path (useful for tests that simulate "git not installed"). */
|
|
98
|
+
function runGitMergeFile(outPath, basePath, freshPath) {
|
|
99
|
+
const gitBin = process.env.META_GEN_GIT ?? "git";
|
|
100
|
+
let res;
|
|
101
|
+
try {
|
|
102
|
+
res = spawnSync(gitBin, [
|
|
103
|
+
"merge-file",
|
|
104
|
+
"--diff3",
|
|
105
|
+
"-L",
|
|
106
|
+
"your edits",
|
|
107
|
+
"-L",
|
|
108
|
+
"last generated",
|
|
109
|
+
"-L",
|
|
110
|
+
"fresh from meta gen",
|
|
111
|
+
outPath,
|
|
112
|
+
basePath,
|
|
113
|
+
freshPath,
|
|
114
|
+
], { encoding: "utf-8" });
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
const msg = err.message ?? "";
|
|
118
|
+
if (msg.includes("ENOENT"))
|
|
119
|
+
throw new GitMissingError();
|
|
120
|
+
throw err;
|
|
121
|
+
}
|
|
122
|
+
if (res.error) {
|
|
123
|
+
const code = res.error.code;
|
|
124
|
+
if (code === "ENOENT")
|
|
125
|
+
throw new GitMissingError();
|
|
126
|
+
throw res.error;
|
|
127
|
+
}
|
|
128
|
+
// `git merge-file` returns the conflict count (0 = clean, > 0 = conflicts,
|
|
129
|
+
// < 0 = error). Negative is unexpected — surface verbatim.
|
|
130
|
+
const exitCode = res.status ?? 0;
|
|
131
|
+
if (exitCode < 0) {
|
|
132
|
+
throw new Error(`git merge-file failed for ${outPath}: ${res.stderr || res.stdout}`);
|
|
133
|
+
}
|
|
134
|
+
const mergedContent = readFileSync(outPath, "utf-8");
|
|
135
|
+
return { exitCode, stderr: res.stderr ?? "", mergedContent };
|
|
136
|
+
}
|
|
137
|
+
/** Write `content` to a freshly-named tmpfile under the OS tmpdir; return the
|
|
138
|
+
* path. Caller is responsible for cleanup (acceptable for codegen — tmpdir
|
|
139
|
+
* is process-scoped). */
|
|
140
|
+
function writeTmpfile(content) {
|
|
141
|
+
const dir = join(tmpdir(), "meta-gen-merge");
|
|
142
|
+
mkdirSync(dir, { recursive: true });
|
|
143
|
+
const path = join(dir, `${Date.now()}-${randomBytes(6).toString("hex")}.tmp`);
|
|
144
|
+
writeFileSync(path, content);
|
|
145
|
+
return path;
|
|
146
|
+
}
|
|
147
|
+
/** Resolve the snapshot key for a given output path. Falls back to a stable
|
|
148
|
+
* hash-of-path so unit tests that pass arbitrary tmpdir outputs still get a
|
|
149
|
+
* consistent .gen-state key. */
|
|
150
|
+
function defaultOutputRelPath(outputPath) {
|
|
151
|
+
// Use sha256 of the absolute path → hex; lets tests work without supplying
|
|
152
|
+
// an explicit relPath. NOT used by the runner — runGen always passes the
|
|
153
|
+
// real project-relative path.
|
|
154
|
+
return sha256(resolve(outputPath)).slice(0, 32);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The main entry point. Backward-compatible with the rc.11 signature: passing
|
|
158
|
+
* a `MergeStrategy` string as the third argument continues to work; passing
|
|
159
|
+
* an options object opts into three-way merge.
|
|
160
|
+
*/
|
|
161
|
+
export function decideAndWrite(path, content, optsOrStrategy = {}) {
|
|
162
|
+
const opts = typeof optsOrStrategy === "string"
|
|
163
|
+
? { strategy: optsOrStrategy }
|
|
164
|
+
: optsOrStrategy;
|
|
165
|
+
const strategy = opts.strategy ?? "overwrite";
|
|
166
|
+
const baseline = opts.baseline ?? "default";
|
|
167
|
+
const genStateDir = opts.genStateDir !== undefined
|
|
168
|
+
? (isAbsolute(opts.genStateDir)
|
|
169
|
+
? opts.genStateDir
|
|
170
|
+
: resolve(opts.genStateDir))
|
|
171
|
+
: join(tmpdir(), "meta-gen-state-fallback");
|
|
172
|
+
const relPath = opts.outputRelPath ?? defaultOutputRelPath(path);
|
|
173
|
+
// 1. First-time write — file doesn't exist.
|
|
8
174
|
if (!existsSync(path)) {
|
|
9
175
|
mkdirSync(dirname(path), { recursive: true });
|
|
10
176
|
writeFileSync(path, content);
|
|
177
|
+
advanceSnapshot(genStateDir, relPath, content);
|
|
11
178
|
return { path, status: "new" };
|
|
12
179
|
}
|
|
13
|
-
const current = readFileSync(path, "utf-8");
|
|
14
|
-
if (!current.includes(GENERATED_HEADER)) {
|
|
15
|
-
return { path, status: "refused" };
|
|
16
|
-
}
|
|
17
180
|
if (strategy === "skip-existing") {
|
|
18
181
|
return { path, status: "skipped" };
|
|
19
182
|
}
|
|
20
|
-
|
|
21
|
-
|
|
183
|
+
// 2. File exists. Load the canonical snapshot if any.
|
|
184
|
+
const snapshot = readSnapshotChecked(genStateDir, relPath);
|
|
185
|
+
// 3. First-time regen on a pre-existing file (no snapshot).
|
|
186
|
+
if (snapshot === undefined) {
|
|
187
|
+
const current = readFileSync(path, "utf-8");
|
|
188
|
+
if (baseline === "fresh") {
|
|
189
|
+
// Opt-in escape hatch: overwrite and seed the snapshot from fresh.
|
|
190
|
+
if (current === content) {
|
|
191
|
+
advanceSnapshot(genStateDir, relPath, content);
|
|
192
|
+
return { path, status: "unchanged" };
|
|
193
|
+
}
|
|
194
|
+
writeFileSync(path, content);
|
|
195
|
+
advanceSnapshot(genStateDir, relPath, content);
|
|
196
|
+
return { path, status: "overwrite" };
|
|
197
|
+
}
|
|
198
|
+
// Default: write-if-different. The EXISTING file is treated as the
|
|
199
|
+
// canonical baseline so subsequent runs do real three-way merges. If
|
|
200
|
+
// fresh output is identical, just seed the snapshot. If different, write
|
|
201
|
+
// the fresh content + seed snapshot — there's no marker policy left to
|
|
202
|
+
// refuse on, but this is the contract documented in the runbook (no
|
|
203
|
+
// marker check; users with hand-written files should never have the
|
|
204
|
+
// codegen output path colliding with them).
|
|
205
|
+
if (current === content) {
|
|
206
|
+
advanceSnapshot(genStateDir, relPath, current);
|
|
207
|
+
return { path, status: "unchanged" };
|
|
208
|
+
}
|
|
209
|
+
writeFileSync(path, content);
|
|
210
|
+
advanceSnapshot(genStateDir, relPath, content);
|
|
211
|
+
return { path, status: "overwrite" };
|
|
212
|
+
}
|
|
213
|
+
// 4. Snapshot exists — real three-way merge.
|
|
214
|
+
const current = readFileSync(path, "utf-8");
|
|
215
|
+
// Fast path: nothing changed.
|
|
216
|
+
if (current === content && snapshot.text === content) {
|
|
217
|
+
return { path, status: "unchanged" };
|
|
218
|
+
}
|
|
219
|
+
const baseTmp = writeTmpfile(snapshot.text);
|
|
220
|
+
const freshTmp = writeTmpfile(content);
|
|
221
|
+
const outcome = runGitMergeFile(path, baseTmp, freshTmp);
|
|
222
|
+
if (outcome.exitCode === 0) {
|
|
223
|
+
// Clean merge — advance the canonical snapshot to fresh.
|
|
224
|
+
advanceSnapshot(genStateDir, relPath, content);
|
|
225
|
+
// Distinguish "user had no changes vs canonical" from "merge integrated
|
|
226
|
+
// edits". The fresh equals snapshot case happened above (fast path) — so
|
|
227
|
+
// if outcome.mergedContent equals fresh we report a plain overwrite,
|
|
228
|
+
// otherwise it's a merge that pulled in user edits.
|
|
229
|
+
if (outcome.mergedContent === content) {
|
|
230
|
+
return { path, status: "overwrite" };
|
|
231
|
+
}
|
|
232
|
+
return { path, status: "merged" };
|
|
233
|
+
}
|
|
234
|
+
// Conflict — do NOT advance the snapshot. The output now contains diff3
|
|
235
|
+
// markers from git merge-file.
|
|
236
|
+
return {
|
|
237
|
+
path,
|
|
238
|
+
status: "conflict",
|
|
239
|
+
conflictHint: "merge conflict — resolve `<<<<<<<` markers and re-run `meta gen` to " +
|
|
240
|
+
"advance the canonical state.",
|
|
241
|
+
};
|
|
22
242
|
}
|
|
23
243
|
//# sourceMappingURL=overwrite-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overwrite-policy.js","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"overwrite-policy.js","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4DAA4D;AAC5D,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,2DAA2D;AAC3D,EAAE;AACF,iBAAiB;AACjB,EAAE;AACF,0CAA0C;AAC1C,kEAAkE;AAClE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,yEAAyE;AACzE,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAE7E,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA+CtD,MAAM,WAAW,GAAG,cAAc,CAAC;AAInC,SAAS,MAAM,CAAC,OAAwB;IACtC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,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Strategy: ColumnNamingStrategy;
|
|
36
36
|
/** Path prefix applied to generated route registrations + hook fetch URLs. Defaults to "". */
|
|
37
37
|
apiPrefix: string;
|
|
38
|
+
/** Whether abstract entities emit their shape artifact (type-only interface / value-object file). Defaults to true. Instance/write artifacts are never emitted for abstract entities regardless. */
|
|
39
|
+
emitAbstractShapes: boolean;
|
|
38
40
|
/** Output layout mode: "flat" (default) — all files in outDir; "package" — sub-paths from entity metadata package. */
|
|
39
41
|
outputLayout: OutputLayout;
|
|
40
42
|
/** The target THIS generator emits to (drives path layout + same-target imports). */
|
|
@@ -48,11 +50,12 @@ export interface RenderContext {
|
|
|
48
50
|
packageOf: Map<string, string | undefined>;
|
|
49
51
|
}
|
|
50
52
|
/** Optional shape — `extStyle`, `omImport`, `columnNamingStrategy`, `apiPrefix`, `outputLayout`, and `packageOf` default if omitted. `packageOf` defaults to an empty Map (correct for flat layout; `runGen` always provides the real map). */
|
|
51
|
-
export type RenderContextInput = Omit<RenderContext, "extStyle" | "omImport" | "columnNamingStrategy" | "apiPrefix" | "outputLayout" | "packageOf" | "selfTarget" | "entityModuleTarget"> & {
|
|
53
|
+
export type RenderContextInput = Omit<RenderContext, "extStyle" | "omImport" | "columnNamingStrategy" | "apiPrefix" | "emitAbstractShapes" | "outputLayout" | "packageOf" | "selfTarget" | "entityModuleTarget"> & {
|
|
52
54
|
extStyle?: ExtStyle;
|
|
53
55
|
omImport?: string;
|
|
54
56
|
columnNamingStrategy?: ColumnNamingStrategy;
|
|
55
57
|
apiPrefix?: string;
|
|
58
|
+
emitAbstractShapes?: boolean;
|
|
56
59
|
outputLayout?: OutputLayout;
|
|
57
60
|
packageOf?: Map<string, string | undefined>;
|
|
58
61
|
selfTarget?: ResolvedTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-context.d.ts","sourceRoot":"","sources":["../src/render-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAA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SAAS,CAAC,CAAC;CAC5C;AAED,+OAA+O;AAC/O,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG,WAAW,GAAG,oBAAoB,GAAG,cAAc,GAAG,WAAW,GAAG,YAAY,GAAG,oBAAoB,CAAC,GAAG;IACjN,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,kBAAkB,CAAC,EAAE,cAAc,CAAC;CACrC,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAE7D;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,aAAa,CAqBzE"}
|
package/dist/render-context.js
CHANGED
|
@@ -19,6 +19,7 @@ export function makeRenderContext(opts) {
|
|
|
19
19
|
omImport: opts.omImport ?? "../index",
|
|
20
20
|
columnNamingStrategy: opts.columnNamingStrategy ?? "snake_case",
|
|
21
21
|
apiPrefix: opts.apiPrefix ?? "",
|
|
22
|
+
emitAbstractShapes: opts.emitAbstractShapes ?? true,
|
|
22
23
|
outputLayout,
|
|
23
24
|
packageOf: opts.packageOf ?? new Map(),
|
|
24
25
|
selfTarget: defaultTarget,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-context.js","sourceRoot":"","sources":["../src/render-context.ts"],"names":[],"mappings":"AAAA,gEAAgE;
|
|
1
|
+
{"version":3,"file":"render-context.js","sourceRoot":"","sources":["../src/render-context.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAqEhE,0EAA0E;AAC1E,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAe;IACnD,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAAC,IAAwB;IACxD,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC;IACjD,MAAM,aAAa,GAAmB,IAAI,CAAC,UAAU,IAAI;QACvD,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,YAAY;QACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC;IACF,OAAO;QACL,GAAG,IAAI;QACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,MAAM;QACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU;QACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,YAAY;QAC/D,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;QAC/B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,IAAI;QACnD,YAAY;QACZ,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,GAAG,EAAE;QACtC,UAAU,EAAE,aAAa;QACzB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,aAAa;KAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Provider } from "@metaobjectsdev/render";
|
|
2
|
+
/** Provider backed by an arbitrary on-disk template directory. References
|
|
3
|
+
* resolve as `<dir>/<ref>.mustache`. Used by both the framework default
|
|
4
|
+
* and adopter override paths. */
|
|
5
|
+
export declare class FileSystemProvider implements Provider {
|
|
6
|
+
private readonly root;
|
|
7
|
+
constructor(root: string);
|
|
8
|
+
resolve(ref: string): string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/** The framework defaults provider — resolves refs against codegen-ts's own
|
|
11
|
+
* `templates/` directory. */
|
|
12
|
+
export declare const frameworkTemplatesProvider: Provider;
|
|
13
|
+
/** Compose providers: first match wins. Adopters typically chain
|
|
14
|
+
* `[projectProvider, frameworkTemplatesProvider]` so their own templates
|
|
15
|
+
* override the framework defaults. */
|
|
16
|
+
export declare class ProviderChain implements Provider {
|
|
17
|
+
private readonly providers;
|
|
18
|
+
constructor(providers: readonly Provider[]);
|
|
19
|
+
resolve(ref: string): string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Build a project-scoped Provider: layers an optional project `templates/`
|
|
22
|
+
* directory over the framework defaults. Returns just the framework provider
|
|
23
|
+
* when `projectRoot` is undefined / its `templates/` dir doesn't exist. */
|
|
24
|
+
export declare function projectProvider(projectRoot?: string): Provider;
|
|
25
|
+
/** Exposed for tests that want to inspect / clear the resolved framework
|
|
26
|
+
* templates directory (don't use outside tests). */
|
|
27
|
+
export declare const __frameworkTemplatesDirForTests: string;
|
|
28
|
+
//# sourceMappingURL=framework-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-provider.d.ts","sourceRoot":"","sources":["../../src/render-engine/framework-provider.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA6CvD;;kCAEkC;AAClC,qBAAa,kBAAmB,YAAW,QAAQ;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IACzC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAKzC;AAED;8BAC8B;AAC9B,eAAO,MAAM,0BAA0B,EAAE,QAExC,CAAC;AAEF;;uCAEuC;AACvC,qBAAa,aAAc,YAAW,QAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS,QAAQ,EAAE;IAC3D,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAOzC;AAED;;4EAE4E;AAC5E,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAQ9D;AAED;qDACqD;AACrD,eAAO,MAAM,+BAA+B,QAA0B,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// FrameworkTemplateProvider — resolves template refs (e.g. "docs/entity-page.md")
|
|
2
|
+
// against the codegen-ts package's `templates/` directory. Adopters who want
|
|
3
|
+
// to override a framework template create their own `templates/<ref>.mustache`
|
|
4
|
+
// file in their project; `ProviderChain` (below) consults the project first
|
|
5
|
+
// and falls back to the framework defaults.
|
|
6
|
+
//
|
|
7
|
+
// Decision D1 from the template-driven-codegen design — hybrid: framework
|
|
8
|
+
// ships defaults, adopters override by file-system convention.
|
|
9
|
+
//
|
|
10
|
+
// The framework Provider is filesystem-backed so it works identically whether
|
|
11
|
+
// codegen-ts runs from source (bun, dev) or from `dist/` (npm install). The
|
|
12
|
+
// `templates/` directory is included in the published tarball via
|
|
13
|
+
// package.json `files: ["dist", "src", "templates", ...]`.
|
|
14
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
15
|
+
import { join, resolve, dirname } from "node:path";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
/** Canonical shipped template — used to verify a candidate framework
|
|
18
|
+
* templates directory actually contains our defaults. Without this check a
|
|
19
|
+
* hoisted-install layout (pnpm/bun workspaces) can walk up to a CONSUMER
|
|
20
|
+
* package.json and silently return a templates dir that doesn't exist. */
|
|
21
|
+
const CANONICAL_TEMPLATE_REL = "docs/entity-page.md.mustache";
|
|
22
|
+
/** Walk up from `start` until we find a `package.json` whose neighbour
|
|
23
|
+
* `templates/` directory contains our canonical shipped template (i.e., the
|
|
24
|
+
* codegen-ts package root). Works the same way from
|
|
25
|
+
* `src/render-engine/framework-provider.ts` (during dev) and
|
|
26
|
+
* `dist/render-engine/framework-provider.js` (after `npm install`). */
|
|
27
|
+
function findFrameworkTemplatesDir(start) {
|
|
28
|
+
let dir = start;
|
|
29
|
+
while (true) {
|
|
30
|
+
const pkgJson = join(dir, "package.json");
|
|
31
|
+
if (existsSync(pkgJson)) {
|
|
32
|
+
const templatesDir = join(dir, "templates");
|
|
33
|
+
// Assert we landed at the codegen-ts package root, not a consumer's.
|
|
34
|
+
if (existsSync(join(templatesDir, CANONICAL_TEMPLATE_REL))) {
|
|
35
|
+
return templatesDir;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const parent = dirname(dir);
|
|
39
|
+
if (parent === dir)
|
|
40
|
+
break;
|
|
41
|
+
dir = parent;
|
|
42
|
+
}
|
|
43
|
+
throw new Error(`framework templates dir unresolved: walked up from ${start} without finding a package.json ` +
|
|
44
|
+
`whose templates/${CANONICAL_TEMPLATE_REL} exists. This usually means codegen-ts was installed ` +
|
|
45
|
+
`via a hoisted layout (pnpm/bun workspaces) into an unexpected location, or the published ` +
|
|
46
|
+
`tarball is missing the templates/ directory.`);
|
|
47
|
+
}
|
|
48
|
+
// In ESM (CLAUDE.md: "ESM only. No CommonJS."), `import.meta.url` is
|
|
49
|
+
// guaranteed to be a file: URL; no defensive try/catch needed.
|
|
50
|
+
const SELF_DIR = dirname(fileURLToPath(import.meta.url));
|
|
51
|
+
const FRAMEWORK_TEMPLATES_DIR = findFrameworkTemplatesDir(SELF_DIR);
|
|
52
|
+
/** Provider backed by an arbitrary on-disk template directory. References
|
|
53
|
+
* resolve as `<dir>/<ref>.mustache`. Used by both the framework default
|
|
54
|
+
* and adopter override paths. */
|
|
55
|
+
export class FileSystemProvider {
|
|
56
|
+
root;
|
|
57
|
+
constructor(root) {
|
|
58
|
+
this.root = root;
|
|
59
|
+
}
|
|
60
|
+
resolve(ref) {
|
|
61
|
+
const path = join(this.root, `${ref}.mustache`);
|
|
62
|
+
if (!existsSync(path))
|
|
63
|
+
return undefined;
|
|
64
|
+
return readFileSync(path, "utf-8");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** The framework defaults provider — resolves refs against codegen-ts's own
|
|
68
|
+
* `templates/` directory. */
|
|
69
|
+
export const frameworkTemplatesProvider = new FileSystemProvider(FRAMEWORK_TEMPLATES_DIR);
|
|
70
|
+
/** Compose providers: first match wins. Adopters typically chain
|
|
71
|
+
* `[projectProvider, frameworkTemplatesProvider]` so their own templates
|
|
72
|
+
* override the framework defaults. */
|
|
73
|
+
export class ProviderChain {
|
|
74
|
+
providers;
|
|
75
|
+
constructor(providers) {
|
|
76
|
+
this.providers = providers;
|
|
77
|
+
}
|
|
78
|
+
resolve(ref) {
|
|
79
|
+
for (const p of this.providers) {
|
|
80
|
+
const text = p.resolve(ref);
|
|
81
|
+
if (text !== undefined)
|
|
82
|
+
return text;
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Build a project-scoped Provider: layers an optional project `templates/`
|
|
88
|
+
* directory over the framework defaults. Returns just the framework provider
|
|
89
|
+
* when `projectRoot` is undefined / its `templates/` dir doesn't exist. */
|
|
90
|
+
export function projectProvider(projectRoot) {
|
|
91
|
+
if (projectRoot === undefined)
|
|
92
|
+
return frameworkTemplatesProvider;
|
|
93
|
+
const projTemplates = resolve(projectRoot, "templates");
|
|
94
|
+
if (!existsSync(projTemplates))
|
|
95
|
+
return frameworkTemplatesProvider;
|
|
96
|
+
return new ProviderChain([
|
|
97
|
+
new FileSystemProvider(projTemplates),
|
|
98
|
+
frameworkTemplatesProvider,
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
/** Exposed for tests that want to inspect / clear the resolved framework
|
|
102
|
+
* templates directory (don't use outside tests). */
|
|
103
|
+
export const __frameworkTemplatesDirForTests = FRAMEWORK_TEMPLATES_DIR;
|
|
104
|
+
//# sourceMappingURL=framework-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-provider.js","sourceRoot":"","sources":["../../src/render-engine/framework-provider.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,4CAA4C;AAC5C,EAAE;AACF,0EAA0E;AAC1E,+DAA+D;AAC/D,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,kEAAkE;AAClE,2DAA2D;AAG3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;2EAG2E;AAC3E,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAE9D;;;;wEAIwE;AACxE,SAAS,yBAAyB,CAAC,KAAa;IAC9C,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAC1C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;YAC5C,qEAAqE;YACrE,IAAI,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC;gBAC3D,OAAO,YAAY,CAAC;YACtB,CAAC;QACH,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CACb,sDAAsD,KAAK,kCAAkC;QAC7F,mBAAmB,sBAAsB,uDAAuD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E,WAAW,CAAC,CAAC;IACxD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,0BAA0B,CAAC;IAClE,OAAO,IAAI,aAAa,CAAC;QACvB,IAAI,kBAAkB,CAAC,aAAa,CAAC;QACrC,0BAA0B;KAC3B,CAAC,CAAC;AACL,CAAC;AAED;qDACqD;AACrD,MAAM,CAAC,MAAM,+BAA+B,GAAG,uBAAuB,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MetaData } from "@metaobjectsdev/metadata";
|
|
2
2
|
import type { MetaobjectsGenConfig } from "./metaobjects-config.js";
|
|
3
|
-
import { type WriteResult, type MergeStrategy } from "./overwrite-policy.js";
|
|
3
|
+
import { type WriteResult, type MergeStrategy, type BaselineMode } from "./overwrite-policy.js";
|
|
4
4
|
export interface RunGenOpts {
|
|
5
5
|
config: MetaobjectsGenConfig;
|
|
6
6
|
metadata: MetaData;
|
|
@@ -8,10 +8,24 @@ export interface RunGenOpts {
|
|
|
8
8
|
entityFilter?: string[];
|
|
9
9
|
/** Overwrite strategy passed to decideAndWrite. Defaults to "overwrite". */
|
|
10
10
|
mergeStrategy?: MergeStrategy;
|
|
11
|
+
/** Project root (used to derive the .gen-state/ snapshot directory and to
|
|
12
|
+
* key snapshots by project-relative output path). When omitted, falls back
|
|
13
|
+
* to process.cwd(). */
|
|
14
|
+
projectRoot?: string;
|
|
15
|
+
/** Override the snapshot directory location. Defaults to
|
|
16
|
+
* `<projectRoot>/.metaobjects/.gen-state/`. */
|
|
17
|
+
genStateDir?: string;
|
|
18
|
+
/** First-time-on-existing-file behavior. Defaults to "default" (write-if-
|
|
19
|
+
* different). "fresh" → overwrite and re-baseline (the `--baseline=fresh`
|
|
20
|
+
* CLI flag). */
|
|
21
|
+
baseline?: BaselineMode;
|
|
11
22
|
}
|
|
12
23
|
export interface RunGenResult {
|
|
13
24
|
files: WriteResult[];
|
|
14
25
|
warnings: string[];
|
|
26
|
+
/** Subset of `files` with status "conflict" — surfaced separately so the
|
|
27
|
+
* CLI can print the end-of-run summary. */
|
|
28
|
+
conflicts: WriteResult[];
|
|
15
29
|
}
|
|
16
30
|
export declare function runGen(opts: RunGenOpts): Promise<RunGenResult>;
|
|
17
31
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAMpE,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;4BAEwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;oDACgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;qBAEiB;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;gDAC4C;IAC5C,SAAS,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CA2LpE"}
|