From c46026fb1ce43c7c20f71e7b9d01fdc5eb867b57 Mon Sep 17 00:00:00 2001 From: Ajaypanchal4326 Date: Wed, 4 Feb 2026 20:23:53 +0530 Subject: [PATCH 1/3] fix: update @nodesecure/scanner to v10 --- README.md | 2 +- package.json | 2 +- src/analysis/scanner.ts | 2 +- test/api/report.spec.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03fea6a..7ec8b55 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This project is designed to generate periodic security reports in both HTML and ## Features -- Automatically clones and scans Git repositories using **scanner.cwd**. +- Automatically clones and scans Git repositories using **scanner.workingDir**. - Provides a visual overview of **security threats** and quality issues for multiple Git or NPM packages. - Facilitates visualization of changes over time. - Generates reports in both **HTML** and **PDF** formats. diff --git a/package.json b/package.json index dd527fe..d07f76a 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@nodesecure/flags": "^3.0.3", "@nodesecure/ossf-scorecard-sdk": "^3.2.1", "@nodesecure/rc": "^5.0.0", - "@nodesecure/scanner": "^9.0.0", + "@nodesecure/scanner": "^10.0.0", "@nodesecure/utils": "^2.2.0", "@openally/mutex": "^2.0.0", "@topcli/spinner": "^4.0.0", diff --git a/src/analysis/scanner.ts b/src/analysis/scanner.ts index 05fc7c6..1615f87 100644 --- a/src/analysis/scanner.ts +++ b/src/analysis/scanner.ts @@ -45,7 +45,7 @@ export async function cwd( try { const name = `${path.basename(dir)}.json`; - const { dependencies } = await scanner.cwd(dir, { + const { dependencies } = await scanner.workingDir(dir, { maxDepth: 4, vulnerabilityStrategy: "none" }); diff --git a/test/api/report.spec.ts b/test/api/report.spec.ts index 68111ba..1a1684a 100644 --- a/test/api/report.spec.ts +++ b/test/api/report.spec.ts @@ -188,7 +188,7 @@ PDF or HTML for packages that don't have a scorecard`, async() => { }); }); -function isPDF(buf) { +function isPDF(buf: Buffer) { return ( Buffer.isBuffer(buf) && buf.lastIndexOf("%PDF-") === 0 && buf.lastIndexOf("%%EOF") > -1 ); From 05fa18bbbe8f8f91751e578b33349aa315f0885f Mon Sep 17 00:00:00 2001 From: Ajaypanchal4326 Date: Sat, 7 Feb 2026 22:44:10 +0530 Subject: [PATCH 2/3] ui: modernize Authors & Maintainers section with readable layout --- public/css/style.css | 83 ++++++++++++++++++++++++++++++++++++++++++++ views/template.html | 13 ++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/public/css/style.css b/public/css/style.css index 08a0cda..89bc3f4 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -347,3 +347,86 @@ li[role=link]:focus { display: 100%; } } + +/* ===== UI ENHANCEMENTS ===== */ + +.box-stats, +.box-stats-resume > .one-stat { + background: var(--card-background, transparent); + transition: transform 0.15s ease, box-shadow 0.15s ease; +} + +.box-stats:hover, +.box-stats-resume > .one-stat:hover { + transform: translateY(-2px); +} + +ul > li > a span { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.npm-packages-item:hover { + background: rgba(255, 255, 255, 0.04); + border-radius: 4px; +} + +.box-stats-resume > .one-stat span { + font-size: 1.3rem; + letter-spacing: 1px; +} + +.box-stats-container.charts { + box-shadow: inset 0 0 0 1px var(--faded-border-color); +} + +/* ===== Authors & Maintainers – List View ===== */ + +.authors-list { + margin-top: 15px; + width: 100%; + max-width: 520px; + margin-left: auto; + margin-right: auto; + padding: 0; +} + +.authors-list li { + display: flex; + justify-content: space-between; + align-items: center; + padding: 6px 10px; + border-bottom: 1px solid var(--primary-border-color); + font-family: "mononoki"; +} + +.authors-list li:last-child { + border-bottom: none; +} + +.author-email { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 75%; +} + +.author-count { + font-weight: bold; + color: var(--main-color); +} + + +.authors-list li:nth-child(1)::before { + content: "🥇"; + margin-right: 6px; +} +.authors-list li:nth-child(2)::before { + content: "🥈"; + margin-right: 6px; +} +.authors-list li:nth-child(3)::before { + content: "🥉"; + margin-right: 6px; +} diff --git a/views/template.html b/views/template.html index 1275220..6b18fee 100644 --- a/views/template.html +++ b/views/template.html @@ -153,6 +153,7 @@

[[=Object.keys(z.npm_stats.deps.node).length]]Node.js Core Depe

Authors & Maintainers

+
[[ for (const [email, count] of Object.entries(z.npm_stats.authors)) { ]]
@@ -161,6 +162,16 @@

Authors & Maintainers

[[ } ]]
+ + + [[ if (Object.keys(z.npm_stats.scorecards).length > 0) { ]] @@ -370,4 +381,4 @@

[[=name]]

[[ } ]] [[ } ]] - + \ No newline at end of file From 4be7660cc1e359037161233d6ed8e16903f52242 Mon Sep 17 00:00:00 2001 From: Ajaypanchal4326 Date: Sat, 7 Feb 2026 23:10:50 +0530 Subject: [PATCH 3/3] ui: redesign Authors & Maintainers with ranked leaderboard --- public/css/style.css | 75 +++++++++++++++++++++++--------------------- views/template.html | 9 ++++-- 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 89bc3f4..49e4aee 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -258,7 +258,8 @@ div.page>section h2 { ul { margin-top: var(--default-margin); } -ul + ul { + +ul+ul { margin-right: 20px; } @@ -283,7 +284,8 @@ ul>li>a { color: var(--secondary-text-color); } -ul>li>p,ul>li>span { +ul>li>p, +ul>li>span { font-size: 18px; } @@ -351,17 +353,17 @@ li[role=link]:focus { /* ===== UI ENHANCEMENTS ===== */ .box-stats, -.box-stats-resume > .one-stat { +.box-stats-resume>.one-stat { background: var(--card-background, transparent); transition: transform 0.15s ease, box-shadow 0.15s ease; } .box-stats:hover, -.box-stats-resume > .one-stat:hover { +.box-stats-resume>.one-stat:hover { transform: translateY(-2px); } -ul > li > a span { +ul>li>a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -372,7 +374,7 @@ ul > li > a span { border-radius: 4px; } -.box-stats-resume > .one-stat span { +.box-stats-resume>.one-stat span { font-size: 1.3rem; letter-spacing: 1px; } @@ -381,52 +383,55 @@ ul > li > a span { box-shadow: inset 0 0 0 1px var(--faded-border-color); } -/* ===== Authors & Maintainers – List View ===== */ +/* ===== Authors & Maintainers – Leaderboard UI ===== */ -.authors-list { - margin-top: 15px; - width: 100%; - max-width: 520px; +.authors-leaderboard { + margin-top: 20px; + max-width: 650px; margin-left: auto; margin-right: auto; padding: 0; } -.authors-list li { - display: flex; - justify-content: space-between; +.authors-leaderboard li { + display: grid; + grid-template-columns: 40px 1fr 60px; align-items: center; - padding: 6px 10px; - border-bottom: 1px solid var(--primary-border-color); + gap: 10px; + padding: 10px 14px; + margin-bottom: 8px; + border-radius: 10px; + background: rgba(255, 255, 255, 0.04); + border: 1px solid var(--faded-border-color); font-family: "mononoki"; } -.authors-list li:last-child { - border-bottom: none; +.authors-leaderboard .rank { + font-weight: bold; + text-align: center; +} + +/* Top 3 highlight */ +.authors-leaderboard .rank-1 { + border-color: gold; +} + +.authors-leaderboard .rank-2 { + border-color: silver; +} + +.authors-leaderboard .rank-3 { + border-color: #cd7f32; } .author-email { + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; - max-width: 75%; } .author-count { font-weight: bold; color: var(--main-color); -} - - -.authors-list li:nth-child(1)::before { - content: "🥇"; - margin-right: 6px; -} -.authors-list li:nth-child(2)::before { - content: "🥈"; - margin-right: 6px; -} -.authors-list li:nth-child(3)::before { - content: "🥉"; - margin-right: 6px; -} + text-align: right; +} \ No newline at end of file diff --git a/views/template.html b/views/template.html index 6b18fee..5229801 100644 --- a/views/template.html +++ b/views/template.html @@ -163,12 +163,15 @@

Authors & Maintainers

[[ } ]] -
    - [[ for (const [email, count] of Object.entries(z.npm_stats.authors)) { ]] -
  • +
      + [[ let index = 0; ]] + [[ for (const [email, count] of Object.entries(z.npm_stats.authors).sort((a, b) => b[1] - a[1])) { ]] +
    • + [[=index+1]] [[=email]] [[=count]]
    • + [[ index++; ]] [[ } ]]