@metaobjectsdev/codegen-ts 0.24.4 → 0.25.0

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 (265) hide show
  1. package/README.md +37 -12
  2. package/dist/api-surface.d.ts +29 -0
  3. package/dist/api-surface.d.ts.map +1 -1
  4. package/dist/api-surface.js +47 -0
  5. package/dist/api-surface.js.map +1 -1
  6. package/dist/client-directive.d.ts +18 -0
  7. package/dist/client-directive.d.ts.map +1 -0
  8. package/dist/client-directive.js +37 -0
  9. package/dist/client-directive.js.map +1 -0
  10. package/dist/column-mapper.d.ts +12 -0
  11. package/dist/column-mapper.d.ts.map +1 -1
  12. package/dist/column-mapper.js +1 -0
  13. package/dist/column-mapper.js.map +1 -1
  14. package/dist/constants.d.ts +24 -11
  15. package/dist/constants.d.ts.map +1 -1
  16. package/dist/constants.js +54 -19
  17. package/dist/constants.js.map +1 -1
  18. package/dist/db-emitting.d.ts +6 -0
  19. package/dist/db-emitting.d.ts.map +1 -0
  20. package/dist/db-emitting.js +26 -0
  21. package/dist/db-emitting.js.map +1 -0
  22. package/dist/generator-registry.d.ts.map +1 -1
  23. package/dist/generator-registry.js +7 -1
  24. package/dist/generator-registry.js.map +1 -1
  25. package/dist/generator.d.ts +5 -0
  26. package/dist/generator.d.ts.map +1 -1
  27. package/dist/generator.js.map +1 -1
  28. package/dist/generators/agent-docs-file.d.ts +19 -0
  29. package/dist/generators/agent-docs-file.d.ts.map +1 -0
  30. package/dist/generators/agent-docs-file.js +257 -0
  31. package/dist/generators/agent-docs-file.js.map +1 -0
  32. package/dist/generators/agent-requirements-page.d.ts +22 -0
  33. package/dist/generators/agent-requirements-page.d.ts.map +1 -0
  34. package/dist/generators/agent-requirements-page.js +175 -0
  35. package/dist/generators/agent-requirements-page.js.map +1 -0
  36. package/dist/generators/agent-schema-input.d.ts +69 -0
  37. package/dist/generators/agent-schema-input.d.ts.map +1 -0
  38. package/dist/generators/agent-schema-input.js +23 -0
  39. package/dist/generators/agent-schema-input.js.map +1 -0
  40. package/dist/generators/agent-schema-page.d.ts +21 -0
  41. package/dist/generators/agent-schema-page.d.ts.map +1 -0
  42. package/dist/generators/agent-schema-page.js +241 -0
  43. package/dist/generators/agent-schema-page.js.map +1 -0
  44. package/dist/generators/agent-ui-page.d.ts +22 -0
  45. package/dist/generators/agent-ui-page.d.ts.map +1 -0
  46. package/dist/generators/agent-ui-page.js +253 -0
  47. package/dist/generators/agent-ui-page.js.map +1 -0
  48. package/dist/generators/api-docs-file.d.ts.map +1 -1
  49. package/dist/generators/api-docs-file.js +13 -6
  50. package/dist/generators/api-docs-file.js.map +1 -1
  51. package/dist/generators/api-model.d.ts +6 -0
  52. package/dist/generators/api-model.d.ts.map +1 -1
  53. package/dist/generators/api-model.js +54 -35
  54. package/dist/generators/api-model.js.map +1 -1
  55. package/dist/generators/callable-file.js +1 -1
  56. package/dist/generators/callable-file.js.map +1 -1
  57. package/dist/generators/docs-data-builder.d.ts.map +1 -1
  58. package/dist/generators/docs-data-builder.js +47 -2
  59. package/dist/generators/docs-data-builder.js.map +1 -1
  60. package/dist/generators/docs-data.d.ts +6 -2
  61. package/dist/generators/docs-data.d.ts.map +1 -1
  62. package/dist/generators/index.d.ts +3 -0
  63. package/dist/generators/index.d.ts.map +1 -1
  64. package/dist/generators/index.js +4 -0
  65. package/dist/generators/index.js.map +1 -1
  66. package/dist/generators/names-file.d.ts +17 -0
  67. package/dist/generators/names-file.d.ts.map +1 -0
  68. package/dist/generators/names-file.js +95 -0
  69. package/dist/generators/names-file.js.map +1 -0
  70. package/dist/generators/requirements-markdown.d.ts +18 -1
  71. package/dist/generators/requirements-markdown.d.ts.map +1 -1
  72. package/dist/generators/requirements-markdown.js +11 -9
  73. package/dist/generators/requirements-markdown.js.map +1 -1
  74. package/dist/generators/routes-file-hono.d.ts +17 -2
  75. package/dist/generators/routes-file-hono.d.ts.map +1 -1
  76. package/dist/generators/routes-file-hono.js +15 -12
  77. package/dist/generators/routes-file-hono.js.map +1 -1
  78. package/dist/generators/routes-file.d.ts +17 -2
  79. package/dist/generators/routes-file.d.ts.map +1 -1
  80. package/dist/generators/routes-file.js +10 -8
  81. package/dist/generators/routes-file.js.map +1 -1
  82. package/dist/generators/template-generator.d.ts.map +1 -1
  83. package/dist/generators/template-generator.js +20 -6
  84. package/dist/generators/template-generator.js.map +1 -1
  85. package/dist/index.d.ts +21 -5
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +40 -4
  88. package/dist/index.js.map +1 -1
  89. package/dist/metaobjects-config.d.ts +67 -1
  90. package/dist/metaobjects-config.d.ts.map +1 -1
  91. package/dist/metaobjects-config.js +10 -1
  92. package/dist/metaobjects-config.js.map +1 -1
  93. package/dist/names.d.ts +275 -0
  94. package/dist/names.d.ts.map +1 -0
  95. package/dist/names.js +434 -0
  96. package/dist/names.js.map +1 -0
  97. package/dist/naming.d.ts +17 -0
  98. package/dist/naming.d.ts.map +1 -1
  99. package/dist/naming.js +21 -0
  100. package/dist/naming.js.map +1 -1
  101. package/dist/overwrite-policy.d.ts.map +1 -1
  102. package/dist/overwrite-policy.js +15 -3
  103. package/dist/overwrite-policy.js.map +1 -1
  104. package/dist/payload-codegen.d.ts.map +1 -1
  105. package/dist/payload-codegen.js +4 -3
  106. package/dist/payload-codegen.js.map +1 -1
  107. package/dist/projection/extract-view-spec.d.ts +25 -1
  108. package/dist/projection/extract-view-spec.d.ts.map +1 -1
  109. package/dist/projection/extract-view-spec.js +79 -6
  110. package/dist/projection/extract-view-spec.js.map +1 -1
  111. package/dist/prompt-generator-gate.d.ts +27 -0
  112. package/dist/prompt-generator-gate.d.ts.map +1 -0
  113. package/dist/prompt-generator-gate.js +62 -0
  114. package/dist/prompt-generator-gate.js.map +1 -0
  115. package/dist/reference-templates.d.ts +22 -5
  116. package/dist/reference-templates.d.ts.map +1 -1
  117. package/dist/reference-templates.js +55 -21
  118. package/dist/reference-templates.js.map +1 -1
  119. package/dist/render-context.d.ts +20 -1
  120. package/dist/render-context.d.ts.map +1 -1
  121. package/dist/render-context.js +2 -0
  122. package/dist/render-context.js.map +1 -1
  123. package/dist/retired-codegen-attrs.d.ts +32 -0
  124. package/dist/retired-codegen-attrs.d.ts.map +1 -0
  125. package/dist/retired-codegen-attrs.js +47 -0
  126. package/dist/retired-codegen-attrs.js.map +1 -0
  127. package/dist/routes-expose.d.ts +63 -0
  128. package/dist/routes-expose.d.ts.map +1 -0
  129. package/dist/routes-expose.js +57 -0
  130. package/dist/routes-expose.js.map +1 -0
  131. package/dist/runner.d.ts +18 -0
  132. package/dist/runner.d.ts.map +1 -1
  133. package/dist/runner.js +115 -7
  134. package/dist/runner.js.map +1 -1
  135. package/dist/templates/callable-file.d.ts +7 -2
  136. package/dist/templates/callable-file.d.ts.map +1 -1
  137. package/dist/templates/callable-file.js +54 -9
  138. package/dist/templates/callable-file.js.map +1 -1
  139. package/dist/templates/drizzle-schema.d.ts.map +1 -1
  140. package/dist/templates/drizzle-schema.js +236 -65
  141. package/dist/templates/drizzle-schema.js.map +1 -1
  142. package/dist/templates/entity-constants.d.ts +15 -6
  143. package/dist/templates/entity-constants.d.ts.map +1 -1
  144. package/dist/templates/entity-constants.js +85 -161
  145. package/dist/templates/entity-constants.js.map +1 -1
  146. package/dist/templates/entity-file.d.ts.map +1 -1
  147. package/dist/templates/entity-file.js +38 -4
  148. package/dist/templates/entity-file.js.map +1 -1
  149. package/dist/templates/entity-meta-file.d.ts +15 -1
  150. package/dist/templates/entity-meta-file.d.ts.map +1 -1
  151. package/dist/templates/entity-meta-file.js +12 -2
  152. package/dist/templates/entity-meta-file.js.map +1 -1
  153. package/dist/templates/entity-ui-descriptor.d.ts +112 -0
  154. package/dist/templates/entity-ui-descriptor.d.ts.map +1 -0
  155. package/dist/templates/entity-ui-descriptor.js +238 -0
  156. package/dist/templates/entity-ui-descriptor.js.map +1 -0
  157. package/dist/templates/field-meta.d.ts +46 -9
  158. package/dist/templates/field-meta.d.ts.map +1 -1
  159. package/dist/templates/field-meta.js +95 -21
  160. package/dist/templates/field-meta.js.map +1 -1
  161. package/dist/templates/names-decl.d.ts +38 -0
  162. package/dist/templates/names-decl.d.ts.map +1 -0
  163. package/dist/templates/names-decl.js +104 -0
  164. package/dist/templates/names-decl.js.map +1 -0
  165. package/dist/templates/output-parser.d.ts.map +1 -1
  166. package/dist/templates/output-parser.js +54 -8
  167. package/dist/templates/output-parser.js.map +1 -1
  168. package/dist/templates/projection-decl.d.ts +21 -0
  169. package/dist/templates/projection-decl.d.ts.map +1 -1
  170. package/dist/templates/projection-decl.js +53 -29
  171. package/dist/templates/projection-decl.js.map +1 -1
  172. package/dist/templates/queries-file.d.ts.map +1 -1
  173. package/dist/templates/queries-file.js +17 -2
  174. package/dist/templates/queries-file.js.map +1 -1
  175. package/dist/templates/render-helper.d.ts.map +1 -1
  176. package/dist/templates/render-helper.js +3 -1
  177. package/dist/templates/render-helper.js.map +1 -1
  178. package/dist/templates/requirement-test.d.ts.map +1 -1
  179. package/dist/templates/requirement-test.js +48 -21
  180. package/dist/templates/requirement-test.js.map +1 -1
  181. package/dist/templates/routes-file-hono.d.ts +2 -1
  182. package/dist/templates/routes-file-hono.d.ts.map +1 -1
  183. package/dist/templates/routes-file-hono.js +11 -2
  184. package/dist/templates/routes-file-hono.js.map +1 -1
  185. package/dist/templates/routes-file.d.ts +2 -1
  186. package/dist/templates/routes-file.d.ts.map +1 -1
  187. package/dist/templates/routes-file.js +54 -21
  188. package/dist/templates/routes-file.js.map +1 -1
  189. package/dist/templates/value-object-file.d.ts.map +1 -1
  190. package/dist/templates/value-object-file.js +15 -1
  191. package/dist/templates/value-object-file.js.map +1 -1
  192. package/dist/templates/view-decl.d.ts +37 -1
  193. package/dist/templates/view-decl.d.ts.map +1 -1
  194. package/dist/templates/view-decl.js +27 -3
  195. package/dist/templates/view-decl.js.map +1 -1
  196. package/dist/templates/zod-validators.d.ts +21 -0
  197. package/dist/templates/zod-validators.d.ts.map +1 -1
  198. package/dist/templates/zod-validators.js +40 -5
  199. package/dist/templates/zod-validators.js.map +1 -1
  200. package/dist/view-context.d.ts +24 -0
  201. package/dist/view-context.d.ts.map +1 -0
  202. package/dist/view-context.js +81 -0
  203. package/dist/view-context.js.map +1 -0
  204. package/package.json +6 -6
  205. package/src/api-surface.ts +53 -0
  206. package/src/client-directive.ts +36 -0
  207. package/src/column-mapper.ts +13 -0
  208. package/src/constants.ts +91 -16
  209. package/src/db-emitting.ts +31 -0
  210. package/src/generator-registry.ts +7 -0
  211. package/src/generator.ts +5 -0
  212. package/src/generators/agent-docs-file.ts +297 -0
  213. package/src/generators/agent-requirements-page.ts +199 -0
  214. package/src/generators/agent-schema-input.ts +88 -0
  215. package/src/generators/agent-schema-page.ts +297 -0
  216. package/src/generators/agent-ui-page.ts +290 -0
  217. package/src/generators/api-docs-file.ts +13 -6
  218. package/src/generators/api-model.ts +63 -34
  219. package/src/generators/callable-file.ts +1 -1
  220. package/src/generators/docs-data-builder.ts +46 -2
  221. package/src/generators/docs-data.ts +6 -2
  222. package/src/generators/index.ts +10 -0
  223. package/src/generators/names-file.ts +98 -0
  224. package/src/generators/requirements-markdown.ts +36 -2
  225. package/src/generators/routes-file-hono.ts +26 -15
  226. package/src/generators/routes-file.ts +20 -7
  227. package/src/generators/template-generator.ts +20 -6
  228. package/src/index.ts +63 -5
  229. package/src/metaobjects-config.ts +78 -2
  230. package/src/names.ts +630 -0
  231. package/src/naming.ts +23 -0
  232. package/src/overwrite-policy.ts +15 -3
  233. package/src/payload-codegen.ts +4 -3
  234. package/src/projection/extract-view-spec.ts +85 -6
  235. package/src/prompt-generator-gate.ts +73 -0
  236. package/src/reference/barrel.ts +3 -0
  237. package/src/reference/entity.ts +28 -2
  238. package/src/reference/names.ts +125 -0
  239. package/src/reference/queries.ts +14 -2
  240. package/src/reference/routes-hono.ts +113 -0
  241. package/src/reference/routes.ts +30 -9
  242. package/src/reference-templates.ts +61 -21
  243. package/src/render-context.ts +22 -1
  244. package/src/retired-codegen-attrs.ts +52 -0
  245. package/src/routes-expose.ts +86 -0
  246. package/src/runner.ts +129 -11
  247. package/src/templates/callable-file.ts +60 -8
  248. package/src/templates/drizzle-schema.ts +248 -60
  249. package/src/templates/entity-constants.ts +95 -184
  250. package/src/templates/entity-file.ts +46 -4
  251. package/src/templates/entity-meta-file.ts +16 -3
  252. package/src/templates/entity-ui-descriptor.ts +305 -0
  253. package/src/templates/field-meta.ts +100 -19
  254. package/src/templates/names-decl.ts +165 -0
  255. package/src/templates/output-parser.ts +54 -7
  256. package/src/templates/projection-decl.ts +72 -31
  257. package/src/templates/queries-file.ts +17 -2
  258. package/src/templates/render-helper.ts +3 -1
  259. package/src/templates/requirement-test.ts +49 -18
  260. package/src/templates/routes-file-hono.ts +14 -2
  261. package/src/templates/routes-file.ts +69 -24
  262. package/src/templates/value-object-file.ts +15 -1
  263. package/src/templates/view-decl.ts +53 -3
  264. package/src/templates/zod-validators.ts +41 -5
  265. package/src/view-context.ts +88 -0
@@ -11,34 +11,68 @@ import { existsSync, readFileSync } from "node:fs";
11
11
  import { dirname, join } from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
  /** Basenames (no extension) of the copyable reference generators shipped in `src/reference/`. */
14
- export const REFERENCE_GENERATOR_NAMES = ["entity", "queries", "routes", "barrel"];
15
- /** A directory is the reference root iff it holds the entity reference template. */
16
- function isReferenceRoot(dir) {
17
- return existsSync(join(dir, "entity.ts"));
14
+ export const REFERENCE_GENERATOR_NAMES = ["entity", "queries", "routes", "routes-hono", "barrel", "names"];
15
+ /** A directory is a reference root iff it holds the first template the reader was told to expect. */
16
+ function isReferenceRoot(dir, sentinel) {
17
+ return existsSync(join(dir, `${sentinel}.ts`));
18
18
  }
19
19
  /**
20
- * Resolve the `src/reference/` directory holding the copyable reference generators.
21
- * Works in dev (this module runs from `src/`, templates at `./reference/`) and in a
22
- * published install (this module runs from `dist/`, templates at `../src/reference/`,
23
- * since `src/` ships alongside `dist/`). Walks up checking both layouts at each level.
20
+ * FR-040 §4.1 — build a reference-template reader for ONE package. `moduleUrl` is the
21
+ * calling module's `import.meta.url`, so each package resolves its OWN `src/reference/`.
22
+ * `names[0]` is the sentinel that identifies the directory.
23
+ *
24
+ * Works in dev (module runs from `src/`, templates at `./reference/`) and in a published
25
+ * install (module runs from `dist/`, templates at `../src/reference/`, since `src/` ships
26
+ * alongside `dist/`). Walks up checking both layouts at each level.
24
27
  */
25
- export function resolveReferenceRoot() {
26
- let dir = dirname(fileURLToPath(import.meta.url));
27
- for (let i = 0; i < 8; i++) {
28
- for (const candidate of [join(dir, "reference"), join(dir, "src", "reference")]) {
29
- if (isReferenceRoot(candidate))
30
- return candidate;
28
+ export function makeReferenceReader(moduleUrl, names) {
29
+ // A non-empty tuple type, so `names[0]` is `string` outright — this used to need a
30
+ // runtime empty-check plus a re-bound const, because `noUncheckedIndexedAccess`
31
+ // narrowing does not survive into the closures below. Every call site already passes
32
+ // an `as const` tuple or an array literal, so the type costs nothing and deletes both.
33
+ const sentinel = names[0];
34
+ function resolveReferenceRoot() {
35
+ let dir = dirname(fileURLToPath(moduleUrl));
36
+ for (let i = 0; i < 8; i++) {
37
+ for (const candidate of [join(dir, "reference"), join(dir, "src", "reference")]) {
38
+ if (isReferenceRoot(candidate, sentinel))
39
+ return candidate;
40
+ }
41
+ const parent = dirname(dir);
42
+ if (parent === dir)
43
+ break;
44
+ dir = parent;
31
45
  }
32
- const parent = dirname(dir);
33
- if (parent === dir)
34
- break;
35
- dir = parent;
46
+ throw new Error("reference templates not found — looked for `reference/` and `src/reference/` " +
47
+ `walking up from ${dir}.`);
36
48
  }
37
- throw new Error("codegen-ts reference templates not found — looked for `reference/` and `src/reference/` " +
38
- "walking up from the codegen-ts module.");
49
+ return {
50
+ resolveReferenceRoot,
51
+ /**
52
+ * Read one template by name. The name is checked against `names` FIRST: this is a
53
+ * public export, so `name` is an untrusted `string` at runtime (the per-package
54
+ * wrappers narrow to a literal union, but types are erased). Without the check it
55
+ * interpolates straight into a path, so any caller threading a CLI argument through
56
+ * reads whatever file the string points at. The allowlist is already a parameter —
57
+ * enforcing it here makes the guarantee structural instead of something every call
58
+ * site has to remember, and it is the reason `meta eject` needs no check of its own.
59
+ */
60
+ readReferenceTemplate: (name) => {
61
+ if (!names.includes(name)) {
62
+ throw new Error(`unknown reference template "${name}". Available: ${names.join(", ")}.`);
63
+ }
64
+ return readFileSync(join(resolveReferenceRoot(), `${name}.ts`), "utf8");
65
+ },
66
+ };
67
+ }
68
+ // This package's own reader — the back-compatible named exports `meta init` uses.
69
+ const ownReader = makeReferenceReader(import.meta.url, REFERENCE_GENERATOR_NAMES);
70
+ /** Resolve the `src/reference/` directory holding this package's reference generators. */
71
+ export function resolveReferenceRoot() {
72
+ return ownReader.resolveReferenceRoot();
39
73
  }
40
74
  /** Read the raw source of one reference generator (e.g. `"entity"` → the text of `entity.ts`). */
41
75
  export function readReferenceTemplate(name) {
42
- return readFileSync(join(resolveReferenceRoot(), `${name}.ts`), "utf8");
76
+ return ownReader.readReferenceTemplate(name);
43
77
  }
44
78
  //# sourceMappingURL=reference-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reference-templates.js","sourceRoot":"","sources":["../src/reference-templates.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,sFAAsF;AACtF,wFAAwF;AACxF,sFAAsF;AACtF,qEAAqE;AACrE,EAAE;AACF,qFAAqF;AACrF,yFAAyF;AACzF,mFAAmF;AAEnF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,iGAAiG;AACjG,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG5F,oFAAoF;AACpF,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,UAAU,C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CAAC,IAAY,EAAU,EAAE;YAC9C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CACb,+BAA+B,IAAI,iBAAiB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;YACJ,CAAC;YACD,OAAO,YAAY,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,GAAG,IAAI,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;AAElF,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB;IAClC,OAAO,SAAS,CAAC,oBAAoB,EAAE,CAAC;AAC1C,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,qBAAqB,CAAC,IAA4B;IAChE,OAAO,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC"}
@@ -46,12 +46,29 @@ export interface RenderContext {
46
46
  * doc comment on `MetaobjectsGenConfig.timestampMode` in metaobjects-config.ts.
47
47
  */
48
48
  timestampMode: "date" | "string";
49
+ /**
50
+ * Prepend `"use client";` to generated CLIENT artifacts (forms, hooks, grid
51
+ * columns, grid hooks). Defaults to false. A bundler-topology fact the adopter
52
+ * declares — see `MetaobjectsGenConfig.clientDirective` for why it is config
53
+ * rather than metadata, and why the default is off. FR-040 §6.4.
54
+ */
55
+ clientDirective: boolean;
49
56
  /** Path prefix applied to generated route registrations + hook fetch URLs. Defaults to "". */
50
57
  apiPrefix: string;
51
58
  /** 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. */
52
59
  emitAbstractShapes: boolean;
53
60
  /** Output layout mode: "flat" (default) — all files in outDir; "package" — sub-paths from entity metadata package. */
54
61
  outputLayout: OutputLayout;
62
+ /**
63
+ * §A6 — whether the run emits the `<Entity>Names` artifact (the runner aggregates the
64
+ * suite's `emitsNames` markers; `ctx.config.includeNames` carries the same fact for
65
+ * generators). A template may reference those constants ONLY when this is true: the
66
+ * names generator is opt-in under ADR-0034 scaffold-and-own, so an unconditional
67
+ * import would break every project that has not enabled it. Defaults to FALSE, which
68
+ * is what keeps output byte-identical for such a project — and for every bare-context
69
+ * caller (unit tests, generators invoked outside runGen).
70
+ */
71
+ includeNames: boolean;
55
72
  /**
56
73
  * Resolve an entity name to its Drizzle collection (table) variable name,
57
74
  * applying the project's pluralization config + per-entity overrides. Every
@@ -94,14 +111,16 @@ export interface RenderContext {
94
111
  providedEnumModule?: string;
95
112
  }
96
113
  /** 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). `collectionName` is built from `pluralizeCollections` + `collectionNameOverrides` (both default to always-pluralize). */
97
- export type RenderContextInput = Omit<RenderContext, "extStyle" | "omImport" | "columnNamingStrategy" | "timestampMode" | "apiPrefix" | "emitAbstractShapes" | "outputLayout" | "packageOf" | "valueObjectNames" | "valueObjectEmittedName" | "resolveValueObjectName" | "selfTarget" | "entityModuleTarget" | "collectionName"> & {
114
+ export type RenderContextInput = Omit<RenderContext, "extStyle" | "omImport" | "columnNamingStrategy" | "timestampMode" | "clientDirective" | "apiPrefix" | "emitAbstractShapes" | "outputLayout" | "includeNames" | "packageOf" | "valueObjectNames" | "valueObjectEmittedName" | "resolveValueObjectName" | "selfTarget" | "entityModuleTarget" | "collectionName"> & {
98
115
  extStyle?: ExtStyle;
99
116
  omImport?: string;
100
117
  columnNamingStrategy?: ColumnNamingStrategy;
101
118
  timestampMode?: "date" | "string";
119
+ clientDirective?: boolean;
102
120
  apiPrefix?: string;
103
121
  emitAbstractShapes?: boolean;
104
122
  outputLayout?: OutputLayout;
123
+ includeNames?: boolean;
105
124
  packageOf?: Map<string, string | undefined>;
106
125
  /** ADR-0044/#228 value-object emitted-name map (resolutionKey → emitted name).
107
126
  * Defaults to an empty Map — bare names, byte-identical to pre-#228 output.
@@ -1 +1 @@
1
- {"version":3,"file":"render-context.d.ts","sourceRoot":"","sources":["../src/render-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGrE;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,QAAQ,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,QAAQ,CAAC;IACnB,gGAAgG;IAChG,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C;;;;;;;;;OASG;IACH,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC;IACjC,8FAA8F;IAC9F,SAAS,EAAE,MAAM,CAAC;IAClB,oMAAoM;IACpM,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sHAAsH;IACtH,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;;OAKG;IACH,cAAc,EAAE,CAAC,UAAU,EAAE,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AqB,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE3G;AAED;iEACiE;AACjE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAMvE;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,aAAa,CA8CzE"}
@@ -63,9 +63,11 @@ export function makeRenderContext(opts) {
63
63
  // a unit test or a generator invoked outside `runGen`, must get the same
64
64
  // safe-no-op guarantee). See MetaobjectsGenConfig.timestampMode's doc comment.
65
65
  timestampMode: opts.dialect === "sqlite" ? "string" : (opts.timestampMode ?? "string"),
66
+ clientDirective: opts.clientDirective ?? false,
66
67
  apiPrefix: opts.apiPrefix ?? "",
67
68
  emitAbstractShapes: opts.emitAbstractShapes ?? true,
68
69
  outputLayout,
70
+ includeNames: opts.includeNames ?? false,
69
71
  packageOf: opts.packageOf ?? new Map(),
70
72
  valueObjectNames,
71
73
  valueObjectEmittedName: (obj) => valueObjectNames.get(obj.resolutionKey()) ?? obj.name,
@@ -1 +1 @@
1
- {"version":3,"file":"render-context.js","sourceRoot":"","sources":["../src/render-context.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAGhE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAmHrD;;;;;;mFAMmF;AACnF,MAAM,UAAU,qBAAqB,CAAC,KAAgB,EAAE,WAA+B;IACrF,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,kBAAkB,IAAI,WAAW,CAAC;AAClF,CAAC;AAED;iEACi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AE,EAAE;YACvE,MAAM,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;YACtE,MAAM,OAAO,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5F,OAAO,OAAO,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;QACD,UAAU,EAAE,aAAa;QACzB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,aAAa;QAC5D,cAAc,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,sBAAsB,CAAC,UAAU,EAAE,kBAAkB,CAAC;KAC/F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { MetaObject } from "@metaobjectsdev/metadata";
2
+ /**
3
+ * `@emitRoutes` / `@emitTanstack` / `@emitForm` / `@emitGrid` / `@emitAngular` were read
4
+ * off metadata by generator filters and were never registered metamodel vocabulary. Under
5
+ * the strict loader — which is what `meta verify` runs — every one of them is
6
+ * `ERR_UNKNOWN_ATTR`, while `meta gen` loads non-strict and honoured them. That is the
7
+ * defect: an adopter who authored the documented opt-out got working suppression AND a red
8
+ * `meta verify`, with nothing connecting the two.
9
+ *
10
+ * The reads are gone (see constants.ts for why registering them was refused rather than
11
+ * the other way round). But a project can be sitting on a WORKING `@emitRoutes: false`
12
+ * today, and deleting the read alone would start writing that suppressed file with no
13
+ * explanation — a silent behaviour change on upgrade, which is the one outcome not open
14
+ * to us. So the run says it.
15
+ *
16
+ * This follows the `layout.dataGrid` precedent (#287, data-grid-gate.ts) and the prompt
17
+ * generator gate beside it: tell the adopter at `meta gen` time rather than in a doc line
18
+ * that gets missed the same way the original one was. Warning only — the exit code is
19
+ * untouched, and `--dry-run` reports it too, since generators run before the write phase
20
+ * branches.
21
+ *
22
+ * It lives in the RUNNER, not in a generator, for two reasons. It is a model-level
23
+ * observation, so it must fire exactly ONCE per run rather than once per generator that
24
+ * happens to be wired; and the attribute is equally stale whether or not the generator it
25
+ * used to suppress is wired at all, so a generator-local check would go quiet in exactly
26
+ * the project that dropped the generator and kept the attribute.
27
+ *
28
+ * Self-extinguishing: removing the attribute from the metadata silences it forever. That
29
+ * is also the fix, since the same edit is what makes `meta verify` pass.
30
+ */
31
+ export declare function warnRetiredCodegenAttrs(entities: readonly MetaObject[], warn: (msg: string) => void): void;
32
+ //# sourceMappingURL=retired-codegen-attrs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retired-codegen-attrs.d.ts","sourceRoot":"","sources":["../src/retired-codegen-attrs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,UAAU,EAAE,EAC/B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAC1B,IAAI,CAgBN"}
@@ -0,0 +1,47 @@
1
+ import { RETIRED_CODEGEN_ATTRS } from "./constants.js";
2
+ /**
3
+ * `@emitRoutes` / `@emitTanstack` / `@emitForm` / `@emitGrid` / `@emitAngular` were read
4
+ * off metadata by generator filters and were never registered metamodel vocabulary. Under
5
+ * the strict loader — which is what `meta verify` runs — every one of them is
6
+ * `ERR_UNKNOWN_ATTR`, while `meta gen` loads non-strict and honoured them. That is the
7
+ * defect: an adopter who authored the documented opt-out got working suppression AND a red
8
+ * `meta verify`, with nothing connecting the two.
9
+ *
10
+ * The reads are gone (see constants.ts for why registering them was refused rather than
11
+ * the other way round). But a project can be sitting on a WORKING `@emitRoutes: false`
12
+ * today, and deleting the read alone would start writing that suppressed file with no
13
+ * explanation — a silent behaviour change on upgrade, which is the one outcome not open
14
+ * to us. So the run says it.
15
+ *
16
+ * This follows the `layout.dataGrid` precedent (#287, data-grid-gate.ts) and the prompt
17
+ * generator gate beside it: tell the adopter at `meta gen` time rather than in a doc line
18
+ * that gets missed the same way the original one was. Warning only — the exit code is
19
+ * untouched, and `--dry-run` reports it too, since generators run before the write phase
20
+ * branches.
21
+ *
22
+ * It lives in the RUNNER, not in a generator, for two reasons. It is a model-level
23
+ * observation, so it must fire exactly ONCE per run rather than once per generator that
24
+ * happens to be wired; and the attribute is equally stale whether or not the generator it
25
+ * used to suppress is wired at all, so a generator-local check would go quiet in exactly
26
+ * the project that dropped the generator and kept the attribute.
27
+ *
28
+ * Self-extinguishing: removing the attribute from the metadata silences it forever. That
29
+ * is also the fix, since the same edit is what makes `meta verify` pass.
30
+ */
31
+ export function warnRetiredCodegenAttrs(entities, warn) {
32
+ for (const { name, replacement } of RETIRED_CODEGEN_ATTRS) {
33
+ // ADR-0039: resolving — an INHERITED flag suppressed emission exactly as an own one
34
+ // did, so an own-only read here would leave the inheriting adopter unwarned while
35
+ // their output silently changed. `hasAttr` rather than a value comparison: an
36
+ // `@emitForm: true` was a no-op that still fails `meta verify`, so it is just as
37
+ // stale as the `false` that did something.
38
+ const carriers = entities.filter((e) => e.hasAttr(name));
39
+ if (carriers.length === 0)
40
+ continue;
41
+ warn(`@${name} on ${carriers.map((e) => e.name).join(", ")} is no longer read by any ` +
42
+ `generator — it was never registered metamodel vocabulary, so \`meta verify\` ` +
43
+ `rejects it outright with ERR_UNKNOWN_ATTR. Decide per generator what you ` +
44
+ `consume: ${replacement}. Remove the attribute to silence this.`);
45
+ }
46
+ }
47
+ //# sourceMappingURL=retired-codegen-attrs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retired-codegen-attrs.js","sourceRoot":"","sources":["../src/retired-codegen-attrs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA+B,EAC/B,IAA2B;IAE3B,KAAK,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,qBAAqB,EAAE,CAAC;QAC1D,oFAAoF;QACpF,kFAAkF;QAClF,8EAA8E;QAC9E,iFAAiF;QACjF,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACpC,IAAI,CACF,IAAI,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B;YAC/E,+EAA+E;YAC/E,2EAA2E;YAC3E,YAAY,WAAW,yCAAyC,CACnE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { MetaObject } from "@metaobjectsdev/metadata";
2
+ /**
3
+ * The five CRUD verbs a generated routes file can mount.
4
+ *
5
+ * Mirrors `CrudVerb` in `@metaobjectsdev/runtime-ts` — both the fastify and hono mount
6
+ * modules declare it identically. It is RESTATED rather than imported because codegen-ts
7
+ * does not depend on runtime-ts: codegen emits a call to that helper, it never links
8
+ * against it. Pinned against both runtime declarations by test/routes-expose.test.ts, so
9
+ * the two cannot drift the way the cell-renderer keys drifted from the view registry.
10
+ */
11
+ export declare const CRUD_VERBS: readonly ["list", "get", "create", "update", "delete"];
12
+ /**
13
+ * The verbs a TPH discriminator BASE serves at its own path.
14
+ *
15
+ * Read-only BY CONSTRUCTION: the discriminated union has no single writable shape, so the
16
+ * base mount can never carry `create`/`update`/`delete` — an author-supplied `expose`
17
+ * INTERSECTS with this set rather than replacing it, and may narrow to just `list`.
18
+ * Writes live on the per-subtype mounts at `<base path>/<segment>`.
19
+ *
20
+ * Named here because two places need it and a second literal would be a second answer:
21
+ * `routes-file.ts` emits the mount, and `api-model.ts` documents it. They disagreed —
22
+ * the api surface documented POST/PATCH/DELETE on a base path that serves none, under a
23
+ * comment claiming the documented paths "match the generated routes exactly".
24
+ */
25
+ export declare const TPH_POLYMORPHIC_VERBS: readonly ["list", "get"];
26
+ export type CrudVerb = (typeof CRUD_VERBS)[number];
27
+ /**
28
+ * Which CRUD verbs a generated routes file mounts (#348).
29
+ *
30
+ * A `filter` cannot express this. `filter` decides whether the file emits AT ALL, per
31
+ * entity, so it can only remove the whole surface; restricting to a SUBSET of verbs is a
32
+ * different axis. That is why this is a generator option rather than the "narrow it with
33
+ * `filter`" remedy that answered the retired `@emit*` attributes — the same reasoning that
34
+ * made a TPH subtype's opt-IN grid `tphSubtypeGrids` rather than a filter.
35
+ *
36
+ * It is deliberately NOT metadata. Which verbs a deployment exposes is a property of the
37
+ * app, not of the model: the same entity is read-only in one service and writable in
38
+ * another, and an attribute would force one answer into the shared spine.
39
+ *
40
+ * Absent — or a function returning `undefined` for an entity — means all five, and emits
41
+ * output byte-identical to before this option existed.
42
+ */
43
+ export type ExposeOption = readonly CrudVerb[] | ((entity: MetaObject) => readonly CrudVerb[] | undefined);
44
+ /** Resolve the option for one entity. `undefined` means "mount all five". */
45
+ export declare function resolveExpose(entity: MetaObject, expose: ExposeOption | undefined): readonly CrudVerb[] | undefined;
46
+ /**
47
+ * Narrow a mount whose verb set is already fixed by construction.
48
+ *
49
+ * A TPH polymorphic mount is read-only (`["list", "get"]`) because the discriminated union
50
+ * has no single writable shape. An author-supplied `expose` may narrow that further but
51
+ * must never widen it, so this INTERSECTS rather than replaces: mounting `create` on a
52
+ * surface that cannot serve it would emit a route that fails at runtime, and a wrong
53
+ * endpoint is worse than a missing one.
54
+ */
55
+ export declare function intersectExpose(fixed: readonly CrudVerb[], requested: readonly CrudVerb[] | undefined): readonly CrudVerb[];
56
+ /**
57
+ * The `expose: [...]` line for a mount call, or "" when every verb mounts.
58
+ *
59
+ * Emitting nothing rather than the full list keeps output byte-identical for every
60
+ * project that does not use the option.
61
+ */
62
+ export declare function exposeLine(verbs: readonly CrudVerb[] | undefined, indent: string): string;
63
+ //# sourceMappingURL=routes-expose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-expose.d.ts","sourceRoot":"","sources":["../src/routes-expose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,wDAAyD,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,0BAA2B,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,QAAQ,EAAE,GACnB,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,SAAS,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;AAE9D,6EAA6E;AAC7E,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,SAAS,QAAQ,EAAE,GAAG,SAAS,CAGjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,SAAS,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,GACzC,SAAS,QAAQ,EAAE,CAIrB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGzF"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The five CRUD verbs a generated routes file can mount.
3
+ *
4
+ * Mirrors `CrudVerb` in `@metaobjectsdev/runtime-ts` — both the fastify and hono mount
5
+ * modules declare it identically. It is RESTATED rather than imported because codegen-ts
6
+ * does not depend on runtime-ts: codegen emits a call to that helper, it never links
7
+ * against it. Pinned against both runtime declarations by test/routes-expose.test.ts, so
8
+ * the two cannot drift the way the cell-renderer keys drifted from the view registry.
9
+ */
10
+ export const CRUD_VERBS = ["list", "get", "create", "update", "delete"];
11
+ /**
12
+ * The verbs a TPH discriminator BASE serves at its own path.
13
+ *
14
+ * Read-only BY CONSTRUCTION: the discriminated union has no single writable shape, so the
15
+ * base mount can never carry `create`/`update`/`delete` — an author-supplied `expose`
16
+ * INTERSECTS with this set rather than replacing it, and may narrow to just `list`.
17
+ * Writes live on the per-subtype mounts at `<base path>/<segment>`.
18
+ *
19
+ * Named here because two places need it and a second literal would be a second answer:
20
+ * `routes-file.ts` emits the mount, and `api-model.ts` documents it. They disagreed —
21
+ * the api surface documented POST/PATCH/DELETE on a base path that serves none, under a
22
+ * comment claiming the documented paths "match the generated routes exactly".
23
+ */
24
+ export const TPH_POLYMORPHIC_VERBS = ["list", "get"];
25
+ /** Resolve the option for one entity. `undefined` means "mount all five". */
26
+ export function resolveExpose(entity, expose) {
27
+ if (expose === undefined)
28
+ return undefined;
29
+ return typeof expose === "function" ? expose(entity) : expose;
30
+ }
31
+ /**
32
+ * Narrow a mount whose verb set is already fixed by construction.
33
+ *
34
+ * A TPH polymorphic mount is read-only (`["list", "get"]`) because the discriminated union
35
+ * has no single writable shape. An author-supplied `expose` may narrow that further but
36
+ * must never widen it, so this INTERSECTS rather than replaces: mounting `create` on a
37
+ * surface that cannot serve it would emit a route that fails at runtime, and a wrong
38
+ * endpoint is worse than a missing one.
39
+ */
40
+ export function intersectExpose(fixed, requested) {
41
+ if (requested === undefined)
42
+ return fixed;
43
+ const want = new Set(requested);
44
+ return fixed.filter((v) => want.has(v));
45
+ }
46
+ /**
47
+ * The `expose: [...]` line for a mount call, or "" when every verb mounts.
48
+ *
49
+ * Emitting nothing rather than the full list keeps output byte-identical for every
50
+ * project that does not use the option.
51
+ */
52
+ export function exposeLine(verbs, indent) {
53
+ if (verbs === undefined)
54
+ return "";
55
+ return `\n${indent}expose: [${verbs.map((v) => JSON.stringify(v)).join(", ")}],`;
56
+ }
57
+ //# sourceMappingURL=routes-expose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-expose.js","sourceRoot":"","sources":["../src/routes-expose.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU,CAAC;AAuB9D,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAC3B,MAAkB,EAClB,MAAgC;IAEhC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,KAA0B,EAC1B,SAA0C;IAE1C,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,SAAS,CAAC,CAAC;IACxC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsC,EAAE,MAAc;IAC/E,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,KAAK,MAAM,YAAY,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACnF,CAAC"}
package/dist/runner.d.ts CHANGED
@@ -73,5 +73,23 @@ export interface RunGenResult {
73
73
  * CLI can print the end-of-run summary. */
74
74
  conflicts: WriteResult[];
75
75
  }
76
+ /**
77
+ * True exactly on the FIRST gen after upgrading past the release that moved the API base
78
+ * URL out of the entity descriptor, and only for a project that actually had a prefix to
79
+ * move. Exported for test.
80
+ *
81
+ * Keyed on the #232 engine stamp rather than on `apiPrefix` alone so the note is
82
+ * self-extinguishing: whether the app passed `baseUrl` to its provider is runtime code
83
+ * `meta gen` cannot see, so a prefix-only trigger would nag for ever with no way to
84
+ * satisfy it — the cry-wolf failure that got the `timestampMode` warning deleted from
85
+ * this file (see `codegen-ts-tanstack/src/data-grid-gate.ts`).
86
+ *
87
+ * Silence is the default for an absent or unorderable recorded version. That is the
88
+ * OPPOSITE call to the 0.24.5 agent-context staleness nudge, and deliberately: there an
89
+ * unknown version meant "cannot prove it is fresh, so nudge"; here it means "no gen
90
+ * history, so nothing to migrate", and a false nag costs more than a missed one when the
91
+ * compile break already routes the adopter to the same line.
92
+ */
93
+ export declare function shouldNoteBaseUrlMove(apiPrefix: string, recordedEngine: string | undefined, moveVersion?: string): boolean;
76
94
  export declare function runGen(opts: RunGenOpts): Promise<RunGenResult>;
77
95
  //# sourceMappingURL=runner.d.ts.map
@@ -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;AAQpE,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AAU/B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,oBAAoB,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