diff --git a/package.json b/package.json index 43edef69..61f499a8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build:front": "node ./esbuild.config.ts", "build:workspaces": "npm run build --ws --if-present", "test": "npm run test:cli && npm run lint && npm run lint:css", - "test:cli": "node --no-warnings --test test/**/*.test.js", + "test:cli": "node --no-warnings --test \"test/**/*.test.js\"", "test:all": "npm run test --ws --if-present", "coverage": "c8 --reporter=lcov npm run test", "ci:publish": "changeset publish", @@ -92,6 +92,7 @@ "stylelint": "17.5.0", "stylelint-config-standard": "40.0.0", "typescript": "^5.8.3", + "undici": "7.24.6", "vite": "8.0.2" }, "dependencies": { @@ -107,7 +108,7 @@ "@nodesecure/ossf-scorecard-sdk": "4.0.1", "@nodesecure/rc": "5.5.0", "@nodesecure/report": "4.2.2", - "@nodesecure/scanner": "10.7.0", + "@nodesecure/scanner": "10.8.0", "@nodesecure/server": "1.0.0", "@nodesecure/utils": "^2.2.0", "@nodesecure/vulnera": "3.1.0", diff --git a/src/commands/scanner.js b/src/commands/scanner.js index adbf20d1..44575f72 100644 --- a/src/commands/scanner.js +++ b/src/commands/scanner.js @@ -13,7 +13,11 @@ import * as scanner from "@nodesecure/scanner"; // Import Internal Dependencies import kleur from "../utils/styleText.js"; import * as http from "./http.js"; -import { logScannerStat, logScannerError, formatMs } from "./loggers/logger.js"; +import { + logScannerStat, + logScannerError, + formatMs +} from "./loggers/logger.js"; import { parseContacts } from "./parsers/contacts.js"; export async function auto(spec, options) { @@ -73,8 +77,15 @@ export async function cwd(options) { const payload = await scanner.workingDir( process.cwd(), { - maxDepth, usePackageLock: !nolock, fullLockMode: full, vulnerabilityStrategy, highlight: - { contacts: parseContacts(contacts) }, isVerbose: verbose + maxDepth, + usePackageLock: !nolock, + fullLockMode: full, + vulnerabilityStrategy, + highlight: { + contacts: parseContacts(contacts) + }, + isVerbose: verbose, + workers: true }, initLogger(void 0, !silent) ); @@ -83,7 +94,14 @@ export async function cwd(options) { } export async function from(spec, options) { - const { depth: maxDepth = Infinity, output, silent, contacts, vulnerabilityStrategy, verbose } = options; + const { + depth: maxDepth = Infinity, + output, + silent, + contacts, + vulnerabilityStrategy, + verbose + } = options; const payload = await scanner.from( spec, @@ -93,7 +111,8 @@ export async function from(spec, options) { highlight: { contacts: parseContacts(contacts) }, - isVerbose: verbose + isVerbose: verbose, + workers: true }, initLogger(spec, !silent) ); @@ -258,7 +277,9 @@ async function logAndWrite( fs.writeFileSync(filePath, ret); console.log(""); - console.log(kleur.white().bold(i18n.getTokenSync("cli.successfully_written_json", kleur.green().bold(filePath)))); + console.log( + kleur.white().bold(i18n.getTokenSync("cli.successfully_written_json", kleur.green().bold(filePath))) + ); console.log(""); return filePath; diff --git a/src/commands/verify.js b/src/commands/verify.js index 31614b00..e71347d8 100644 --- a/src/commands/verify.js +++ b/src/commands/verify.js @@ -75,8 +75,8 @@ export async function main( { text: white().bold("source location"), width: 30, align: "right" } ); for (const [depName, infos] of Object.entries(deps)) { - const { start, end } = infos.location; - const position = `[${start.line}:${start.column}] - [${end.line}:${end.column}]`; + const [start, end] = infos.location; + const position = `[${start[0]}:${start[1]}] - [${end[0]}:${end[1]}]`; ui.div( { text: depName, width: 30 }, diff --git a/workspaces/cache/package.json b/workspaces/cache/package.json index de5e8651..cb149d28 100644 --- a/workspaces/cache/package.json +++ b/workspaces/cache/package.json @@ -12,7 +12,7 @@ "build": "tsc", "prepublishOnly": "npm run build", "lint": "eslint src test", - "test": "node --test test/**.test.ts", + "test": "node --test \"test/**.test.ts\"", "test:c8": "c8 npm run test" }, "publishConfig": { @@ -28,7 +28,7 @@ "author": "GENTILHOMME Thomas ", "license": "MIT", "dependencies": { - "@nodesecure/scanner": "10.7.0", + "@nodesecure/scanner": "10.8.0", "cacache": "20.0.4" }, "devDependencies": { diff --git a/workspaces/server/package.json b/workspaces/server/package.json index dc82c281..ed8e6f9f 100644 --- a/workspaces/server/package.json +++ b/workspaces/server/package.json @@ -12,7 +12,7 @@ "build": "tsc", "prepublishOnly": "npm run build", "lint": "eslint src test", - "test": "node --test ./test/**/*.test.ts", + "test": "node --test \"./test/**/*.test.ts\"", "test:c8": "c8 npm run test" }, "publishConfig": { @@ -37,7 +37,7 @@ "@nodesecure/i18n": "4.1.0", "@nodesecure/npm-registry-sdk": "4.5.2", "@nodesecure/ossf-scorecard-sdk": "4.0.1", - "@nodesecure/scanner": "10.7.0", + "@nodesecure/scanner": "10.8.0", "cacache": "20.0.4", "chokidar": "5.0.0", "find-my-way": "9.5.0", diff --git a/workspaces/vis-network/package.json b/workspaces/vis-network/package.json index aab64c47..3eaf1e21 100644 --- a/workspaces/vis-network/package.json +++ b/workspaces/vis-network/package.json @@ -12,7 +12,7 @@ "prepublishOnly": "npm run build", "lint": "eslint src test", "lint:fix": "eslint --fix src test", - "test-only": "node --test test/*.test.ts", + "test-only": "node --test \"test/*.test.ts\"", "test": "c8 npm run test", "example": "vite" },