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(orval): re-export client extra files from the tags-split barrel
In `tags-split` mode with `tagsSplitDeduplication`, `writeSplitTagsMode` emits
`<clientDir>/index.ts` — the only complete client entry point — but builds it
from the per-tag implementation files alone. Client extra files are produced by
the client builder, so Angular's `retrievalClient: 'both'` left every per-tag
`*.resource.ts` unreachable from the barrel:
client/pets/pets.service.ts
client/pets/pets.resource.ts
client/index.ts -> export * from './pets/pets.service'; # resource missing
Consumers wanting the resource API had to import per-tag paths directly, which
is exactly what a module-boundary-enforced monorepo forbids.
`builder.extraFiles` is already in scope in `writeSplitTagsMode`, so the
re-exports are composed into the barrel content before it is written rather
than patched in afterwards. They are derived from the emitted paths, not from
tag names: a mutation-only tag produces no resource file, and a name-derived
barrel would export a file that is never written. Files outside the client
directory belong to another barrel and are left alone.
Each `*.resource.ts` carries its own copy of the shared httpResource
boilerplate, so plain wildcards make those names ambiguous — TypeScript reports
TS2308 and recommends exactly this remedy. The names are declared by the
generator that emits them (`ClientFileBuilder.sharedExports`), built from the
same constants the templates interpolate, and re-exported from a single file
ahead of the wildcards. Ownership is per name rather than per file, so a
generator emitting some of its shared declarations conditionally stays correct.
Declared rather than inferred from the generated source: inference cannot tell
intentional boilerplate from an accidental collision between two tags, and
would silently resolve the latter to one arbitrary file — a wrong type at the
call site in place of a build failure. Generators whose extra files carry no
repeated declarations (hono, mcp) declare nothing and are unaffected.
New `httpResourceBothTagsSplitBarrel` fixture covers it; the generated-output
typecheck gate passes for all 16 clients. `http-resource.test.ts` asserts the
declaration against the names two generated resource files actually share, so a
new shared declaration cannot be added without being listed. No existing
snapshot changed — no prior fixture combined `tagsSplitDeduplication` with a
client emitting extra files.
Workspace output still has the same gap: it emits no client barrel at all, and
its workspace barrel omits extra files for the same ordering reason. The shared
helper sits in core's utils so closing that is additive.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments