feat(types): legacy leaf facade entries (SD-3180)#3360
Merged
caio-pizzol merged 3 commits intoMay 17, 2026
Conversation
Three more facade files under SD-3178 / Phase 3 of SD-3175. Mirrors
the three single-export legacy subpaths under `src/public/legacy/`:
legacy/converter.ts - re-exports SuperConverter
legacy/file-zipper.ts - re-exports createZip
legacy/docx-zipper.ts - re-exports DocxZipper as default
(preserves `import DocxZipper from 'superdoc/docx-zipper'`)
All three classified as legacy public compatibility surface in
package-boundaries.md Decision 4 (already updated in SD-3179).
Already covered by SD-3176 no-growth snapshots. No changes to docs
or snapshots here; this PR adds the source-side facade only.
Pipeline:
- vite.config.js: 3 new rollupOptions.input entries.
- ensure-types.cjs: NOT updated. The three existing legacy subpaths
use a single `types` string (no .import/.require split) and have
no .d.cts shim today; the new facade matches that pattern. The
CJS shim generator skips `default` exports anyway, so adding a
shim for docx-zipper would require generator work. Phase 4
decides whether to add proper CJS shims when the contract flips.
- verify-public-facade-emit.cjs: FACADE_ENTRIES schema extended to
make `cjs` optional. When `cjs: null`, the ESM/CJS parity check
and the leak check on the CJS file are skipped. Three new
entries added.
- 3 smoke tests, including a default-import assertion for
docx-zipper.
No package.json#exports change. Phase 4 owns the contract flip.
Empirically verified:
- clean tree: OK, 5 entries
- drift on legacy/converter facade .d.ts (rename SuperConverter): exit 1
- drift on legacy/docx-zipper facade .d.ts (default → NotDefault): exit 1
- 8/8 smoke tests pass
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f6454e8a5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…acade (SD-3180) Codex review on PR #3360 caught a runtime/type contract split. Today's `superdoc/converter` runtime (`dist/super-editor/converter.es.js`) exports both `SuperConverter` AND `hasBodyNumberingReferences`. The existing types entry only declares `SuperConverter`, so the SD-3176 typed snapshot shows 1 name while the runtime contract has 2. The earlier draft of the facade only re-exported `SuperConverter`, which would have regressed JS consumers doing `import { hasBodyNumberingReferences } from 'superdoc/converter'` once Phase 4 flips package.json#exports to the facade. Adds `hasBodyNumberingReferences` to: - packages/superdoc/src/public/legacy/converter.ts (typed re-export through the narrow `@superdoc/super-editor/converter` subpath, which already exposes both names at runtime) - FACADE_ENTRIES['legacy/converter'].expectedNames (now 2 names) - converter.test.ts (runtime smoke assertion) This is "type the existing runtime contract correctly" rather than "grow the surface". The SD-3176 baseline for the live `superdoc/converter` subpath stays at 1 (it tracks the old types entry until Phase 4 flips). Verified: - pnpm run build:es: pass - verifier: 5 entries clean, legacy/converter: 2 exports - vitest converter.test.ts: 2/2 pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three more facade files under SD-3178 / Phase 3 of SD-3175 (path-as-contract architecture). Mirrors the three single-export legacy subpaths under
src/public/legacy/so the source-side structure covers most of the legacy compatibility surface.These were already classified as legacy in
package-boundaries.mdDecision 4 and already covered by SD-3176 no-growth snapshots — this PR adds the source-side facade to match.What changes
packages/superdoc/src/public/legacy/converter.tsre-exportsSuperConverter.packages/superdoc/src/public/legacy/file-zipper.tsre-exportscreateZip.packages/superdoc/src/public/legacy/docx-zipper.tsre-exportsDocxZipperas default (preserves the existingimport DocxZipper from 'superdoc/docx-zipper'contract).@superdoc/super-editor/{converter,docx-zipper,file-zipper}subpaths rather than the root, so the emitted bundles stay narrow.vite.config.js: three new rollup input entries.verify-public-facade-emit.cjs:FACADE_ENTRIESschema extended to make thecjsfield optional. Header reworded to clarify the trade-off. The three new entries setcjs: nullto match the existing single-typespattern of the livesuperdoc/converter/superdoc/docx-zipper/superdoc/file-zippersubpaths. Phase 4 decides per-entry whether to add proper CJS shims when the contract flips.No
package.json#exportschange. Nopackage-boundaries.mdchange (already updated in SD-3179). No SD-3176 snapshot change (already covers these three).Why narrow imports
Earlier draft sourced from the broad
@superdoc/super-editorroot, which pulled the entire super-editor graph through each facade entry. The narrow subpaths keep bundle shape close to the existing targets:converter.es.js: 335Bdocx-zipper.es.js: 351Bfile-zipper.es.js: 135BPhase 4's contract flip would otherwise have knowingly regressed bundle size on three legacy subpaths.
Verified locally
.d.ts(renameSuperConverter).d.ts(default → named)Related