@storm-software/config-tools 1.150.5 → 1.150.9

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.
Files changed (130) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +14795 -283
  3. package/bin/config.js +14806 -266
  4. package/dist/chunk-2MY3KGBB.cjs +70 -0
  5. package/dist/chunk-322YBAWX.js +6 -0
  6. package/dist/chunk-3BGF4LNL.cjs +67 -0
  7. package/dist/chunk-3OZGKUMC.js +1120 -0
  8. package/dist/chunk-4CTFS6DM.js +143 -0
  9. package/dist/chunk-4YA7DJB5.cjs +451 -0
  10. package/dist/chunk-56RY3KW7.cjs +6 -0
  11. package/dist/chunk-5LYWI7E7.cjs +49 -0
  12. package/dist/chunk-5SDU662B.js +274 -0
  13. package/dist/chunk-5XAQKBRL.js +510 -0
  14. package/dist/chunk-6JG5O6FD.js +2645 -0
  15. package/dist/chunk-6R6FJLKT.cjs +84 -0
  16. package/dist/chunk-6ZPVROB4.js +51 -0
  17. package/dist/chunk-73C3QB67.js +27 -0
  18. package/dist/chunk-77YC3XPW.js +9228 -0
  19. package/dist/chunk-7PDFNXOV.js +67 -0
  20. package/dist/chunk-B2HXAAFT.cjs +274 -0
  21. package/dist/chunk-BKJUQIEL.cjs +6 -0
  22. package/dist/chunk-CHYZZRN6.cjs +165 -0
  23. package/dist/chunk-CUX3BOLK.cjs +6 -0
  24. package/dist/chunk-DYTSQ3L3.js +14 -0
  25. package/dist/chunk-E554LMEP.cjs +28 -0
  26. package/dist/chunk-FUALBFYR.cjs +247 -0
  27. package/dist/chunk-FZMUKCM5.js +50 -0
  28. package/dist/chunk-G62PQROD.cjs +510 -0
  29. package/dist/chunk-GJDVCWVL.cjs +27 -0
  30. package/dist/chunk-GZ6SGFYZ.cjs +2645 -0
  31. package/dist/chunk-HAYTD5F2.js +247 -0
  32. package/dist/chunk-HBJSM6VU.js +6 -0
  33. package/dist/chunk-HLB4MOTZ.js +6 -0
  34. package/dist/chunk-HUMXKKE6.js +765 -0
  35. package/dist/chunk-HVVHVCVH.js +24 -0
  36. package/dist/chunk-I2LFMHGF.cjs +14 -0
  37. package/dist/chunk-I5FJ2QOS.js +84 -0
  38. package/dist/chunk-IYMLNFGA.cjs +33 -0
  39. package/dist/chunk-JN37L7NL.js +33 -0
  40. package/dist/chunk-JVONSFJS.cjs +765 -0
  41. package/dist/chunk-KN7POPML.cjs +21 -0
  42. package/dist/chunk-KONO4OMT.cjs +9231 -0
  43. package/dist/chunk-KQLERSRE.js +93 -0
  44. package/dist/chunk-KXHNOCVY.cjs +24 -0
  45. package/dist/chunk-LAIQ2Z5B.cjs +93 -0
  46. package/dist/chunk-LUQRLSMI.js +6 -0
  47. package/dist/chunk-M3KQNO7N.cjs +93 -0
  48. package/dist/chunk-MJL6D7T3.js +28 -0
  49. package/dist/chunk-MKB5GTL4.js +451 -0
  50. package/dist/chunk-MMMRCNC6.js +77 -0
  51. package/dist/chunk-NERZUU47.js +93 -0
  52. package/dist/chunk-NVXMXDZM.js +70 -0
  53. package/dist/chunk-NWFS53UA.js +21 -0
  54. package/dist/chunk-PBEGXSGU.js +165 -0
  55. package/dist/chunk-PMRCDW2Q.cjs +44 -0
  56. package/dist/chunk-RDWCJD4I.cjs +30 -0
  57. package/dist/chunk-RN5XBSCX.cjs +77 -0
  58. package/dist/chunk-TJ7RSPG3.cjs +6 -0
  59. package/dist/chunk-US52HP52.cjs +143 -0
  60. package/dist/chunk-UXYX4UF4.cjs +50 -0
  61. package/dist/chunk-W7YJIINP.js +49 -0
  62. package/dist/chunk-WTHXS4H2.js +44 -0
  63. package/dist/chunk-X3T2GC65.cjs +51 -0
  64. package/dist/chunk-XUGBUGHC.cjs +1120 -0
  65. package/dist/chunk-YO6XHACG.js +30 -0
  66. package/dist/config-file/get-config-file.cjs +26 -66
  67. package/dist/config-file/get-config-file.js +25 -65
  68. package/dist/config-file/index.cjs +31 -1
  69. package/dist/config-file/index.js +31 -1
  70. package/dist/create-storm-config.cjs +30 -68
  71. package/dist/create-storm-config.js +29 -67
  72. package/dist/env/get-env.cjs +8 -152
  73. package/dist/env/get-env.js +7 -151
  74. package/dist/env/index.cjs +19 -2
  75. package/dist/env/index.js +19 -2
  76. package/dist/env/set-env.cjs +8 -259
  77. package/dist/env/set-env.js +7 -258
  78. package/dist/esm-HKV66HQZ.js +1716 -0
  79. package/dist/esm-TZUWSATN.cjs +1716 -0
  80. package/dist/get-config.cjs +29 -9
  81. package/dist/get-config.js +29 -9
  82. package/dist/index.cjs +180 -7
  83. package/dist/index.js +180 -7
  84. package/dist/json5-NI4CISQP.cjs +10 -0
  85. package/dist/json5-XMK3UBET.js +10 -0
  86. package/dist/jsonc-GYGN4BMZ.js +15 -0
  87. package/dist/jsonc-TDL6NXBV.cjs +15 -0
  88. package/dist/logger/chalk.cjs +4 -30
  89. package/dist/logger/chalk.js +3 -29
  90. package/dist/logger/console-icons.cjs +5 -15
  91. package/dist/logger/console-icons.js +5 -15
  92. package/dist/logger/console.cjs +37 -125
  93. package/dist/logger/console.js +23 -111
  94. package/dist/logger/create-logger.cjs +15 -31
  95. package/dist/logger/create-logger.js +14 -30
  96. package/dist/logger/format-timestamp.cjs +3 -5
  97. package/dist/logger/format-timestamp.js +3 -5
  98. package/dist/logger/get-log-level.cjs +6 -56
  99. package/dist/logger/get-log-level.js +6 -56
  100. package/dist/logger/index.cjs +61 -7
  101. package/dist/logger/index.js +61 -7
  102. package/dist/logger/is-unicode-supported.cjs +4 -16
  103. package/dist/logger/is-unicode-supported.js +3 -15
  104. package/dist/toml-5NX5FGDD.cjs +10 -0
  105. package/dist/toml-ZYXFVZLI.js +10 -0
  106. package/dist/types.cjs +6 -24
  107. package/dist/types.js +5 -23
  108. package/dist/utilities/apply-workspace-tokens.cjs +9 -55
  109. package/dist/utilities/apply-workspace-tokens.js +8 -54
  110. package/dist/utilities/correct-paths.cjs +33 -242
  111. package/dist/utilities/correct-paths.js +16 -225
  112. package/dist/utilities/file-path-utils.cjs +5 -18
  113. package/dist/utilities/file-path-utils.js +4 -17
  114. package/dist/utilities/find-up.cjs +4 -22
  115. package/dist/utilities/find-up.js +3 -21
  116. package/dist/utilities/find-workspace-root.cjs +7 -64
  117. package/dist/utilities/find-workspace-root.js +6 -63
  118. package/dist/utilities/get-default-config.cjs +7 -79
  119. package/dist/utilities/get-default-config.js +7 -79
  120. package/dist/utilities/index.cjs +84 -7
  121. package/dist/utilities/index.js +84 -7
  122. package/dist/utilities/process-handler.cjs +16 -35
  123. package/dist/utilities/process-handler.js +16 -35
  124. package/dist/utilities/run.cjs +6 -34
  125. package/dist/utilities/run.js +5 -33
  126. package/dist/yaml-GRT7ORXT.cjs +10 -0
  127. package/dist/yaml-WD4DF2QH.js +10 -0
  128. package/package.json +7 -4
  129. package/dist/chunk-SHUYVCID.js +0 -6
  130. package/dist/chunk-USNT2KNT.cjs +0 -6
@@ -0,0 +1,30 @@
1
+ import {
2
+ __name,
3
+ init_esm_shims
4
+ } from "./chunk-W7YJIINP.js";
5
+
6
+ // src/utilities/find-up.ts
7
+ init_esm_shims();
8
+ import { existsSync } from "node:fs";
9
+ import { join } from "node:path";
10
+ var MAX_PATH_SEARCH_DEPTH = 30;
11
+ var depth = 0;
12
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
13
+ const _startPath = startPath ?? process.cwd();
14
+ if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
15
+ return _startPath;
16
+ }
17
+ if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
18
+ return _startPath;
19
+ }
20
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
21
+ const parent = join(_startPath, "..");
22
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
23
+ }
24
+ return void 0;
25
+ }
26
+ __name(findFolderUp, "findFolderUp");
27
+
28
+ export {
29
+ findFolderUp
30
+ };
@@ -1,70 +1,30 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- var _c12 = require('c12');
5
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
6
- var _console = require('../logger/console');
7
- var _utilities = require('../utilities');
8
- var _findworkspaceroot = require('../utilities/find-workspace-root');
9
- const getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
10
- const workspacePath = filePath || _findworkspaceroot.findWorkspaceRoot.call(void 0, filePath);
11
- const configs = await Promise.all([
12
- _c12.loadConfig.call(void 0, {
13
- cwd: workspacePath,
14
- packageJson: true,
15
- name: fileName,
16
- envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
17
- jitiOptions: {
18
- debug: false,
19
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _utilities.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
20
- },
21
- ...options
22
- }),
23
- _c12.loadConfig.call(void 0, {
24
- cwd: workspacePath,
25
- packageJson: true,
26
- name: fileName,
27
- envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
28
- jitiOptions: {
29
- debug: false,
30
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _utilities.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
31
- },
32
- configFile: fileName,
33
- ...options
34
- })
35
- ]);
36
- return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
37
- }, "getConfigFileByName");
38
- const getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
39
- const workspacePath = filePath ? filePath : _findworkspaceroot.findWorkspaceRoot.call(void 0, filePath);
40
- const result = await getConfigFileByName("storm-workspace", workspacePath);
41
- let config = result.config;
42
- const configFile = result.configFile;
43
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
44
- _console.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
45
- logLevel: "all"
46
- });
47
- }
48
- if (additionalFileNames && additionalFileNames.length > 0) {
49
- const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
50
- for (const result2 of results) {
51
- if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
52
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
53
- _console.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
54
- logLevel: "all"
55
- });
56
- }
57
- config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
58
- }
59
- }
60
- }
61
- if (!config) {
62
- return void 0;
63
- }
64
- config.configFile = configFile;
65
- return config;
66
- }, "getConfigFile");
67
3
 
4
+ var _chunkKONO4OMTcjs = require('../chunk-KONO4OMT.cjs');
5
+ require('../chunk-JVONSFJS.cjs');
6
+ require('../chunk-XUGBUGHC.cjs');
7
+ require('../chunk-G62PQROD.cjs');
8
+ require('../chunk-4YA7DJB5.cjs');
9
+ require('../chunk-6R6FJLKT.cjs');
10
+ require('../chunk-BKJUQIEL.cjs');
11
+ require('../chunk-X3T2GC65.cjs');
12
+ require('../chunk-PMRCDW2Q.cjs');
13
+ require('../chunk-3BGF4LNL.cjs');
14
+ require('../chunk-GJDVCWVL.cjs');
15
+ require('../chunk-US52HP52.cjs');
16
+ require('../chunk-M3KQNO7N.cjs');
17
+ require('../chunk-RN5XBSCX.cjs');
18
+ require('../chunk-RDWCJD4I.cjs');
19
+ require('../chunk-GZ6SGFYZ.cjs');
20
+ require('../chunk-E554LMEP.cjs');
21
+ require('../chunk-KXHNOCVY.cjs');
22
+ require('../chunk-I2LFMHGF.cjs');
23
+ require('../chunk-FUALBFYR.cjs');
24
+ require('../chunk-2MY3KGBB.cjs');
25
+ require('../chunk-IYMLNFGA.cjs');
26
+ require('../chunk-5LYWI7E7.cjs');
68
27
 
69
28
 
70
- exports.getConfigFile = getConfigFile; exports.getConfigFileByName = getConfigFileByName;
29
+
30
+ exports.getConfigFile = _chunkKONO4OMTcjs.getConfigFile; exports.getConfigFileByName = _chunkKONO4OMTcjs.getConfigFileByName;
@@ -1,69 +1,29 @@
1
1
  import {
2
- __name
3
- } from "../chunk-SHUYVCID.js";
4
- import { loadConfig } from "c12";
5
- import defu from "defu";
6
- import { writeTrace } from "../logger/console";
7
- import { joinPaths } from "../utilities";
8
- import { findWorkspaceRoot } from "../utilities/find-workspace-root";
9
- const getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
10
- const workspacePath = filePath || findWorkspaceRoot(filePath);
11
- const configs = await Promise.all([
12
- loadConfig({
13
- cwd: workspacePath,
14
- packageJson: true,
15
- name: fileName,
16
- envName: fileName?.toUpperCase(),
17
- jitiOptions: {
18
- debug: false,
19
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
20
- },
21
- ...options
22
- }),
23
- loadConfig({
24
- cwd: workspacePath,
25
- packageJson: true,
26
- name: fileName,
27
- envName: fileName?.toUpperCase(),
28
- jitiOptions: {
29
- debug: false,
30
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
31
- },
32
- configFile: fileName,
33
- ...options
34
- })
35
- ]);
36
- return defu(configs[0] ?? {}, configs[1] ?? {});
37
- }, "getConfigFileByName");
38
- const getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
39
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
40
- const result = await getConfigFileByName("storm-workspace", workspacePath);
41
- let config = result.config;
42
- const configFile = result.configFile;
43
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
44
- writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
45
- logLevel: "all"
46
- });
47
- }
48
- if (additionalFileNames && additionalFileNames.length > 0) {
49
- const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
50
- for (const result2 of results) {
51
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
52
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
53
- writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
54
- logLevel: "all"
55
- });
56
- }
57
- config = defu(result2.config ?? {}, config ?? {});
58
- }
59
- }
60
- }
61
- if (!config) {
62
- return void 0;
63
- }
64
- config.configFile = configFile;
65
- return config;
66
- }, "getConfigFile");
2
+ getConfigFile,
3
+ getConfigFileByName
4
+ } from "../chunk-77YC3XPW.js";
5
+ import "../chunk-HUMXKKE6.js";
6
+ import "../chunk-3OZGKUMC.js";
7
+ import "../chunk-5XAQKBRL.js";
8
+ import "../chunk-MKB5GTL4.js";
9
+ import "../chunk-I5FJ2QOS.js";
10
+ import "../chunk-322YBAWX.js";
11
+ import "../chunk-6ZPVROB4.js";
12
+ import "../chunk-WTHXS4H2.js";
13
+ import "../chunk-7PDFNXOV.js";
14
+ import "../chunk-73C3QB67.js";
15
+ import "../chunk-4CTFS6DM.js";
16
+ import "../chunk-KQLERSRE.js";
17
+ import "../chunk-MMMRCNC6.js";
18
+ import "../chunk-YO6XHACG.js";
19
+ import "../chunk-6JG5O6FD.js";
20
+ import "../chunk-MJL6D7T3.js";
21
+ import "../chunk-HVVHVCVH.js";
22
+ import "../chunk-DYTSQ3L3.js";
23
+ import "../chunk-HAYTD5F2.js";
24
+ import "../chunk-NVXMXDZM.js";
25
+ import "../chunk-JN37L7NL.js";
26
+ import "../chunk-W7YJIINP.js";
67
27
  export {
68
28
  getConfigFile,
69
29
  getConfigFileByName
@@ -1 +1,31 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _getconfigfile = require('./get-config-file'); _createStarExport(_getconfigfile);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-TJ7RSPG3.cjs');
2
+
3
+
4
+
5
+ var _chunkKONO4OMTcjs = require('../chunk-KONO4OMT.cjs');
6
+ require('../chunk-JVONSFJS.cjs');
7
+ require('../chunk-XUGBUGHC.cjs');
8
+ require('../chunk-G62PQROD.cjs');
9
+ require('../chunk-4YA7DJB5.cjs');
10
+ require('../chunk-6R6FJLKT.cjs');
11
+ require('../chunk-BKJUQIEL.cjs');
12
+ require('../chunk-X3T2GC65.cjs');
13
+ require('../chunk-PMRCDW2Q.cjs');
14
+ require('../chunk-3BGF4LNL.cjs');
15
+ require('../chunk-GJDVCWVL.cjs');
16
+ require('../chunk-US52HP52.cjs');
17
+ require('../chunk-M3KQNO7N.cjs');
18
+ require('../chunk-RN5XBSCX.cjs');
19
+ require('../chunk-RDWCJD4I.cjs');
20
+ require('../chunk-GZ6SGFYZ.cjs');
21
+ require('../chunk-E554LMEP.cjs');
22
+ require('../chunk-KXHNOCVY.cjs');
23
+ require('../chunk-I2LFMHGF.cjs');
24
+ require('../chunk-FUALBFYR.cjs');
25
+ require('../chunk-2MY3KGBB.cjs');
26
+ require('../chunk-IYMLNFGA.cjs');
27
+ require('../chunk-5LYWI7E7.cjs');
28
+
29
+
30
+
31
+ exports.getConfigFile = _chunkKONO4OMTcjs.getConfigFile; exports.getConfigFileByName = _chunkKONO4OMTcjs.getConfigFileByName;
@@ -1 +1,31 @@
1
- export * from "./get-config-file";
1
+ import "../chunk-LUQRLSMI.js";
2
+ import {
3
+ getConfigFile,
4
+ getConfigFileByName
5
+ } from "../chunk-77YC3XPW.js";
6
+ import "../chunk-HUMXKKE6.js";
7
+ import "../chunk-3OZGKUMC.js";
8
+ import "../chunk-5XAQKBRL.js";
9
+ import "../chunk-MKB5GTL4.js";
10
+ import "../chunk-I5FJ2QOS.js";
11
+ import "../chunk-322YBAWX.js";
12
+ import "../chunk-6ZPVROB4.js";
13
+ import "../chunk-WTHXS4H2.js";
14
+ import "../chunk-7PDFNXOV.js";
15
+ import "../chunk-73C3QB67.js";
16
+ import "../chunk-4CTFS6DM.js";
17
+ import "../chunk-KQLERSRE.js";
18
+ import "../chunk-MMMRCNC6.js";
19
+ import "../chunk-YO6XHACG.js";
20
+ import "../chunk-6JG5O6FD.js";
21
+ import "../chunk-MJL6D7T3.js";
22
+ import "../chunk-HVVHVCVH.js";
23
+ import "../chunk-DYTSQ3L3.js";
24
+ import "../chunk-HAYTD5F2.js";
25
+ import "../chunk-NVXMXDZM.js";
26
+ import "../chunk-JN37L7NL.js";
27
+ import "../chunk-W7YJIINP.js";
28
+ export {
29
+ getConfigFile,
30
+ getConfigFileByName
31
+ };
@@ -1,73 +1,35 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
- var _schema = require('@storm-software/config/schema');
5
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
6
- var _getconfigfile = require('./config-file/get-config-file');
7
- var _getenv = require('./env/get-env');
8
- var _setenv = require('./env/set-env');
9
- var _console = require('./logger/console');
10
- var _findworkspaceroot = require('./utilities/find-workspace-root');
11
- var _getdefaultconfig = require('./utilities/get-default-config');
12
- const _extension_cache = /* @__PURE__ */ new WeakMap();
13
- let _static_cache = void 0;
14
- const createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
15
- let result;
16
- if (!_optionalChain([_static_cache, 'optionalAccess', _ => _.data]) || !_optionalChain([_static_cache, 'optionalAccess', _2 => _2.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
17
- let _workspaceRoot = workspaceRoot;
18
- if (!_workspaceRoot) {
19
- _workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, );
20
- }
21
- const configEnv = _getenv.getConfigEnv.call(void 0, );
22
- const defaultConfig = await _getdefaultconfig.getDefaultConfig.call(void 0, _workspaceRoot);
23
- const configFile = await _getconfigfile.getConfigFile.call(void 0, _workspaceRoot);
24
- if (!configFile && !skipLogs) {
25
- _console.writeWarning.call(void 0, "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
26
- logLevel: "all"
27
- });
28
- }
29
- result = await _schema.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
30
- result.workspaceRoot ??= _workspaceRoot;
31
- } else {
32
- result = _static_cache.data;
33
- }
34
- if (schema && extensionName) {
35
- result.extensions = {
36
- ...result.extensions,
37
- [extensionName]: createConfigExtension(extensionName, schema)
38
- };
39
- }
40
- _static_cache = {
41
- timestamp: Date.now(),
42
- data: result
43
- };
44
- return result;
45
- }, "createStormConfig");
46
- const createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, schema) => {
47
- const extension_cache_key = {
48
- extensionName
49
- };
50
- if (_extension_cache.has(extension_cache_key)) {
51
- return _extension_cache.get(extension_cache_key);
52
- }
53
- let extension = _getenv.getExtensionEnv.call(void 0, extensionName);
54
- if (schema) {
55
- extension = schema.parse(extension);
56
- }
57
- _extension_cache.set(extension_cache_key, extension);
58
- return extension;
59
- }, "createConfigExtension");
60
- const loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
61
- const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
62
- _setenv.setConfigEnv.call(void 0, config);
63
- if (!skipLogs && !config.skipConfigLogging) {
64
- _console.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
65
- ${_console.formatLogMessage.call(void 0, config)}`, config);
66
- }
67
- return config;
68
- }, "loadStormConfig");
69
3
 
70
4
 
5
+ var _chunkLAIQ2Z5Bcjs = require('./chunk-LAIQ2Z5B.cjs');
6
+ require('./chunk-KONO4OMT.cjs');
7
+ require('./chunk-JVONSFJS.cjs');
8
+ require('./chunk-XUGBUGHC.cjs');
9
+ require('./chunk-G62PQROD.cjs');
10
+ require('./chunk-4YA7DJB5.cjs');
11
+ require('./chunk-6R6FJLKT.cjs');
12
+ require('./chunk-BKJUQIEL.cjs');
13
+ require('./chunk-X3T2GC65.cjs');
14
+ require('./chunk-PMRCDW2Q.cjs');
15
+ require('./chunk-3BGF4LNL.cjs');
16
+ require('./chunk-GJDVCWVL.cjs');
17
+ require('./chunk-US52HP52.cjs');
18
+ require('./chunk-M3KQNO7N.cjs');
19
+ require('./chunk-RN5XBSCX.cjs');
20
+ require('./chunk-RDWCJD4I.cjs');
21
+ require('./chunk-GZ6SGFYZ.cjs');
22
+ require('./chunk-E554LMEP.cjs');
23
+ require('./chunk-KXHNOCVY.cjs');
24
+ require('./chunk-I2LFMHGF.cjs');
25
+ require('./chunk-B2HXAAFT.cjs');
26
+ require('./chunk-CHYZZRN6.cjs');
27
+ require('./chunk-FUALBFYR.cjs');
28
+ require('./chunk-2MY3KGBB.cjs');
29
+ require('./chunk-IYMLNFGA.cjs');
30
+ require('./chunk-5LYWI7E7.cjs');
71
31
 
72
32
 
73
- exports.createConfigExtension = createConfigExtension; exports.createStormConfig = createStormConfig; exports.loadStormConfig = loadStormConfig;
33
+
34
+
35
+ exports.createConfigExtension = _chunkLAIQ2Z5Bcjs.createConfigExtension; exports.createStormConfig = _chunkLAIQ2Z5Bcjs.createStormConfig; exports.loadStormConfig = _chunkLAIQ2Z5Bcjs.loadStormConfig;
@@ -1,71 +1,33 @@
1
1
  import {
2
- __name
3
- } from "./chunk-SHUYVCID.js";
4
- import { StormConfigSchema } from "@storm-software/config/schema";
5
- import defu from "defu";
6
- import { getConfigFile } from "./config-file/get-config-file";
7
- import { getConfigEnv, getExtensionEnv } from "./env/get-env";
8
- import { setConfigEnv } from "./env/set-env";
9
- import { formatLogMessage, writeTrace, writeWarning } from "./logger/console";
10
- import { findWorkspaceRoot } from "./utilities/find-workspace-root";
11
- import { getDefaultConfig } from "./utilities/get-default-config";
12
- const _extension_cache = /* @__PURE__ */ new WeakMap();
13
- let _static_cache = void 0;
14
- const createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
15
- let result;
16
- if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
17
- let _workspaceRoot = workspaceRoot;
18
- if (!_workspaceRoot) {
19
- _workspaceRoot = findWorkspaceRoot();
20
- }
21
- const configEnv = getConfigEnv();
22
- const defaultConfig = await getDefaultConfig(_workspaceRoot);
23
- const configFile = await getConfigFile(_workspaceRoot);
24
- if (!configFile && !skipLogs) {
25
- writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
26
- logLevel: "all"
27
- });
28
- }
29
- result = await StormConfigSchema.parseAsync(defu(configEnv, configFile, defaultConfig));
30
- result.workspaceRoot ??= _workspaceRoot;
31
- } else {
32
- result = _static_cache.data;
33
- }
34
- if (schema && extensionName) {
35
- result.extensions = {
36
- ...result.extensions,
37
- [extensionName]: createConfigExtension(extensionName, schema)
38
- };
39
- }
40
- _static_cache = {
41
- timestamp: Date.now(),
42
- data: result
43
- };
44
- return result;
45
- }, "createStormConfig");
46
- const createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
47
- const extension_cache_key = {
48
- extensionName
49
- };
50
- if (_extension_cache.has(extension_cache_key)) {
51
- return _extension_cache.get(extension_cache_key);
52
- }
53
- let extension = getExtensionEnv(extensionName);
54
- if (schema) {
55
- extension = schema.parse(extension);
56
- }
57
- _extension_cache.set(extension_cache_key, extension);
58
- return extension;
59
- }, "createConfigExtension");
60
- const loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
61
- const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
62
- setConfigEnv(config);
63
- if (!skipLogs && !config.skipConfigLogging) {
64
- writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
65
- ${formatLogMessage(config)}`, config);
66
- }
67
- return config;
68
- }, "loadStormConfig");
2
+ createConfigExtension,
3
+ createStormConfig,
4
+ loadStormConfig
5
+ } from "./chunk-NERZUU47.js";
6
+ import "./chunk-77YC3XPW.js";
7
+ import "./chunk-HUMXKKE6.js";
8
+ import "./chunk-3OZGKUMC.js";
9
+ import "./chunk-5XAQKBRL.js";
10
+ import "./chunk-MKB5GTL4.js";
11
+ import "./chunk-I5FJ2QOS.js";
12
+ import "./chunk-322YBAWX.js";
13
+ import "./chunk-6ZPVROB4.js";
14
+ import "./chunk-WTHXS4H2.js";
15
+ import "./chunk-7PDFNXOV.js";
16
+ import "./chunk-73C3QB67.js";
17
+ import "./chunk-4CTFS6DM.js";
18
+ import "./chunk-KQLERSRE.js";
19
+ import "./chunk-MMMRCNC6.js";
20
+ import "./chunk-YO6XHACG.js";
21
+ import "./chunk-6JG5O6FD.js";
22
+ import "./chunk-MJL6D7T3.js";
23
+ import "./chunk-HVVHVCVH.js";
24
+ import "./chunk-DYTSQ3L3.js";
25
+ import "./chunk-5SDU662B.js";
26
+ import "./chunk-PBEGXSGU.js";
27
+ import "./chunk-HAYTD5F2.js";
28
+ import "./chunk-NVXMXDZM.js";
29
+ import "./chunk-JN37L7NL.js";
30
+ import "./chunk-W7YJIINP.js";
69
31
  export {
70
32
  createConfigExtension,
71
33
  createStormConfig,
@@ -1,156 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- var _config = require('@storm-software/config');
5
- var _getloglevel = require('../logger/get-log-level');
6
- var _correctpaths = require('../utilities/correct-paths');
7
- const getExtensionEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName) => {
8
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
9
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
10
- const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
11
- if (name) {
12
- ret[name] = process.env[key];
13
- }
14
- return ret;
15
- }, {});
16
- }, "getExtensionEnv");
17
- const getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
18
- const prefix = "STORM_";
19
- let config = {
20
- extends: process.env[`${prefix}EXTENDS`] || void 0,
21
- name: process.env[`${prefix}NAME`] || void 0,
22
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
23
- owner: process.env[`${prefix}OWNER`] || void 0,
24
- bot: {
25
- name: process.env[`${prefix}BOT_NAME`] || void 0,
26
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
27
- },
28
- organization: process.env[`${prefix}ORGANIZATION`] || void 0,
29
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
30
- license: process.env[`${prefix}LICENSE`] || void 0,
31
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
32
- docs: process.env[`${prefix}DOCS`] || void 0,
33
- licensing: process.env[`${prefix}LICENSING`] || void 0,
34
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
35
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
36
- configFile: process.env[`${prefix}CONFIG_FILE`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
37
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
38
- directories: {
39
- cache: process.env[`${prefix}CACHE_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
40
- data: process.env[`${prefix}DATA_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
41
- config: process.env[`${prefix}CONFIG_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
42
- temp: process.env[`${prefix}TEMP_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
43
- log: process.env[`${prefix}LOG_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
44
- build: process.env[`${prefix}BUILD_DIR`] ? _correctpaths.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
45
- },
46
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
47
- env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
48
- // ci:
49
- // process.env[`${prefix}CI`] !== undefined
50
- // ? Boolean(
51
- // process.env[`${prefix}CI`] ??
52
- // process.env.CI ??
53
- // process.env.CONTINUOUS_INTEGRATION
54
- // )
55
- // : undefined,
56
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
57
- branch: process.env[`${prefix}BRANCH`] || void 0,
58
- preid: process.env[`${prefix}PRE_ID`] || void 0,
59
- externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
60
- registry: {
61
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
62
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
63
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
64
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
65
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
66
- },
67
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _getloglevel.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
68
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
69
- };
70
- const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _config.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
71
- config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
72
- ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
73
- return ret;
74
- }, {}) : getThemeColorConfigEnv(prefix);
75
- if (config.docs === _config.STORM_DEFAULT_DOCS) {
76
- if (config.homepage === _config.STORM_DEFAULT_HOMEPAGE) {
77
- config.docs = `${_config.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
78
- } else {
79
- config.docs = `${config.homepage}/docs`;
80
- }
81
- }
82
- if (config.licensing === _config.STORM_DEFAULT_LICENSING) {
83
- if (config.homepage === _config.STORM_DEFAULT_HOMEPAGE) {
84
- config.licensing = `${_config.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
85
- } else {
86
- config.licensing = `${config.homepage}/docs`;
87
- }
88
- }
89
- const serializedConfig = process.env[`${prefix}CONFIG`];
90
- if (serializedConfig) {
91
- const parsed = JSON.parse(serializedConfig);
92
- config = {
93
- ...config,
94
- ...parsed,
95
- colors: {
96
- ...config.colors,
97
- ...parsed.colors
98
- },
99
- extensions: {
100
- ...config.extensions,
101
- ...parsed.extensions
102
- }
103
- };
104
- }
105
- return config;
106
- }, "getConfigEnv");
107
- const getThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, theme) => {
108
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
109
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
110
- }, "getThemeColorConfigEnv");
111
- const getSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix) => {
112
- return {
113
- dark: process.env[`${prefix}DARK`],
114
- light: process.env[`${prefix}LIGHT`],
115
- brand: process.env[`${prefix}BRAND`],
116
- alternate: process.env[`${prefix}ALTERNATE`],
117
- accent: process.env[`${prefix}ACCENT`],
118
- link: process.env[`${prefix}LINK`],
119
- help: process.env[`${prefix}HELP`],
120
- success: process.env[`${prefix}SUCCESS`],
121
- info: process.env[`${prefix}INFO`],
122
- warning: process.env[`${prefix}WARNING`],
123
- danger: process.env[`${prefix}DANGER`],
124
- fatal: process.env[`${prefix}FATAL`],
125
- positive: process.env[`${prefix}POSITIVE`],
126
- negative: process.env[`${prefix}NEGATIVE`]
127
- };
128
- }, "getSingleThemeColorConfigEnv");
129
- const getMultiThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix) => {
130
- return {
131
- light: getBaseThemeColorConfigEnv(`${prefix}_LIGHT_`),
132
- dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
133
- };
134
- }, "getMultiThemeColorConfigEnv");
135
- const getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix) => {
136
- return {
137
- foreground: process.env[`${prefix}FOREGROUND`],
138
- background: process.env[`${prefix}BACKGROUND`],
139
- brand: process.env[`${prefix}BRAND`],
140
- alternate: process.env[`${prefix}ALTERNATE`],
141
- accent: process.env[`${prefix}ACCENT`],
142
- link: process.env[`${prefix}LINK`],
143
- help: process.env[`${prefix}HELP`],
144
- success: process.env[`${prefix}SUCCESS`],
145
- info: process.env[`${prefix}INFO`],
146
- warning: process.env[`${prefix}WARNING`],
147
- danger: process.env[`${prefix}DANGER`],
148
- fatal: process.env[`${prefix}FATAL`],
149
- positive: process.env[`${prefix}POSITIVE`],
150
- negative: process.env[`${prefix}NEGATIVE`]
151
- };
152
- }, "getBaseThemeColorConfigEnv");
153
3
 
4
+ var _chunkCHYZZRN6cjs = require('../chunk-CHYZZRN6.cjs');
5
+ require('../chunk-FUALBFYR.cjs');
6
+ require('../chunk-2MY3KGBB.cjs');
7
+ require('../chunk-IYMLNFGA.cjs');
8
+ require('../chunk-5LYWI7E7.cjs');
154
9
 
155
10
 
156
- exports.getConfigEnv = getConfigEnv; exports.getExtensionEnv = getExtensionEnv;
11
+
12
+ exports.getConfigEnv = _chunkCHYZZRN6cjs.getConfigEnv; exports.getExtensionEnv = _chunkCHYZZRN6cjs.getExtensionEnv;