Skip to content

convert plugin strip project root from js to ts#2762

Merged
SB-gulshans merged 4 commits into
integration/v9from
gs/plat-16467-pluginSPR-JS-to-TS
Jun 18, 2026
Merged

convert plugin strip project root from js to ts#2762
SB-gulshans merged 4 commits into
integration/v9from
gs/plat-16467-pluginSPR-JS-to-TS

Conversation

@SB-gulshans

Copy link
Copy Markdown
Contributor

Goal

convert plugin strip project root from js to ts

Changeset

convert plugin strip project root from js to ts

Testing

Unit test cases

@SB-gulshans SB-gulshans requested a review from SB-jigneshR June 8, 2026 13:57
@github-actions

github-actions Bot commented Jun 8, 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-strip-project-root/src/strip-project-root.ts 100%
(+100%)
75%
(+75%)
100%
(+100%)
91.66%
(+91.66%)

Total:

Lines Branches Functions Statements
77.43%(+0.08%) 69.35%(+0.02%) 75.09%(+0.13%) 76.41%(+0.06%)

Generated by 🚫 dangerJS against 733d982

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

This PR migrates @bugsnag/plugin-strip-project-root from a CommonJS/JS implementation to a TypeScript + Rollup-built package with dual ESM/CJS outputs, aligning it with the build/distribution approach used by other packages in this monorepo.

Changes:

  • Added TypeScript source (src/strip-project-root.ts) and Rollup build config to produce dist/esm and dist/cjs artifacts.
  • Updated tests to import the TypeScript source directly.
  • Updated package metadata (package.json) to use exports and publish dist/ outputs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/plugin-strip-project-root/tsconfig.json Adds package-level TS config extending the repo defaults.
packages/plugin-strip-project-root/test/strip-project-root.test.ts Updates test import to target the TS source file.
packages/plugin-strip-project-root/src/strip-project-root.ts Converts plugin implementation to TypeScript and ESM export.
packages/plugin-strip-project-root/rollup.config.mjs Adds Rollup config for building ESM/CJS outputs.
packages/plugin-strip-project-root/package.json Updates entrypoints/exports to point at built artifacts and adds build scripts.
Comments suppressed due to low confidence (1)

packages/plugin-strip-project-root/src/strip-project-root.ts:13

  • Array.prototype.map() is used for side effects here; since the return value is ignored, forEach() is the correct API and avoids allocating an unused array.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/plugin-strip-project-root/package.json
Comment thread packages/plugin-strip-project-root/package.json
Comment thread packages/plugin-strip-project-root/package.json
Comment thread packages/plugin-strip-project-root/tsconfig.json

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/plugin-strip-project-root/src/strip-project-root.ts:17

  • Array.prototype.map() is being used purely for side effects here, which allocates an array that is immediately discarded. forEach() avoids the extra allocation and better matches the intent.

@SB-gulshans SB-gulshans merged commit 5f1d07a into integration/v9 Jun 18, 2026
35 checks passed
@SB-gulshans SB-gulshans deleted the gs/plat-16467-pluginSPR-JS-to-TS branch June 18, 2026 10:50
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