convert plugin strip project root from js to ts#2762
Merged
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-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%) |
Contributor
There was a problem hiding this comment.
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 producedist/esmanddist/cjsartifacts. - Updated tests to import the TypeScript source directly.
- Updated package metadata (
package.json) to useexportsand publishdist/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.
SB-jigneshR
approved these changes
Jun 9, 2026
Contributor
There was a problem hiding this comment.
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.
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 strip project root from js to ts
Changeset
convert plugin strip project root from js to ts
Testing
Unit test cases