@metaobjectsdev/codegen-ts 0.23.2 → 0.24.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.
Files changed (168) hide show
  1. package/dist/generator.d.ts +9 -0
  2. package/dist/generator.d.ts.map +1 -1
  3. package/dist/generator.js.map +1 -1
  4. package/dist/generators/api-field-shape.js +1 -1
  5. package/dist/generators/api-field-shape.js.map +1 -1
  6. package/dist/generators/api-model.d.ts.map +1 -1
  7. package/dist/generators/api-model.js +71 -42
  8. package/dist/generators/api-model.js.map +1 -1
  9. package/dist/generators/docs-data-builder.d.ts.map +1 -1
  10. package/dist/generators/docs-data-builder.js +36 -1
  11. package/dist/generators/docs-data-builder.js.map +1 -1
  12. package/dist/generators/docs-data.d.ts +14 -0
  13. package/dist/generators/docs-data.d.ts.map +1 -1
  14. package/dist/generators/docs-file.d.ts.map +1 -1
  15. package/dist/generators/docs-file.js +13 -4
  16. package/dist/generators/docs-file.js.map +1 -1
  17. package/dist/generators/extractor-file.d.ts.map +1 -1
  18. package/dist/generators/extractor-file.js +7 -11
  19. package/dist/generators/extractor-file.js.map +1 -1
  20. package/dist/generators/index.d.ts +4 -0
  21. package/dist/generators/index.d.ts.map +1 -1
  22. package/dist/generators/index.js +5 -0
  23. package/dist/generators/index.js.map +1 -1
  24. package/dist/generators/output-parser-file.d.ts.map +1 -1
  25. package/dist/generators/output-parser-file.js +12 -7
  26. package/dist/generators/output-parser-file.js.map +1 -1
  27. package/dist/generators/output-prompt-file.d.ts.map +1 -1
  28. package/dist/generators/output-prompt-file.js +14 -24
  29. package/dist/generators/output-prompt-file.js.map +1 -1
  30. package/dist/generators/requirement-tests.d.ts +44 -0
  31. package/dist/generators/requirement-tests.d.ts.map +1 -0
  32. package/dist/generators/requirement-tests.js +127 -0
  33. package/dist/generators/requirement-tests.js.map +1 -0
  34. package/dist/generators/requirements-file.d.ts +9 -0
  35. package/dist/generators/requirements-file.d.ts.map +1 -0
  36. package/dist/generators/requirements-file.js +53 -0
  37. package/dist/generators/requirements-file.js.map +1 -0
  38. package/dist/generators/requirements-markdown.d.ts +10 -0
  39. package/dist/generators/requirements-markdown.d.ts.map +1 -0
  40. package/dist/generators/requirements-markdown.js +71 -0
  41. package/dist/generators/requirements-markdown.js.map +1 -0
  42. package/dist/generators/requirements-toon.d.ts +3 -0
  43. package/dist/generators/requirements-toon.d.ts.map +1 -0
  44. package/dist/generators/requirements-toon.js +47 -0
  45. package/dist/generators/requirements-toon.js.map +1 -0
  46. package/dist/generators/requirements-view.d.ts +32 -0
  47. package/dist/generators/requirements-view.d.ts.map +1 -0
  48. package/dist/generators/requirements-view.js +64 -0
  49. package/dist/generators/requirements-view.js.map +1 -0
  50. package/dist/generators/trace-helper-file.d.ts.map +1 -1
  51. package/dist/generators/trace-helper-file.js +19 -11
  52. package/dist/generators/trace-helper-file.js.map +1 -1
  53. package/dist/index.d.ts +13 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +18 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/metaobjects-config.d.ts +12 -20
  58. package/dist/metaobjects-config.d.ts.map +1 -1
  59. package/dist/metaobjects-config.js +5 -1
  60. package/dist/metaobjects-config.js.map +1 -1
  61. package/dist/orphan-sweep.d.ts +38 -0
  62. package/dist/orphan-sweep.d.ts.map +1 -0
  63. package/dist/orphan-sweep.js +129 -0
  64. package/dist/orphan-sweep.js.map +1 -0
  65. package/dist/overwrite-policy.d.ts +97 -3
  66. package/dist/overwrite-policy.d.ts.map +1 -1
  67. package/dist/overwrite-policy.js +293 -81
  68. package/dist/overwrite-policy.js.map +1 -1
  69. package/dist/projection/build-projection-views.d.ts +8 -0
  70. package/dist/projection/build-projection-views.d.ts.map +1 -1
  71. package/dist/projection/build-projection-views.js +7 -4
  72. package/dist/projection/build-projection-views.js.map +1 -1
  73. package/dist/projection/extract-view-spec.d.ts.map +1 -1
  74. package/dist/projection/extract-view-spec.js +70 -4
  75. package/dist/projection/extract-view-spec.js.map +1 -1
  76. package/dist/projection/view-ddl-emit.d.ts.map +1 -1
  77. package/dist/projection/view-ddl-emit.js +52 -0
  78. package/dist/projection/view-ddl-emit.js.map +1 -1
  79. package/dist/projection/view-spec.d.ts +15 -0
  80. package/dist/projection/view-spec.d.ts.map +1 -1
  81. package/dist/reconcile-orphans.d.ts +80 -0
  82. package/dist/reconcile-orphans.d.ts.map +1 -0
  83. package/dist/reconcile-orphans.js +61 -0
  84. package/dist/reconcile-orphans.js.map +1 -0
  85. package/dist/render-engine/embedded-templates.generated.js +1 -1
  86. package/dist/render-engine/embedded-templates.generated.js.map +1 -1
  87. package/dist/requirement-walk.d.ts +57 -0
  88. package/dist/requirement-walk.d.ts.map +1 -0
  89. package/dist/requirement-walk.js +94 -0
  90. package/dist/requirement-walk.js.map +1 -0
  91. package/dist/runner.d.ts +35 -0
  92. package/dist/runner.d.ts.map +1 -1
  93. package/dist/runner.js +217 -21
  94. package/dist/runner.js.map +1 -1
  95. package/dist/templates/extractor.d.ts +4 -4
  96. package/dist/templates/extractor.d.ts.map +1 -1
  97. package/dist/templates/extractor.js +18 -22
  98. package/dist/templates/extractor.js.map +1 -1
  99. package/dist/templates/find-inbound.d.ts +44 -0
  100. package/dist/templates/find-inbound.d.ts.map +1 -0
  101. package/dist/templates/find-inbound.js +69 -0
  102. package/dist/templates/find-inbound.js.map +1 -0
  103. package/dist/templates/inferred-types.d.ts.map +1 -1
  104. package/dist/templates/inferred-types.js +8 -4
  105. package/dist/templates/inferred-types.js.map +1 -1
  106. package/dist/templates/output-format-spec-emitter.d.ts.map +1 -1
  107. package/dist/templates/output-format-spec-emitter.js +7 -4
  108. package/dist/templates/output-format-spec-emitter.js.map +1 -1
  109. package/dist/templates/output-parser.d.ts +8 -3
  110. package/dist/templates/output-parser.d.ts.map +1 -1
  111. package/dist/templates/output-parser.js +71 -31
  112. package/dist/templates/output-parser.js.map +1 -1
  113. package/dist/templates/output-prompt.d.ts +6 -5
  114. package/dist/templates/output-prompt.d.ts.map +1 -1
  115. package/dist/templates/output-prompt.js +26 -37
  116. package/dist/templates/output-prompt.js.map +1 -1
  117. package/dist/templates/queries.js +1 -1
  118. package/dist/templates/queries.js.map +1 -1
  119. package/dist/templates/requirement-test.d.ts +12 -0
  120. package/dist/templates/requirement-test.d.ts.map +1 -0
  121. package/dist/templates/requirement-test.js +120 -0
  122. package/dist/templates/requirement-test.js.map +1 -0
  123. package/dist/templates/zod-validators.d.ts.map +1 -1
  124. package/dist/templates/zod-validators.js +32 -15
  125. package/dist/templates/zod-validators.js.map +1 -1
  126. package/package.json +9 -8
  127. package/src/generator.ts +9 -0
  128. package/src/generators/api-field-shape.ts +1 -1
  129. package/src/generators/api-model.ts +69 -44
  130. package/src/generators/docs-data-builder.ts +37 -0
  131. package/src/generators/docs-data.ts +15 -0
  132. package/src/generators/docs-file.ts +13 -4
  133. package/src/generators/extractor-file.ts +7 -11
  134. package/src/generators/index.ts +11 -0
  135. package/src/generators/output-parser-file.ts +12 -7
  136. package/src/generators/output-prompt-file.ts +14 -27
  137. package/src/generators/requirement-tests.ts +203 -0
  138. package/src/generators/requirements-file.ts +71 -0
  139. package/src/generators/requirements-markdown.ts +72 -0
  140. package/src/generators/requirements-toon.ts +64 -0
  141. package/src/generators/requirements-view.ts +93 -0
  142. package/src/generators/trace-helper-file.ts +20 -10
  143. package/src/index.ts +47 -1
  144. package/src/metaobjects-config.ts +17 -22
  145. package/src/orphan-sweep.ts +178 -0
  146. package/src/overwrite-policy.ts +362 -89
  147. package/src/projection/build-projection-views.ts +15 -4
  148. package/src/projection/extract-view-spec.ts +62 -3
  149. package/src/projection/view-ddl-emit.ts +54 -0
  150. package/src/projection/view-spec.ts +25 -0
  151. package/src/reconcile-orphans.ts +136 -0
  152. package/src/reference/barrel.ts +4 -0
  153. package/src/reference/entity.ts +4 -0
  154. package/src/reference/queries.ts +4 -0
  155. package/src/reference/routes.ts +4 -0
  156. package/src/render-engine/embedded-templates.generated.ts +1 -1
  157. package/src/requirement-walk.ts +124 -0
  158. package/src/runner.ts +266 -27
  159. package/src/templates/extractor.ts +19 -24
  160. package/src/templates/find-inbound.ts +96 -0
  161. package/src/templates/inferred-types.ts +8 -4
  162. package/src/templates/output-format-spec-emitter.ts +7 -4
  163. package/src/templates/output-parser.ts +76 -34
  164. package/src/templates/output-prompt.ts +29 -42
  165. package/src/templates/queries.ts +1 -1
  166. package/src/templates/requirement-test.ts +140 -0
  167. package/src/templates/zod-validators.ts +32 -15
  168. package/templates/docs/entity-page.md.mustache +8 -0
@@ -0,0 +1,57 @@
1
+ import type { MetaData, MetaRequirement } from "@metaobjectsdev/metadata";
2
+ /** The shape an app's `filter` receives. Never the node itself. */
3
+ export interface RequirementView {
4
+ /** "functional" | "architectural" — the check-polarity axis. */
5
+ readonly subType: string;
6
+ /** 1 solution · 2 segment · 3 service · 4 object · 5 member. Undefined on an
7
+ * unlevelled architectural requirement (the original flat policy form). */
8
+ readonly level: number | undefined;
9
+ readonly status: string | undefined;
10
+ /** Dotted path from the root through nesting ancestors — hierarchy is nesting. */
11
+ readonly path: string;
12
+ /** DISTINCT `type.subType` concerns among the resolved targets. */
13
+ readonly implementedByTypes: readonly string[];
14
+ }
15
+ export interface ResolvedClaim {
16
+ /** The reference exactly as authored, for the doc comment. */
17
+ readonly ref: string;
18
+ readonly node: MetaData;
19
+ readonly concern: string;
20
+ }
21
+ export interface WalkedRequirement {
22
+ readonly node: MetaRequirement;
23
+ readonly view: RequirementView;
24
+ readonly targets: readonly ResolvedClaim[];
25
+ }
26
+ /** `<type>.<subType>` — the key a renderer map is looked up by. */
27
+ export declare function concernOf(node: MetaData): string;
28
+ /**
29
+ * The concern key for a requirement that resolves NO targets.
30
+ *
31
+ * Doubles as the catch-all renderer key, deliberately: a requirement with nothing
32
+ * to fan out over falls through to whatever the app registered as its default.
33
+ */
34
+ export declare const NO_CONCERN = "*";
35
+ /**
36
+ * Depth-first walk of every `requirement.*` node, nested ones included.
37
+ *
38
+ * Unresolvable `@implementedBy` references are skipped rather than thrown on —
39
+ * resolution severity is `meta verify`'s job (it depends on `@status`, which is why
40
+ * it cannot live in the loader), and codegen must not fail a build over a
41
+ * diagnostic another command owns.
42
+ */
43
+ export declare function walkRequirements(root: MetaData): WalkedRequirement[];
44
+ /**
45
+ * Group a requirement's targets by distinct concern — the fan-out unit.
46
+ *
47
+ * One entry per distinct `type.subType`, NOT one per target: a single architectural
48
+ * requirement claimed by 123 entities must emit one stub, not 123, which is the
49
+ * hostile-first-contact outcome FR-038 §10 exists to avoid.
50
+ *
51
+ * A requirement resolving NO targets still yields exactly ONE group. That is not a
52
+ * degenerate case: `REQUIREMENT_LINK_FLOOR_LEVEL` forbids `@implementedBy` below L4,
53
+ * so every L1–L3 requirement resolves nothing — and an application that chooses to
54
+ * cover L3 would otherwise get silence instead of a stub.
55
+ */
56
+ export declare function groupByConcern(w: WalkedRequirement): Map<string, ResolvedClaim[]>;
57
+ //# sourceMappingURL=requirement-walk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirement-walk.d.ts","sourceRoot":"","sources":["../src/requirement-walk.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE1E,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;gFAC4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAED,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEhD;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,EAAE,CAmCpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CASjF"}
@@ -0,0 +1,94 @@
1
+ // FR-038 — walking `requirement.*` nodes and projecting them for downstream filters.
2
+ //
3
+ // WHY A WALK RATHER THAN ctx.matches: the `Generator` contract is entity-shaped —
4
+ // `GenContext.entities` is `MetaObject[]` and `filter` is
5
+ // `(entity: MetaObject) => boolean` — so a requirement-driven generator cannot use
6
+ // it and must walk `loadedRoot` itself. Generalising `Generator` over any node kind
7
+ // is the principled fix and is deliberately out of scope: it is a core contract
8
+ // change touching every existing generator in five ports.
9
+ //
10
+ // WHY A PROJECTION rather than the raw node: an application's filter is app-owned
11
+ // policy (FR-038 §5), and handing it a `MetaData` would bind adopter code to
12
+ // metamodel internals and export the ADR-0039 own-vs-resolving accessor trap. The
13
+ // projection is additive — it can grow, but it never hands out the node.
14
+ import { TYPE_REQUIREMENT, resolveClaim } from "@metaobjectsdev/metadata";
15
+ /** `<type>.<subType>` — the key a renderer map is looked up by. */
16
+ export function concernOf(node) {
17
+ return `${node.type}.${node.subType}`;
18
+ }
19
+ /**
20
+ * The concern key for a requirement that resolves NO targets.
21
+ *
22
+ * Doubles as the catch-all renderer key, deliberately: a requirement with nothing
23
+ * to fan out over falls through to whatever the app registered as its default.
24
+ */
25
+ export const NO_CONCERN = "*";
26
+ /**
27
+ * Depth-first walk of every `requirement.*` node, nested ones included.
28
+ *
29
+ * Unresolvable `@implementedBy` references are skipped rather than thrown on —
30
+ * resolution severity is `meta verify`'s job (it depends on `@status`, which is why
31
+ * it cannot live in the loader), and codegen must not fail a build over a
32
+ * diagnostic another command owns.
33
+ */
34
+ export function walkRequirements(root) {
35
+ const out = [];
36
+ const visit = (node, prefix) => {
37
+ if (node.type !== TYPE_REQUIREMENT)
38
+ return;
39
+ const path = prefix === "" ? node.name : `${prefix}.${node.name}`;
40
+ const req = node;
41
+ // Same referrer-package basis the CLI's checks use, so a bare reference binds
42
+ // package-locally under the ADR-0042 contract.
43
+ const referrerPkg = node.package ?? node.fileDefaultPackage ?? "";
44
+ const targets = [];
45
+ for (const ref of req.implementedBy()) {
46
+ const target = resolveClaim(root, ref, referrerPkg);
47
+ if (target === undefined)
48
+ continue;
49
+ targets.push({ ref, node: target, concern: concernOf(target) });
50
+ }
51
+ out.push({
52
+ node: req,
53
+ view: {
54
+ subType: node.subType,
55
+ level: req.level(),
56
+ status: req.status(),
57
+ path,
58
+ implementedByTypes: [...new Set(targets.map((t) => t.concern))],
59
+ },
60
+ targets,
61
+ });
62
+ for (const child of node.children())
63
+ visit(child, path);
64
+ };
65
+ for (const child of root.children())
66
+ visit(child, "");
67
+ return out;
68
+ }
69
+ /**
70
+ * Group a requirement's targets by distinct concern — the fan-out unit.
71
+ *
72
+ * One entry per distinct `type.subType`, NOT one per target: a single architectural
73
+ * requirement claimed by 123 entities must emit one stub, not 123, which is the
74
+ * hostile-first-contact outcome FR-038 §10 exists to avoid.
75
+ *
76
+ * A requirement resolving NO targets still yields exactly ONE group. That is not a
77
+ * degenerate case: `REQUIREMENT_LINK_FLOOR_LEVEL` forbids `@implementedBy` below L4,
78
+ * so every L1–L3 requirement resolves nothing — and an application that chooses to
79
+ * cover L3 would otherwise get silence instead of a stub.
80
+ */
81
+ export function groupByConcern(w) {
82
+ const groups = new Map();
83
+ for (const t of w.targets) {
84
+ const existing = groups.get(t.concern);
85
+ if (existing === undefined)
86
+ groups.set(t.concern, [t]);
87
+ else
88
+ existing.push(t);
89
+ }
90
+ if (groups.size === 0)
91
+ groups.set(NO_CONCERN, []);
92
+ return groups;
93
+ }
94
+ //# sourceMappingURL=requirement-walk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirement-walk.js","sourceRoot":"","sources":["../src/requirement-walk.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,EAAE;AACF,kFAAkF;AAClF,0DAA0D;AAC1D,mFAAmF;AACnF,oFAAoF;AACpF,gFAAgF;AAChF,0DAA0D;AAC1D,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAC7E,kFAAkF;AAClF,yEAAyE;AAEzE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA8B1E,mEAAmE;AACnE,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAc;IAC7C,MAAM,GAAG,GAAwB,EAAE,CAAC;IAEpC,MAAM,KAAK,GAAG,CAAC,IAAc,EAAE,MAAc,EAAQ,EAAE;QACrD,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAAE,OAAO;QAC3C,MAAM,IAAI,GAAG,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAClE,MAAM,GAAG,GAAG,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EAA2B,CAAC;IAClD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;;YAClD,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/runner.d.ts CHANGED
@@ -30,6 +30,41 @@ export interface RunGenOpts {
30
30
  * `--dry-run`, and watching it reappear.
31
31
  */
32
32
  dryRun?: boolean;
33
+ /**
34
+ * Output scope — an object is generated only when this predicate returns true
35
+ * for its fully-qualified name (`obj.resolutionKey()`, `<package>::<name>`).
36
+ * Intersects with `entityFilter`: both must pass. Absent ⇒ every object is
37
+ * in scope (byte-identical to a project with no `scope` declared).
38
+ *
39
+ * The collection metadata always loads in FULL regardless of this predicate —
40
+ * scope filters OUTPUT, never input (design §4.3). So an in-scope object may
41
+ * reference an out-of-scope one (an FK target, a relationship `@objectRef`, a
42
+ * projection's base) and resolve perfectly at load time, while the code
43
+ * emitted FOR the in-scope object still imports/names a symbol that was never
44
+ * generated. This is left silent by design, not auto-widened: the adopter
45
+ * declared the scope precisely because something else (another consumer,
46
+ * another codegen run) owns those objects, and the reference is real. Warning
47
+ * on it correctly would require walking every reference kind (identity.reference,
48
+ * every relationship.* @objectRef, projection extends bases, field.object
49
+ * @objectRef) FQN-resolved against the SAME scope — genuinely new machinery,
50
+ * not a fit for the existing `warnings: string[]` channel at this seam. If an
51
+ * adopter hits it, the failure is a plain compiler error in the generated
52
+ * code (an unresolved import) — loud, at build time, not silent at runtime.
53
+ *
54
+ * Deliberately a PLAIN PREDICATE, not the `include`/`exclude` pattern strings
55
+ * `@metaobjectsdev/sdk`'s `scope.ts` compiles. `codegen-ts` must not depend on
56
+ * `@metaobjectsdev/sdk` — the dependency runs the other way (`cli` depends on
57
+ * both) — so it cannot import `matchesScope`/`CompiledScope` itself. The
58
+ * design's "package patterns, never a predicate function" rule (§4.3 of the
59
+ * metadata-source-resolution design doc) governs CONFIG SURFACES that must
60
+ * port identically to a `pom.xml` / `metaobjects.config.yaml` in every
61
+ * language port; it says nothing about internal plumbing between two
62
+ * TypeScript packages in this one repo. Do not "fix" this into a config
63
+ * shape — `cli`'s `gen`/`verify` commands are the only callers, and a
64
+ * `Collection` already exposes exactly this predicate as `inScope`, which
65
+ * they pass straight through.
66
+ */
67
+ scope?: (fqn: string) => boolean;
33
68
  }
34
69
  export interface RunGenResult {
35
70
  files: WriteResult[];
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,0BAA0B,CAAC;AAMrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAMpE,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAU/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;IACxB;;;;;;;;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E,WAAW,EAAE,CAAC;CAC1B;AAkBD,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAghBpE"}
package/dist/runner.js CHANGED
@@ -10,7 +10,9 @@ import { normalizeConfig, DEFAULT_TARGET_NAME } from "./metaobjects-config.js";
10
10
  import { buildPkMap } from "./pk-resolver.js";
11
11
  import { buildRelationMap } from "./relation-resolver.js";
12
12
  import { makeRenderContext } from "./render-context.js";
13
- import { decideAndWrite, loadEngineVersion, saveEngineVersion, } from "./overwrite-policy.js";
13
+ import { sweepOrphans } from "./orphan-sweep.js";
14
+ import { refusedOrphanMessage } from "./reconcile-orphans.js";
15
+ import { decideAndWrite, previewWriteStatus, hasHashManifest, listGeneratedPaths, loadEngineVersion, saveEngineVersion, } from "./overwrite-policy.js";
14
16
  /** JS-identifier-shape only. Prevents filesystem traversal when metadata comes
15
17
  * from untrusted sources (e.g. MCP). Mirrors the guard in legacy generate.ts. */
16
18
  const VALID_ENTITY_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
@@ -58,6 +60,10 @@ export async function runGen(opts) {
58
60
  // since the last gen, note it (generated output may legitimately differ). Purely
59
61
  // informational — the version file is separate from `.hashes.json` and never
60
62
  // affects the merge. Only fires when a prior stamp exists AND differs.
63
+ // Captured BEFORE any write, because the first write creates the manifest — read
64
+ // it afterwards and every project looks migrated.
65
+ const hadHashManifest = hasHashManifest(genStateDir);
66
+ const relativeForDisplay = (p) => projectRoot !== undefined ? relative(projectRoot, p) : p;
61
67
  const hasPersistentGenState = opts.projectRoot !== undefined || opts.genStateDir !== undefined;
62
68
  const installedEngine = hasPersistentGenState ? engineVersion() : undefined;
63
69
  const recordedEngine = hasPersistentGenState ? loadEngineVersion(genStateDir) : undefined;
@@ -76,16 +82,49 @@ export async function runGen(opts) {
76
82
  throw new Error("runGen: opts.metadata must be a loaded MetaRoot.");
77
83
  }
78
84
  const root = opts.metadata;
79
- // 1. Resolve entities (filter + safety check).
85
+ // 1. Resolve entities (entityFilter + scope + safety check). This is the
86
+ // single choke point for entity selection — scope INTERSECTS entityFilter
87
+ // (an object must pass both), matched against the object's
88
+ // fully-qualified name (resolutionKey(), never the bare name — two
89
+ // packages may declare the same short name).
80
90
  const allObjects = root.objects();
81
91
  const entityFilter = opts.entityFilter;
82
- const filtered = entityFilter
92
+ const afterEntityFilter = entityFilter
83
93
  ? allObjects.filter((o) => entityFilter.includes(o.name))
84
94
  : allObjects;
95
+ const scope = opts.scope;
96
+ const filtered = scope
97
+ ? afterEntityFilter.filter((o) => scope(o.resolutionKey()))
98
+ : afterEntityFilter;
85
99
  if (filtered.length === 0) {
86
- const reason = opts.entityFilter
87
- ? "no object children match the provided entityFilter"
88
- : "root has no object children";
100
+ // Name the REAL cause. When `scope` is absent, this is byte-identical to
101
+ // the pre-scope two-way branch (kept as its own arm, rather than folded
102
+ // into the scope-aware logic below, so an unscoped project's warning text
103
+ // — including its quirky edge case: an empty root with entityFilter set
104
+ // still blames entityFilter — is untouched). Only when `scope` is
105
+ // present does a THIRD reason become reachable: "root has no object
106
+ // children" for a scoped-out model, or "...entityFilter" for a scope
107
+ // that admitted everything entityFilter then excluded, are both false
108
+ // statements that send the reader to the wrong file.
109
+ let reason;
110
+ if (scope === undefined) {
111
+ // Byte-identical to the pre-scope branch, quirk included: an EMPTY root
112
+ // with an entityFilter set still blames the filter. Wrong, and untouched
113
+ // — changing what an unscoped project reads is a behaviour change, and
114
+ // this is a shape change.
115
+ reason = entityFilter
116
+ ? "no object children match the provided entityFilter"
117
+ : "root has no object children";
118
+ }
119
+ else if (allObjects.length === 0) {
120
+ reason = "root has no object children";
121
+ }
122
+ else if (afterEntityFilter.length === 0) {
123
+ reason = "no object children match the provided entityFilter";
124
+ }
125
+ else {
126
+ reason = "no object children match the configured scope";
127
+ }
89
128
  warnings.push(`No entities to generate — ${reason}.`);
90
129
  return { files: [], warnings, conflicts: [] };
91
130
  }
@@ -146,12 +185,25 @@ export async function runGen(opts) {
146
185
  targetOf(g);
147
186
  const entityGen = config.generators.find((g) => g.emitsEntityModule);
148
187
  const entityModuleTarget = entityGen ? targetOf(entityGen) : targets[DEFAULT_TARGET_NAME];
149
- const needsCrossTarget = config.generators.some((g) => (g.target ?? DEFAULT_TARGET_NAME) !== entityModuleTarget.name);
150
- if (needsCrossTarget && entityModuleTarget.importBase === undefined) {
151
- throw new Error(`Target "${entityModuleTarget.name}" holds the entity modules that other ` +
152
- `targets import, but has no importBase. Set importBase on it (e.g. ` +
153
- `"@your-pkg/database/generated").`);
154
- }
188
+ // NO eager importBase check here, deliberately.
189
+ //
190
+ // There used to be one: "any generator on a non-entity target the entity
191
+ // target must have importBase". It asked the wrong question target placement,
192
+ // not whether anything actually imports across targets — so it convicted every
193
+ // multi-target project whose second target imports nothing, and the only way
194
+ // out was to set a value that is provably inert. An adopter hit this with a
195
+ // requirement-test target that imports no entity modules at all.
196
+ //
197
+ // `crossTargetEntityPath` (import-path.ts) is the SOLE consumer of importBase
198
+ // and already throws when it is missing, naming the resolution that needed it —
199
+ // and every cross-target entry point (`entityModuleSpecifier`,
200
+ // `barrelModuleSpecifier`) routes through it. That throw happens inside phase 4,
201
+ // before the write phase, and the runner tags it with the generator name, so
202
+ // the diagnostic is strictly better than the one removed here.
203
+ //
204
+ // The trade, stated: a generator whose cross-target import is CONDITIONAL now
205
+ // fails when a model change first makes it real, rather than at config time.
206
+ // That is the correct moment — it is also the only moment the answer is known.
155
207
  // 3. Build shared render state once.
156
208
  const pkMap = buildPkMap(root);
157
209
  const relationMap = buildRelationMap(root);
@@ -193,6 +245,10 @@ export async function runGen(opts) {
193
245
  const includeHonoRoutes = config.generators.some((g) => g.emitsHonoRoutes === true);
194
246
  // 4. Run each generator with a per-target render context; collect with full path.
195
247
  const emitted = [];
248
+ // FR-038 §8 — generators that opted into orphan reconciliation, paired with the
249
+ // directory their policy's relative paths are measured from. Collected here
250
+ // because `writeOutDir` is resolved per generator inside this loop.
251
+ const orphanJobs = [];
196
252
  for (const generator of config.generators) {
197
253
  // ADR-0025: `meta docs` is the single docs door. A `meta gen` config that
198
254
  // still lists a deprecated doc generator is warned + skipped, not run — the
@@ -213,6 +269,13 @@ export async function runGen(opts) {
213
269
  const writeOutDir = projectRoot !== undefined && !isAbsolute(selfTarget.outDir)
214
270
  ? resolve(projectRoot, selfTarget.outDir)
215
271
  : selfTarget.outDir;
272
+ if (generator.orphanPolicy !== undefined) {
273
+ orphanJobs.push({
274
+ generatorName: generator.name,
275
+ writeOutDir,
276
+ policy: generator.orphanPolicy,
277
+ });
278
+ }
216
279
  const renderContext = makeRenderContext({
217
280
  dialect: config.dialect,
218
281
  loadedRoot: root,
@@ -282,17 +345,147 @@ export async function runGen(opts) {
282
345
  // 5. Write phase.
283
346
  const writes = [];
284
347
  const conflicts = [];
348
+ // FR-038 §8 — reconcile files a previous run generated that this run does not.
349
+ //
350
+ // Gated on a real `projectRoot` for a load-bearing reason, not caution: without
351
+ // one, `decideAndWrite` keys each snapshot by a hash of its absolute path
352
+ // instead of a project-relative path, so gen-state holds no path to resolve and
353
+ // reconciliation has nothing to reason about. That gate is also what keeps
354
+ // `verify --codegen` inert — it runs against a throwaway root whose gen-state is
355
+ // empty — and what keeps programmatic/test callers from ever deleting a file.
356
+ // Refusals are reported ONE of two ways, and which one matters more than the
357
+ // wording. A project with no manifest at all predates the manifest being
358
+ // committed: every refusal in it has the SAME single cause and the same one-line
359
+ // fix, so N per-file warnings would be a wall that buries the instruction — the
360
+ // hostile-first-contact outcome that gets a tool switched off. A project that DOES
361
+ // have a manifest is refusing because specific files were edited, and there the
362
+ // per-file naming is the actionable part.
363
+ //
364
+ // Self-extinguishing: once the manifest is committed, the aggregate never fires
365
+ // again.
366
+ const MAX_NAMED = 5;
367
+ const reportRefusals = () => {
368
+ const refused = writes.filter((w) => w.status === "refused");
369
+ if (refused.length === 0)
370
+ return;
371
+ if (!hadHashManifest) {
372
+ const names = refused.slice(0, MAX_NAMED).map((w) => relativeForDisplay(w.path));
373
+ const more = refused.length > MAX_NAMED ? `, and ${refused.length - MAX_NAMED} more` : "";
374
+ warnings.push(`Refused to overwrite ${refused.length} existing file(s), and this project has ` +
375
+ `no codegen hash manifest — so 'meta gen' cannot tell your edits from its own ` +
376
+ `stale output, and it will not guess. This is the expected first run for a ` +
377
+ `project created before the manifest was committed. ` +
378
+ `ONE-TIME FIX: commit '.metaobjects/.gen-state/.hashes.json' (un-ignore it in ` +
379
+ `.metaobjects/.gitignore with '.gen-state/*' + '!.gen-state/.hashes.json'), ` +
380
+ `then re-run. To adopt fresh output and DISCARD any hand edits in these files ` +
381
+ `instead, re-run with --baseline=fresh. Files: ${names.join(", ")}${more}.`);
382
+ return;
383
+ }
384
+ for (const w of refused) {
385
+ warnings.push(`Refused to overwrite ${w.path}: ${w.conflictHint ?? "content differs and could not be verified as generated."}`);
386
+ }
387
+ };
388
+ const sweep = (dryRun) => {
389
+ if (projectRoot === undefined || orphanJobs.length === 0)
390
+ return;
391
+ // NEVER reconcile a PARTIAL run. `meta gen <entity>` narrows the object set, so
392
+ // `emitted` is a subset of the full output BY CONSTRUCTION — every path belonging
393
+ // to an unselected entity looks exactly like an orphan, and the untouched ones get
394
+ // deleted. The shipped `requirementTests()` escapes only by accident (it walks
395
+ // `ctx.loadedRoot` and ignores `ctx.matches`); any app generator that honours
396
+ // `ctx.matches` — the documented, encouraged composition — would wipe every
397
+ // non-selected entity's output on a routine filtered run.
398
+ //
399
+ // The runner is the ONLY layer that knows the run was partial: a generator sees a
400
+ // narrowed entity list and cannot tell it from a model that genuinely has one
401
+ // entity. So the guard has to live here.
402
+ if (opts.entityFilter !== undefined && opts.entityFilter.length > 0) {
403
+ // Say it only when something was ACTUALLY withheld. With no previously-generated
404
+ // path outside this run's own output there are no orphan candidates at all, so
405
+ // the sweep provably no-ops and there is nothing to report. `meta gen <entity>`
406
+ // is a routine command; warning on every one of them teaches the reader to skim
407
+ // the message, which is how the real one gets skimmed too.
408
+ //
409
+ // Note the manifest is NOT empty here even on a first run — the writes above have
410
+ // already recorded this run's own paths in it — so the emitted set has to come
411
+ // out before counting. Computing the candidate set is safe on a filtered run;
412
+ // what must never happen is ACTING on it.
413
+ //
414
+ // A non-empty candidate set is the FLOOR, not proof that a specific file would
415
+ // have been removed: whether one falls inside an opting-in generator's namespace
416
+ // is the reconcile's answer, and running that is the thing being skipped.
417
+ const emittedRel = new Set(emitted.map((f) => relative(projectRoot, f.fullPath)));
418
+ const withheld = listGeneratedPaths(genStateDir).filter((p) => !emittedRel.has(p));
419
+ if (withheld.length > 0) {
420
+ warnings.push(`Skipped orphan cleanup: this run generated only ${opts.entityFilter.join(", ")}, ` +
421
+ `so it cannot tell a file belonging to an unselected entity from one that is no ` +
422
+ `longer generated. Run 'meta gen' with no entity filter to reconcile deletions.`);
423
+ }
424
+ return;
425
+ }
426
+ const result = sweepOrphans({
427
+ genStateDir,
428
+ projectRoot,
429
+ emittedRelPaths: emitted.map((f) => relative(projectRoot, f.fullPath)),
430
+ jobs: orphanJobs,
431
+ dryRun,
432
+ });
433
+ // Both kinds are the same file outcome — gone. What differs is what it cost,
434
+ // which is what the warning below is for.
435
+ for (const relPath of [...result.removed, ...result.forced]) {
436
+ writes.push({ path: join(projectRoot, relPath), status: "removed" });
437
+ }
438
+ if (result.refused.length > 0) {
439
+ // Grouped by the generator that refused, so each message names a generator the
440
+ // project actually registered. `orphanPolicy` is generic and apps are encouraged
441
+ // to compose their own, so one blanket message naming `requirement-tests` would
442
+ // be wrong for precisely the users the seam exists for.
443
+ const byGenerator = new Map();
444
+ for (const relPath of result.refused) {
445
+ const owner = result.refusedBy.get(relPath) ?? "orphan cleanup";
446
+ const list = byGenerator.get(owner);
447
+ if (list === undefined)
448
+ byGenerator.set(owner, [relPath]);
449
+ else
450
+ list.push(relPath);
451
+ }
452
+ for (const [owner, paths] of byGenerator) {
453
+ warnings.push(refusedOrphanMessage(paths, owner));
454
+ }
455
+ }
456
+ if (result.forced.length > 0) {
457
+ warnings.push(`Deleted ${result.forced.length} hand-edited generated file(s) because a ` +
458
+ `generator's orphanPolicy sets force: ${result.forced.join(", ")}. ` +
459
+ `Hand-written content in them is gone — recover from version control.`);
460
+ }
461
+ };
285
462
  // --dry-run: report what WOULD be written and touch nothing — no output files
286
463
  // and no .gen-state/ snapshot (writing the snapshot would silently re-baseline
287
464
  // the merge base, so a later real run could skip a genuinely-needed write).
288
465
  if (opts.dryRun === true) {
289
466
  for (const file of emitted) {
290
- // Report the outcome faithfully rather than a placeholder: a path that does
291
- // not exist yet would be created ("new"), one that does would be rewritten.
292
- // Merge/conflict outcomes can't be known without doing the merge, so this
293
- // deliberately reports the coarser truth instead of guessing.
294
- writes.push({ path: file.fullPath, status: existsSync(file.fullPath) ? "overwrite" : "new" });
467
+ // Ask the same policy the real run asks, in a read-only mode. This used to be
468
+ // `existsSync(...) ? "overwrite" : "new"`, which previewed a hand-edited file
469
+ // as "overwrite" while the real run refused it — the one case the preview most
470
+ // needs to be right about. A merge outcome is still coarse (see
471
+ // previewWriteStatus), because clean-vs-conflicted is unknowable without merging.
472
+ const policyOpts = {
473
+ strategy,
474
+ genStateDir,
475
+ baseline,
476
+ };
477
+ if (projectRoot !== undefined) {
478
+ policyOpts.outputRelPath = relative(projectRoot, file.fullPath);
479
+ }
480
+ writes.push({
481
+ path: file.fullPath,
482
+ status: previewWriteStatus(file.fullPath, file.content, policyOpts),
483
+ });
295
484
  }
485
+ reportRefusals();
486
+ // A preview that hides a pending deletion is worse than no preview at all, so
487
+ // the sweep still runs — in decide-and-report mode, touching nothing.
488
+ sweep(true);
296
489
  return { files: writes, warnings, conflicts };
297
490
  }
298
491
  for (const file of emitted) {
@@ -315,11 +508,14 @@ export async function runGen(opts) {
315
508
  warnings.push(`Merge conflict in ${file.fullPath}: resolve diff3 markers and re-run ` +
316
509
  `'meta gen' to advance the canonical state.`);
317
510
  }
318
- if (result.status === "refused") {
319
- warnings.push(`Refused to overwrite ${file.fullPath}: file exists without @generated header. ` +
320
- `Move to a different outDir, delete the file, or add the header to opt in.`);
321
- }
511
+ // Refusals are reported together after the loop (see reportRefusals) so a
512
+ // whole-project cause can be stated once instead of once per file.
322
513
  }
514
+ reportRefusals();
515
+ // Sweep AFTER the writes: writing is the primary job, and a deletion that runs
516
+ // first would be unrecoverable if a later write threw. Ordering cannot change
517
+ // the decision — a path this run emitted is never an orphan either way.
518
+ sweep(false);
323
519
  // #232 — stamp the engine version that produced this snapshot, so the NEXT gen can
324
520
  // detect an engine change. Written after a successful run only.
325
521
  if (installedEngine !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC5H,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAIlB,MAAM,uBAAuB,CAAC;AAE/B;kFACkF;AAClF,MAAM,iB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AA+E;IAC/E,8EAA8E;IAC9E,wEAAwE;IACxE,KAAK,CAAC,KAAK,CAAC,CAAC;IAEb,mFAAmF;IACnF,gEAAgE;IAChE,IAAI,eAAe,KAAK,SAAS;QAAE,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAEnF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { type MetaData } from "@metaobjectsdev/metadata";
2
2
  import type { RenderContext } from "../render-context.js";
3
3
  /**
4
- * Render the full `<TemplateName>.extractor.ts` for one `template.output` node.
5
- * Throws if the template isn't found / isn't a template.output / its @payloadRef doesn't resolve,
6
- * or if the target format is not json/xml (the extract tier requires the extract<Name> API, which
7
- * only the json/xml output-parsers emit).
4
+ * Render the full `<PromptName>.extractor.ts` for one responding `template.prompt`.
5
+ * Throws if the template isn't found / isn't a template.prompt / its @responseRef
6
+ * doesn't resolve. ADR-0052: no format gate remains @responseFormat is a closed
7
+ * json|xml set, so every responding prompt has an extract<Name> API to sit over.
8
8
  */
9
9
  export declare function renderExtractor(root: MetaData, templateName: string, ctx?: RenderContext): string;
10
10
  //# sourceMappingURL=extractor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/templates/extractor.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,QAAQ,EAWd,MAAM,0BAA0B,CAAC;AAKlC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA0P1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAsFjG"}
1
+ {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/templates/extractor.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,QAAQ,EAUd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA0P1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAiFjG"}