@storm-software/config-tools 1.148.3 → 1.148.4

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,10 +1,60 @@
1
1
  import {
2
- getLogLevel,
3
- getLogLevelLabel,
4
- isVerbose
5
- } from "../chunk-HI33NNPB.js";
6
- import "../chunk-POXTJ6GF.js";
7
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { LogLevel, LogLevelLabel } from "../types";
5
+ const getLogLevel = /* @__PURE__ */ __name((label) => {
6
+ switch (label) {
7
+ case "all":
8
+ return LogLevel.ALL;
9
+ case "trace":
10
+ return LogLevel.TRACE;
11
+ case "debug":
12
+ return LogLevel.DEBUG;
13
+ case "info":
14
+ return LogLevel.INFO;
15
+ case "warn":
16
+ return LogLevel.WARN;
17
+ case "error":
18
+ return LogLevel.ERROR;
19
+ case "fatal":
20
+ return LogLevel.FATAL;
21
+ case "silent":
22
+ return LogLevel.SILENT;
23
+ default:
24
+ return LogLevel.INFO;
25
+ }
26
+ }, "getLogLevel");
27
+ const getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
28
+ if (logLevel >= LogLevel.ALL) {
29
+ return LogLevelLabel.ALL;
30
+ }
31
+ if (logLevel >= LogLevel.TRACE) {
32
+ return LogLevelLabel.TRACE;
33
+ }
34
+ if (logLevel >= LogLevel.DEBUG) {
35
+ return LogLevelLabel.DEBUG;
36
+ }
37
+ if (logLevel >= LogLevel.INFO) {
38
+ return LogLevelLabel.INFO;
39
+ }
40
+ if (logLevel >= LogLevel.WARN) {
41
+ return LogLevelLabel.WARN;
42
+ }
43
+ if (logLevel >= LogLevel.ERROR) {
44
+ return LogLevelLabel.ERROR;
45
+ }
46
+ if (logLevel >= LogLevel.FATAL) {
47
+ return LogLevelLabel.FATAL;
48
+ }
49
+ if (logLevel <= LogLevel.SILENT) {
50
+ return LogLevelLabel.SILENT;
51
+ }
52
+ return LogLevelLabel.INFO;
53
+ }, "getLogLevelLabel");
54
+ const isVerbose = /* @__PURE__ */ __name((label = LogLevelLabel.SILENT) => {
55
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
56
+ return logLevel >= LogLevel.DEBUG;
57
+ }, "isVerbose");
8
58
  export {
9
59
  getLogLevel,
10
60
  getLogLevelLabel,
@@ -1,62 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-7PV6L7I7.cjs');
2
-
3
-
4
- var _chunkXIVRONKMcjs = require('../chunk-XIVRONKM.cjs');
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- var _chunkC4RHWKK6cjs = require('../chunk-C4RHWKK6.cjs');
18
- require('../chunk-2IKEUEGY.cjs');
19
- require('../chunk-KNLWLA7O.cjs');
20
- require('../chunk-SWX2MJHI.cjs');
21
-
22
-
23
- var _chunkSLGVSUEVcjs = require('../chunk-SLGVSUEV.cjs');
24
-
25
-
26
- var _chunkXY2LDOQ4cjs = require('../chunk-XY2LDOQ4.cjs');
27
-
28
-
29
- var _chunkRVM5N5ZIcjs = require('../chunk-RVM5N5ZI.cjs');
30
-
31
-
32
- var _chunk7NSHGJWYcjs = require('../chunk-7NSHGJWY.cjs');
33
- require('../chunk-SVQE7WVB.cjs');
34
- require('../chunk-HESFC24Z.cjs');
35
-
36
-
37
-
38
-
39
- var _chunk3NWKPYIGcjs = require('../chunk-3NWKPYIG.cjs');
40
- require('../chunk-IRCFHYKZ.cjs');
41
- require('../chunk-USNT2KNT.cjs');
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
- exports.CONSOLE_ICONS = _chunkXY2LDOQ4cjs.CONSOLE_ICONS; exports.createLogger = _chunkXIVRONKMcjs.createLogger; exports.formatLogMessage = _chunkC4RHWKK6cjs.formatLogMessage; exports.formatTimestamp = _chunk7NSHGJWYcjs.formatTimestamp; exports.getChalk = _chunkSLGVSUEVcjs.getChalk; exports.getLogFn = _chunkC4RHWKK6cjs.getLogFn; exports.getLogLevel = _chunk3NWKPYIGcjs.getLogLevel; exports.getLogLevelLabel = _chunk3NWKPYIGcjs.getLogLevelLabel; exports.getStopwatch = _chunkC4RHWKK6cjs.getStopwatch; exports.isUnicodeSupported = _chunkRVM5N5ZIcjs.isUnicodeSupported; exports.isVerbose = _chunk3NWKPYIGcjs.isVerbose; exports.writeDebug = _chunkC4RHWKK6cjs.writeDebug; exports.writeError = _chunkC4RHWKK6cjs.writeError; exports.writeFatal = _chunkC4RHWKK6cjs.writeFatal; exports.writeInfo = _chunkC4RHWKK6cjs.writeInfo; exports.writeSuccess = _chunkC4RHWKK6cjs.writeSuccess; exports.writeSystem = _chunkC4RHWKK6cjs.writeSystem; exports.writeTrace = _chunkC4RHWKK6cjs.writeTrace; exports.writeWarning = _chunkC4RHWKK6cjs.writeWarning;
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 _chalk = require('./chalk'); _createStarExport(_chalk);
2
+ var _console = require('./console'); _createStarExport(_console);
3
+ var _consoleicons = require('./console-icons'); _createStarExport(_consoleicons);
4
+ var _createlogger = require('./create-logger'); _createStarExport(_createlogger);
5
+ var _formattimestamp = require('./format-timestamp'); _createStarExport(_formattimestamp);
6
+ var _getloglevel = require('./get-log-level'); _createStarExport(_getloglevel);
7
+ var _isunicodesupported = require('./is-unicode-supported'); _createStarExport(_isunicodesupported);
@@ -1,62 +1,7 @@
1
- import "../chunk-RRKB32OH.js";
2
- import {
3
- createLogger
4
- } from "../chunk-Q7MMWMEN.js";
5
- import {
6
- formatLogMessage,
7
- getLogFn,
8
- getStopwatch,
9
- writeDebug,
10
- writeError,
11
- writeFatal,
12
- writeInfo,
13
- writeSuccess,
14
- writeSystem,
15
- writeTrace,
16
- writeWarning
17
- } from "../chunk-23WUCNWX.js";
18
- import "../chunk-GZFXEQPB.js";
19
- import "../chunk-OIEEXHKO.js";
20
- import "../chunk-XQPQRRG3.js";
21
- import {
22
- getChalk
23
- } from "../chunk-ZA4IO7YJ.js";
24
- import {
25
- CONSOLE_ICONS
26
- } from "../chunk-IUT7Y2UY.js";
27
- import {
28
- isUnicodeSupported
29
- } from "../chunk-QBS3OCHH.js";
30
- import {
31
- formatTimestamp
32
- } from "../chunk-PR7RQHRE.js";
33
- import "../chunk-6T3V5XJK.js";
34
- import "../chunk-MLUBD3PU.js";
35
- import {
36
- getLogLevel,
37
- getLogLevelLabel,
38
- isVerbose
39
- } from "../chunk-HI33NNPB.js";
40
- import "../chunk-POXTJ6GF.js";
41
- import "../chunk-SHUYVCID.js";
42
- export {
43
- CONSOLE_ICONS,
44
- createLogger,
45
- formatLogMessage,
46
- formatTimestamp,
47
- getChalk,
48
- getLogFn,
49
- getLogLevel,
50
- getLogLevelLabel,
51
- getStopwatch,
52
- isUnicodeSupported,
53
- isVerbose,
54
- writeDebug,
55
- writeError,
56
- writeFatal,
57
- writeInfo,
58
- writeSuccess,
59
- writeSystem,
60
- writeTrace,
61
- writeWarning
62
- };
1
+ export * from "./chalk";
2
+ export * from "./console";
3
+ export * from "./console-icons";
4
+ export * from "./create-logger";
5
+ export * from "./format-timestamp";
6
+ export * from "./get-log-level";
7
+ export * from "./is-unicode-supported";
@@ -1,7 +1,19 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkRVM5N5ZIcjs = require('../chunk-RVM5N5ZI.cjs');
4
- require('../chunk-USNT2KNT.cjs');
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _nodeprocess = require('node:process'); var _nodeprocess2 = _interopRequireDefault(_nodeprocess);
5
+ function isUnicodeSupported() {
6
+ const { env } = _nodeprocess2.default;
7
+ const { TERM, TERM_PROGRAM } = env;
8
+ if (_nodeprocess2.default.platform !== "win32") {
9
+ return TERM !== "linux";
10
+ }
11
+ return Boolean(env.WT_SESSION) || // Windows Terminal
12
+ Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
13
+ env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
14
+ TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
15
+ }
16
+ _chunkUSNT2KNTcjs.__name.call(void 0, isUnicodeSupported, "isUnicodeSupported");
5
17
 
6
18
 
7
- exports.isUnicodeSupported = _chunkRVM5N5ZIcjs.isUnicodeSupported;
19
+ exports.isUnicodeSupported = isUnicodeSupported;
@@ -1,7 +1,19 @@
1
1
  import {
2
- isUnicodeSupported
3
- } from "../chunk-QBS3OCHH.js";
4
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import process from "node:process";
5
+ function isUnicodeSupported() {
6
+ const { env } = process;
7
+ const { TERM, TERM_PROGRAM } = env;
8
+ if (process.platform !== "win32") {
9
+ return TERM !== "linux";
10
+ }
11
+ return Boolean(env.WT_SESSION) || // Windows Terminal
12
+ Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
13
+ env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
14
+ TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
15
+ }
16
+ __name(isUnicodeSupported, "isUnicodeSupported");
5
17
  export {
6
18
  isUnicodeSupported
7
19
  };
package/dist/types.cjs CHANGED
@@ -1,9 +1,27 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-USNT2KNT.cjs');
2
+ const LogLevel = {
3
+ SILENT: 0,
4
+ FATAL: 10,
5
+ ERROR: 20,
6
+ WARN: 30,
7
+ SUCCESS: 35,
8
+ INFO: 40,
9
+ DEBUG: 60,
10
+ TRACE: 70,
11
+ ALL: 100
12
+ };
13
+ const LogLevelLabel = {
14
+ SILENT: "silent",
15
+ FATAL: "fatal",
16
+ ERROR: "error",
17
+ WARN: "warn",
18
+ SUCCESS: "success",
19
+ INFO: "info",
20
+ DEBUG: "debug",
21
+ TRACE: "trace",
22
+ ALL: "all"
23
+ };
2
24
 
3
25
 
4
- var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
5
- require('./chunk-USNT2KNT.cjs');
6
26
 
7
-
8
-
9
- exports.LogLevel = _chunkIRCFHYKZcjs.LogLevel; exports.LogLevelLabel = _chunkIRCFHYKZcjs.LogLevelLabel;
27
+ exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel;
package/dist/types.js CHANGED
@@ -1,8 +1,26 @@
1
- import {
2
- LogLevel,
3
- LogLevelLabel
4
- } from "./chunk-POXTJ6GF.js";
5
1
  import "./chunk-SHUYVCID.js";
2
+ const LogLevel = {
3
+ SILENT: 0,
4
+ FATAL: 10,
5
+ ERROR: 20,
6
+ WARN: 30,
7
+ SUCCESS: 35,
8
+ INFO: 40,
9
+ DEBUG: 60,
10
+ TRACE: 70,
11
+ ALL: 100
12
+ };
13
+ const LogLevelLabel = {
14
+ SILENT: "silent",
15
+ FATAL: "fatal",
16
+ ERROR: "error",
17
+ WARN: "warn",
18
+ SUCCESS: "success",
19
+ INFO: "info",
20
+ DEBUG: "debug",
21
+ TRACE: "trace",
22
+ ALL: "all"
23
+ };
6
24
  export {
7
25
  LogLevel,
8
26
  LogLevelLabel
@@ -1,14 +1,60 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _findworkspaceroot = require('./find-workspace-root');
5
+ const applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (option, tokenParams) => {
6
+ let result = option;
7
+ if (!result) {
8
+ return result;
9
+ }
10
+ if (tokenParams) {
11
+ const optionKeys = Object.keys(tokenParams);
12
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
13
+ for (const optionKey of optionKeys) {
14
+ if (result.includes(`{${optionKey}}`)) {
15
+ result = result.replaceAll(`{${optionKey}}`, _optionalChain([tokenParams, 'optionalAccess', _ => _[optionKey]]) || "");
16
+ }
17
+ }
18
+ }
19
+ }
20
+ if (tokenParams.config) {
21
+ const configKeys = Object.keys(tokenParams.config);
22
+ if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
23
+ for (const configKey of configKeys) {
24
+ if (result.includes(`{${configKey}}`)) {
25
+ result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (result.includes("{workspaceRoot}")) {
31
+ result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _2 => _2.config, 'optionalAccess', _3 => _3.workspaceRoot]))), () => ( _findworkspaceroot.findWorkspaceRoot.call(void 0, ))));
32
+ }
33
+ return result;
34
+ }, "applyWorkspaceBaseTokens");
35
+ const applyWorkspaceProjectTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (option, tokenParams) => {
36
+ return applyWorkspaceBaseTokens(option, tokenParams);
37
+ }, "applyWorkspaceProjectTokens");
38
+ const applyWorkspaceTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (options, tokenParams, tokenizerFn) => {
39
+ if (!options) {
40
+ return {};
41
+ }
42
+ const result = {};
43
+ for (const option of Object.keys(options)) {
44
+ if (typeof options[option] === "string") {
45
+ result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
46
+ } else if (Array.isArray(options[option])) {
47
+ result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
48
+ } else if (typeof options[option] === "object") {
49
+ result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
50
+ } else {
51
+ result[option] = options[option];
52
+ }
53
+ }
54
+ return result;
55
+ }, "applyWorkspaceTokens");
3
56
 
4
57
 
5
- var _chunk4DLP6LZYcjs = require('../chunk-4DLP6LZY.cjs');
6
- require('../chunk-KNLWLA7O.cjs');
7
- require('../chunk-SWX2MJHI.cjs');
8
- require('../chunk-HESFC24Z.cjs');
9
- require('../chunk-USNT2KNT.cjs');
10
58
 
11
59
 
12
-
13
-
14
- exports.applyWorkspaceBaseTokens = _chunk4DLP6LZYcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunk4DLP6LZYcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunk4DLP6LZYcjs.applyWorkspaceTokens;
60
+ exports.applyWorkspaceBaseTokens = applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = applyWorkspaceTokens;
@@ -1,12 +1,58 @@
1
1
  import {
2
- applyWorkspaceBaseTokens,
3
- applyWorkspaceProjectTokens,
4
- applyWorkspaceTokens
5
- } from "../chunk-6OM23J4N.js";
6
- import "../chunk-OIEEXHKO.js";
7
- import "../chunk-XQPQRRG3.js";
8
- import "../chunk-MLUBD3PU.js";
9
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { findWorkspaceRoot } from "./find-workspace-root";
5
+ const applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams) => {
6
+ let result = option;
7
+ if (!result) {
8
+ return result;
9
+ }
10
+ if (tokenParams) {
11
+ const optionKeys = Object.keys(tokenParams);
12
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
13
+ for (const optionKey of optionKeys) {
14
+ if (result.includes(`{${optionKey}}`)) {
15
+ result = result.replaceAll(`{${optionKey}}`, tokenParams?.[optionKey] || "");
16
+ }
17
+ }
18
+ }
19
+ }
20
+ if (tokenParams.config) {
21
+ const configKeys = Object.keys(tokenParams.config);
22
+ if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
23
+ for (const configKey of configKeys) {
24
+ if (result.includes(`{${configKey}}`)) {
25
+ result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (result.includes("{workspaceRoot}")) {
31
+ result = result.replaceAll("{workspaceRoot}", tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot());
32
+ }
33
+ return result;
34
+ }, "applyWorkspaceBaseTokens");
35
+ const applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option, tokenParams) => {
36
+ return applyWorkspaceBaseTokens(option, tokenParams);
37
+ }, "applyWorkspaceProjectTokens");
38
+ const applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, tokenParams, tokenizerFn) => {
39
+ if (!options) {
40
+ return {};
41
+ }
42
+ const result = {};
43
+ for (const option of Object.keys(options)) {
44
+ if (typeof options[option] === "string") {
45
+ result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
46
+ } else if (Array.isArray(options[option])) {
47
+ result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
48
+ } else if (typeof options[option] === "object") {
49
+ result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
50
+ } else {
51
+ result[option] = options[option];
52
+ }
53
+ }
54
+ return result;
55
+ }, "applyWorkspaceTokens");
10
56
  export {
11
57
  applyWorkspaceBaseTokens,
12
58
  applyWorkspaceProjectTokens,