changes to convert node surrounding code plugin to TS#2756
Merged
SB-gulshans merged 5 commits intoJun 18, 2026
Conversation
|
| Minified | Minfied + Gzipped | |
|---|---|---|
| Before | 48.45 kB |
14.68 kB |
| After | 48.45 kB |
14.68 kB |
| ± | No change | No change |
code coverage diff
| Ok | File | Lines | Branches | Functions | Statements |
|---|---|---|---|---|---|
| ✅ | /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-node-surrounding-code/src/surrounding-code.ts | 96.82% (+96.82%) |
80% (+80%) |
95.83% (+95.83%) |
94.59% (+94.59%) |
Total:
| Lines | Branches | Functions | Statements |
|---|---|---|---|
| 77.75%(+0.4%) | 69.48%(+0.15%) | 75.6%(+0.64%) | 76.76%(+0.41%) |
Contributor
There was a problem hiding this comment.
Pull request overview
Converts @bugsnag/plugin-node-surrounding-code from JavaScript to TypeScript and updates its packaging/build setup to match the repo’s Rollup-based ESM+CJS distribution pattern.
Changes:
- Added TypeScript build configuration (
tsconfig.json) and Rollup config to emitdist/esm+dist/cjsoutputs (with declarations). - Migrated the plugin implementation to
src/surrounding-code.tsand updated tests to import the TS source. - Updated package metadata (
type,exports, entrypoints) and added type packages for TS compilation.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-node-surrounding-code/tsconfig.json | Adds package-level TS config for compiling the plugin source. |
| packages/plugin-node-surrounding-code/src/surrounding-code.ts | TypeScript port of the surrounding-code plugin implementation. |
| packages/plugin-node-surrounding-code/test/surrounding-code.test.ts | Updates tests to import TS source and adjusts stream-count expectation. |
| packages/plugin-node-surrounding-code/rollup.config.mjs | Adds Rollup build config using the repo’s shared Rollup helper. |
| packages/plugin-node-surrounding-code/package.json | Updates package entrypoints/exports and adds build/typecheck scripts and deps. |
| package-lock.json | Locks newly added dependencies. |
Comments suppressed due to low confidence (2)
packages/plugin-node-surrounding-code/src/surrounding-code.ts:133
pMapSeries()creates a Promise that never rejects (and never resolves if any inner promise rejects). If any mapped promise rejects, thereduce(...).then(...)chain will reject and the outer Promise will remain pending, which can stalladdOnErrorforever and prevent events from being delivered.
packages/plugin-node-surrounding-code/src/surrounding-code.ts:94- The
CodeRangefield declarations are inconsistently indented (private _startis indented more than the other fields). This is likely to fail formatting/linting and makes the block harder to read.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
SB-priyankap
approved these changes
Jun 12, 2026
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.
Goal
convert plugin nsc js to ts
Design
Changeset
convert plugin nsc js to ts
Testing
unit test cases