@storm-software/config-tools 1.76.0 → 1.78.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.
package/CHANGELOG.md CHANGED
@@ -1,109 +1,127 @@
1
- ## 1.76.0 (2024-08-04)
1
+ ## 1.78.0 (2024-08-29)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- - **config:** Added the `docs` and `licensing` options to the Storm configuration ([c867efe1](https://github.com/storm-software/storm-ops/commit/c867efe1))
6
+ - **workspace-tools:** Added `nx-default.json` and `nx-cloud.json` files ([4bb13faa](https://github.com/storm-software/storm-ops/commit/4bb13faa))
7
7
 
8
- ## 1.75.0 (2024-08-03)
8
+ ## 1.77.0 (2024-08-29)
9
+
10
+ ### Features
9
11
 
12
+ - **workspace-tools:** Added base entry to package
13
+ ([b0d3b788](https://github.com/storm-software/storm-ops/commit/b0d3b788))
14
+
15
+ ## 1.76.0 (2024-08-04)
10
16
 
11
17
  ### Features
12
18
 
13
- - **eslint:** Ignore `prefer-nullish-coalescing` for strings ([dbae2a58](https://github.com/storm-software/storm-ops/commit/dbae2a58))
19
+ - **config:** Added the `docs` and `licensing` options to the Storm
20
+ configuration
21
+ ([c867efe1](https://github.com/storm-software/storm-ops/commit/c867efe1))
14
22
 
15
- ## 1.74.0 (2024-08-03)
23
+ ## 1.75.0 (2024-08-03)
24
+
25
+ ### Features
26
+
27
+ - **eslint:** Ignore `prefer-nullish-coalescing` for strings
28
+ ([dbae2a58](https://github.com/storm-software/storm-ops/commit/dbae2a58))
16
29
 
30
+ ## 1.74.0 (2024-08-03)
17
31
 
18
32
  ### Features
19
33
 
20
- - **build-tools:** Add back experimental DTS option to TSUP ([4fe9652b](https://github.com/storm-software/storm-ops/commit/4fe9652b))
34
+ - **build-tools:** Add back experimental DTS option to TSUP
35
+ ([4fe9652b](https://github.com/storm-software/storm-ops/commit/4fe9652b))
21
36
 
22
37
  ## 1.73.0 (2024-08-03)
23
38
 
24
-
25
39
  ### Features
26
40
 
27
- - **storm-ops:** Upgrade workspace's Nx package dependencies ([5f31f734](https://github.com/storm-software/storm-ops/commit/5f31f734))
41
+ - **storm-ops:** Upgrade workspace's Nx package dependencies
42
+ ([5f31f734](https://github.com/storm-software/storm-ops/commit/5f31f734))
28
43
 
29
44
  ## 1.72.0 (2024-08-03)
30
45
 
31
-
32
46
  ### Features
33
47
 
34
- - **build-tools:** Add tsup build's rollup helpers ([27ecd4e6](https://github.com/storm-software/storm-ops/commit/27ecd4e6))
48
+ - **build-tools:** Add tsup build's rollup helpers
49
+ ([27ecd4e6](https://github.com/storm-software/storm-ops/commit/27ecd4e6))
35
50
 
36
51
  ## 1.71.1 (2024-08-03)
37
52
 
38
-
39
53
  ### Bug Fixes
40
54
 
41
- - **build-tools:** Resolved issue with the entry name parameter in unbuild config ([f5e5dbdd](https://github.com/storm-software/storm-ops/commit/f5e5dbdd))
55
+ - **build-tools:** Resolved issue with the entry name parameter in unbuild
56
+ config
57
+ ([f5e5dbdd](https://github.com/storm-software/storm-ops/commit/f5e5dbdd))
42
58
 
43
59
  ## 1.71.0 (2024-08-02)
44
60
 
45
-
46
61
  ### Features
47
62
 
48
- - **build-tools:** Added back the export statements to unbuild configuration ([5fb63682](https://github.com/storm-software/storm-ops/commit/5fb63682))
63
+ - **build-tools:** Added back the export statements to unbuild configuration
64
+ ([5fb63682](https://github.com/storm-software/storm-ops/commit/5fb63682))
49
65
 
50
66
  ## 1.70.0 (2024-08-02)
51
67
 
52
-
53
68
  ### Features
54
69
 
55
- - **build-tools:** Update the unbuild configuration to get exports from `package.json` files ([bb2fc78f](https://github.com/storm-software/storm-ops/commit/bb2fc78f))
70
+ - **build-tools:** Update the unbuild configuration to get exports from
71
+ `package.json` files
72
+ ([bb2fc78f](https://github.com/storm-software/storm-ops/commit/bb2fc78f))
56
73
 
57
74
  ## 1.69.0 (2024-08-02)
58
75
 
59
-
60
76
  ### Features
61
77
 
62
- - **config:** Removed the `ci` option from config and enabled better caching ([2456c216](https://github.com/storm-software/storm-ops/commit/2456c216))
78
+ - **config:** Removed the `ci` option from config and enabled better caching
79
+ ([2456c216](https://github.com/storm-software/storm-ops/commit/2456c216))
63
80
 
64
81
  ## 1.68.0 (2024-08-02)
65
82
 
66
-
67
83
  ### Features
68
84
 
69
- - **terraform-tools:** Added terraform options to the plugin's executor schemas ([fb555cb4](https://github.com/storm-software/storm-ops/commit/fb555cb4))
85
+ - **terraform-tools:** Added terraform options to the plugin's executor schemas
86
+ ([fb555cb4](https://github.com/storm-software/storm-ops/commit/fb555cb4))
70
87
 
71
88
  ## 1.67.1 (2024-07-31)
72
89
 
73
-
74
90
  ### Bug Fixes
75
91
 
76
- - **build-tools:** Remove unused plugin from unbuild ([ad8a5991](https://github.com/storm-software/storm-ops/commit/ad8a5991))
92
+ - **build-tools:** Remove unused plugin from unbuild
93
+ ([ad8a5991](https://github.com/storm-software/storm-ops/commit/ad8a5991))
77
94
 
78
95
  ## 1.67.0 (2024-07-31)
79
96
 
80
-
81
97
  ### Features
82
98
 
83
- - **create-storm-workspace:** Configure workspace to include GitHub ([eea71de7](https://github.com/storm-software/storm-ops/commit/eea71de7))
99
+ - **create-storm-workspace:** Configure workspace to include GitHub
100
+ ([eea71de7](https://github.com/storm-software/storm-ops/commit/eea71de7))
84
101
 
85
102
  ## 1.66.0 (2024-07-30)
86
103
 
87
-
88
104
  ### Features
89
105
 
90
- - **eslint:** Added the header plugin ([cc0cbbea](https://github.com/storm-software/storm-ops/commit/cc0cbbea))
106
+ - **eslint:** Added the header plugin
107
+ ([cc0cbbea](https://github.com/storm-software/storm-ops/commit/cc0cbbea))
91
108
 
92
- - **eslint:** Removed invalid JSON configuration from package ([2622ee7e](https://github.com/storm-software/storm-ops/commit/2622ee7e))
109
+ - **eslint:** Removed invalid JSON configuration from package
110
+ ([2622ee7e](https://github.com/storm-software/storm-ops/commit/2622ee7e))
93
111
 
94
112
  ## 1.65.0 (2024-07-29)
95
113
 
96
-
97
114
  ### Features
98
115
 
99
- - **build-tools:** Update unbuild process to use the `tsconfck` package ([d0e4dbf6](https://github.com/storm-software/storm-ops/commit/d0e4dbf6))
116
+ - **build-tools:** Update unbuild process to use the `tsconfck` package
117
+ ([d0e4dbf6](https://github.com/storm-software/storm-ops/commit/d0e4dbf6))
100
118
 
101
119
  ## 1.64.0 (2024-07-29)
102
120
 
103
-
104
121
  ### Features
105
122
 
106
- - **config:** Added the `brand2` and `brand3` color tokens ([58705631](https://github.com/storm-software/storm-ops/commit/58705631))
123
+ - **config:** Added the `brand2` and `brand3` color tokens
124
+ ([58705631](https://github.com/storm-software/storm-ops/commit/58705631))
107
125
 
108
126
  ## 1.63.0 (2024-07-29)
109
127
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-1.75.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-1.77.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
package/declarations.d.ts CHANGED
@@ -1,14 +1,15 @@
1
+ import type { StormConfig, StormConfigInput } from "@storm-software/config";
1
2
  import type { CosmiconfigResult } from "cosmiconfig";
2
3
  import type * as z from "zod";
3
- import type { StormConfig, StormConfigInput } from "@storm-software/config";
4
4
  import type {
5
+ BaseTokenizerOptions,
5
6
  LogLevel,
6
7
  LogLevelLabel,
7
- BaseTokenizerOptions,
8
8
  ProjectTokenizerOptions
9
9
  } from "./src/types";
10
10
 
11
11
  export * from "./src/types";
12
+ export { findWorkspaceRoot };
12
13
 
13
14
  export type DeepPartial<T> = T extends object
14
15
  ? {
@@ -22,7 +23,6 @@ export type DeepPartial<T> = T extends object
22
23
  * @param pathInsideMonorepo - The path inside the monorepo
23
24
  */
24
25
  declare function findWorkspaceRoot(pathInsideMonorepo?: string): string;
25
- export { findWorkspaceRoot };
26
26
 
27
27
  /**
28
28
  * Find the root of the current monorepo safely (do not throw an error if it cannot be found)
package/index.cjs CHANGED
@@ -62936,6 +62936,120 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
62936
62936
  return result;
62937
62937
  }
62938
62938
 
62939
+ // packages/config-tools/src/utilities/apply-workspace-tokens.ts
62940
+ var applyWorkspaceBaseTokens = async (option, tokenizerOptions) => {
62941
+ let result = option;
62942
+ if (!result) {
62943
+ return result;
62944
+ }
62945
+ if (tokenizerOptions) {
62946
+ const optionKeys = Object.keys(tokenizerOptions);
62947
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
62948
+ for (const optionKey of optionKeys) {
62949
+ if (result.includes(`{${optionKey}}`)) {
62950
+ result = result.replaceAll(
62951
+ `{${optionKey}}`,
62952
+ tokenizerOptions.config?.[optionKey] ?? ""
62953
+ );
62954
+ }
62955
+ }
62956
+ }
62957
+ }
62958
+ if (tokenizerOptions.config) {
62959
+ const configKeys = Object.keys(tokenizerOptions.config);
62960
+ if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
62961
+ for (const configKey of configKeys) {
62962
+ if (result.includes(`{${configKey}}`)) {
62963
+ result = result.replaceAll(
62964
+ `{${configKey}}`,
62965
+ tokenizerOptions.config[configKey]
62966
+ );
62967
+ }
62968
+ }
62969
+ }
62970
+ }
62971
+ if (result.includes("{workspaceRoot}")) {
62972
+ result = result.replaceAll(
62973
+ "{workspaceRoot}",
62974
+ tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
62975
+ );
62976
+ }
62977
+ return result;
62978
+ };
62979
+ var applyWorkspaceProjectTokens = (option, tokenizerOptions) => {
62980
+ return applyWorkspaceBaseTokens(option, tokenizerOptions);
62981
+ };
62982
+ var applyWorkspaceTokens = async (options, config, tokenizerFn) => {
62983
+ if (!options) {
62984
+ return {};
62985
+ }
62986
+ const result = {};
62987
+ for (const option of Object.keys(options)) {
62988
+ if (typeof options[option] === "string") {
62989
+ result[option] = await Promise.resolve(
62990
+ tokenizerFn(options[option], config)
62991
+ );
62992
+ } else if (Array.isArray(options[option])) {
62993
+ result[option] = await Promise.all(
62994
+ options[option].map(
62995
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
62996
+ )
62997
+ );
62998
+ } else if (typeof options[option] === "object") {
62999
+ result[option] = await applyWorkspaceTokens(
63000
+ options[option],
63001
+ config,
63002
+ tokenizerFn
63003
+ );
63004
+ } else {
63005
+ result[option] = options[option];
63006
+ }
63007
+ }
63008
+ return result;
63009
+ };
63010
+
63011
+ // packages/config-tools/src/utilities/chalk.ts
63012
+ var import_chalk = __toESM(require_source());
63013
+ var chalkDefault = {
63014
+ hex: (_6) => (message) => message,
63015
+ bgHex: (_6) => ({
63016
+ whiteBright: (message) => message
63017
+ }),
63018
+ whiteBright: (message) => message,
63019
+ bold: {
63020
+ hex: (_6) => (message) => message,
63021
+ bgHex: (_6) => ({
63022
+ whiteBright: (message) => message
63023
+ }),
63024
+ whiteBright: (message) => message
63025
+ }
63026
+ };
63027
+ var getChalk = () => {
63028
+ let _chalk = import_chalk.default;
63029
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
63030
+ _chalk = chalkDefault;
63031
+ }
63032
+ return _chalk;
63033
+ };
63034
+
63035
+ // packages/config-tools/src/utilities/file-path-utils.ts
63036
+ var import_node_path6 = require("node:path");
63037
+ var removeExtension = (filePath) => {
63038
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
63039
+ if (result.startsWith("./")) {
63040
+ return result.substring(2);
63041
+ }
63042
+ if (result.startsWith(".") || result.startsWith("/")) {
63043
+ return result.substring(1);
63044
+ }
63045
+ return result;
63046
+ };
63047
+ function findFileName(filePath) {
63048
+ return filePath?.split(
63049
+ filePath?.includes(import_node_path6.sep) ? import_node_path6.sep : filePath?.includes("/") ? "/" : "\\"
63050
+ )?.pop() ?? "";
63051
+ }
63052
+
62939
63053
  // packages/config/src/constants.ts
62940
63054
  var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
62941
63055
  var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
@@ -67008,7 +67122,7 @@ var COLOR_KEYS = [
67008
67122
 
67009
67123
  // packages/config-tools/src/utilities/get-default-config.ts
67010
67124
  var import_node_fs10 = require("node:fs");
67011
- var import_node_path6 = require("node:path");
67125
+ var import_node_path7 = require("node:path");
67012
67126
  var DEFAULT_COLOR_CONFIG = {
67013
67127
  light: {
67014
67128
  background: "#f4f4f5",
@@ -67063,8 +67177,8 @@ var getDefaultConfig = (config = {}, root) => {
67063
67177
  let license = DEFAULT_STORM_CONFIG.license;
67064
67178
  let homepage = DEFAULT_STORM_CONFIG.homepage;
67065
67179
  const workspaceRoot = findWorkspaceRoot(root);
67066
- if ((0, import_node_fs10.existsSync)((0, import_node_path6.join)(workspaceRoot, "package.json"))) {
67067
- const file = (0, import_node_fs10.readFileSync)((0, import_node_path6.join)(workspaceRoot, "package.json"), {
67180
+ if ((0, import_node_fs10.existsSync)((0, import_node_path7.join)(workspaceRoot, "package.json"))) {
67181
+ const file = (0, import_node_fs10.readFileSync)((0, import_node_path7.join)(workspaceRoot, "package.json"), {
67068
67182
  encoding: "utf-8"
67069
67183
  });
67070
67184
  if (file) {
@@ -67185,30 +67299,6 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
67185
67299
  return LogLevelLabel.INFO;
67186
67300
  };
67187
67301
 
67188
- // packages/config-tools/src/utilities/chalk.ts
67189
- var import_chalk = __toESM(require_source());
67190
- var chalkDefault = {
67191
- hex: (_6) => (message) => message,
67192
- bgHex: (_6) => ({
67193
- whiteBright: (message) => message
67194
- }),
67195
- whiteBright: (message) => message,
67196
- bold: {
67197
- hex: (_6) => (message) => message,
67198
- bgHex: (_6) => ({
67199
- whiteBright: (message) => message
67200
- }),
67201
- whiteBright: (message) => message
67202
- }
67203
- };
67204
- var getChalk = () => {
67205
- let _chalk = import_chalk.default;
67206
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
67207
- _chalk = chalkDefault;
67208
- }
67209
- return _chalk;
67210
- };
67211
-
67212
67302
  // packages/config-tools/src/utilities/logger.ts
67213
67303
  var getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
67214
67304
  let _chalk = getChalk();
@@ -67391,82 +67481,6 @@ var run = (config, command, cwd2 = config.workspaceRoot ?? process.cwd(), stdio
67391
67481
  });
67392
67482
  };
67393
67483
 
67394
- // packages/config-tools/src/utilities/file-path-utils.ts
67395
- var import_node_path7 = require("node:path");
67396
- var removeExtension = (filePath) => {
67397
- const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
67398
- if (result.startsWith("./")) {
67399
- return result.substring(2);
67400
- }
67401
- if (result.startsWith(".") || result.startsWith("/")) {
67402
- return result.substring(1);
67403
- }
67404
- return result;
67405
- };
67406
- function findFileName(filePath) {
67407
- return filePath?.split(filePath?.includes(import_node_path7.sep) ? import_node_path7.sep : filePath?.includes("/") ? "/" : "\\")?.pop() ?? "";
67408
- }
67409
-
67410
- // packages/config-tools/src/utilities/apply-workspace-tokens.ts
67411
- var applyWorkspaceBaseTokens = async (option, tokenizerOptions) => {
67412
- let result = option;
67413
- if (!result) {
67414
- return result;
67415
- }
67416
- if (tokenizerOptions) {
67417
- const optionKeys = Object.keys(tokenizerOptions);
67418
- if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
67419
- for (const optionKey of optionKeys) {
67420
- if (result.includes(`{${optionKey}}`)) {
67421
- result = result.replaceAll(`{${optionKey}}`, tokenizerOptions.config?.[optionKey] ?? "");
67422
- }
67423
- }
67424
- }
67425
- }
67426
- if (tokenizerOptions.config) {
67427
- const configKeys = Object.keys(tokenizerOptions.config);
67428
- if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
67429
- for (const configKey of configKeys) {
67430
- if (result.includes(`{${configKey}}`)) {
67431
- result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
67432
- }
67433
- }
67434
- }
67435
- }
67436
- if (result.includes("{workspaceRoot}")) {
67437
- result = result.replaceAll(
67438
- "{workspaceRoot}",
67439
- tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
67440
- );
67441
- }
67442
- return result;
67443
- };
67444
- var applyWorkspaceProjectTokens = (option, tokenizerOptions) => {
67445
- return applyWorkspaceBaseTokens(option, tokenizerOptions);
67446
- };
67447
- var applyWorkspaceTokens = async (options, config, tokenizerFn) => {
67448
- if (!options) {
67449
- return {};
67450
- }
67451
- const result = {};
67452
- for (const option of Object.keys(options)) {
67453
- if (typeof options[option] === "string") {
67454
- result[option] = await Promise.resolve(tokenizerFn(options[option], config));
67455
- } else if (Array.isArray(options[option])) {
67456
- result[option] = await Promise.all(
67457
- options[option].map(
67458
- async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
67459
- )
67460
- );
67461
- } else if (typeof options[option] === "object") {
67462
- result[option] = await applyWorkspaceTokens(options[option], config, tokenizerFn);
67463
- } else {
67464
- result[option] = options[option];
67465
- }
67466
- }
67467
- return result;
67468
- };
67469
-
67470
67484
  // packages/config-tools/src/config-file/get-config-file.ts
67471
67485
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
67472
67486
  const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
package/index.js CHANGED
@@ -62893,6 +62893,120 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
62893
62893
  return result;
62894
62894
  }
62895
62895
 
62896
+ // packages/config-tools/src/utilities/apply-workspace-tokens.ts
62897
+ var applyWorkspaceBaseTokens = async (option, tokenizerOptions) => {
62898
+ let result = option;
62899
+ if (!result) {
62900
+ return result;
62901
+ }
62902
+ if (tokenizerOptions) {
62903
+ const optionKeys = Object.keys(tokenizerOptions);
62904
+ if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
62905
+ for (const optionKey of optionKeys) {
62906
+ if (result.includes(`{${optionKey}}`)) {
62907
+ result = result.replaceAll(
62908
+ `{${optionKey}}`,
62909
+ tokenizerOptions.config?.[optionKey] ?? ""
62910
+ );
62911
+ }
62912
+ }
62913
+ }
62914
+ }
62915
+ if (tokenizerOptions.config) {
62916
+ const configKeys = Object.keys(tokenizerOptions.config);
62917
+ if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
62918
+ for (const configKey of configKeys) {
62919
+ if (result.includes(`{${configKey}}`)) {
62920
+ result = result.replaceAll(
62921
+ `{${configKey}}`,
62922
+ tokenizerOptions.config[configKey]
62923
+ );
62924
+ }
62925
+ }
62926
+ }
62927
+ }
62928
+ if (result.includes("{workspaceRoot}")) {
62929
+ result = result.replaceAll(
62930
+ "{workspaceRoot}",
62931
+ tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
62932
+ );
62933
+ }
62934
+ return result;
62935
+ };
62936
+ var applyWorkspaceProjectTokens = (option, tokenizerOptions) => {
62937
+ return applyWorkspaceBaseTokens(option, tokenizerOptions);
62938
+ };
62939
+ var applyWorkspaceTokens = async (options, config, tokenizerFn) => {
62940
+ if (!options) {
62941
+ return {};
62942
+ }
62943
+ const result = {};
62944
+ for (const option of Object.keys(options)) {
62945
+ if (typeof options[option] === "string") {
62946
+ result[option] = await Promise.resolve(
62947
+ tokenizerFn(options[option], config)
62948
+ );
62949
+ } else if (Array.isArray(options[option])) {
62950
+ result[option] = await Promise.all(
62951
+ options[option].map(
62952
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
62953
+ )
62954
+ );
62955
+ } else if (typeof options[option] === "object") {
62956
+ result[option] = await applyWorkspaceTokens(
62957
+ options[option],
62958
+ config,
62959
+ tokenizerFn
62960
+ );
62961
+ } else {
62962
+ result[option] = options[option];
62963
+ }
62964
+ }
62965
+ return result;
62966
+ };
62967
+
62968
+ // packages/config-tools/src/utilities/chalk.ts
62969
+ var import_chalk = __toESM(require_source());
62970
+ var chalkDefault = {
62971
+ hex: (_6) => (message) => message,
62972
+ bgHex: (_6) => ({
62973
+ whiteBright: (message) => message
62974
+ }),
62975
+ whiteBright: (message) => message,
62976
+ bold: {
62977
+ hex: (_6) => (message) => message,
62978
+ bgHex: (_6) => ({
62979
+ whiteBright: (message) => message
62980
+ }),
62981
+ whiteBright: (message) => message
62982
+ }
62983
+ };
62984
+ var getChalk = () => {
62985
+ let _chalk = import_chalk.default;
62986
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
62987
+ _chalk = chalkDefault;
62988
+ }
62989
+ return _chalk;
62990
+ };
62991
+
62992
+ // packages/config-tools/src/utilities/file-path-utils.ts
62993
+ import { sep as sep2 } from "node:path";
62994
+ var removeExtension = (filePath) => {
62995
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
62996
+ if (result.startsWith("./")) {
62997
+ return result.substring(2);
62998
+ }
62999
+ if (result.startsWith(".") || result.startsWith("/")) {
63000
+ return result.substring(1);
63001
+ }
63002
+ return result;
63003
+ };
63004
+ function findFileName(filePath) {
63005
+ return filePath?.split(
63006
+ filePath?.includes(sep2) ? sep2 : filePath?.includes("/") ? "/" : "\\"
63007
+ )?.pop() ?? "";
63008
+ }
63009
+
62896
63010
  // packages/config/src/constants.ts
62897
63011
  var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
62898
63012
  var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
@@ -67142,30 +67256,6 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
67142
67256
  return LogLevelLabel.INFO;
67143
67257
  };
67144
67258
 
67145
- // packages/config-tools/src/utilities/chalk.ts
67146
- var import_chalk = __toESM(require_source());
67147
- var chalkDefault = {
67148
- hex: (_6) => (message) => message,
67149
- bgHex: (_6) => ({
67150
- whiteBright: (message) => message
67151
- }),
67152
- whiteBright: (message) => message,
67153
- bold: {
67154
- hex: (_6) => (message) => message,
67155
- bgHex: (_6) => ({
67156
- whiteBright: (message) => message
67157
- }),
67158
- whiteBright: (message) => message
67159
- }
67160
- };
67161
- var getChalk = () => {
67162
- let _chalk = import_chalk.default;
67163
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
67164
- _chalk = chalkDefault;
67165
- }
67166
- return _chalk;
67167
- };
67168
-
67169
67259
  // packages/config-tools/src/utilities/logger.ts
67170
67260
  var getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
67171
67261
  let _chalk = getChalk();
@@ -67348,82 +67438,6 @@ var run = (config, command, cwd2 = config.workspaceRoot ?? process.cwd(), stdio
67348
67438
  });
67349
67439
  };
67350
67440
 
67351
- // packages/config-tools/src/utilities/file-path-utils.ts
67352
- import { sep as sep2 } from "node:path";
67353
- var removeExtension = (filePath) => {
67354
- const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
67355
- if (result.startsWith("./")) {
67356
- return result.substring(2);
67357
- }
67358
- if (result.startsWith(".") || result.startsWith("/")) {
67359
- return result.substring(1);
67360
- }
67361
- return result;
67362
- };
67363
- function findFileName(filePath) {
67364
- return filePath?.split(filePath?.includes(sep2) ? sep2 : filePath?.includes("/") ? "/" : "\\")?.pop() ?? "";
67365
- }
67366
-
67367
- // packages/config-tools/src/utilities/apply-workspace-tokens.ts
67368
- var applyWorkspaceBaseTokens = async (option, tokenizerOptions) => {
67369
- let result = option;
67370
- if (!result) {
67371
- return result;
67372
- }
67373
- if (tokenizerOptions) {
67374
- const optionKeys = Object.keys(tokenizerOptions);
67375
- if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
67376
- for (const optionKey of optionKeys) {
67377
- if (result.includes(`{${optionKey}}`)) {
67378
- result = result.replaceAll(`{${optionKey}}`, tokenizerOptions.config?.[optionKey] ?? "");
67379
- }
67380
- }
67381
- }
67382
- }
67383
- if (tokenizerOptions.config) {
67384
- const configKeys = Object.keys(tokenizerOptions.config);
67385
- if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
67386
- for (const configKey of configKeys) {
67387
- if (result.includes(`{${configKey}}`)) {
67388
- result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
67389
- }
67390
- }
67391
- }
67392
- }
67393
- if (result.includes("{workspaceRoot}")) {
67394
- result = result.replaceAll(
67395
- "{workspaceRoot}",
67396
- tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
67397
- );
67398
- }
67399
- return result;
67400
- };
67401
- var applyWorkspaceProjectTokens = (option, tokenizerOptions) => {
67402
- return applyWorkspaceBaseTokens(option, tokenizerOptions);
67403
- };
67404
- var applyWorkspaceTokens = async (options, config, tokenizerFn) => {
67405
- if (!options) {
67406
- return {};
67407
- }
67408
- const result = {};
67409
- for (const option of Object.keys(options)) {
67410
- if (typeof options[option] === "string") {
67411
- result[option] = await Promise.resolve(tokenizerFn(options[option], config));
67412
- } else if (Array.isArray(options[option])) {
67413
- result[option] = await Promise.all(
67414
- options[option].map(
67415
- async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item
67416
- )
67417
- );
67418
- } else if (typeof options[option] === "object") {
67419
- result[option] = await applyWorkspaceTokens(options[option], config, tokenizerFn);
67420
- } else {
67421
- result[option] = options[option];
67422
- }
67423
- }
67424
- return result;
67425
- };
67426
-
67427
67441
  // packages/config-tools/src/config-file/get-config-file.ts
67428
67442
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
67429
67443
  const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);