From 535ad89c2946a48d763fb449bd2103f818c5a82f Mon Sep 17 00:00:00 2001 From: fraxken Date: Thu, 11 Dec 2025 15:02:42 +0100 Subject: [PATCH 1/2] fix: typescript error that make build fail fix: score always number --- src/analysis/extractScannerData.ts | 9 +++------ src/analysis/fetch.ts | 6 ++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/analysis/extractScannerData.ts b/src/analysis/extractScannerData.ts index cb70c1b..036a517 100644 --- a/src/analysis/extractScannerData.ts +++ b/src/analysis/extractScannerData.ts @@ -4,7 +4,7 @@ import fs from "node:fs"; // Import Third-party Dependencies import { getScoreColor, getVCSRepositoryPathAndPlatform } from "@nodesecure/utils"; import { getManifest, getFlags } from "@nodesecure/flags/web"; -import { Extractors, type Payload, type Dependency, type DependencyVersion, type DependencyLinks } from "@nodesecure/scanner"; +import { Extractors, type Payload } from "@nodesecure/scanner"; import type { RC } from "@nodesecure/rc"; // Import Internal Dependencies @@ -123,11 +123,8 @@ export function buildStatsFromScannerDependencies( new Extractors.Probes.NodeDependencies() ]); - extractor.on("manifest", (spec: string, - { flags, links = [] }: Omit & { - links: DependencyLinks | never[]; - }, - { name }: { name: string; dependency: Dependency; }) => { + extractor.on("manifest", (spec: string, dependencyVersion, { name }) => { + const { flags, links = [] } = dependencyVersion; const isThird = npmConfig.organizationPrefix === null ? true : !name.startsWith(`${npmConfig.organizationPrefix}/`); diff --git a/src/analysis/fetch.ts b/src/analysis/fetch.ts index 51bb4fb..036dc0d 100644 --- a/src/analysis/fetch.ts +++ b/src/analysis/fetch.ts @@ -106,9 +106,11 @@ async function fetchRepositoriesStats( const scoresCache = new Map(); -export async function fetchScorecardScore(fullName: string) { +export async function fetchScorecardScore( + fullName: string +): Promise { if (scoresCache.has(fullName)) { - return scoresCache.get(fullName); + return scoresCache.get(fullName)!; } try { const { score } = await scorecard.result(fullName, { resolveOnVersionControl: false }); From a6f107002c5f1d0851080057dbaec46562269b13 Mon Sep 17 00:00:00 2001 From: fraxken Date: Thu, 11 Dec 2025 15:11:54 +0100 Subject: [PATCH 2/2] ci: always build typescript source --- .github/workflows/nodejs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 5b9119e..b7ff7cb 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -32,6 +32,8 @@ jobs: run: npx puppeteer browsers install chrome - name: Install dependencies run: npm install --ignore-scripts + - name: build + run: npm run build - name: Lint run: npm run lint - name: Run tests