@nodesecure/rc 1.1.0 → 1.2.1

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
@@ -1,8 +1,6 @@
1
1
  # rc
2
2
  ![version](https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/NodeSecure/rc/master/package.json&query=$.version&label=Version)
3
3
  [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/NodeSecure/rc/commit-activity)
4
- [![Security Responsible Disclosure](https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg)](https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md
5
- )
6
4
  [![mit](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/NodeSecure/rc/blob/master/LICENSE)
7
5
 
8
6
  NodeSecure runtime configuration.
@@ -111,6 +109,16 @@ export interface writePartialPayload {
111
109
  export type writeOptions = writeCompletePayload | writePartialPayload;
112
110
  ```
113
111
 
112
+ ### homedir(): string
113
+
114
+ Dedicated directory for NodeSecure to store the configuration in the os HOME directory.
115
+
116
+ ```ts
117
+ import * as RC from "@nodesecure/rc";
118
+
119
+ const homedir = RC.homedir();
120
+ ```
121
+
114
122
  ### CONSTANTS
115
123
 
116
124
  ```ts
@@ -152,7 +160,7 @@ console.log(RC.JSONSchema);
152
160
  ## Contributors ✨
153
161
 
154
162
  <!-- 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-)
163
+ [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
156
164
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
157
165
 
158
166
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -164,6 +172,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
164
172
  <tr>
165
173
  <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
174
  <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>
175
+ <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
176
  </tr>
168
177
  </table>
169
178
 
@@ -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,C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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,EAAE,OAAO;QAChB,IAAI,EAAE,SAAkB;QACxB,QAAQ,EAAE,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.1",
4
4
  "description": "NodeSecure runtime configuration",
5
5
  "exports": "./dist/index.js",
6
6
  "type": "module",
@@ -35,30 +35,31 @@
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.5.0",
39
+ "@types/chai": "^4.3.3",
40
+ "@types/lodash.merge": "^4.6.7",
41
+ "@types/mocha": "^10.0.0",
42
+ "@types/node": "^18.11.9",
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.12.0",
46
46
  "chai": "^4.3.6",
47
- "eslint": "^8.7.0",
47
+ "eslint": "^8.26.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": "^10.1.0",
50
+ "tape": "^5.6.1",
51
+ "ts-node": "^10.9.1",
52
+ "tsd": "^0.24.1",
53
+ "typescript": "^4.8.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",
59
- "@slimio/config": "^1.0.1",
56
+ "@nodesecure/i18n": "^1.5.0",
57
+ "@nodesecure/js-x-ray": "^5.1.0",
58
+ "@nodesecure/vuln": "^1.7.0",
59
+ "@slimio/config": "^1.1.0",
60
60
  "ts-results": "^3.3.0",
61
- "type-fest": "^2.11.0"
61
+ "tslib": "^2.4.1",
62
+ "type-fest": "^3.2.0"
62
63
  },
63
64
  "tsd": {
64
65
  "directory": "test/types",