Conversation
There was a problem hiding this comment.
Pull request overview
Updates the package build/publish setup to generate and ship TypeScript declaration files for the library’s public API, aligning runtime bundles (Vite) with published type definitions.
Changes:
- Added a declaration-only TypeScript build (
tsconfig.build.json) and wired it intonpm run build. - Updated
package.jsonto publish types viatypes+ conditionalexports, and addedprepackto build beforenpm pack/npm publish. - Adjusted
AbstractErrorto use an optionalError.captureStackTraceto avoid leaking Node-only typings into generated declarations; updated Travis CI to Node 20 and to run the build.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.build.json | Adds a dedicated declaration-only TS build configuration. |
| src/AbstractError.ts | Makes captureStackTrace optional with explicit typing to avoid Node ambient type leakage. |
| package.json | Publishes .d.ts via types/exports and updates build/publish lifecycle scripts. |
| package-lock.json | Updates lockfile metadata/version as part of the release/build changes. |
| .travis.yml | Modernizes CI to Node 20 and runs both tests and build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jhnns
approved these changes
Jun 16, 2026
Member
|
Published as v2.0.1 🚀 |
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.
Update the package build and publish metadata so TypeScript declarations are generated and included in the npm package.
The source exports TypeScript types, but the package did not emit or publish declaration files.
What changed
typesentry pointing todist/main.d.tstsconfig.build.jsonnpm run buildto generate both JS bundles and.d.tsfilesprepacksonpm pack/npm publishbuild the distributable package before packagingError.captureStackTraceoptional so generated declarations do not leak Node-only ambient typesThe first declaration build also exposed
@types/nodethrough inheritedErrorstatic fields, which could break consumers that do not install Node types. The dedicated declaration build avoids that leak.