Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
chore!: update to @nodesecure/vulnera 2.0.0 (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken authored Aug 11, 2024
1 parent 860b315 commit 41a3c85
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 7 additions & 5 deletions src/rc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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`
Expand All @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions src/schema/nodesecurerc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/configuration/ci_v1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.0.0",
"i18n": "english",
"strategy": "npm",
"strategy": "github-advisory",
"ci": {
"reporters": ["console"],
"vulnerabilities": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/configuration/ci_v2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.0.0",
"i18n": "english",
"strategy": "npm",
"strategy": "github-advisory",
"ci": {
"reporters": ["console"],
"vulnerabilities": {
Expand Down

0 comments on commit 41a3c85

Please sign in to comment.