@storm-software/config-tools 1.148.3 → 1.149.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.
Files changed (106) hide show
  1. package/README.md +1 -1
  2. package/dist/config-file/get-config-file.cjs +66 -22
  3. package/dist/config-file/get-config-file.js +65 -21
  4. package/dist/config-file/index.cjs +1 -27
  5. package/dist/config-file/index.js +1 -27
  6. package/dist/create-storm-config.cjs +68 -26
  7. package/dist/create-storm-config.js +67 -25
  8. package/dist/env/get-env.cjs +152 -9
  9. package/dist/env/get-env.js +151 -8
  10. package/dist/env/index.cjs +2 -20
  11. package/dist/env/index.js +2 -20
  12. package/dist/env/set-env.cjs +259 -8
  13. package/dist/env/set-env.js +258 -7
  14. package/dist/get-config.cjs +9 -25
  15. package/dist/get-config.js +9 -25
  16. package/dist/index.cjs +7 -171
  17. package/dist/index.js +7 -171
  18. package/dist/logger/chalk.cjs +30 -4
  19. package/dist/logger/chalk.js +29 -3
  20. package/dist/logger/console-icons.cjs +15 -5
  21. package/dist/logger/console-icons.js +15 -5
  22. package/dist/logger/console.cjs +126 -38
  23. package/dist/logger/console.js +112 -24
  24. package/dist/logger/create-logger.cjs +31 -16
  25. package/dist/logger/create-logger.js +30 -15
  26. package/dist/logger/format-timestamp.cjs +5 -3
  27. package/dist/logger/format-timestamp.js +5 -3
  28. package/dist/logger/get-log-level.cjs +56 -6
  29. package/dist/logger/get-log-level.js +56 -6
  30. package/dist/logger/index.cjs +7 -62
  31. package/dist/logger/index.js +7 -62
  32. package/dist/logger/is-unicode-supported.cjs +16 -4
  33. package/dist/logger/is-unicode-supported.js +15 -3
  34. package/dist/types.cjs +24 -6
  35. package/dist/types.js +22 -4
  36. package/dist/utilities/apply-workspace-tokens.cjs +55 -9
  37. package/dist/utilities/apply-workspace-tokens.js +54 -8
  38. package/dist/utilities/correct-paths.cjs +242 -33
  39. package/dist/utilities/correct-paths.js +225 -16
  40. package/dist/utilities/file-path-utils.cjs +18 -5
  41. package/dist/utilities/file-path-utils.js +17 -4
  42. package/dist/utilities/find-up.cjs +22 -4
  43. package/dist/utilities/find-up.js +21 -3
  44. package/dist/utilities/find-workspace-root.cjs +64 -7
  45. package/dist/utilities/find-workspace-root.js +63 -6
  46. package/dist/utilities/get-default-config.cjs +79 -8
  47. package/dist/utilities/get-default-config.js +79 -8
  48. package/dist/utilities/index.cjs +7 -85
  49. package/dist/utilities/index.js +7 -85
  50. package/dist/utilities/process-handler.cjs +35 -17
  51. package/dist/utilities/process-handler.js +35 -17
  52. package/dist/utilities/run.cjs +34 -6
  53. package/dist/utilities/run.js +33 -5
  54. package/package.json +1 -1
  55. package/dist/chunk-23WUCNWX.js +0 -142
  56. package/dist/chunk-2AVLCXLT.js +0 -0
  57. package/dist/chunk-2IKEUEGY.cjs +0 -94
  58. package/dist/chunk-3NWKPYIG.cjs +0 -68
  59. package/dist/chunk-4DLP6LZY.cjs +0 -65
  60. package/dist/chunk-65SWKEHV.cjs +0 -1
  61. package/dist/chunk-6OM23J4N.js +0 -65
  62. package/dist/chunk-6T3V5XJK.js +0 -180
  63. package/dist/chunk-7JBLPO7O.cjs +0 -168
  64. package/dist/chunk-7NSHGJWY.cjs +0 -12
  65. package/dist/chunk-7PV6L7I7.cjs +0 -1
  66. package/dist/chunk-BHZFTVXN.js +0 -42
  67. package/dist/chunk-C4RHWKK6.cjs +0 -142
  68. package/dist/chunk-CCO2PASC.js +0 -168
  69. package/dist/chunk-DD3HX2NX.cjs +0 -1
  70. package/dist/chunk-DD5UX56L.cjs +0 -272
  71. package/dist/chunk-FDJZUZKJ.js +0 -93
  72. package/dist/chunk-GS25DBTT.cjs +0 -93
  73. package/dist/chunk-GZFXEQPB.js +0 -94
  74. package/dist/chunk-HESFC24Z.cjs +0 -245
  75. package/dist/chunk-HI33NNPB.js +0 -68
  76. package/dist/chunk-HKZSDZZ4.cjs +0 -19
  77. package/dist/chunk-HSCCBYAV.js +0 -25
  78. package/dist/chunk-IRCFHYKZ.cjs +0 -28
  79. package/dist/chunk-IUT7Y2UY.js +0 -26
  80. package/dist/chunk-IWD6YQKX.cjs +0 -1
  81. package/dist/chunk-KNLWLA7O.cjs +0 -75
  82. package/dist/chunk-L6UNTUC4.js +0 -0
  83. package/dist/chunk-MLUBD3PU.js +0 -245
  84. package/dist/chunk-NJVL3GF4.js +0 -0
  85. package/dist/chunk-OIEEXHKO.js +0 -75
  86. package/dist/chunk-P7Q327IR.js +0 -272
  87. package/dist/chunk-POXTJ6GF.js +0 -28
  88. package/dist/chunk-PR7RQHRE.js +0 -12
  89. package/dist/chunk-Q7MMWMEN.js +0 -44
  90. package/dist/chunk-QBS3OCHH.js +0 -22
  91. package/dist/chunk-RRKB32OH.js +0 -0
  92. package/dist/chunk-RVM5N5ZI.cjs +0 -22
  93. package/dist/chunk-SLGVSUEV.cjs +0 -36
  94. package/dist/chunk-SVQE7WVB.cjs +0 -180
  95. package/dist/chunk-SWX2MJHI.cjs +0 -28
  96. package/dist/chunk-TZO4SYUO.cjs +0 -49
  97. package/dist/chunk-UZ5SHCFX.js +0 -49
  98. package/dist/chunk-WMWOH7LS.js +0 -79
  99. package/dist/chunk-XAJB3BSF.cjs +0 -25
  100. package/dist/chunk-XDBACKKN.cjs +0 -42
  101. package/dist/chunk-XIVRONKM.cjs +0 -44
  102. package/dist/chunk-XQPQRRG3.js +0 -28
  103. package/dist/chunk-XVIPFWZW.cjs +0 -79
  104. package/dist/chunk-XY2LDOQ4.cjs +0 -26
  105. package/dist/chunk-ZA4IO7YJ.js +0 -36
  106. package/dist/chunk-ZU6V7IRV.js +0 -19
@@ -1,79 +0,0 @@
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; }
2
-
3
- var _chunkC4RHWKK6cjs = require('./chunk-C4RHWKK6.cjs');
4
-
5
-
6
- var _chunkKNLWLA7Ocjs = require('./chunk-KNLWLA7O.cjs');
7
-
8
-
9
- var _chunkHESFC24Zcjs = require('./chunk-HESFC24Z.cjs');
10
-
11
-
12
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
13
-
14
- // src/config-file/get-config-file.ts
15
- var _c12 = require('c12');
16
- var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
17
- var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
18
- const workspacePath = filePath || _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, filePath);
19
- const configs = await Promise.all([
20
- _c12.loadConfig.call(void 0, {
21
- cwd: workspacePath,
22
- packageJson: true,
23
- name: fileName,
24
- envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
25
- jitiOptions: {
26
- debug: false,
27
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkHESFC24Zcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
28
- },
29
- ...options
30
- }),
31
- _c12.loadConfig.call(void 0, {
32
- cwd: workspacePath,
33
- packageJson: true,
34
- name: fileName,
35
- envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
36
- jitiOptions: {
37
- debug: false,
38
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkHESFC24Zcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
39
- },
40
- configFile: fileName,
41
- ...options
42
- })
43
- ]);
44
- return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
45
- }, "getConfigFileByName");
46
- var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
47
- const workspacePath = filePath ? filePath : _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, filePath);
48
- const result = await getConfigFileByName("storm-workspace", workspacePath);
49
- let config = result.config;
50
- const configFile = result.configFile;
51
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
52
- _chunkC4RHWKK6cjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
53
- logLevel: "all"
54
- });
55
- }
56
- if (additionalFileNames && additionalFileNames.length > 0) {
57
- const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
58
- for (const result2 of results) {
59
- if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
60
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
61
- _chunkC4RHWKK6cjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
62
- logLevel: "all"
63
- });
64
- }
65
- config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
66
- }
67
- }
68
- }
69
- if (!config) {
70
- return void 0;
71
- }
72
- config.configFile = configFile;
73
- return config;
74
- }, "getConfigFile");
75
-
76
-
77
-
78
-
79
- exports.getConfigFileByName = getConfigFileByName; exports.getConfigFile = getConfigFile;
@@ -1,26 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkRVM5N5ZIcjs = require('./chunk-RVM5N5ZI.cjs');
4
-
5
-
6
- var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
7
-
8
-
9
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
10
-
11
- // src/logger/console-icons.ts
12
- var useIcon = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (c, fallback) => _chunkRVM5N5ZIcjs.isUnicodeSupported.call(void 0, ) ? c : fallback, "useIcon");
13
- var CONSOLE_ICONS = {
14
- [_chunkIRCFHYKZcjs.LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
15
- [_chunkIRCFHYKZcjs.LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
16
- [_chunkIRCFHYKZcjs.LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
17
- [_chunkIRCFHYKZcjs.LogLevelLabel.INFO]: useIcon("\u2139", "i"),
18
- [_chunkIRCFHYKZcjs.LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
19
- [_chunkIRCFHYKZcjs.LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
20
- [_chunkIRCFHYKZcjs.LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
21
- [_chunkIRCFHYKZcjs.LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
22
- };
23
-
24
-
25
-
26
- exports.CONSOLE_ICONS = CONSOLE_ICONS;
@@ -1,36 +0,0 @@
1
- import {
2
- __name
3
- } from "./chunk-SHUYVCID.js";
4
-
5
- // src/logger/chalk.ts
6
- import chalk from "chalk";
7
- var chalkDefault = {
8
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
9
- bgHex: /* @__PURE__ */ __name((_) => ({
10
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
11
- }), "bgHex"),
12
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright"),
13
- gray: /* @__PURE__ */ __name((message) => message, "gray"),
14
- bold: {
15
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
16
- bgHex: /* @__PURE__ */ __name((_) => ({
17
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
18
- }), "bgHex"),
19
- whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
20
- },
21
- dim: {
22
- hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
23
- gray: /* @__PURE__ */ __name((message) => message, "gray")
24
- }
25
- };
26
- var getChalk = /* @__PURE__ */ __name(() => {
27
- let _chalk = chalk;
28
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
29
- _chalk = chalkDefault;
30
- }
31
- return _chalk;
32
- }, "getChalk");
33
-
34
- export {
35
- getChalk
36
- };
@@ -1,19 +0,0 @@
1
- import {
2
- loadStormConfig
3
- } from "./chunk-FDJZUZKJ.js";
4
- import {
5
- __name
6
- } from "./chunk-SHUYVCID.js";
7
-
8
- // src/get-config.ts
9
- var getConfig = /* @__PURE__ */ __name((workspaceRoot, skipLogs = false) => {
10
- return loadStormConfig(workspaceRoot, skipLogs);
11
- }, "getConfig");
12
- var getWorkspaceConfig = /* @__PURE__ */ __name((skipLogs = false) => {
13
- return getConfig(void 0, skipLogs);
14
- }, "getWorkspaceConfig");
15
-
16
- export {
17
- getConfig,
18
- getWorkspaceConfig
19
- };