Fix TypeScript type resolution by including all .d.ts files in dist#88
Conversation
… to dist Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
tas-client/scripts/bundle.js
Outdated
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
| const root = join(__dirname, '..'); | ||
|
|
||
| function copyDirRecursive(src, dest) { |
There was a problem hiding this comment.
@copilot since Node.js 22, there's been a built-in fs.glob/fs.globSync. Maybe use that instead.
There was a problem hiding this comment.
Done! Refactored to use fs.globSync instead of the custom recursive function. The implementation now uses the built-in API with pattern **/*.d.ts and ignore: 'index.d.ts' option. Commit: b93fc44
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@TylerLeonhardt When you get a chance, can you please publish these changes to npm. Not a huge deal but I did have to work around this issue while adopting tsgo for building VS Code |
Fix TypeScript type declaration issues in tas-client ✅
The issue is that the package only publishes a single
tas-client.d.tsfile that re-exports from other modules, but doesn't include those referenced.d.tsfiles. This causes TypeScript compilation errors when consumers don't use--skipLibCheck.Changes:
scripts/bundle.jsto recursively copy all.d.tsfiles todistpackage.jsonto add types condition for/bundleexportfs.globSync(Node.js 22+) instead of custom functionResults:
Before: 6x "🥴 Internal resolution error", TS2307 errors, "❌ No types"
After: ✅ All type resolution errors fixed, node10 & bundler fully working (🟢)
The fix ensures all
.d.tsfiles are properly published alongside the main type declaration file, allowing TypeScript to resolve all module references without requiring--skipLibCheck.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.