Skip to content

changes to convert node surrounding code plugin to TS#2756

Merged
SB-gulshans merged 5 commits into
integration/v9from
gs/plat-16466-convert-pluginNSC-JS-to-TS
Jun 18, 2026
Merged

changes to convert node surrounding code plugin to TS#2756
SB-gulshans merged 5 commits into
integration/v9from
gs/plat-16466-convert-pluginNSC-JS-to-TS

Conversation

@SB-gulshans

Copy link
Copy Markdown
Contributor

Goal

convert plugin nsc js to ts

Design

Changeset

convert plugin nsc js to ts

Testing

unit test cases

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

@bugsnag/browser bundle size diff

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%)

Generated by 🚫 dangerJS against ad465b5

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 emit dist/esm + dist/cjs outputs (with declarations).
  • Migrated the plugin implementation to src/surrounding-code.ts and 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, the reduce(...).then(...) chain will reject and the outer Promise will remain pending, which can stall addOnError forever and prevent events from being delivered.
    packages/plugin-node-surrounding-code/src/surrounding-code.ts:94
  • The CodeRange field declarations are inconsistently indented (private _start is 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.

Comment thread packages/plugin-node-surrounding-code/package.json
Comment thread packages/plugin-node-surrounding-code/package.json
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@SB-gulshans SB-gulshans requested a review from SB-priyankap June 12, 2026 12:42
@SB-gulshans SB-gulshans merged commit 0eab24f into integration/v9 Jun 18, 2026
34 checks passed
@SB-gulshans SB-gulshans deleted the gs/plat-16466-convert-pluginNSC-JS-to-TS branch June 18, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants