@nodesecure/rc 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -111,6 +111,16 @@ export interface writePartialPayload {
111
111
  export type writeOptions = writeCompletePayload | writePartialPayload;
112
112
  ```
113
113
 
114
+ ### homedir(): string
115
+
116
+ Dedicated directory for NodeSecure to store the configuration in the os HOME directory.
117
+
118
+ ```ts
119
+ import * as RC from "@nodesecure/rc";
120
+
121
+ const homedir = RC.homedir();
122
+ ```
123
+
114
124
  ### CONSTANTS
115
125
 
116
126
  ```ts
@@ -152,7 +162,7 @@ console.log(RC.JSONSchema);
152
162
  ## Contributors ✨
153
163
 
154
164
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
155
- [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
165
+ [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
156
166
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
157
167
 
158
168
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -164,6 +174,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
164
174
  <tr>
165
175
  <td align="center"><a href="https://www.linkedin.com/in/thomas-gentilhomme/"><img src="https://avatars.githubusercontent.com/u/4438263?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gentilhomme</b></sub></a><br /><a href="https://github.com/NodeSecure/rc/commits?author=fraxken" title="Code">💻</a> <a href="https://github.com/NodeSecure/rc/issues?q=author%3Afraxken" title="Bug reports">🐛</a> <a href="https://github.com/NodeSecure/rc/pulls?q=is%3Apr+reviewed-by%3Afraxken" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/NodeSecure/rc/commits?author=fraxken" title="Documentation">📖</a> <a href="#security-fraxken" title="Security">🛡️</a></td>
166
176
  <td align="center"><a href="https://dev.to/antoinecoulon"><img src="https://avatars.githubusercontent.com/u/43391199?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Antoine Coulon</b></sub></a><br /><a href="https://github.com/NodeSecure/rc/commits?author=antoine-coulon" title="Code">💻</a> <a href="https://github.com/NodeSecure/rc/issues?q=author%3Aantoine-coulon" title="Bug reports">🐛</a> <a href="https://github.com/NodeSecure/rc/pulls?q=is%3Apr+reviewed-by%3Aantoine-coulon" title="Reviewed Pull Requests">👀</a></td>
177
+ <td align="center"><a href="https://github.com/PierreDemailly"><img src="https://avatars.githubusercontent.com/u/39910767?v=4?s=100" width="100px;" alt=""/><br /><sub><b>PierreD</b></sub></a><br /><a href="https://github.com/NodeSecure/rc/commits?author=PierreDemailly" title="Code">💻</a></td>
167
178
  </tr>
168
179
  </table>
169
180
 
@@ -1 +1,2 @@
1
1
  export declare const CONFIGURATION_NAME = ".nodesecurerc";
2
+ export declare const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
package/dist/constants.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export const CONFIGURATION_NAME = ".nodesecurerc";
2
+ export const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
2
3
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAClD,MAAM,CAAC,MAAM,8BAA8B,GAAG,YAAY,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from "./functions/read.js";
2
2
  export * from "./functions/write.js";
3
3
  export * as CONSTANTS from "./constants.js";
4
- export { RC, JSONSchema } from "./rc.js";
4
+ export { RC, JSONSchema, homedir } from "./rc.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./functions/read.js";
2
2
  export * from "./functions/write.js";
3
3
  export * as CONSTANTS from "./constants.js";
4
- export { JSONSchema } from "./rc.js";
4
+ export { JSONSchema, homedir } from "./rc.js";
5
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAM,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
@@ -17,7 +17,7 @@ export interface CiConfiguration {
17
17
  * JS-X-Ray warnings configuration
18
18
  * @see https://github.com/NodeSecure/js-x-ray#warnings-legends-v20
19
19
  */
20
- warnings?: CiWarnings | Record<jsxray.kindWithValue | "unsafe-import", CiWarnings>;
20
+ warnings?: CiWarnings | Record<jsxray.WarningName, CiWarnings>;
21
21
  }
22
22
  export declare type CiWarnings = "off" | "error" | "warning";
23
23
  export declare function generateCIConfiguration(): {
package/dist/rc.d.ts CHANGED
@@ -33,4 +33,8 @@ export declare type RCGenerationMode = "minimal" | "ci" | "report" | "complete";
33
33
  * generateDefaultRC(["ci", "report"]); // minimal + ci + report
34
34
  */
35
35
  export declare function generateDefaultRC(mode?: RCGenerationMode | RCGenerationMode[]): RC;
36
+ /**
37
+ * Dedicated directory for NodeSecure to store the configuration in the os HOME directory.
38
+ */
39
+ export declare function homedir(): string;
36
40
  export { generateCIConfiguration, CiConfiguration, CiWarnings, generateReportConfiguration, ReportConfiguration, ReportChart };
package/dist/rc.js CHANGED
@@ -1,4 +1,8 @@
1
+ // Import Node.js Dependencies
2
+ import os from "node:os";
3
+ import path from "node:path";
1
4
  // Import Internal Dependencies
5
+ import { GLOBAL_CONFIGURATION_DIRECTORY } from "./constants.js";
2
6
  import { loadJSONSchemaSync } from "./schema/loader.js";
3
7
  import { generateCIConfiguration } from "./projects/ci.js";
4
8
  import { generateReportConfiguration } from "./projects/report.js";
@@ -19,5 +23,11 @@ export function generateDefaultRC(mode = "minimal") {
19
23
  const complete = modes.has("complete");
20
24
  return Object.assign(minimalRC, complete || modes.has("ci") ? generateCIConfiguration() : {}, complete || modes.has("report") ? generateReportConfiguration() : {});
21
25
  }
26
+ /**
27
+ * Dedicated directory for NodeSecure to store the configuration in the os HOME directory.
28
+ */
29
+ export function homedir() {
30
+ return path.join(os.homedir(), GLOBAL_CONFIGURATION_DIRECTORY);
31
+ }
22
32
  export { generateCIConfiguration, generateReportConfiguration };
23
33
  //# sourceMappingURL=rc.js.map
package/dist/rc.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rc.js","sourceRoot":"","sources":["../src/rc.ts"],"names":[],"mappings":"AAIA,+BAA+B;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAA+B,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAoC,MAAM,sBAAsB,CAAC;AAErG,YAAY;AACZ,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC;AA4B/C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA8C,SAAS;IACvF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEhE,MAAM,SAAS,GAAG;QAChB,OAAO,EA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,KAAc;KACzB,CAAC;IACF,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEvC,OAAO,MAAM,CAAC,MAAM,CAClB,SAAS,EACT,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,EAAE,EAC5D,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,EAAE,CACrE,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO;IACrB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,8BAA8B,CAAC,CAAC;AACjE,CAAC;AAED,OAAO,EACL,uBAAuB,EAIvB,2BAA2B,EAG5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodesecure/rc",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "NodeSecure runtime configuration",
5
5
  "exports": "./dist/index.js",
6
6
  "type": "module",
@@ -35,30 +35,30 @@
35
35
  },
36
36
  "homepage": "https://github.com/NodeSecure/rc#readme",
37
37
  "devDependencies": {
38
- "@nodesecure/eslint-config": "^1.3.1",
39
- "@types/chai": "^4.3.0",
40
- "@types/lodash.merge": "^4.6.6",
41
- "@types/mocha": "^9.1.0",
42
- "@types/node": "^17.0.13",
38
+ "@nodesecure/eslint-config": "^1.4.1",
39
+ "@types/chai": "^4.3.1",
40
+ "@types/lodash.merge": "^4.6.7",
41
+ "@types/mocha": "^9.1.1",
42
+ "@types/node": "^18.0.0",
43
43
  "@types/zen-observable": "^0.8.3",
44
- "ajv": "^8.9.0",
45
- "c8": "^7.11.0",
44
+ "ajv": "^8.11.0",
45
+ "c8": "^7.11.3",
46
46
  "chai": "^4.3.6",
47
- "eslint": "^8.7.0",
47
+ "eslint": "^8.18.0",
48
48
  "lodash.merge": "^4.6.2",
49
- "mocha": "^9.2.0",
50
- "tape": "^5.5.0",
51
- "ts-node": "^10.4.0",
52
- "tsd": "^0.19.1",
53
- "typescript": "^4.5.5"
49
+ "mocha": "^9.2.2",
50
+ "tape": "^5.5.3",
51
+ "ts-node": "^10.8.1",
52
+ "tsd": "^0.21.0",
53
+ "typescript": "^4.7.4"
54
54
  },
55
55
  "dependencies": {
56
- "@nodesecure/i18n": "^1.2.1",
57
- "@nodesecure/js-x-ray": "^4.2.1",
58
- "@nodesecure/vuln": "^1.5.0",
56
+ "@nodesecure/i18n": "^1.5.0",
57
+ "@nodesecure/js-x-ray": "^5.0.1",
58
+ "@nodesecure/vuln": "^1.7.0",
59
59
  "@slimio/config": "^1.0.1",
60
60
  "ts-results": "^3.3.0",
61
- "type-fest": "^2.11.0"
61
+ "type-fest": "^2.13.1"
62
62
  },
63
63
  "tsd": {
64
64
  "directory": "test/types",