Skip to content

fix(build): isolate shared/common declaration emit from @types auto-inclusion#3306

Merged
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/fix-ensure-types-implicit-at-types
May 14, 2026
Merged

fix(build): isolate shared/common declaration emit from @types auto-inclusion#3306
caio-pizzol merged 1 commit into
mainfrom
caio-pizzol/fix-ensure-types-implicit-at-types

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

The standalone tsc call in packages/superdoc/scripts/ensure-types.cjs ran without a tsconfig, so TypeScript fell back to auto-loading every @types/* package visible in node_modules. When pnpm hoisted the deprecated @types/minimatch@6 stub (a transitive dep of @types/glob, containing no .d.ts), tsc failed mid-build with TS2688 Cannot find type definition file for 'minimatch'. skipLibCheck does not help because the error fires before lib check. The failure surfaces on some fresh pnpm install outcomes and not others, depending on pnpm version and prior node_modules state.

Write a tiny temp tsconfig with types: [] and invoke tsc -p against it, so this packaging emit is independent of whichever @types/* happen to be visible. The three shared/common sources don't use any Node ambient types, so an empty types array is the honest constraint - it also catches any future Node-ambient leak into the public declaration surface.

  • Reproduced TS2688 by placing the @types/minimatch stub next to @types/node in a controlled node_modules/@types/
  • Confirmed the new temp tsconfig succeeds under the same controlled @types layout
  • pnpm --filter superdoc run build:es runs the full declaration audit chain green
  • dist/shared/common/*.d.ts emitted as before

…nclusion

The standalone tsc call in ensure-types.cjs ran without a tsconfig, so TypeScript auto-loaded every @types/* package visible in node_modules. When pnpm hoisted the deprecated @types/minimatch@6 stub (a transitive dep of @types/glob, contains no .d.ts), tsc failed with TS2688 mid-build.

Write a temp tsconfig with types: [] and invoke tsc -p, making the packaging emit independent of which @types/* happen to be hoisted.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 14, 2026 17:06
@caio-pizzol caio-pizzol merged commit 202325b into main May 14, 2026
60 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/fix-ensure-types-implicit-at-types branch May 14, 2026 17:10
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.111

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

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

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 14, 2026

🎉 This PR is included in superdoc v1.30.0-next.91

The release is available on GitHub release

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