Skip to content

fix(types): drain @superdoc/style-engine/ooxml shim (SD-2893)#3153

Merged
caio-pizzol merged 2 commits intomainfrom
caio-pizzol/SD-2893-stack-5-style-engine-ooxml
May 5, 2026
Merged

fix(types): drain @superdoc/style-engine/ooxml shim (SD-2893)#3153
caio-pizzol merged 2 commits intomainfrom
caio-pizzol/SD-2893-stack-5-style-engine-ooxml

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Stacked on #3151. Drains the fifth shim entry (@superdoc/style-engine/ooxml), bringing the count to 1. Only @superdoc/common remains.

The /ooxml subpath is the only part of style-engine publicly reachable - 10 dist d.ts references across pm-adapter, the diffing extension, super-converter, parts adapters, and plan-engine. The bare @superdoc/style-engine is internal-only.

Approach mirrors the pm-adapter narrow-scope pattern from #3144:

  • Include only the ooxml/** subtree plus its sibling cascade.ts dependency in vite.config.js/tsconfig.json. A full src/**/* glob pulls the broader project graph through @superdoc/contracts project references and re-expands the shim list (verified during probe).
  • Add an exact relocation rule for @superdoc/style-engine/ooxml.
  • Guard the bare @superdoc/style-engine root in both RELOCATION_GUARD_PACKAGES and UNSHIMMED_PRIVATE_SPECIFIERS so a future bare-barrel leak fails audit Rule 1 instead of producing a broken relative path.

Also removes a misleading JSDoc @example block from cascade.ts. The example showed import from '@superdoc/style-engine/cascade', but cascade is not in the package's exports field. Same false-positive class as the useUiFontFamily cleanup in #3140 - the bare specifier inside the @example was being captured by the workspace-import scanner.

Verified:

  • pnpm --filter superdoc build:es clean (audit OK, 9 guarded packages, 1 shim module)
  • Consumer matrix: 47 passed, 0 failed, 0 warnings
  • Runtime smoke 4/4 against the freshly packed tarball
  • Dist has the 6 expected declaration files: cascade.d.ts, ooxml/{index,types,numbering-types,styles-types,table-style-selection}.d.ts
  • Negative tests: import('@superdoc/style-engine/ooxml') rewrites to a real target file in dist; import('@superdoc/style-engine') (bare) is preserved unchanged and audit Rule 1 fails with exit 1

After this lands, only @superdoc/common (5 dist refs, catch-all bin) remains. That's the hardest of the original 9 shims and needs per-type analysis (Comment, CommentJSON, CommentContent, CommentThreadingProfile - each gets an inline-vs-relocate-vs-remove decision).

BasicUpload was re-exported through `superdoc/super-editor` and
`superdoc` despite being marked `@internal` at the export site
(packages/super-editor/src/editors/v1/index.js:103). It is not
documented in any README, AGENTS guide, or example. The two dev
components that use it (SuperdocDev.vue, DeveloperPlayground.vue)
import it directly from `@superdoc/common/components/BasicUpload.vue`,
not via the public re-export.

Drop the re-export rather than relocating the .vue file. The upload
widget is dev-tooling, not a public API. The bare
`@superdoc/common/components/BasicUpload.vue` shim entry goes away
because no public d.ts file references it anymore.

Also removes the BasicUpload assertion from the consumer-typecheck
customer-scenario fixture so the matrix stays green; the fixture
was the only place the public re-export was exercised.

Shim count: 3 to 2. Remaining: @superdoc/common (5 dist refs,
catch-all bin), @superdoc/style-engine/ooxml (10 dist refs).

Verified: build:es clean (8 guarded packages, 2 shim modules),
consumer matrix 47/0/0, runtime smoke 4/4 with BasicUpload
explicitly asserted absent from main and super-editor entries.
The /ooxml subpath of style-engine is the only part publicly
reachable today (10 dist d.ts references across pm-adapter,
diffing, super-converter, parts adapters, and plan-engine).

Approach mirrors the pm-adapter narrow-scope pattern from #3144:

- Include only the ooxml subtree plus its sibling cascade.ts
  dependency in vite-plugin-dts. A full src/**/* glob would pull
  the broader project graph through @superdoc/contracts project
  references and re-expand the shim list.
- Add an exact relocation rule for @superdoc/style-engine/ooxml.
- Guard the bare @superdoc/style-engine root in both
  RELOCATION_GUARD_PACKAGES and UNSHIMMED_PRIVATE_SPECIFIERS so a
  future bare-barrel leak fails audit Rule 1 instead of producing
  a broken relative path or an ambient any shim.

Also removes a misleading JSDoc @example block from cascade.ts.
The example showed `import from '@superdoc/style-engine/cascade'`
which is not a valid public import (cascade is not in the
package's exports field), and the bare specifier inside the
@example was being captured by the workspace-import scanner.

Shim count: 2 to 1. Only @superdoc/common remains.

Verified: build:es clean (9 guarded packages, 1 shim module),
consumer matrix 47/0/0, runtime smoke 4/4, dist has the 6 expected
declaration files, negative tests confirm the /ooxml subpath
rewrites to a real target file and a bare @superdoc/style-engine
specifier is preserved unchanged for audit Rule 1 to catch.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 5, 2026 11:37
@linear
Copy link
Copy Markdown

linear Bot commented May 5, 2026

Base automatically changed from caio-pizzol/SD-2893-stack-4-basicupload to main May 5, 2026 11:41
@caio-pizzol caio-pizzol merged commit 17505df into main May 5, 2026
42 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-2893-stack-5-style-engine-ooxml branch May 5, 2026 11:45
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.51

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.95

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.93

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in superdoc-sdk v1.8.0-next.53

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.

1 participant