You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix 1: render `./`-prefixed relative import specifiers in the api-docs code
blocks (human page imports, agent group headers, and example import blocks) so a
verbatim copy-paste consumer resolves against the co-located generated code
(no TS2307). The ApiSymbol.importPath data stays the bare module path (the
accuracy gate verifies it against the emitted file); only the rendered
`from "..."` gains the `./` prefix.
Fix 2: auto-detect the opt-in Hono routes generator. routesFileHono carries a
new `emitsHonoRoutes` marker; the runner aggregates it across the active suite
into ctx.config.includeHonoRoutes; api-docs reads it and documents the Hono CRUD
registrars exactly when routesFileHono() is wired (Fastify-only otherwise).
New gate api-docs-relative-imports.test.ts: asserts the rendered import blocks
are `./`-prefixed (flat + package layout), tsc-compiles a CRUD consumer written
from AGENT-API.md against the REAL generated entity+queries code (proves no
TS2307 + the CRUD call type-checks), and proves Hono auto-detection end-to-end
through runGen. Render goldens updated; other generators' goldens byte-identical.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@@ -433,19 +433,19 @@ Generated API reference for this project; call these exactly as written. Imports
433
433
434
434
## Product
435
435
436
-
\`import { Product, ProductInsertSchema, ProductUpdateSchema } from "Product"\`
436
+
\`import { Product, ProductInsertSchema, ProductUpdateSchema } from "./Product"\`
437
437
- \`interface Product { id: number; name?: string }\` — The typed shape of a Product row, generated from its metadata.
438
438
- \`ProductInsertSchema: ZodType<{ name?: string }>\` — Zod schema validating the body of a create<Product> / POST request (auto-generated PKs excluded).
439
439
- \`ProductUpdateSchema: ZodType<{ name?: string }>\` — Zod schema validating the body of an update / PATCH request (all fields optional).
440
440
441
-
\`import { findProductById, listProducts, createProduct, updateProduct, deleteProductById } from "Product.queries"\`
441
+
\`import { findProductById, listProducts, createProduct, updateProduct, deleteProductById } from "./Product.queries"\`
442
442
- \`findProductById(db: Db, id: number): Promise<Product | null>\` — Fetch a single Product by its primary key; null when not found.
443
443
- \`listProducts(db: Db, opts?: { limit?: number; offset?: number }): Promise<Product[]>\` — List Product rows with optional limit/offset paging.
444
444
- \`createProduct(db: Db, data: { name?: string }): Promise<Product>\` — Validate (via ProductInsertSchema) and insert a new Product. [throws: ZodError when data fails ProductInsertSchema validation.]
445
445
- \`updateProduct(db: Db, id: number, data: { name?: string }): Promise<Product | null>\` — Partially update an existing Product by primary key; null when not found. [throws: ZodError when data fails the partial ProductInsertSchema validation.]
446
446
- \`deleteProductById(db: Db, id: number): Promise<boolean>\` — Delete a Product by primary key; true when a row was removed.
447
447
448
-
\`import { productRoutes } from "Product.routes"\`
448
+
\`import { productRoutes } from "./Product.routes"\`
- \`interface SummaryVO { headline: string }\` — The typed shape of a SummaryVO row, generated from its metadata.
467
467
468
468
## ProductSummary
469
469
470
-
\`import { extractProductSummary, extractLenientProductSummary } from "ProductSummary.extractor"\`
470
+
\`import { extractProductSummary, extractLenientProductSummary } from "./ProductSummary.extractor"\`
471
471
- \`extractProductSummary(root: MetaRoot, text: string): SummaryVO // SummaryVO: { headline: string }\` — Parse dirty LLM json text into a strict, fully-typed SummaryVO graph. [throws: Error when a @required field is lost (the strict opt-in gate).]
0 commit comments