Skip to content

feat(Assemble): capabilitiesOnIncluded to stamp primary data only - #582

Merged
thomasfosterau merged 2 commits into
trunkfrom
issue-567-capabilities-included
Nov 12, 2026
Merged

thomasfosterau merged 2 commits into
trunkfrom
issue-567-capabilities-included

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Adds capabilitiesOnIncluded?: boolean (default true, today's behaviour) to Assemble.Options and Assemble.RelationshipInput, and to the ResourceHandlers read-only, writable and related configs. false stamps the capabilities hook's result on primary data only; included members carry no capability meta. Owner decision of 2026-11-11 (a boolean option rather than a hook-role argument). From gardeneria#1263 O5.

Implementation: the single onResource transform shapes both slots, so with false the stamp is skipped for any resource whose (type, id) is not in the primary data. A resource that is both primary and included is shaped once, for the primary slot. In a relationship document the primary data is linkage (no meta), so false there stamps nothing. Members are spelled readonly capabilitiesOnIncluded?: boolean and threaded with definedMember, so exactOptionalPropertyTypes needed no widening.

Closes #567

Verification

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass (0 errors; no new warnings in the changed files)
  • vp run check: pass
  • vp run -r test:unit: pass
  • vp run docgen: pass
  • vp run test:coverage, then vp exec fallow audit --base origin/trunk: pass (verdict pass)

Changeset

.changeset/capabilities-on-included.md, minor (additive).

  • A changeset under .changeset/ for every change to published behaviour

Notes

New public members on Assemble.Options, Assemble.RelationshipInput and the ResourceHandlers configs; @since 0.22.0 (package is 0.21.0). Tests cover default and explicit true stamping both, and false stamping primary only, for single-resource, paginated and unpaginated collection documents with includes, and through ResourceHandlers.list.


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ecfe336

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thomasfosterau/effect-jsonapi Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@thomasfosterau
thomasfosterau force-pushed the issue-567-capabilities-included branch from d9a71ee to ecfe336 Compare November 12, 2026 05:21
@thomasfosterau
thomasfosterau merged commit ae9270d into trunk Nov 12, 2026
4 checks passed
@thomasfosterau
thomasfosterau deleted the issue-567-capabilities-included branch November 12, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assemble capabilities: a hook can't stamp primary data only (gardeneria#1263 O5)

2 participants