Skip to content

feat!: migrate to document-schema.js 4.0.0 (formatVersion retired, depth-only list memberships) - #65

Merged
Mearman merged 1 commit into
mainfrom
feat/schema-4-content
Aug 18, 2026
Merged

feat!: migrate to document-schema.js 4.0.0 (formatVersion retired, depth-only list memberships)#65
Mearman merged 1 commit into
mainfrom
feat/schema-4-content

Conversation

@Mearman

@Mearman Mearman commented Aug 18, 2026

Copy link
Copy Markdown
Member

Moves markdown-codec onto document-schema.js ^4.0.0, the tree-form major from ExaDev/document-schema.js#20.

Schema 4.0.0 retired ContentDocument's per-arm formatVersion literal (versioning now lives at the serialised-artefact boundary via the release-pinned $schema URI), so lowerParsedMarkdown no longer stamps one, and the test fixtures plus the smoke suite's spreadsheet fixture drop the field with it. The z.codec() pair validates both directions against ContentDocumentSchema itself, so the round-trip and conformance suites carry the new shape automatically -- green locally across lint, typecheck, build, the unit suite (940 tests incl. CommonMark/GFM conformance), workers, and smoke.

The jump from 3.2.0 also crosses 3.3.0's numId-optional ContentListMembership, which surfaced as three type errors in emit.ts: a depth-only membership (a source carrying a level but no numbering identity of its own -- OOXML drawing paragraphs' a:pPr/@lvl is the motivating case) can now reach emitMarkdown. It renders under the same md/list-numid-fallback cross-format contract as a foreign numId: a plain, tight, non-task bullet at the paragraph's own level, reported once per document. The README gotcha entry and src/shared/list-id.ts's contract note now cover both cases.

No Layout* imports existed outside LayoutMetadata (which stays in the schema), so the layout demotion half of the major needed nothing here. Deliberately no tree-form DocumentPackage handling either -- that lives behind documents.js's package boundary, not in a codec exchanging flat ContentDocuments.

Breaking for consumers: readMarkdown's emitted ContentDocuments no longer carry formatVersion and validate against document-schema.js 4; consumers still validating against schema 3 must move to 4. semantic-release cuts this as 3.0.0.

Generated by Claude Code

…pth-only list memberships)

document-schema.js 4.0.0 retired ContentDocument's per-arm formatVersion
literal -- versioning now lives at the serialised-artefact boundary via
the release-pinned $schema URI -- so lowerParsedMarkdown no longer
stamps one, and every fixture asserting the old envelope shape drops
the field with it. The z.codec() pair validates both directions against
ContentDocumentSchema itself, so the round-trip and conformance suites
carry the new shape automatically.

The jump from 3.2.0 also crosses 3.3.0's numId-optional
ContentListMembership, which surfaces in emitMarkdown: a depth-only
membership (a source carrying a level but no numbering identity of its
own, e.g. OOXML drawing paragraphs' a:pPr/@lvl) renders under the same
md/list-numid-fallback cross-format contract as a foreign numId -- a
plain, tight, non-task bullet at the paragraph's own level, reported
once per document.

BREAKING CHANGE: readMarkdown's emitted ContentDocuments no longer
carry formatVersion and validate against document-schema.js 4;
consumers still validating against schema 3 must move to 4.
@Mearman
Mearman merged commit 226463a into main Aug 18, 2026
11 checks passed
@Mearman
Mearman deleted the feat/schema-4-content branch August 18, 2026 10:55
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant