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 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 });