Skip to content

Add Partial Support // Extraction and Apply Updates#134

Merged
bryantgillespie merged 13 commits into
mainfrom
bry/partials
Jun 3, 2026
Merged

Add Partial Support // Extraction and Apply Updates#134
bryantgillespie merged 13 commits into
mainfrom
bry/partials

Conversation

@bryantgillespie

@bryantgillespie bryantgillespie commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds partial template extraction/apply support.

Partial templates can now scope exported/applied template data by collections/components, with relation handling strategies
for excluded collections.

Changes

  • Add template plan metadata support for partial templates
  • Add collection/component scoping flags
  • Add deep schema/content expansion for related collections
  • Add relation strategies:
    • deep
    • empty
    • preserve
  • Add excluded relation warnings + apply-time guard
  • Skip broken junction collections when FK targets are excluded
  • Finalize collection/field metadata after schema load
  • Improve error context around collection/data/relation load failures
  • Remove dead update-required-fields path
  • Add tests for template plans, metadata scoping, relation inclusion, junction detection

Validation

  • npm run build passes
  • Unit tests pass: 32 passing

Notes

  • Lint currently fails repo-wide with many pre-existing issues; not fully addressed here.
  • Test prerelease can is published and can be run with:

npx directus-template-cli@partials <command>

@bryantgillespie bryantgillespie changed the title [WIP] Add Partial Extraction Add Partial Support // Extraction and Apply Updates May 13, 2026
@bryantgillespie bryantgillespie marked this pull request as ready for review June 2, 2026 18:20
@bryantgillespie bryantgillespie requested a review from LZylstra June 2, 2026 18:20

@LZylstra LZylstra left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work on this. A few things to fix before merging, the most critical being an ordering bug with finalizeFields that'll break FK inserts on most real templates.

Comment thread src/lib/load/index.ts Outdated
Comment thread src/lib/template-plan/metadata-plan.ts Outdated
Comment thread src/lib/template-plan/metadata-plan.ts
Comment thread src/lib/load/load-data.ts Outdated
Comment thread src/lib/template-plan/metadata.ts
Comment thread src/lib/extract/extract-content.ts
Comment thread src/lib/extract/extract-content.ts
@bryantgillespie bryantgillespie merged commit 5720be3 into main Jun 3, 2026
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.

2 participants