fix(build): isolate shared/common declaration emit from @types auto-inclusion#3306
Merged
Merged
Conversation
…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.
Contributor
|
🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.96 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.140 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in vscode-ext v2.3.0-next.142 |
Contributor
|
🎉 This PR is included in superdoc-cli v0.8.0-next.111 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc-sdk v1.8.0-next.94 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
🎉 This PR is included in superdoc v1.30.0-next.91 The release is available on GitHub release |
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.
The standalone tsc call in
packages/superdoc/scripts/ensure-types.cjsran without a tsconfig, so TypeScript fell back to auto-loading every@types/*package visible innode_modules. When pnpm hoisted the deprecated@types/minimatch@6stub (a transitive dep of@types/glob, containing no.d.ts), tsc failed mid-build withTS2688 Cannot find type definition file for 'minimatch'.skipLibCheckdoes not help because the error fires before lib check. The failure surfaces on some freshpnpm installoutcomes and not others, depending on pnpm version and priornode_modulesstate.Write a tiny temp tsconfig with
types: []and invoketsc -pagainst it, so this packaging emit is independent of whichever@types/*happen to be visible. The threeshared/commonsources don't use any Node ambient types, so an emptytypesarray is the honest constraint - it also catches any future Node-ambient leak into the public declaration surface.@types/minimatchstub next to@types/nodein a controllednode_modules/@types/@typeslayoutpnpm --filter superdoc run build:esruns the full declaration audit chain greendist/shared/common/*.d.tsemitted as before