Skip to content

fix: preserve materials frontmatter in serializeNode - #229

Merged
nahiyankhan merged 1 commit into
mainfrom
fix/serialize-node-materials
Jul 14, 2026
Merged

fix: preserve materials frontmatter in serializeNode#229
nahiyankhan merged 1 commit into
mainfrom
fix/serialize-node-materials

Conversation

@nahiyankhan

Copy link
Copy Markdown
Collaborator

Category: fix
User Impact: Saving a Ghost node no longer silently deletes its materials frontmatter.
Problem: serializeNode emitted only description into frontmatter, so any serialize round-trip dropped a node's materials locators. A downstream consumer (Ether) verified this against the lib source and had to splice materials back in after serializing.
Solution: Emit materials after description in the stable key order, so round-trips are lossless and diffs stay deterministic.

Validation:

  • pnpm test: 175 passed, 1 skipped (run in main checkout with identical diff; this worktree's install was blocked by a registry proxy issue)
  • pnpm check: green
  • Targeted node-schema.test.ts run: 13 passed, including the new materials round-trip test

Changeset: added (patch)

Ghost Review:

  • ghost check / ghost review: not run because the change is a pure serialization fix in ghost-core with no UI or fingerprint surface impact
File changes

packages/ghost/src/ghost-core/node/serialize.ts
Emit materials into ordered frontmatter when defined; update the doc comment to reflect the stable key order.

packages/ghost/test/ghost-core/node-schema.test.ts
New round-trip test asserting materials (repo glob + HTTPS URL) survives serialize/parse.

.changeset/serialize-node-materials.md
Patch changeset for @design-intelligence/ghost.

Screenshots/Demos: N/A

@nahiyankhan
nahiyankhan marked this pull request as ready for review July 14, 2026 00:35
@nahiyankhan
nahiyankhan merged commit e45fe48 into main Jul 14, 2026
5 checks passed
@nahiyankhan
nahiyankhan deleted the fix/serialize-node-materials branch July 14, 2026 00:35
@github-actions github-actions Bot mentioned this pull request Jul 14, 2026
nahiyankhan added a commit that referenced this pull request Jul 14, 2026
* origin/main:
  chore: version packages (#230)
  fix: preserve materials frontmatter in serializeNode (#229)
  chore: version packages (#217)

# Conflicts:
#	packages/ghost/src/ghost-core/node/serialize.ts
#	packages/ghost/test/ghost-core/node-schema.test.ts
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.

1 participant