-
Notifications
You must be signed in to change notification settings - Fork 15
feat: bundle-stats plugin poc implementation #1024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared current commit 34fcb41 with previous commit 7daf201. 🕵️ See full comparison in Code PushUp portal 🔍 🏷️ Categories👍 1 group improved, 👎 12 groups regressed, 👍 4 audits improved, 👎 62 audits regressed, 14 audits changed without impacting score🗃️ Groups
8 other groups are unchanged. 🛡️ Audits530 other audits are unchanged. |
# Conflicts: # package-lock.json # package.json # packages/cli/project.json # packages/models/src/lib/configuration.ts # packages/utils/src/index.ts
# Conflicts: # nx.json # package-lock.json # package.json # packages/models/src/index.ts # packages/models/src/lib/configuration.ts
|
View your CI Pipeline Execution ↗ for commit e72dfac
☁️ Nx Cloud last updated this comment at |
| } | ||
|
|
||
| export function normalizePathForMatching(path: string): string { | ||
| return path.replace(/\.\.\//g, '').replace(/^\/+/, ''); |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
../
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 24 hours ago
The best way to fix this specific issue is to ensure that all instances of "../" are removed even when they may reappear due to the replacement operation. This can be done by repeatedly applying the replace operation until no more substitutions are made. This strategy guarantees that every instance is removed, regardless of how many instances may appear or overlap.
The changes needed:
- In file
packages/plugin-bundle-stats/src/lib/runner/audits/details/grouping.ts, modify the implementation ofnormalizePathForMatching()(lines 71-73) to repeatedly apply.replace(/\.\.\//g, '')in a loop until the output stabilizes. - No extra imports or dependencies are required – plain TypeScript is sufficient.
-
Copy modified lines R72-R78
| @@ -69,7 +69,13 @@ | ||
| } | ||
|
|
||
| export function normalizePathForMatching(path: string): string { | ||
| return path.replace(/\.\.\//g, '').replace(/^\/+/, ''); | ||
| let sanitized = path; | ||
| let previous; | ||
| do { | ||
| previous = sanitized; | ||
| sanitized = sanitized.replace(/\.\.\//g, ''); | ||
| } while (sanitized !== previous); | ||
| return sanitized.replace(/^\/+/, ''); | ||
| } | ||
|
|
||
| /** |
Dependency Review SummaryThe full dependency review summary is too large to display here. Please download the artifact named "dependency-review-summary" to view the complete report. |
@code-pushup/ci
@code-pushup/cli
@code-pushup/core
@code-pushup/create-cli
@code-pushup/models
@code-pushup/nx-plugin
@code-pushup/axe-plugin
@code-pushup/bundle-stats-plugin
@code-pushup/coverage-plugin
@code-pushup/eslint-plugin
@code-pushup/js-packages-plugin
@code-pushup/jsdocs-plugin
@code-pushup/lighthouse-plugin
@code-pushup/typescript-plugin
@code-pushup/utils
commit: |
Code PushUp😟 Code PushUp report has regressed – compared current commit ce663db with previous commit f74d2dd. 💼 Project
|
| 🏷️ Category | ⭐ Previous score | ⭐ Current score | 🔄 Score change |
|---|---|---|---|
| Code coverage | 🟢 94 | 🟢 94 | |
| Documentation | 🔴 38 | 🔴 38 |
4 other categories are unchanged.
👎 2 groups regressed, 👎 3 audits regressed
🗃️ Groups
| 🔌 Plugin | 🗃️ Group | ⭐ Previous score | ⭐ Current score | 🔄 Score change |
|---|---|---|---|---|
| Code coverage | Code coverage metrics | 🟢 94 | 🟢 94 | |
| JSDoc coverage | Documentation coverage | 🔴 38 | 🔴 38 |
13 other groups are unchanged.
🛡️ Audits
| 🔌 Plugin | 🛡️ Audit | 📏 Previous value | 📏 Current value | 🔄 Value change |
|---|---|---|---|---|
| Code coverage | Function coverage | 🟩 95.3 % | 🟩 94.4 % | |
| Code coverage | Line coverage | 🟩 97 % | 🟩 96.8 % | |
| JSDoc coverage | Functions coverage | 🟥 236 undocumented functions | 🟥 239 undocumented functions |
440 other audits are unchanged.
13 other projects are unchanged.
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared current commit ce663db with previous commit f74d2dd. 🕵️ See full comparison in Code PushUp portal 🔍 🏷️ Categories👍 2 groups improved, 👎 9 groups regressed, 👍 5 audits improved, 👎 35 audits regressed, 14 audits changed without impacting score🗃️ Groups
12 other groups are unchanged. 🛡️ Audits
624 other audits are unchanged. |
Bundle Stats Plugin PoC Implementation
Fine-grained bundle size tracking for your builds
This plugin enables advanced bundle stats capabilities to avoiding unwanted size increase.
📝 Related Issue
👉 #1015 – Bundle Stats Plugin Architecture Discussion
Examples
Features
Legend:
Todos:
PluginArtefactOptionsto models✅ MVP State
The final implementation is delivered in the following PR's: