fix(types): drain @superdoc/common/list-marker-utils shim (SD-2893)#3150
Merged
caio-pizzol merged 2 commits intomainfrom May 5, 2026
Merged
fix(types): drain @superdoc/common/list-marker-utils shim (SD-2893)#3150caio-pizzol merged 2 commits intomainfrom
caio-pizzol merged 2 commits intomainfrom
Conversation
Two cheap-win follow-ups to the D1 relocation. Shim count: 6 to 4. useUiFontFamily: the bare @superdoc/composables/useUiFontFamily.js specifier only appeared inside a JSDoc @example block. The example was also misleading; this composable is not exported from any public entry, so a consumer cannot use the shown import. Removing the example clears the shim without changing public API. @superdoc/layout-engine: relocate via the same D1 pattern as contracts and layout-bridge. layout-engine only imports from @superdoc/contracts (already relocated), so a full src/**/* glob is safe and does not pull additional internal packages into the declaration graph. Remaining shims: @superdoc/common, common/components/BasicUpload.vue, common/list-marker-utils, style-engine/ooxml. Each needs more evaluation than a cheap-win slice.
list-marker-utils is the only @superdoc/common subpath publicly reachable today (via painter-dom/src/utils/marker-helpers). Adding shared/common to vite-plugin-dts's include shifts the common ancestor to the repo root and reorganises the entire dist tree, so emit declarations directly via tsc in the postbuild step instead. Adds the file plus its sibling layout-constants dependency to dist/shared/common, registers an exact relocation rule, and guards the subpath against a future shim regression. The bare @superdoc/common package and other subpaths stay shimmed until separately drained. Shim count: 4 to 3. Remaining: @superdoc/common, @superdoc/common/components/BasicUpload.vue, @superdoc/style-engine/ooxml. Verified: build:es clean, declaration audit clean (8 guarded), consumer matrix 47/0/0, runtime smoke 4/4, negative test confirms the painter-dom consumer rewrites to dist/shared/common/list-marker-utils.d.ts.
Contributor
|
🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.48 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in vscode-ext v2.3.0-next.92 |
Contributor
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.90 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc-cli v0.8.0-next.66 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc v1.30.0-next.49 The release is available on GitHub release |
caio-pizzol
added a commit
that referenced
this pull request
May 5, 2026
The remaining @superdoc/common shim is referenced by three internal dist d.ts files for four Comment* types (Comment, CommentContent, CommentJSON, CommentThreadingProfile). All four live in shared/common/comments-types.ts. Approach matches the list-marker-utils pattern from #3150: tsc-emit just comments-types.ts into dist/shared/common/, then rewrite bare @superdoc/common imports to that file. matchSubpaths: false because only the bare specifier is referenced; any future @superdoc/common/<other-subpath> import falls through to the shim generator and audit Rule 3 fires (because @superdoc/common is now in RELOCATION_GUARD_PACKAGES, the regex matches the subpath). Verified end-to-end: a synthetic @superdoc/common/some-other-subpath probe is left unchanged by ensure-types, the shim generator captures it, audit Rule 3 fails with exit 1. The existing inline-replacement step at ensure-types.cjs:89-119 that handles the main entry's runtime-value imports (DOCX, PDF, HTML, getFileObject, compareVersions, BlankDOCX) stays as-is. Two paths through the script address different concerns: - Inline-replacement: runtime values from @superdoc/common in superdoc/src/index.d.ts (handles those 6 specific imports) - Relocation rule: bare @superdoc/common type imports in three internal dist d.ts files (resolves to comments-types.d.ts) Shim count: 1 to 0. Final shim drain. _internal-shims.d.ts has no declare-module entries; all originally-shimmed @superdoc/* packages have been relocated, removed from the public surface, or guarded. Verified: build:es clean (10 guarded packages, 0 shim modules), consumer matrix 47/0/0, runtime smoke 4/4, dist has the relocation target at shared/common/comments-types.d.ts, the three consumer d.ts files now import from a relative path. Negative test confirms the audit gate catches future @superdoc/common subpath leaks.
caio-pizzol
added a commit
that referenced
this pull request
May 5, 2026
…93) (#3154) The remaining @superdoc/common shim is referenced by three internal dist d.ts files for four Comment* types (Comment, CommentContent, CommentJSON, CommentThreadingProfile). All four live in shared/common/comments-types.ts. Approach matches the list-marker-utils pattern from #3150: tsc-emit just comments-types.ts into dist/shared/common/, then rewrite bare @superdoc/common imports to that file. matchSubpaths: false because only the bare specifier is referenced; any future @superdoc/common/<other-subpath> import falls through to the shim generator and audit Rule 3 fires (because @superdoc/common is now in RELOCATION_GUARD_PACKAGES, the regex matches the subpath). Verified end-to-end: a synthetic @superdoc/common/some-other-subpath probe is left unchanged by ensure-types, the shim generator captures it, audit Rule 3 fails with exit 1. The existing inline-replacement step at ensure-types.cjs:89-119 that handles the main entry's runtime-value imports (DOCX, PDF, HTML, getFileObject, compareVersions, BlankDOCX) stays as-is. Two paths through the script address different concerns: - Inline-replacement: runtime values from @superdoc/common in superdoc/src/index.d.ts (handles those 6 specific imports) - Relocation rule: bare @superdoc/common type imports in three internal dist d.ts files (resolves to comments-types.d.ts) Shim count: 1 to 0. Final shim drain. _internal-shims.d.ts has no declare-module entries; all originally-shimmed @superdoc/* packages have been relocated, removed from the public surface, or guarded. Verified: build:es clean (10 guarded packages, 0 shim modules), consumer matrix 47/0/0, runtime smoke 4/4, dist has the relocation target at shared/common/comments-types.d.ts, the three consumer d.ts files now import from a relative path. Negative test confirms the audit gate catches future @superdoc/common subpath leaks.
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.
Stacked on #3140. Drains the third remaining shim entry, dropping the count from 4 to 3.
list-marker-utilsis the only@superdoc/commonsubpath publicly reachable today, viapainter-dom/src/utils/marker-helpers. The bare@superdoc/commonpackage and other subpaths stay shimmed for separate follow-ups.Why this doesn't add to vite-plugin-dts's
include: extending the include list with../../shared/common/...shifts the common-ancestor to the repo root and reorganises the whole dist tree. To avoid that, the postbuild step runstscdirectly on the two source files (list-marker-utils.tsplus its siblinglayout-constants.tsdependency) and emits the declarations intodist/shared/common/. Same effect, no tree-shape change.The exact relocation rule + guard entry follow the SD-2893 pattern established by the pm-adapter subpath rules. Audit Rule 1 / Rule 3 still cover the bare
@superdoc/commonshim that remains.Remaining shims (3):
@superdoc/common,@superdoc/common/components/BasicUpload.vue,@superdoc/style-engine/ooxml.Verified:
pnpm --filter superdoc build:esclean (audit OK, 8 guarded packages, 3 shim modules)import('@superdoc/common/list-marker-utils')rewrites to./shared/common/list-marker-utils.jsand the target file exists in dist