Commit 3e7b772
committed
fix(profile): avoid duplicate meta key when meta is a factory param
When a profile exposes `meta` as a required factory param (e.g. KBV
FOR/ERP profiles where `meta.profile` is pinned via min=1), the
TypeScript profile writer emitted two `meta:` keys in the same
`createResource` object literal — the first from the generic param
loop and the second from the unconditional `meta: { profile: [...] }`
emission. This produced TypeScript TS1117 errors and silently
dropped any caller-supplied `meta.tag` / `meta.source` / extra
profile URLs, because the second key overwrote the first.
Fix: when `meta` is already in `allFields`, suppress the generic
emission and merge the caller-supplied meta with the profile's
canonical URL:
meta: { ...args.meta, profile: [...(args.meta?.profile ?? []), canonicalUrl] }
Profiles without `meta` in params are unchanged:
meta: { profile: [canonicalUrl] }
Applies to both the Input-helper branch (with extension slices) and
the standard branch. Typecheck on consuming project (mira-adapters,
10+ KBV profiles) goes from 9 TS1117 errors to 0 after regeneration.1 parent 373dc66 commit 3e7b772
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| 491 | + | |
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
| 495 | + | |
494 | 496 | | |
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
498 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
499 | 507 | | |
500 | 508 | | |
501 | 509 | | |
| |||
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| 541 | + | |
533 | 542 | | |
534 | 543 | | |
| 544 | + | |
535 | 545 | | |
536 | 546 | | |
537 | 547 | | |
538 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
539 | 555 | | |
540 | 556 | | |
541 | 557 | | |
| |||
0 commit comments