From 665aa93d26a4aeb9a566d4be02f05277cccc8086 Mon Sep 17 00:00:00 2001 From: fraxken Date: Sun, 11 Aug 2024 20:35:14 +0200 Subject: [PATCH] chore!: update to @nodesecure/vulnera 2.0.0 --- package.json | 2 +- src/rc.ts | 12 +++++++----- src/schema/nodesecurerc.json | 6 +++--- test/fixtures/configuration/ci_v1.json | 2 +- test/fixtures/configuration/ci_v2.json | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index b48bd23..6143e4d 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@nodesecure/i18n": "^4.0.1", "@nodesecure/js-x-ray": "^7.3.0", "@nodesecure/npm-types": "^1.0.0", - "@nodesecure/vuln": "^1.7.0", + "@nodesecure/vulnera": "^2.0.1", "@openally/config": "^1.0.1", "@openally/result": "^1.2.1", "lodash.merge": "^4.6.2", diff --git a/src/rc.ts b/src/rc.ts index c2ea76d..0e5327b 100644 --- a/src/rc.ts +++ b/src/rc.ts @@ -4,7 +4,7 @@ import path from "node:path"; // Import Third-party Dependencies import i18n from "@nodesecure/i18n"; -import * as vuln from "@nodesecure/vuln"; +import * as vulnera from "@nodesecure/vulnera"; // Import Internal Dependencies import { GLOBAL_CONFIGURATION_DIRECTORY } from "./constants.js"; @@ -43,9 +43,9 @@ export interface RC { * Vulnerability strategy to use. Can be disabled by using `none` as value. * @see https://github.com/NodeSecure/vuln#available-strategy * - * @default `npm` + * @default `github-advisory` */ - strategy?: vuln.Strategy.Kind; + strategy?: vulnera.Kind; /** * Package Registry (default to NPM public registry) * @default `https://registry.npmjs.org` @@ -66,13 +66,15 @@ export type RCGenerationMode = "minimal" | "ci" | "report" | "scanner" | "comple * generateDefaultRC("complete"); * generateDefaultRC(["ci", "report"]); // minimal + ci + report */ -export function generateDefaultRC(mode: RCGenerationMode | RCGenerationMode[] = "minimal"): RC { +export function generateDefaultRC( + mode: RCGenerationMode | RCGenerationMode[] = "minimal" +): RC { const modes = new Set(typeof mode === "string" ? [mode] : mode); const minimalRC = { version: "1.0.0", i18n: "english" as const, - strategy: "npm" as const, + strategy: "github-advisory" as const, registry: "https://registry.npmjs.org" }; const complete = modes.has("complete"); diff --git a/src/schema/nodesecurerc.json b/src/schema/nodesecurerc.json index 83823d2..9c31714 100644 --- a/src/schema/nodesecurerc.json +++ b/src/schema/nodesecurerc.json @@ -17,12 +17,12 @@ "strategy": { "type": "string", "enum": [ - "npm", - "node", + "github-advisory", + "sonatype", "snyk", "none" ], - "default": "npm", + "default": "github-advisory", "description": "Vulnerability strategy to use" }, "registry": { diff --git a/test/fixtures/configuration/ci_v1.json b/test/fixtures/configuration/ci_v1.json index 71c0117..cbcb92b 100644 --- a/test/fixtures/configuration/ci_v1.json +++ b/test/fixtures/configuration/ci_v1.json @@ -1,7 +1,7 @@ { "version": "1.0.0", "i18n": "english", - "strategy": "npm", + "strategy": "github-advisory", "ci": { "reporters": ["console"], "vulnerabilities": { diff --git a/test/fixtures/configuration/ci_v2.json b/test/fixtures/configuration/ci_v2.json index 6468a2b..6bbaa39 100644 --- a/test/fixtures/configuration/ci_v2.json +++ b/test/fixtures/configuration/ci_v2.json @@ -1,7 +1,7 @@ { "version": "1.0.0", "i18n": "english", - "strategy": "npm", + "strategy": "github-advisory", "ci": { "reporters": ["console"], "vulnerabilities": {