Skip to content

feat(types): legacy headless-toolbar public facade entry (SD-3179)#3359

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/SD-3179-public-facade-headless-toolbar
May 17, 2026
Merged

feat(types): legacy headless-toolbar public facade entry (SD-3179)#3359
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/SD-3179-public-facade-headless-toolbar

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Second facade file under SD-3178 / Phase 3 of SD-3175 (path-as-contract architecture). Reframes the ./headless-toolbar family as legacy public compatibility surface rather than supported new API.

What changes

  • superdoc/headless-toolbar, superdoc/headless-toolbar/react, and superdoc/headless-toolbar/vue are reclassified as legacy public compatibility surface in docs/architecture/package-boundaries.md (inventory table + Decision 4 migration table). Existing consumers keep compiling with full types; new custom UI integrations should use superdoc/ui and superdoc/ui/react.
  • New facade file packages/superdoc/src/public/legacy/headless-toolbar.ts mirrors the 16-name surface (3 runtime + 13 types) under the path-as-contract structure. Named exports only.
  • Pipeline wiring: new vite rollup input entry, CJS shim entry in ensure-types.cjs.
  • verify-public-facade-emit.cjs refactored to be config-driven via a FACADE_ENTRIES list. Adding a new facade file is now a single append. Root entry keeps the command-signature probe; the headless-toolbar entry doesn't need it (no EditorCommands exposure).
  • tests/consumer-typecheck/snapshot-superdoc-legacy-exports.mjs: SD-3176's no-growth gate extended to cover the three headless-toolbar subpaths. Three new baseline files (16/1/1 resolved exports). Snapshots README updated.
  • 3 smoke assertions for the runtime re-exports.

No package.json#exports change. Phase 4 owns the contract flip.

Verified locally

Check Result
Facade verifier clean OK across 2 entries (root: 4 exports, legacy/headless-toolbar: 16)
Drift on legacy/headless-toolbar facade .d.ts exit 1
Injected @superdoc/* leak in facade .d.ts exit 1
Command-signature probe still fires on root confirmed
No-growth gate clean across all 7 legacy subpaths OK
Drift on superdoc/headless-toolbar published .d.ts exit 1
Vitest smoke tests 5/5 pass (2 root + 3 headless-toolbar)

Related

Stacked on PR #3358 (SD-3178). Second facade file in the path-as-contract
scaffold under SD-3175 / Phase 3.

`superdoc/headless-toolbar`, `superdoc/headless-toolbar/react`, and
`superdoc/headless-toolbar/vue` are reclassified as legacy public
compatibility surface. Existing consumers keep compiling with full
types; new custom UI integrations should use `superdoc/ui` and
`superdoc/ui/react` instead. The next-generation typed UI controller
replaces the default headless-toolbar path.

Source facade:

- packages/superdoc/src/public/legacy/headless-toolbar.ts: 16 named
  exports (3 runtime + 13 types) mirroring src/headless-toolbar.js +
  src/headless-toolbar.d.ts. Lives under legacy/ to mark it compat-only.
- vite.config.js + ensure-types.cjs: build wiring for the new entry.
- verify-public-facade-emit.cjs: refactored to be config-driven via a
  FACADE_ENTRIES list. Adding a new facade file is now a single append.
- src/public/legacy/headless-toolbar.test.ts: 3 smoke assertions.

Policy:

- docs/architecture/package-boundaries.md: inventory table rows for
  `./headless-toolbar` and its react/vue subpaths reclassified from
  Public subpath to Legacy public compatibility surface. Decision 4's
  migration table extended to cover all three.

No-growth enforcement (extends SD-3176):

- tests/consumer-typecheck/snapshot-superdoc-legacy-exports.mjs: adds
  `./headless-toolbar`, `./headless-toolbar/react`, and
  `./headless-toolbar/vue` to the SUBPATHS list.
- snapshots/: three new baselines (16/1/1 resolved exports).
- README updated with the new entries.

No package.json#exports change. Phase 4 owns the contract flip.

Empirically verified the multi-entry facade verifier:
- clean: OK, 2 entries (root: 4 exports, legacy/headless-toolbar: 16)
- drift on legacy/headless-toolbar facade .d.ts: exit 1
- leak in legacy/headless-toolbar facade .d.ts: exit 1
- command-signature probe still fires on root entry only

Empirically verified the no-growth gate:
- clean across all 7 subpaths: OK
- drift on superdoc/headless-toolbar published .d.ts: exit 1
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 17, 2026 20:20
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 17, 2026

SD-3179

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol merged commit d705459 into main May 17, 2026
72 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-3179-public-facade-headless-toolbar branch May 17, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants