@storm-software/config-tools 1.190.119 → 1.190.120

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 (114) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +20 -1532
  3. package/bin/config.js +19 -1527
  4. package/dist/config-file/get-config-file.cjs +80 -25
  5. package/dist/config-file/get-config-file.js +79 -24
  6. package/dist/config-file/index.cjs +1 -29
  7. package/dist/config-file/index.js +1 -29
  8. package/dist/create-storm-config.cjs +138 -26
  9. package/dist/create-storm-config.js +140 -28
  10. package/dist/env/get-env.cjs +221 -6
  11. package/dist/env/get-env.js +221 -6
  12. package/dist/env/index.cjs +2 -18
  13. package/dist/env/index.js +2 -18
  14. package/dist/env/set-env.cjs +383 -8
  15. package/dist/env/set-env.js +382 -7
  16. package/dist/get-config.cjs +28 -27
  17. package/dist/get-config.js +29 -28
  18. package/dist/index.cjs +7 -201
  19. package/dist/index.js +7 -201
  20. package/dist/logger/chalk.cjs +32 -4
  21. package/dist/logger/chalk.js +31 -3
  22. package/dist/logger/console-icons.cjs +15 -6
  23. package/dist/logger/console-icons.js +14 -5
  24. package/dist/logger/console.cjs +191 -37
  25. package/dist/logger/console.js +176 -22
  26. package/dist/logger/create-logger.cjs +25 -12
  27. package/dist/logger/create-logger.js +24 -11
  28. package/dist/logger/format-timestamp.cjs +4 -4
  29. package/dist/logger/format-timestamp.js +3 -3
  30. package/dist/logger/get-log-level.cjs +60 -7
  31. package/dist/logger/get-log-level.js +59 -6
  32. package/dist/logger/index.cjs +7 -61
  33. package/dist/logger/index.js +7 -61
  34. package/dist/logger/is-unicode-supported.cjs +10 -4
  35. package/dist/logger/is-unicode-supported.js +9 -3
  36. package/dist/types.cjs +25 -5
  37. package/dist/types.js +24 -4
  38. package/dist/utilities/apply-workspace-tokens.cjs +72 -9
  39. package/dist/utilities/apply-workspace-tokens.js +71 -8
  40. package/dist/utilities/colors.cjs +76 -7
  41. package/dist/utilities/colors.js +75 -6
  42. package/dist/utilities/correct-paths.cjs +231 -32
  43. package/dist/utilities/correct-paths.js +215 -16
  44. package/dist/utilities/file-path-utils.cjs +29 -7
  45. package/dist/utilities/file-path-utils.js +28 -6
  46. package/dist/utilities/find-up.cjs +21 -4
  47. package/dist/utilities/find-up.js +20 -3
  48. package/dist/utilities/find-workspace-root.cjs +74 -7
  49. package/dist/utilities/find-workspace-root.js +73 -6
  50. package/dist/utilities/get-default-config.cjs +90 -6
  51. package/dist/utilities/get-default-config.js +90 -6
  52. package/dist/utilities/index.cjs +9 -109
  53. package/dist/utilities/index.js +9 -109
  54. package/dist/utilities/process-handler.cjs +46 -11
  55. package/dist/utilities/process-handler.js +47 -12
  56. package/dist/utilities/run.cjs +34 -6
  57. package/dist/utilities/run.js +33 -5
  58. package/dist/utilities/toml.cjs +42 -24
  59. package/dist/utilities/toml.js +35 -17
  60. package/package.json +4 -4
  61. package/dist/chunk-24B36RDB.cjs +0 -81
  62. package/dist/chunk-27N3QEX5.js +0 -40
  63. package/dist/chunk-2AVLCXLT.js +0 -0
  64. package/dist/chunk-2RLMTBVZ.js +0 -233
  65. package/dist/chunk-2WBD2G3E.cjs +0 -38
  66. package/dist/chunk-3COHMHPU.cjs +0 -1
  67. package/dist/chunk-4Q45WJYQ.js +0 -165
  68. package/dist/chunk-5C7PIENF.js +0 -92
  69. package/dist/chunk-5J2SS4QU.js +0 -83
  70. package/dist/chunk-65SWKEHV.cjs +0 -1
  71. package/dist/chunk-6Y623TCS.cjs +0 -40
  72. package/dist/chunk-7PV6L7I7.cjs +0 -1
  73. package/dist/chunk-7QBTVNMR.cjs +0 -30
  74. package/dist/chunk-BDATZ3UB.cjs +0 -233
  75. package/dist/chunk-BZRTSWH4.cjs +0 -395
  76. package/dist/chunk-D3FRXXDE.js +0 -947
  77. package/dist/chunk-DTGT4OI3.cjs +0 -14
  78. package/dist/chunk-EC2KPWRG.cjs +0 -24
  79. package/dist/chunk-EENQN6N2.js +0 -40
  80. package/dist/chunk-ENI4UUSK.cjs +0 -35
  81. package/dist/chunk-FJNXECWU.js +0 -395
  82. package/dist/chunk-FMDVBSP6.cjs +0 -83
  83. package/dist/chunk-G2MK47WL.js +0 -14
  84. package/dist/chunk-HFS7WJVW.js +0 -81
  85. package/dist/chunk-HVVJHTFS.js +0 -36
  86. package/dist/chunk-IWD6YQKX.cjs +0 -1
  87. package/dist/chunk-IWQRXQ4N.cjs +0 -84
  88. package/dist/chunk-JK4TT5IV.js +0 -35
  89. package/dist/chunk-JWLDCEBZ.cjs +0 -70
  90. package/dist/chunk-JZAYHDV3.js +0 -8
  91. package/dist/chunk-KSMN3HSC.js +0 -38
  92. package/dist/chunk-L6UNTUC4.js +0 -0
  93. package/dist/chunk-LOY6ICHZ.cjs +0 -36
  94. package/dist/chunk-MBG2FTBL.cjs +0 -47
  95. package/dist/chunk-MQG74XF7.js +0 -102
  96. package/dist/chunk-MSAQEGBK.cjs +0 -92
  97. package/dist/chunk-NJFLUTGH.cjs +0 -25
  98. package/dist/chunk-PCYB64MB.cjs +0 -40
  99. package/dist/chunk-RALMUN5C.js +0 -30
  100. package/dist/chunk-RRKB32OH.js +0 -0
  101. package/dist/chunk-RUKM6FCF.js +0 -25
  102. package/dist/chunk-SIW7AXUG.js +0 -56
  103. package/dist/chunk-SLICWTO2.cjs +0 -165
  104. package/dist/chunk-SO3FWVXC.js +0 -84
  105. package/dist/chunk-SXPH7ILL.js +0 -70
  106. package/dist/chunk-T7YISGRS.cjs +0 -102
  107. package/dist/chunk-TZZRLM5J.cjs +0 -947
  108. package/dist/chunk-UJ77IBHD.cjs +0 -233
  109. package/dist/chunk-UKGRDKIH.js +0 -0
  110. package/dist/chunk-V3GMJ4TX.js +0 -233
  111. package/dist/chunk-WQJYIPSL.cjs +0 -8
  112. package/dist/chunk-YBVOKYAM.cjs +0 -56
  113. package/dist/chunk-YX4736HU.js +0 -47
  114. package/dist/chunk-ZFNAUMQS.js +0 -24
@@ -1,9 +1,62 @@
1
- import {
2
- getLogLevel,
3
- getLogLevelLabel,
4
- isVerbose
5
- } from "../chunk-SXPH7ILL.js";
6
- import "../chunk-RALMUN5C.js";
1
+ import { LogLevel, LogLevelLabel } from "../types";
2
+ const getLogLevel = (label) => {
3
+ switch (label) {
4
+ case "all":
5
+ return LogLevel.ALL;
6
+ case "trace":
7
+ return LogLevel.TRACE;
8
+ case "debug":
9
+ return LogLevel.DEBUG;
10
+ case "performance":
11
+ return LogLevel.PERFORMANCE;
12
+ case "info":
13
+ return LogLevel.INFO;
14
+ case "warn":
15
+ return LogLevel.WARN;
16
+ case "error":
17
+ return LogLevel.ERROR;
18
+ case "fatal":
19
+ return LogLevel.FATAL;
20
+ case "silent":
21
+ return LogLevel.SILENT;
22
+ default:
23
+ return LogLevel.INFO;
24
+ }
25
+ };
26
+ const getLogLevelLabel = (logLevel = LogLevel.INFO) => {
27
+ if (logLevel >= LogLevel.ALL) {
28
+ return LogLevelLabel.ALL;
29
+ }
30
+ if (logLevel >= LogLevel.TRACE) {
31
+ return LogLevelLabel.TRACE;
32
+ }
33
+ if (logLevel >= LogLevel.DEBUG) {
34
+ return LogLevelLabel.DEBUG;
35
+ }
36
+ if (logLevel >= LogLevel.PERFORMANCE) {
37
+ return LogLevelLabel.PERFORMANCE;
38
+ }
39
+ if (logLevel >= LogLevel.INFO) {
40
+ return LogLevelLabel.INFO;
41
+ }
42
+ if (logLevel >= LogLevel.WARN) {
43
+ return LogLevelLabel.WARN;
44
+ }
45
+ if (logLevel >= LogLevel.ERROR) {
46
+ return LogLevelLabel.ERROR;
47
+ }
48
+ if (logLevel >= LogLevel.FATAL) {
49
+ return LogLevelLabel.FATAL;
50
+ }
51
+ if (logLevel <= LogLevel.SILENT) {
52
+ return LogLevelLabel.SILENT;
53
+ }
54
+ return LogLevelLabel.INFO;
55
+ };
56
+ const isVerbose = (label = LogLevelLabel.SILENT) => {
57
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
58
+ return logLevel >= LogLevel.DEBUG;
59
+ };
7
60
  export {
8
61
  getLogLevel,
9
62
  getLogLevelLabel,
@@ -1,61 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-7PV6L7I7.cjs');
2
-
3
-
4
- var _chunkENI4UUSKcjs = require('../chunk-ENI4UUSK.cjs');
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
- var _chunkTZZRLM5Jcjs = require('../chunk-TZZRLM5J.cjs');
20
- require('../chunk-FMDVBSP6.cjs');
21
-
22
-
23
- var _chunkLOY6ICHZcjs = require('../chunk-LOY6ICHZ.cjs');
24
-
25
-
26
- var _chunkEC2KPWRGcjs = require('../chunk-EC2KPWRG.cjs');
27
-
28
-
29
- var _chunkDTGT4OI3cjs = require('../chunk-DTGT4OI3.cjs');
30
-
31
-
32
- var _chunkWQJYIPSLcjs = require('../chunk-WQJYIPSL.cjs');
33
-
34
-
35
-
36
-
37
- var _chunkJWLDCEBZcjs = require('../chunk-JWLDCEBZ.cjs');
38
- require('../chunk-7QBTVNMR.cjs');
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
- exports.CONSOLE_ICONS = _chunkEC2KPWRGcjs.CONSOLE_ICONS; exports.brandIcon = _chunkTZZRLM5Jcjs.brandIcon; exports.createLogger = _chunkENI4UUSKcjs.createLogger; exports.formatLogMessage = _chunkTZZRLM5Jcjs.formatLogMessage; exports.formatTimestamp = _chunkWQJYIPSLcjs.formatTimestamp; exports.getChalk = _chunkLOY6ICHZcjs.getChalk; exports.getLogFn = _chunkTZZRLM5Jcjs.getLogFn; exports.getLogLevel = _chunkJWLDCEBZcjs.getLogLevel; exports.getLogLevelLabel = _chunkJWLDCEBZcjs.getLogLevelLabel; exports.getStopwatch = _chunkTZZRLM5Jcjs.getStopwatch; exports.isUnicodeSupported = _chunkDTGT4OI3cjs.isUnicodeSupported; exports.isVerbose = _chunkJWLDCEBZcjs.isVerbose; exports.writeDebug = _chunkTZZRLM5Jcjs.writeDebug; exports.writeError = _chunkTZZRLM5Jcjs.writeError; exports.writeFatal = _chunkTZZRLM5Jcjs.writeFatal; exports.writeInfo = _chunkTZZRLM5Jcjs.writeInfo; exports.writePerformance = _chunkTZZRLM5Jcjs.writePerformance; exports.writeSuccess = _chunkTZZRLM5Jcjs.writeSuccess; exports.writeSystem = _chunkTZZRLM5Jcjs.writeSystem; exports.writeTrace = _chunkTZZRLM5Jcjs.writeTrace; exports.writeWarning = _chunkTZZRLM5Jcjs.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,61 +1,7 @@
1
- import "../chunk-RRKB32OH.js";
2
- import {
3
- createLogger
4
- } from "../chunk-JK4TT5IV.js";
5
- import {
6
- brandIcon,
7
- formatLogMessage,
8
- getLogFn,
9
- getStopwatch,
10
- writeDebug,
11
- writeError,
12
- writeFatal,
13
- writeInfo,
14
- writePerformance,
15
- writeSuccess,
16
- writeSystem,
17
- writeTrace,
18
- writeWarning
19
- } from "../chunk-D3FRXXDE.js";
20
- import "../chunk-5J2SS4QU.js";
21
- import {
22
- getChalk
23
- } from "../chunk-HVVJHTFS.js";
24
- import {
25
- CONSOLE_ICONS
26
- } from "../chunk-ZFNAUMQS.js";
27
- import {
28
- isUnicodeSupported
29
- } from "../chunk-G2MK47WL.js";
30
- import {
31
- formatTimestamp
32
- } from "../chunk-JZAYHDV3.js";
33
- import {
34
- getLogLevel,
35
- getLogLevelLabel,
36
- isVerbose
37
- } from "../chunk-SXPH7ILL.js";
38
- import "../chunk-RALMUN5C.js";
39
- export {
40
- CONSOLE_ICONS,
41
- brandIcon,
42
- createLogger,
43
- formatLogMessage,
44
- formatTimestamp,
45
- getChalk,
46
- getLogFn,
47
- getLogLevel,
48
- getLogLevelLabel,
49
- getStopwatch,
50
- isUnicodeSupported,
51
- isVerbose,
52
- writeDebug,
53
- writeError,
54
- writeFatal,
55
- writeInfo,
56
- writePerformance,
57
- writeSuccess,
58
- writeSystem,
59
- writeTrace,
60
- writeWarning
61
- };
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,6 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});function isUnicodeSupported() {
2
+ if (process.platform !== "win32") {
3
+ return process.env.TERM !== "linux";
4
+ }
5
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
6
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
7
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
8
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
9
+ }
2
10
 
3
- var _chunkDTGT4OI3cjs = require('../chunk-DTGT4OI3.cjs');
4
11
 
5
-
6
- exports.isUnicodeSupported = _chunkDTGT4OI3cjs.isUnicodeSupported;
12
+ exports.isUnicodeSupported = isUnicodeSupported;
@@ -1,6 +1,12 @@
1
- import {
2
- isUnicodeSupported
3
- } from "../chunk-G2MK47WL.js";
1
+ function isUnicodeSupported() {
2
+ if (process.platform !== "win32") {
3
+ return process.env.TERM !== "linux";
4
+ }
5
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
6
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
7
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
8
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
9
+ }
4
10
  export {
5
11
  isUnicodeSupported
6
12
  };
package/dist/types.cjs CHANGED
@@ -1,8 +1,28 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});const LogLevel = {
2
+ SILENT: 0,
3
+ FATAL: 10,
4
+ ERROR: 20,
5
+ WARN: 30,
6
+ SUCCESS: 35,
7
+ INFO: 40,
8
+ PERFORMANCE: 50,
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
+ PERFORMANCE: "performance",
21
+ DEBUG: "debug",
22
+ TRACE: "trace",
23
+ ALL: "all"
24
+ };
2
25
 
3
26
 
4
- var _chunk7QBTVNMRcjs = require('./chunk-7QBTVNMR.cjs');
5
27
 
6
-
7
-
8
- exports.LogLevel = _chunk7QBTVNMRcjs.LogLevel; exports.LogLevelLabel = _chunk7QBTVNMRcjs.LogLevelLabel;
28
+ exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel;
package/dist/types.js CHANGED
@@ -1,7 +1,27 @@
1
- import {
2
- LogLevel,
3
- LogLevelLabel
4
- } from "./chunk-RALMUN5C.js";
1
+ const LogLevel = {
2
+ SILENT: 0,
3
+ FATAL: 10,
4
+ ERROR: 20,
5
+ WARN: 30,
6
+ SUCCESS: 35,
7
+ INFO: 40,
8
+ PERFORMANCE: 50,
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
+ PERFORMANCE: "performance",
21
+ DEBUG: "debug",
22
+ TRACE: "trace",
23
+ ALL: "all"
24
+ };
5
25
  export {
6
26
  LogLevel,
7
27
  LogLevelLabel
@@ -1,13 +1,76 @@
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; }var _findworkspaceroot = require('./find-workspace-root');
2
+ const applyWorkspaceBaseTokens = async (option, tokenParams) => {
3
+ let result = option;
4
+ if (!result) {
5
+ return result;
6
+ }
7
+ if (tokenParams) {
8
+ const optionKeys = Object.keys(tokenParams);
9
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
10
+ for (const optionKey of optionKeys) {
11
+ if (result.includes(`{${optionKey}}`)) {
12
+ result = result.replaceAll(
13
+ `{${optionKey}}`,
14
+ _optionalChain([tokenParams, 'optionalAccess', _ => _[optionKey]]) || ""
15
+ );
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(
26
+ `{${configKey}}`,
27
+ tokenParams.config[configKey] || ""
28
+ );
29
+ }
30
+ }
31
+ }
32
+ }
33
+ if (result.includes("{workspaceRoot}")) {
34
+ result = result.replaceAll(
35
+ "{workspaceRoot}",
36
+ _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _2 => _2.config, 'optionalAccess', _3 => _3.workspaceRoot]))), () => ( _findworkspaceroot.findWorkspaceRoot.call(void 0, )))
37
+ );
38
+ }
39
+ return result;
40
+ };
41
+ const applyWorkspaceProjectTokens = (option, tokenParams) => {
42
+ return applyWorkspaceBaseTokens(option, tokenParams);
43
+ };
44
+ const applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
45
+ if (!options) {
46
+ return {};
47
+ }
48
+ const result = {};
49
+ for (const option of Object.keys(options)) {
50
+ if (typeof options[option] === "string") {
51
+ result[option] = await Promise.resolve(
52
+ tokenizerFn(options[option], tokenParams)
53
+ );
54
+ } else if (Array.isArray(options[option])) {
55
+ result[option] = await Promise.all(
56
+ options[option].map(
57
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
58
+ )
59
+ );
60
+ } else if (typeof options[option] === "object") {
61
+ result[option] = await applyWorkspaceTokens(
62
+ options[option],
63
+ tokenParams,
64
+ tokenizerFn
65
+ );
66
+ } else {
67
+ result[option] = options[option];
68
+ }
69
+ }
70
+ return result;
71
+ };
2
72
 
3
73
 
4
74
 
5
- var _chunk24B36RDBcjs = require('../chunk-24B36RDB.cjs');
6
- require('../chunk-IWQRXQ4N.cjs');
7
- require('../chunk-NJFLUTGH.cjs');
8
- require('../chunk-BDATZ3UB.cjs');
9
75
 
10
-
11
-
12
-
13
- exports.applyWorkspaceBaseTokens = _chunk24B36RDBcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunk24B36RDBcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunk24B36RDBcjs.applyWorkspaceTokens;
76
+ exports.applyWorkspaceBaseTokens = applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = applyWorkspaceTokens;
@@ -1,11 +1,74 @@
1
- import {
2
- applyWorkspaceBaseTokens,
3
- applyWorkspaceProjectTokens,
4
- applyWorkspaceTokens
5
- } from "../chunk-HFS7WJVW.js";
6
- import "../chunk-SO3FWVXC.js";
7
- import "../chunk-RUKM6FCF.js";
8
- import "../chunk-V3GMJ4TX.js";
1
+ import { findWorkspaceRoot } from "./find-workspace-root";
2
+ const applyWorkspaceBaseTokens = async (option, tokenParams) => {
3
+ let result = option;
4
+ if (!result) {
5
+ return result;
6
+ }
7
+ if (tokenParams) {
8
+ const optionKeys = Object.keys(tokenParams);
9
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
10
+ for (const optionKey of optionKeys) {
11
+ if (result.includes(`{${optionKey}}`)) {
12
+ result = result.replaceAll(
13
+ `{${optionKey}}`,
14
+ tokenParams?.[optionKey] || ""
15
+ );
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(
26
+ `{${configKey}}`,
27
+ tokenParams.config[configKey] || ""
28
+ );
29
+ }
30
+ }
31
+ }
32
+ }
33
+ if (result.includes("{workspaceRoot}")) {
34
+ result = result.replaceAll(
35
+ "{workspaceRoot}",
36
+ tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
37
+ );
38
+ }
39
+ return result;
40
+ };
41
+ const applyWorkspaceProjectTokens = (option, tokenParams) => {
42
+ return applyWorkspaceBaseTokens(option, tokenParams);
43
+ };
44
+ const applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
45
+ if (!options) {
46
+ return {};
47
+ }
48
+ const result = {};
49
+ for (const option of Object.keys(options)) {
50
+ if (typeof options[option] === "string") {
51
+ result[option] = await Promise.resolve(
52
+ tokenizerFn(options[option], tokenParams)
53
+ );
54
+ } else if (Array.isArray(options[option])) {
55
+ result[option] = await Promise.all(
56
+ options[option].map(
57
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
58
+ )
59
+ );
60
+ } else if (typeof options[option] === "object") {
61
+ result[option] = await applyWorkspaceTokens(
62
+ options[option],
63
+ tokenParams,
64
+ tokenizerFn
65
+ );
66
+ } else {
67
+ result[option] = options[option];
68
+ }
69
+ }
70
+ return result;
71
+ };
9
72
  export {
10
73
  applyWorkspaceBaseTokens,
11
74
  applyWorkspaceProjectTokens,
@@ -1,12 +1,81 @@
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; }const DEFAULT_COLOR_CONFIG = {
2
+ light: {
3
+ background: "#fafafa",
4
+ foreground: "#1d1e22",
5
+ brand: "#1fb2a6",
6
+ alternate: "#db2777",
7
+ discovery: "#5C4EE5",
8
+ success: "#087f5b",
9
+ info: "#0550ae",
10
+ debug: "#8afafc",
11
+ warning: "#e3b341",
12
+ danger: "#D8314A",
13
+ fatal: "#51070f",
14
+ performance: "#13c302",
15
+ link: "#3fa6ff",
16
+ positive: "#22c55e",
17
+ negative: "#dc2626",
18
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
19
+ },
20
+ dark: {
21
+ background: "#1e2124",
22
+ foreground: "#cbd5e1",
23
+ brand: "#2dd4bf",
24
+ alternate: "#db2777",
25
+ discovery: "#818cf8",
26
+ success: "#10b981",
27
+ info: "#58a6ff",
28
+ debug: "#8afafc",
29
+ warning: "#f3d371",
30
+ danger: "#D8314A",
31
+ fatal: "#a40e26",
32
+ performance: "#80fd74",
33
+ link: "#3fa6ff",
34
+ positive: "#22c55e",
35
+ negative: "#dc2626",
36
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
37
+ }
38
+ };
39
+ function getColors(config) {
40
+ if (!_optionalChain([config, 'optionalAccess', _ => _.colors]) || typeof config.colors !== "object" || !config.colors["dark"] && (!config.colors["base"] || typeof config.colors !== "object" || !_optionalChain([config, 'access', _2 => _2.colors, 'access', _3 => _3["base"], 'optionalAccess', _4 => _4["dark"]]))) {
41
+ return DEFAULT_COLOR_CONFIG;
42
+ }
43
+ if (config.colors["base"]) {
44
+ if (typeof config.colors["base"]["dark"] === "object") {
45
+ return config.colors["base"]["dark"];
46
+ } else if (config.colors["base"]["dark"] === "string") {
47
+ return config.colors["base"];
48
+ }
49
+ }
50
+ if (typeof config.colors["dark"] === "object") {
51
+ return config.colors["dark"];
52
+ }
53
+ return _nullishCoalesce(config.colors, () => ( DEFAULT_COLOR_CONFIG));
54
+ }
55
+ function getColor(key, config) {
56
+ const colors = getColors(config);
57
+ const result = (typeof colors["dark"] === "object" ? colors["dark"][key] : colors[key]) || DEFAULT_COLOR_CONFIG["dark"][key] || DEFAULT_COLOR_CONFIG[key];
58
+ if (result) {
59
+ return result;
60
+ }
61
+ if (key === "link" || key === "debug") {
62
+ return getColor("info", config);
63
+ } else if (key === "fatal") {
64
+ return getColor("danger", config);
65
+ }
66
+ return getColor("brand", config);
67
+ }
68
+ function getGradient(config) {
69
+ const colors = getColors(config);
70
+ const result = (typeof colors["dark"] === "object" ? colors["dark"].gradient : colors.gradient) || DEFAULT_COLOR_CONFIG["dark"].gradient;
71
+ if (result && Array.isArray(result) && result.length > 0) {
72
+ return result;
73
+ }
74
+ return void 0;
75
+ }
2
76
 
3
77
 
4
78
 
5
79
 
6
- var _chunkFMDVBSP6cjs = require('../chunk-FMDVBSP6.cjs');
7
80
 
8
-
9
-
10
-
11
-
12
- exports.DEFAULT_COLOR_CONFIG = _chunkFMDVBSP6cjs.DEFAULT_COLOR_CONFIG; exports.getColor = _chunkFMDVBSP6cjs.getColor; exports.getColors = _chunkFMDVBSP6cjs.getColors; exports.getGradient = _chunkFMDVBSP6cjs.getGradient;
81
+ exports.DEFAULT_COLOR_CONFIG = DEFAULT_COLOR_CONFIG; exports.getColor = getColor; exports.getColors = getColors; exports.getGradient = getGradient;
@@ -1,9 +1,78 @@
1
- import {
2
- DEFAULT_COLOR_CONFIG,
3
- getColor,
4
- getColors,
5
- getGradient
6
- } from "../chunk-5J2SS4QU.js";
1
+ const DEFAULT_COLOR_CONFIG = {
2
+ light: {
3
+ background: "#fafafa",
4
+ foreground: "#1d1e22",
5
+ brand: "#1fb2a6",
6
+ alternate: "#db2777",
7
+ discovery: "#5C4EE5",
8
+ success: "#087f5b",
9
+ info: "#0550ae",
10
+ debug: "#8afafc",
11
+ warning: "#e3b341",
12
+ danger: "#D8314A",
13
+ fatal: "#51070f",
14
+ performance: "#13c302",
15
+ link: "#3fa6ff",
16
+ positive: "#22c55e",
17
+ negative: "#dc2626",
18
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
19
+ },
20
+ dark: {
21
+ background: "#1e2124",
22
+ foreground: "#cbd5e1",
23
+ brand: "#2dd4bf",
24
+ alternate: "#db2777",
25
+ discovery: "#818cf8",
26
+ success: "#10b981",
27
+ info: "#58a6ff",
28
+ debug: "#8afafc",
29
+ warning: "#f3d371",
30
+ danger: "#D8314A",
31
+ fatal: "#a40e26",
32
+ performance: "#80fd74",
33
+ link: "#3fa6ff",
34
+ positive: "#22c55e",
35
+ negative: "#dc2626",
36
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
37
+ }
38
+ };
39
+ function getColors(config) {
40
+ if (!config?.colors || typeof config.colors !== "object" || !config.colors["dark"] && (!config.colors["base"] || typeof config.colors !== "object" || !config.colors["base"]?.["dark"])) {
41
+ return DEFAULT_COLOR_CONFIG;
42
+ }
43
+ if (config.colors["base"]) {
44
+ if (typeof config.colors["base"]["dark"] === "object") {
45
+ return config.colors["base"]["dark"];
46
+ } else if (config.colors["base"]["dark"] === "string") {
47
+ return config.colors["base"];
48
+ }
49
+ }
50
+ if (typeof config.colors["dark"] === "object") {
51
+ return config.colors["dark"];
52
+ }
53
+ return config.colors ?? DEFAULT_COLOR_CONFIG;
54
+ }
55
+ function getColor(key, config) {
56
+ const colors = getColors(config);
57
+ const result = (typeof colors["dark"] === "object" ? colors["dark"][key] : colors[key]) || DEFAULT_COLOR_CONFIG["dark"][key] || DEFAULT_COLOR_CONFIG[key];
58
+ if (result) {
59
+ return result;
60
+ }
61
+ if (key === "link" || key === "debug") {
62
+ return getColor("info", config);
63
+ } else if (key === "fatal") {
64
+ return getColor("danger", config);
65
+ }
66
+ return getColor("brand", config);
67
+ }
68
+ function getGradient(config) {
69
+ const colors = getColors(config);
70
+ const result = (typeof colors["dark"] === "object" ? colors["dark"].gradient : colors.gradient) || DEFAULT_COLOR_CONFIG["dark"].gradient;
71
+ if (result && Array.isArray(result) && result.length > 0) {
72
+ return result;
73
+ }
74
+ return void 0;
75
+ }
7
76
  export {
8
77
  DEFAULT_COLOR_CONFIG,
9
78
  getColor,