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

Commit

Permalink
feat: add root 'registry' property (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken authored Sep 4, 2023
1 parent 4f1f1c9 commit 6b9e6bf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/rc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export interface RC {
* @default `npm`
*/
strategy?: vuln.Strategy.Kind;
/**
* Package Registry (default to NPM public registry)
* @default `https://registry.npmjs.org`
*/
registry?: string;
/** NodeSecure scanner Object configuration */
scanner?: ScannerConfiguration;
/** NodeSecure ci Object configuration */
Expand All @@ -56,7 +61,8 @@ export function generateDefaultRC(mode: RCGenerationMode | RCGenerationMode[] =
const minimalRC = {
version: "1.0.0",
i18n: "english" as const,
strategy: "npm" as const
strategy: "npm" as const,
registry: "https://registry.npmjs.org"
};
const complete = modes.has("complete");

Expand Down
6 changes: 6 additions & 0 deletions src/schema/nodesecurerc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"default": "npm",
"description": "Vulnerability strategy to use"
},
"registry": {
"type": "string",
"description": "Package Registry (default to NPM public registry)",
"pattern": "^(https?|http?)://",
"default": "https://registry.npmjs.org"
},
"scanner": {
"$ref": "#/$defs/scanner"
},
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/.nodesecurerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"version": "2.1.0",
"i18n": "french",
"strategy": "none"
"strategy": "none",
"registry": "https://registry.npmjs.org"
}
3 changes: 2 additions & 1 deletion test/read.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ describe("read .nodesecurerc", () => {
expect(result.val).deep.equal({
version: "2.1.0",
i18n: "french",
strategy: "none"
strategy: "none",
registry: "https://registry.npmjs.org"
});
});
});
Expand Down

0 comments on commit 6b9e6bf

Please sign in to comment.