@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,9 +1,37 @@
1
1
  import {
2
- LARGE_BUFFER,
3
- run,
4
- runAsync
5
- } from "../chunk-BHZFTVXN.js";
6
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { exec, execSync } from "node:child_process";
5
+ const LARGE_BUFFER = 1024 * 1e6;
6
+ const run = /* @__PURE__ */ __name((config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
7
+ return execSync(command, {
8
+ cwd,
9
+ env: {
10
+ ...process.env,
11
+ ...env,
12
+ CLICOLOR: "true",
13
+ FORCE_COLOR: "true"
14
+ },
15
+ windowsHide: true,
16
+ stdio,
17
+ maxBuffer: LARGE_BUFFER,
18
+ killSignal: "SIGTERM"
19
+ });
20
+ }, "run");
21
+ const runAsync = /* @__PURE__ */ __name((config, command, cwd = config.workspaceRoot ?? process.cwd(), env = process.env) => {
22
+ return exec(command, {
23
+ cwd,
24
+ env: {
25
+ ...process.env,
26
+ ...env,
27
+ CLICOLOR: "true",
28
+ FORCE_COLOR: "true"
29
+ },
30
+ windowsHide: true,
31
+ maxBuffer: LARGE_BUFFER,
32
+ killSignal: "SIGTERM"
33
+ });
34
+ }, "runAsync");
7
35
  export {
8
36
  LARGE_BUFFER,
9
37
  run,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/config-tools",
3
- "version": "1.148.3",
3
+ "version": "1.148.4",
4
4
  "type": "module",
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "repository": {
@@ -1,142 +0,0 @@
1
- import {
2
- DEFAULT_COLOR_CONFIG
3
- } from "./chunk-GZFXEQPB.js";
4
- import {
5
- getChalk
6
- } from "./chunk-ZA4IO7YJ.js";
7
- import {
8
- CONSOLE_ICONS
9
- } from "./chunk-IUT7Y2UY.js";
10
- import {
11
- formatTimestamp
12
- } from "./chunk-PR7RQHRE.js";
13
- import {
14
- getLogLevel
15
- } from "./chunk-HI33NNPB.js";
16
- import {
17
- LogLevel,
18
- LogLevelLabel
19
- } from "./chunk-POXTJ6GF.js";
20
- import {
21
- __name
22
- } from "./chunk-SHUYVCID.js";
23
-
24
- // src/logger/console.ts
25
- var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
26
- const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
27
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
28
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
29
- return (_) => {
30
- };
31
- }
32
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
33
- return (message) => {
34
- console.error(`
35
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
36
- `);
37
- };
38
- }
39
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
40
- return (message) => {
41
- console.error(`
42
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
43
- `);
44
- };
45
- }
46
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
47
- return (message) => {
48
- console.warn(`
49
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
50
- `);
51
- };
52
- }
53
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
54
- return (message) => {
55
- console.info(`
56
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
57
- `);
58
- };
59
- }
60
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
61
- return (message) => {
62
- console.info(`
63
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
64
- `);
65
- };
66
- }
67
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
68
- return (message) => {
69
- console.debug(`
70
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
71
- `);
72
- };
73
- }
74
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
75
- return (message) => {
76
- console.debug(`
77
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
78
- `);
79
- };
80
- }
81
- return (message) => {
82
- console.log(`
83
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
84
- `);
85
- };
86
- }, "getLogFn");
87
- var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
88
- var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
89
- var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
90
- var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
91
- var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
92
- var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
93
- var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
94
- var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
95
- var getStopwatch = /* @__PURE__ */ __name((name) => {
96
- const start = process.hrtime();
97
- return () => {
98
- const end = process.hrtime(start);
99
- console.info(`
100
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
101
-
102
- `);
103
- };
104
- }, "getStopwatch");
105
- var MAX_DEPTH = 4;
106
- var formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth = 0) => {
107
- if (depth > MAX_DEPTH) {
108
- return "<max depth>";
109
- }
110
- const prefix = options.prefix ?? "-";
111
- const skip = options.skip ?? [];
112
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
113
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
114
- prefix: `${prefix}-`,
115
- skip
116
- }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
117
- ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
118
- prefix: `${prefix}-`,
119
- skip
120
- }, depth + 1) : message[key]}`).join("\n")}` : message;
121
- }, "formatLogMessage");
122
- var _isFunction = /* @__PURE__ */ __name((value) => {
123
- try {
124
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
125
- } catch (e) {
126
- return false;
127
- }
128
- }, "_isFunction");
129
-
130
- export {
131
- getLogFn,
132
- writeFatal,
133
- writeError,
134
- writeWarning,
135
- writeInfo,
136
- writeSuccess,
137
- writeDebug,
138
- writeTrace,
139
- writeSystem,
140
- getStopwatch,
141
- formatLogMessage
142
- };
File without changes
@@ -1,94 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkKNLWLA7Ocjs = require('./chunk-KNLWLA7O.cjs');
4
-
5
-
6
-
7
- var _chunkSVQE7WVBcjs = require('./chunk-SVQE7WVB.cjs');
8
-
9
-
10
- var _chunkHESFC24Zcjs = require('./chunk-HESFC24Z.cjs');
11
-
12
-
13
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
14
-
15
- // src/utilities/get-default-config.ts
16
- var _fs = require('fs');
17
- var _promises = require('fs/promises');
18
- var _path = require('path');
19
- var DEFAULT_COLOR_CONFIG = {
20
- "light": {
21
- "background": "#fafafa",
22
- "foreground": "#1d1e22",
23
- "brand": "#1fb2a6",
24
- "alternate": "#db2777",
25
- "help": "#5C4EE5",
26
- "success": "#087f5b",
27
- "info": "#0550ae",
28
- "warning": "#e3b341",
29
- "danger": "#D8314A",
30
- "positive": "#22c55e",
31
- "negative": "#dc2626"
32
- },
33
- "dark": {
34
- "background": "#1d1e22",
35
- "foreground": "#cbd5e1",
36
- "brand": "#2dd4bf",
37
- "alternate": "#db2777",
38
- "help": "#818cf8",
39
- "success": "#10b981",
40
- "info": "#58a6ff",
41
- "warning": "#f3d371",
42
- "danger": "#D8314A",
43
- "positive": "#22c55e",
44
- "negative": "#dc2626"
45
- }
46
- };
47
- var getDefaultConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (root) => {
48
- let license = _chunkSVQE7WVBcjs.STORM_DEFAULT_LICENSE;
49
- let homepage = _chunkSVQE7WVBcjs.STORM_DEFAULT_HOMEPAGE;
50
- let name = void 0;
51
- let namespace = void 0;
52
- let repository = void 0;
53
- const workspaceRoot = _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, root);
54
- if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
55
- const file = await _promises.readFile.call(void 0, _chunkHESFC24Zcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
56
- if (file) {
57
- const packageJson = JSON.parse(file);
58
- if (packageJson.name) {
59
- name = packageJson.name;
60
- }
61
- if (packageJson.namespace) {
62
- namespace = packageJson.namespace;
63
- }
64
- if (packageJson.repository) {
65
- if (typeof packageJson.repository === "string") {
66
- repository = packageJson.repository;
67
- } else if (packageJson.repository.url) {
68
- repository = packageJson.repository.url;
69
- }
70
- }
71
- if (packageJson.license) {
72
- license = packageJson.license;
73
- }
74
- if (packageJson.homepage) {
75
- homepage = packageJson.homepage;
76
- }
77
- }
78
- }
79
- return {
80
- workspaceRoot,
81
- name,
82
- namespace,
83
- repository,
84
- license,
85
- homepage,
86
- docs: `${homepage || _chunkSVQE7WVBcjs.STORM_DEFAULT_HOMEPAGE}/docs`,
87
- licensing: `${homepage || _chunkSVQE7WVBcjs.STORM_DEFAULT_HOMEPAGE}/license`
88
- };
89
- }, "getDefaultConfig");
90
-
91
-
92
-
93
-
94
- exports.DEFAULT_COLOR_CONFIG = DEFAULT_COLOR_CONFIG; exports.getDefaultConfig = getDefaultConfig;
@@ -1,68 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
5
-
6
-
7
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
8
-
9
- // src/logger/get-log-level.ts
10
- var getLogLevel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label) => {
11
- switch (label) {
12
- case "all":
13
- return _chunkIRCFHYKZcjs.LogLevel.ALL;
14
- case "trace":
15
- return _chunkIRCFHYKZcjs.LogLevel.TRACE;
16
- case "debug":
17
- return _chunkIRCFHYKZcjs.LogLevel.DEBUG;
18
- case "info":
19
- return _chunkIRCFHYKZcjs.LogLevel.INFO;
20
- case "warn":
21
- return _chunkIRCFHYKZcjs.LogLevel.WARN;
22
- case "error":
23
- return _chunkIRCFHYKZcjs.LogLevel.ERROR;
24
- case "fatal":
25
- return _chunkIRCFHYKZcjs.LogLevel.FATAL;
26
- case "silent":
27
- return _chunkIRCFHYKZcjs.LogLevel.SILENT;
28
- default:
29
- return _chunkIRCFHYKZcjs.LogLevel.INFO;
30
- }
31
- }, "getLogLevel");
32
- var getLogLevelLabel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _chunkIRCFHYKZcjs.LogLevel.INFO) => {
33
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.ALL) {
34
- return _chunkIRCFHYKZcjs.LogLevelLabel.ALL;
35
- }
36
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.TRACE) {
37
- return _chunkIRCFHYKZcjs.LogLevelLabel.TRACE;
38
- }
39
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.DEBUG) {
40
- return _chunkIRCFHYKZcjs.LogLevelLabel.DEBUG;
41
- }
42
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.INFO) {
43
- return _chunkIRCFHYKZcjs.LogLevelLabel.INFO;
44
- }
45
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.WARN) {
46
- return _chunkIRCFHYKZcjs.LogLevelLabel.WARN;
47
- }
48
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.ERROR) {
49
- return _chunkIRCFHYKZcjs.LogLevelLabel.ERROR;
50
- }
51
- if (logLevel >= _chunkIRCFHYKZcjs.LogLevel.FATAL) {
52
- return _chunkIRCFHYKZcjs.LogLevelLabel.FATAL;
53
- }
54
- if (logLevel <= _chunkIRCFHYKZcjs.LogLevel.SILENT) {
55
- return _chunkIRCFHYKZcjs.LogLevelLabel.SILENT;
56
- }
57
- return _chunkIRCFHYKZcjs.LogLevelLabel.INFO;
58
- }, "getLogLevelLabel");
59
- var isVerbose = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label = _chunkIRCFHYKZcjs.LogLevelLabel.SILENT) => {
60
- const logLevel = typeof label === "string" ? getLogLevel(label) : label;
61
- return logLevel >= _chunkIRCFHYKZcjs.LogLevel.DEBUG;
62
- }, "isVerbose");
63
-
64
-
65
-
66
-
67
-
68
- exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose;
@@ -1,65 +0,0 @@
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
-
3
- var _chunkKNLWLA7Ocjs = require('./chunk-KNLWLA7O.cjs');
4
-
5
-
6
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
7
-
8
- // src/utilities/apply-workspace-tokens.ts
9
- var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (option, tokenParams) => {
10
- let result = option;
11
- if (!result) {
12
- return result;
13
- }
14
- if (tokenParams) {
15
- const optionKeys = Object.keys(tokenParams);
16
- if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
17
- for (const optionKey of optionKeys) {
18
- if (result.includes(`{${optionKey}}`)) {
19
- result = result.replaceAll(`{${optionKey}}`, _optionalChain([tokenParams, 'optionalAccess', _ => _[optionKey]]) || "");
20
- }
21
- }
22
- }
23
- }
24
- if (tokenParams.config) {
25
- const configKeys = Object.keys(tokenParams.config);
26
- if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
27
- for (const configKey of configKeys) {
28
- if (result.includes(`{${configKey}}`)) {
29
- result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
30
- }
31
- }
32
- }
33
- }
34
- if (result.includes("{workspaceRoot}")) {
35
- result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _2 => _2.config, 'optionalAccess', _3 => _3.workspaceRoot]))), () => ( _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, ))));
36
- }
37
- return result;
38
- }, "applyWorkspaceBaseTokens");
39
- var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (option, tokenParams) => {
40
- return applyWorkspaceBaseTokens(option, tokenParams);
41
- }, "applyWorkspaceProjectTokens");
42
- var applyWorkspaceTokens = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (options, tokenParams, tokenizerFn) => {
43
- if (!options) {
44
- return {};
45
- }
46
- const result = {};
47
- for (const option of Object.keys(options)) {
48
- if (typeof options[option] === "string") {
49
- result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
50
- } else if (Array.isArray(options[option])) {
51
- result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
52
- } else if (typeof options[option] === "object") {
53
- result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
54
- } else {
55
- result[option] = options[option];
56
- }
57
- }
58
- return result;
59
- }, "applyWorkspaceTokens");
60
-
61
-
62
-
63
-
64
-
65
- exports.applyWorkspaceBaseTokens = applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = applyWorkspaceTokens;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,65 +0,0 @@
1
- import {
2
- findWorkspaceRoot
3
- } from "./chunk-OIEEXHKO.js";
4
- import {
5
- __name
6
- } from "./chunk-SHUYVCID.js";
7
-
8
- // src/utilities/apply-workspace-tokens.ts
9
- var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams) => {
10
- let result = option;
11
- if (!result) {
12
- return result;
13
- }
14
- if (tokenParams) {
15
- const optionKeys = Object.keys(tokenParams);
16
- if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
17
- for (const optionKey of optionKeys) {
18
- if (result.includes(`{${optionKey}}`)) {
19
- result = result.replaceAll(`{${optionKey}}`, tokenParams?.[optionKey] || "");
20
- }
21
- }
22
- }
23
- }
24
- if (tokenParams.config) {
25
- const configKeys = Object.keys(tokenParams.config);
26
- if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
27
- for (const configKey of configKeys) {
28
- if (result.includes(`{${configKey}}`)) {
29
- result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
30
- }
31
- }
32
- }
33
- }
34
- if (result.includes("{workspaceRoot}")) {
35
- result = result.replaceAll("{workspaceRoot}", tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot());
36
- }
37
- return result;
38
- }, "applyWorkspaceBaseTokens");
39
- var applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option, tokenParams) => {
40
- return applyWorkspaceBaseTokens(option, tokenParams);
41
- }, "applyWorkspaceProjectTokens");
42
- var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, tokenParams, tokenizerFn) => {
43
- if (!options) {
44
- return {};
45
- }
46
- const result = {};
47
- for (const option of Object.keys(options)) {
48
- if (typeof options[option] === "string") {
49
- result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
50
- } else if (Array.isArray(options[option])) {
51
- result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
52
- } else if (typeof options[option] === "object") {
53
- result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
54
- } else {
55
- result[option] = options[option];
56
- }
57
- }
58
- return result;
59
- }, "applyWorkspaceTokens");
60
-
61
- export {
62
- applyWorkspaceBaseTokens,
63
- applyWorkspaceProjectTokens,
64
- applyWorkspaceTokens
65
- };
@@ -1,180 +0,0 @@
1
- // ../config/src/constants.ts
2
- var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
3
- var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
4
- var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
5
- var STORM_DEFAULT_LICENSE = "Apache-2.0";
6
-
7
- // ../config/src/schema.ts
8
- import z from "zod";
9
- var DarkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
10
- var LightColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
11
- var BrandColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
12
- var AlternateColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
13
- var AccentColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
14
- var LinkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
15
- var HelpColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
16
- var SuccessColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
17
- var InfoColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
18
- var WarningColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
19
- var DangerColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
20
- var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
21
- var PositiveColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
22
- var NegativeColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
23
- var DarkThemeColorConfigSchema = z.object({
24
- foreground: LightColorSchema,
25
- background: DarkColorSchema,
26
- brand: BrandColorSchema,
27
- alternate: AlternateColorSchema,
28
- accent: AccentColorSchema,
29
- link: LinkColorSchema,
30
- help: HelpColorSchema,
31
- success: SuccessColorSchema,
32
- info: InfoColorSchema,
33
- warning: WarningColorSchema,
34
- danger: DangerColorSchema,
35
- fatal: FatalColorSchema,
36
- positive: PositiveColorSchema,
37
- negative: NegativeColorSchema
38
- });
39
- var LightThemeColorConfigSchema = z.object({
40
- foreground: DarkColorSchema,
41
- background: LightColorSchema,
42
- brand: BrandColorSchema,
43
- alternate: AlternateColorSchema,
44
- accent: AccentColorSchema,
45
- link: LinkColorSchema,
46
- help: HelpColorSchema,
47
- success: SuccessColorSchema,
48
- info: InfoColorSchema,
49
- warning: WarningColorSchema,
50
- danger: DangerColorSchema,
51
- fatal: FatalColorSchema,
52
- positive: PositiveColorSchema,
53
- negative: NegativeColorSchema
54
- });
55
- var MultiThemeColorConfigSchema = z.object({
56
- dark: DarkThemeColorConfigSchema,
57
- light: LightThemeColorConfigSchema
58
- });
59
- var SingleThemeColorConfigSchema = z.object({
60
- dark: DarkColorSchema,
61
- light: LightColorSchema,
62
- brand: BrandColorSchema,
63
- alternate: AlternateColorSchema,
64
- accent: AccentColorSchema,
65
- link: LinkColorSchema,
66
- help: HelpColorSchema,
67
- success: SuccessColorSchema,
68
- info: InfoColorSchema,
69
- warning: WarningColorSchema,
70
- danger: DangerColorSchema,
71
- fatal: FatalColorSchema,
72
- positive: PositiveColorSchema,
73
- negative: NegativeColorSchema
74
- });
75
- var RegistryUrlConfigSchema = z.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
76
- var RegistryConfigSchema = z.object({
77
- github: RegistryUrlConfigSchema,
78
- npm: RegistryUrlConfigSchema,
79
- cargo: RegistryUrlConfigSchema,
80
- cyclone: RegistryUrlConfigSchema,
81
- container: RegistryUrlConfigSchema
82
- }).default({}).describe("A list of remote registry URLs used by Storm Software");
83
- var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
84
- var ColorConfigMapSchema = z.union([
85
- z.object({
86
- "base": ColorConfigSchema
87
- }),
88
- z.record(z.string(), ColorConfigSchema)
89
- ]);
90
- var ExtendsItemSchema = z.string().trim().describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
91
- var ExtendsSchema = ExtendsItemSchema.or(z.array(ExtendsItemSchema)).describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
92
- var WorkspaceBotConfigSchema = z.object({
93
- name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
94
- email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
95
- }).describe("The workspace's bot user's config used to automated various operations tasks");
96
- var WorkspaceDirectoryConfigSchema = z.object({
97
- cache: z.string().trim().optional().describe("The directory used to store the environment's cached file data"),
98
- data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
99
- config: z.string().trim().optional().describe("The directory used to store the environment's configuration files"),
100
- temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
101
- log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
102
- build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
103
- }).describe("Various directories used by the workspace to store data, cache, and configuration files");
104
- var StormConfigSchema = z.object({
105
- $schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
106
- extends: ExtendsSchema.optional(),
107
- name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
108
- namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
109
- organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
110
- repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
111
- license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
112
- homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
113
- docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
114
- licensing: z.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
115
- branch: z.string().trim().default("main").describe("The branch of the workspace"),
116
- preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
117
- owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
118
- bot: WorkspaceBotConfigSchema,
119
- env: z.enum([
120
- "development",
121
- "staging",
122
- "production"
123
- ]).default("production").describe("The current runtime environment name for the package"),
124
- workspaceRoot: z.string().trim().default("").describe("The root directory of the workspace"),
125
- externalPackagePatterns: z.array(z.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
126
- skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
127
- directories: WorkspaceDirectoryConfigSchema,
128
- packageManager: z.enum([
129
- "npm",
130
- "yarn",
131
- "pnpm",
132
- "bun"
133
- ]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
134
- timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
135
- locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
136
- logLevel: z.enum([
137
- "silent",
138
- "fatal",
139
- "error",
140
- "warn",
141
- "success",
142
- "info",
143
- "debug",
144
- "trace",
145
- "all"
146
- ]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
147
- skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
148
- registry: RegistryConfigSchema,
149
- configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
150
- colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
151
- extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
152
- }).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
153
-
154
- // ../config/src/types.ts
155
- var COLOR_KEYS = [
156
- "dark",
157
- "light",
158
- "base",
159
- "brand",
160
- "alternate",
161
- "accent",
162
- "link",
163
- "success",
164
- "help",
165
- "info",
166
- "warning",
167
- "danger",
168
- "fatal",
169
- "positive",
170
- "negative"
171
- ];
172
-
173
- export {
174
- STORM_DEFAULT_DOCS,
175
- STORM_DEFAULT_HOMEPAGE,
176
- STORM_DEFAULT_LICENSING,
177
- STORM_DEFAULT_LICENSE,
178
- StormConfigSchema,
179
- COLOR_KEYS
180
- };