Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
33 changes: 27 additions & 6 deletions src/commands/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
);
Expand All @@ -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,
Expand All @@ -93,7 +111,8 @@ export async function from(spec, options) {
highlight: {
contacts: parseContacts(contacts)
},
isVerbose: verbose
isVerbose: verbose,
workers: true
},
initLogger(spec, !silent)
);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
4 changes: 2 additions & 2 deletions workspaces/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -28,7 +28,7 @@
"author": "GENTILHOMME Thomas <gentilhomme.thomas@gmail.com>",
"license": "MIT",
"dependencies": {
"@nodesecure/scanner": "10.7.0",
"@nodesecure/scanner": "10.8.0",
"cacache": "20.0.4"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions workspaces/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/vis-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Loading