Commit 60b84f2
* fix(angular): match multi-word tags with acronym prefixes in tags-split mode
`getRelevantVerbOptionsForTag` compared tags via `camel()`, which converts
"AB Widget" → "aBWidget" but the dictionary key from `generateTargetTags`
is `kebab("AB Widget")` = "ab-widget", and `camel("ab-widget")` = "abWidget".
The mismatch caused the tag's operations to be invisible to the header builder,
so `hasBuiltInFilteredQueryParams` was always false and `filterParams` was
never emitted for acronym-prefixed multi-word tags.
Fix: compare using `kebab()` in both places — it is the canonical form already
used as the tag dictionary key, and it round-trips correctly for all tag shapes.
Closes #3634
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(core): unify tag-bucket identity behind a single shared module
The rule "which file does an operation belong to in tags/tags-split mode"
(`kebab(tags[0] ?? 'default')`) was hand-copied across 6 sites in 4 packages,
in two slightly different variants. Each copy independently decided how to
derive and compare the tag key, so the build-the-key side and the look-up-the-
key side could disagree — the exact failure behind the Angular `filterParams`
bug (#3634), and a still-live identical bug in @orval/hono.
Introduce one source of truth in @orval/core:
- getTagKey(tag?) — canonical, idempotent bucket key (kebab-based)
- getOperationTagKey(op) — key for an operation's primary tag
- isOperationInTagBucket(op, key) — canonical-vs-canonical membership test
Migrate every consumer to it: core target-tags writer, angular
(getRelevantVerbOptionsForTag, http-resource paths), query (angular header),
mock (array-item factory scope), and hono.
hono fixes (#3634 class, previously broken for multi-word/acronym tags):
- getVerbOptionGroupByTag now keys by the canonical tag, so tags-split
handler/zod/context files land in canonical (kebab) directories that match
the composite route's import paths instead of raw `"AB Widget"/` dirs.
- the composite-route handler filter compared a raw `tags[0]` against the
canonical key and silently produced an empty import block; it now uses
isOperationInTagBucket.
Verified end-to-end with an acronym tag ("AB Widget"): angular tags-split
emits the `filterParams` definition alongside its call sites, and hono
composite routes import and wire up the tag's handlers from a matching dir.
Single-word tags are unaffected (kebab is a no-op) — all sample snapshots are
byte-identical to before. New unit tests cover key derivation, idempotency,
and acronym/default-bucket matching.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(core): lock multi-word/acronym tag handling with a CI-gated regression
Adds issue-3634.yaml — a `Widget` (single-word control) + `AB Widget` (acronym
trigger) spec where both operations carry a query param — and wires it through
two orval-tests configs whose generated output is snapshotted and compiled in CI
(`test:snapshots` + `orval-tests build`):
- angular tags-split: the `ab-widget` service must DEFINE `filterParams`, not
just call it. A regression drops the helper definition (the #3634 symptom) and
fails both the snapshot diff and the TypeScript compile (TS2304).
- hono composite-routes tags-split: handler/zod/context files must land in the
canonical `ab-widget/` directory and the composite `routes.ts` must import the
tag's handlers from there. A regression reverts to a raw `AB Widget/` directory
and an empty handler import block.
None of the existing duplicate-tag fixtures cover this: `Dup Tag`/`dup tag` all
camelCase to the same `dupTag`, so the previous (buggy) camel-based matching
grouped them correctly. Only an acronym-prefixed tag exposes the camel-vs-kebab
divergence.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(core): treat empty/whitespace tags as the default bucket
getTagKey's docstring promised that "missing or empty tags" map to the
DefaultTag bucket, but the implementation only fell back for null/undefined,
so a spec with `tags: ['']` would route to a `""` bucket. Trim and fall back
before kebab-casing so empty/whitespace tags resolve to `default`.
Tighten isOperationInTagBucket to treat only `undefined` (not any falsy value)
as the "no tag filter" case, so an accidental empty-string tagKey normalises to
the default bucket instead of silently matching every operation. JSDoc updated
to match, and unit tests now cover the empty/whitespace fallback for both
functions.
Addresses CodeRabbit and Copilot review feedback on #3641.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(core,angular): route default-bucket exports and empty tags through the canonical helper
Generalize the tag-identity fix to two more call sites so they agree with
`isOperationInTagBucket`, the single source of truth for tag-bucket identity:
- core/target-tags: the footer `operationNames` filter excluded untagged
operations (`tags.length > 0`), so the implicit `default` bucket file could
miss its per-operation `*ClientResult` exports. Filter the already
default-normalised `operations` array via `isOperationInTagBucket`.
- angular/utils: `getRelevantVerbOptionsForTag` treated an empty-string tag as
"no filter" (`if (!tag)`); guard on `tag == null` so an empty/whitespace tag
normalises to the `default` bucket like the core writer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(core): cover untagged operations in the default-bucket footer
Regression test for the target-tags fix: an untagged operation routed into the
implicit `default` bucket must have its name passed to that bucket's footer
(which drives per-operation `*ClientResult` return-type exports). Fails against
the old `tags.length > 0` filter, which dropped untagged operations entirely.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(core): regenerate issue-3103 default-bucket snapshot for footer fix
The untagged `getApiProduct` operation routes into the implicit `default`
bucket; with the target-tags footer fix it now correctly emits its
`GetApiProductClientResult` return-type export, which the committed snapshot
predated. This is end-to-end coverage of the default-bucket footer fix.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: stop tracking .impeccable tool cache
The `.impeccable/hook.cache.json` session-cache file was accidentally committed
in this branch (contains a local session UUID and absolute paths). Untrack it
and add `.impeccable` to .gitignore.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: The Ult <the-ult@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7320d75 commit 60b84f2
34 files changed
Lines changed: 1128 additions & 61 deletions
File tree
- packages
- angular/src
- core/src
- utils
- writers
- hono/src
- mock/src/faker/getters
- query/src
- tests
- __snapshots__
- angular
- issue-3103/default
- issue-3634
- ab-widget
- model
- widget
- hono/issue-3634/src
- ab-widget
- endpoints
- schemas
- widget
- configs
- specifications
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
1495 | 1496 | | |
1496 | 1497 | | |
1497 | 1498 | | |
1498 | | - | |
| 1499 | + | |
1499 | 1500 | | |
1500 | 1501 | | |
1501 | 1502 | | |
1502 | | - | |
| 1503 | + | |
1503 | 1504 | | |
1504 | 1505 | | |
1505 | 1506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
493 | 507 | | |
494 | 508 | | |
495 | 509 | | |
| |||
500 | 514 | | |
501 | 515 | | |
502 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
503 | 527 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
157 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
158 | 159 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 160 | + | |
| 161 | + | |
168 | 162 | | |
169 | 163 | | |
170 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
0 commit comments