@storm-software/cloudflare-tools 0.54.1 → 0.54.3

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 (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-KVL4WOIH.mjs → chunk-23YXGFBU.mjs} +1 -1
  4. package/dist/{chunk-VE6PGD5B.mjs → chunk-2XNO3U7C.mjs} +5 -5
  5. package/dist/{chunk-H63GI4CR.js → chunk-BM5BCBD5.js} +3 -3
  6. package/dist/{chunk-NTZUGXQD.mjs → chunk-CXOUHOZ7.mjs} +12 -10
  7. package/dist/{chunk-THKJZT32.js → chunk-DFG3KJWS.js} +119 -70
  8. package/dist/{chunk-6H63LE3D.mjs → chunk-DQHMNZ47.mjs} +88 -39
  9. package/dist/{chunk-4UDIES3V.mjs → chunk-EZCE5VIE.mjs} +1 -1
  10. package/dist/{chunk-W6YNIJQD.js → chunk-ILLCSSWN.js} +20 -17
  11. package/dist/{chunk-3D3WO4IH.mjs → chunk-IXEWBCGZ.mjs} +17 -14
  12. package/dist/{chunk-H2PLVAKC.js → chunk-LOFONHDQ.js} +12 -12
  13. package/dist/{chunk-BAP6AE7N.js → chunk-LW7DSVEL.js} +160 -158
  14. package/dist/{chunk-U6QKP7CG.js → chunk-LXXVBXFM.js} +16 -16
  15. package/dist/{chunk-5WWJ6PHC.js → chunk-NVFBJS7C.js} +1 -1
  16. package/dist/{chunk-BGWUN6JU.mjs → chunk-XIDK2YZE.mjs} +5 -5
  17. package/dist/executors.js +5 -5
  18. package/dist/executors.mjs +5 -5
  19. package/dist/generators.js +5 -5
  20. package/dist/generators.mjs +4 -4
  21. package/dist/index.js +8 -8
  22. package/dist/index.mjs +7 -7
  23. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  24. package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
  25. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  26. package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
  27. package/dist/src/executors/serve/executor.d.mts +3 -3
  28. package/dist/src/executors/serve/executor.d.ts +3 -3
  29. package/dist/src/executors/serve/executor.js +4 -4
  30. package/dist/src/executors/serve/executor.mjs +3 -3
  31. package/dist/src/generators/init/generator.js +2 -2
  32. package/dist/src/generators/init/generator.mjs +1 -1
  33. package/dist/src/generators/worker/generator.js +5 -5
  34. package/dist/src/generators/worker/generator.mjs +4 -4
  35. package/dist/src/utils/index.js +3 -3
  36. package/dist/src/utils/index.mjs +2 -2
  37. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  38. package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.54.3 (2025-01-22)
2
+
3
+ ### Miscellaneous
4
+
5
+ - **monorepo:** Update the workspace's `storm.json` config to use the new preset repository ([95067c70](https://github.com/storm-software/storm-ops/commit/95067c70))
6
+
7
+ ## 0.54.2 (2025-01-22)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **build-tools:** Resolved issue with copying asset files into output directory ([1b314e8e](https://github.com/storm-software/storm-ops/commit/1b314e8e))
12
+
1
13
  ## 0.54.1 (2025-01-22)
2
14
 
3
15
  ### Bug Fixes
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-0.54.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-0.54.2-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 -->
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  writeDebug,
3
3
  writeWarning
4
- } from "./chunk-3D3WO4IH.mjs";
4
+ } from "./chunk-IXEWBCGZ.mjs";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-A7FFSBE6.mjs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  generator_default
3
- } from "./chunk-4UDIES3V.mjs";
3
+ } from "./chunk-EZCE5VIE.mjs";
4
4
  import {
5
- loadStormConfig
6
- } from "./chunk-6H63LE3D.mjs";
5
+ getConfig
6
+ } from "./chunk-DQHMNZ47.mjs";
7
7
  import {
8
8
  findWorkspaceRoot,
9
9
  getStopwatch,
@@ -12,7 +12,7 @@ import {
12
12
  writeFatal,
13
13
  writeInfo,
14
14
  writeTrace
15
- } from "./chunk-3D3WO4IH.mjs";
15
+ } from "./chunk-IXEWBCGZ.mjs";
16
16
  import {
17
17
  __dirname,
18
18
  __name
@@ -48,7 +48,7 @@ async function applicationGenerator(tree, schema) {
48
48
  const workspaceRoot = findWorkspaceRoot();
49
49
  writeDebug(`Loading the Storm Config from environment variables and storm.json file...
50
50
  - workspaceRoot: ${workspaceRoot}`, config);
51
- config = await loadStormConfig(workspaceRoot);
51
+ config = await getConfig(workspaceRoot);
52
52
  writeTrace(`Loaded Storm config into env:
53
53
  ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`, config);
54
54
  const options = await normalizeOptions(tree, schema, config);
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkW6YNIJQDjs = require('./chunk-W6YNIJQD.js');
4
+ var _chunkILLCSSWNjs = require('./chunk-ILLCSSWN.js');
5
5
 
6
6
 
7
7
  var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
@@ -11,7 +11,7 @@ var _crypto = require('crypto');
11
11
  var r2UploadFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (client, bucketName, projectPath, fileName, version, fileContent, contentType = "text/plain", isDryRun = false) => {
12
12
  const checksum = _crypto.createHash.call(void 0, "sha256").update(fileContent).digest("base64");
13
13
  const fileKey = `${projectPath}/${fileName.startsWith("/") ? fileName.substring(1) : fileName}`;
14
- _chunkW6YNIJQDjs.writeDebug.call(void 0, `Uploading file: ${fileKey}`);
14
+ _chunkILLCSSWNjs.writeDebug.call(void 0, `Uploading file: ${fileKey}`);
15
15
  if (!isDryRun) {
16
16
  await client.putObject({
17
17
  Bucket: bucketName,
@@ -24,7 +24,7 @@ var r2UploadFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (c
24
24
  }
25
25
  });
26
26
  } else {
27
- _chunkW6YNIJQDjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
27
+ _chunkILLCSSWNjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
28
28
  }
29
29
  }, "r2UploadFile");
30
30
  var getInternalDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (projectName, graph) => {
@@ -3,8 +3,8 @@ import {
3
3
  addProjectTag
4
4
  } from "./chunk-XU6MTFCV.mjs";
5
5
  import {
6
- loadStormConfig
7
- } from "./chunk-6H63LE3D.mjs";
6
+ getConfig
7
+ } from "./chunk-DQHMNZ47.mjs";
8
8
  import {
9
9
  StormConfigSchema,
10
10
  correctPaths,
@@ -20,7 +20,7 @@ import {
20
20
  writeSuccess,
21
21
  writeTrace,
22
22
  writeWarning
23
- } from "./chunk-3D3WO4IH.mjs";
23
+ } from "./chunk-IXEWBCGZ.mjs";
24
24
  import {
25
25
  __dirname,
26
26
  __name,
@@ -124,7 +124,7 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
124
124
  - sourceRoot: ${sourceRoot}
125
125
  - projectName: ${projectName}
126
126
  `, config);
127
- config = await loadStormConfig(workspaceRoot3);
127
+ config = await getConfig(workspaceRoot3);
128
128
  }
129
129
  if (executorOptions?.hooks?.applyDefaultOptions) {
130
130
  writeDebug("Running the applyDefaultOptions hook...", config);
@@ -461,7 +461,7 @@ import { readFile } from "node:fs/promises";
461
461
  var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot3) => {
462
462
  let rootDir = workspaceRoot3;
463
463
  if (!rootDir) {
464
- const config = await loadStormConfig();
464
+ const config = await getConfig();
465
465
  rootDir = config.workspaceRoot;
466
466
  }
467
467
  const nxJsonPath = joinPaths(rootDir, "nx.json");
@@ -476,7 +476,7 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot3) => {
476
476
  var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
477
477
  const pendingAssets = Array.from(assets ?? []);
478
478
  pendingAssets.push({
479
- input: projectRoot,
479
+ input: joinPaths(config.workspaceRoot, projectRoot),
480
480
  glob: "*.md",
481
481
  output: "."
482
482
  });
@@ -509,8 +509,10 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
509
509
  if (!buildTarget) {
510
510
  throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${joinPaths(projectRoot, "project.json")}`);
511
511
  }
512
+ writeTrace(`\u{1F4DD} Copying the following assets to the output directory:
513
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`, config);
512
514
  const result = await copyAssetsBase({
513
- assets,
515
+ assets: pendingAssets,
514
516
  watch: false,
515
517
  outputPath
516
518
  }, {
@@ -1394,7 +1396,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
1394
1396
  if (!workspaceRoot3) {
1395
1397
  throw new Error("Cannot find Nx workspace root");
1396
1398
  }
1397
- const config = await loadStormConfig(workspaceRoot3.dir);
1399
+ const config = await getConfig(workspaceRoot3.dir);
1398
1400
  writeDebug(" \u2699\uFE0F Resolving build options", config);
1399
1401
  const stopwatch = getStopwatch("Build options resolution");
1400
1402
  const projectGraph = await createProjectGraphAsync({
@@ -1814,7 +1816,7 @@ var resolveOptions2 = /* @__PURE__ */ __name(async (userOptions) => {
1814
1816
  if (!workspaceRoot3) {
1815
1817
  throw new Error("Cannot find Nx workspace root");
1816
1818
  }
1817
- const config = await loadStormConfig(workspaceRoot3.dir);
1819
+ const config = await getConfig(workspaceRoot3.dir);
1818
1820
  writeDebug(" \u2699\uFE0F Resolving build options", config);
1819
1821
  const stopwatch = getStopwatch("Build options resolution");
1820
1822
  const projectGraph = await createProjectGraphAsync2({
@@ -2160,7 +2162,7 @@ var withRunGenerator = /* @__PURE__ */ __name((name, generatorFn, generatorOptio
2160
2162
  if (!generatorOptions.skipReadingConfig) {
2161
2163
  writeDebug(`Loading the Storm Config from environment variables and storm.config.js file...
2162
2164
  - workspaceRoot: ${workspaceRoot3}`, config);
2163
- config = await loadStormConfig(workspaceRoot3);
2165
+ config = await getConfig(workspaceRoot3);
2164
2166
  }
2165
2167
  if (generatorOptions?.hooks?.applyDefaultOptions) {
2166
2168
  writeDebug("Running the applyDefaultOptions hook...", config);
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkW6YNIJQDjs = require('./chunk-W6YNIJQD.js');
17
+ var _chunkILLCSSWNjs = require('./chunk-ILLCSSWN.js');
18
18
 
19
19
 
20
20
  var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
@@ -26,41 +26,41 @@ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
26
26
  var _c12 = require('c12');
27
27
 
28
28
  var getConfigFileByName = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (fileName, filePath, options = {}) => {
29
- const workspacePath = filePath || _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, filePath);
30
- let config = await _c12.loadConfig.call(void 0, {
31
- cwd: workspacePath,
32
- packageJson: true,
33
- name: fileName,
34
- envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
35
- jitiOptions: {
36
- debug: false,
37
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkW6YNIJQDjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
38
- },
39
- ...options
40
- });
41
- if (!config || Object.keys(config).length === 0) {
42
- config = await _c12.loadConfig.call(void 0, {
29
+ const workspacePath = filePath || _chunkILLCSSWNjs.findWorkspaceRoot.call(void 0, filePath);
30
+ const configs = await Promise.all([
31
+ _c12.loadConfig.call(void 0, {
32
+ cwd: workspacePath,
33
+ packageJson: true,
34
+ name: fileName,
35
+ envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
36
+ jitiOptions: {
37
+ debug: false,
38
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkILLCSSWNjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
39
+ },
40
+ ...options
41
+ }),
42
+ _c12.loadConfig.call(void 0, {
43
43
  cwd: workspacePath,
44
44
  packageJson: true,
45
45
  name: fileName,
46
46
  envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
47
47
  jitiOptions: {
48
48
  debug: false,
49
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkW6YNIJQDjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
49
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkILLCSSWNjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
50
50
  },
51
51
  configFile: fileName,
52
52
  ...options
53
- });
54
- }
55
- return config;
53
+ })
54
+ ]);
55
+ return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
56
56
  }, "getConfigFileByName");
57
57
  var getConfigFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
58
- const workspacePath = filePath ? filePath : _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, filePath);
58
+ const workspacePath = filePath ? filePath : _chunkILLCSSWNjs.findWorkspaceRoot.call(void 0, filePath);
59
59
  const result = await getConfigFileByName("storm", workspacePath);
60
60
  let config = result.config;
61
61
  const configFile = result.configFile;
62
62
  if (config && configFile && Object.keys(config).length > 0) {
63
- _chunkW6YNIJQDjs.writeSystem.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
63
+ _chunkILLCSSWNjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
64
64
  logLevel: "all"
65
65
  });
66
66
  }
@@ -68,7 +68,7 @@ var getConfigFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (
68
68
  const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
69
69
  for (const result2 of results) {
70
70
  if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
71
- _chunkW6YNIJQDjs.writeSystem.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
71
+ _chunkILLCSSWNjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
72
72
  logLevel: "all"
73
73
  });
74
74
  config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
@@ -83,6 +83,16 @@ var getConfigFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (
83
83
  }, "getConfigFile");
84
84
 
85
85
  // ../config-tools/src/env/get-env.ts
86
+ var getExtensionEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (extensionName) => {
87
+ const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
88
+ return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
89
+ const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
90
+ if (name) {
91
+ ret[name] = process.env[key];
92
+ }
93
+ return ret;
94
+ }, {});
95
+ }, "getExtensionEnv");
86
96
  var getConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
87
97
  const prefix = "STORM_";
88
98
  let config = {
@@ -102,15 +112,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
102
112
  licensing: process.env[`${prefix}LICENSING`] || void 0,
103
113
  timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
104
114
  locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
105
- configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
106
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
115
+ configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
116
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
107
117
  directories: {
108
- cache: process.env[`${prefix}CACHE_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
109
- data: process.env[`${prefix}DATA_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
110
- config: process.env[`${prefix}CONFIG_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
111
- temp: process.env[`${prefix}TEMP_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
112
- log: process.env[`${prefix}LOG_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
113
- build: process.env[`${prefix}BUILD_DIR`] ? _chunkW6YNIJQDjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
118
+ cache: process.env[`${prefix}CACHE_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
119
+ data: process.env[`${prefix}DATA_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
120
+ config: process.env[`${prefix}CONFIG_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
121
+ temp: process.env[`${prefix}TEMP_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
122
+ log: process.env[`${prefix}LOG_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
123
+ build: process.env[`${prefix}BUILD_DIR`] ? _chunkILLCSSWNjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
114
124
  },
115
125
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
116
126
  env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
@@ -133,23 +143,23 @@ var getConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
133
143
  cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
134
144
  container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
135
145
  },
136
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunkW6YNIJQDjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
146
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunkILLCSSWNjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
137
147
  };
138
- const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkW6YNIJQDjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
148
+ const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkILLCSSWNjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
139
149
  config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
140
150
  ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
141
151
  return ret;
142
152
  }, {}) : getThemeColorConfigEnv(prefix);
143
- if (config.docs === _chunkW6YNIJQDjs.STORM_DEFAULT_DOCS) {
144
- if (config.homepage === _chunkW6YNIJQDjs.STORM_DEFAULT_HOMEPAGE) {
145
- config.docs = `${_chunkW6YNIJQDjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
153
+ if (config.docs === _chunkILLCSSWNjs.STORM_DEFAULT_DOCS) {
154
+ if (config.homepage === _chunkILLCSSWNjs.STORM_DEFAULT_HOMEPAGE) {
155
+ config.docs = `${_chunkILLCSSWNjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
146
156
  } else {
147
157
  config.docs = `${config.homepage}/docs`;
148
158
  }
149
159
  }
150
- if (config.licensing === _chunkW6YNIJQDjs.STORM_DEFAULT_LICENSING) {
151
- if (config.homepage === _chunkW6YNIJQDjs.STORM_DEFAULT_HOMEPAGE) {
152
- config.licensing = `${_chunkW6YNIJQDjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
160
+ if (config.licensing === _chunkILLCSSWNjs.STORM_DEFAULT_LICENSING) {
161
+ if (config.homepage === _chunkILLCSSWNjs.STORM_DEFAULT_HOMEPAGE) {
162
+ config.licensing = `${_chunkILLCSSWNjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
153
163
  } else {
154
164
  config.licensing = `${config.homepage}/docs`;
155
165
  }
@@ -242,7 +252,7 @@ var setExtensionEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (exte
242
252
  var setConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config) => {
243
253
  const prefix = "STORM_";
244
254
  if (config.extends) {
245
- process.env[`${prefix}EXTENDS`] = config.extends;
255
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
246
256
  }
247
257
  if (config.name) {
248
258
  process.env[`${prefix}NAME`] = config.name;
@@ -287,31 +297,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config)
287
297
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
288
298
  }
289
299
  if (config.configFile) {
290
- process.env[`${prefix}CONFIG_FILE`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.configFile);
300
+ process.env[`${prefix}CONFIG_FILE`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.configFile);
291
301
  }
292
302
  if (config.workspaceRoot) {
293
- process.env[`${prefix}WORKSPACE_ROOT`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.workspaceRoot);
294
- process.env.NX_WORKSPACE_ROOT = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.workspaceRoot);
295
- process.env.NX_WORKSPACE_ROOT_PATH = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.workspaceRoot);
303
+ process.env[`${prefix}WORKSPACE_ROOT`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.workspaceRoot);
304
+ process.env.NX_WORKSPACE_ROOT = _chunkILLCSSWNjs.correctPaths.call(void 0, config.workspaceRoot);
305
+ process.env.NX_WORKSPACE_ROOT_PATH = _chunkILLCSSWNjs.correctPaths.call(void 0, config.workspaceRoot);
296
306
  }
297
307
  if (config.directories) {
298
308
  if (!config.skipCache && config.directories.cache) {
299
- process.env[`${prefix}CACHE_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.cache);
309
+ process.env[`${prefix}CACHE_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.cache);
300
310
  }
301
311
  if (config.directories.data) {
302
- process.env[`${prefix}DATA_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.data);
312
+ process.env[`${prefix}DATA_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.data);
303
313
  }
304
314
  if (config.directories.config) {
305
- process.env[`${prefix}CONFIG_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.config);
315
+ process.env[`${prefix}CONFIG_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.config);
306
316
  }
307
317
  if (config.directories.temp) {
308
- process.env[`${prefix}TEMP_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.temp);
318
+ process.env[`${prefix}TEMP_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.temp);
309
319
  }
310
320
  if (config.directories.log) {
311
- process.env[`${prefix}LOG_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.log);
321
+ process.env[`${prefix}LOG_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.log);
312
322
  }
313
323
  if (config.directories.build) {
314
- process.env[`${prefix}BUILD_DIR`] = _chunkW6YNIJQDjs.correctPaths.call(void 0, config.directories.build);
324
+ process.env[`${prefix}BUILD_DIR`] = _chunkILLCSSWNjs.correctPaths.call(void 0, config.directories.build);
315
325
  }
316
326
  }
317
327
  if (config.skipCache !== void 0) {
@@ -365,8 +375,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config)
365
375
  if (config.logLevel) {
366
376
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
367
377
  process.env.LOG_LEVEL = String(config.logLevel);
368
- process.env.NX_VERBOSE_LOGGING = String(_chunkW6YNIJQDjs.getLogLevel.call(void 0, config.logLevel) >= _chunkW6YNIJQDjs.LogLevel.DEBUG ? true : false);
369
- process.env.RUST_BACKTRACE = _chunkW6YNIJQDjs.getLogLevel.call(void 0, config.logLevel) >= _chunkW6YNIJQDjs.LogLevel.DEBUG ? "full" : "none";
378
+ process.env.NX_VERBOSE_LOGGING = String(_chunkILLCSSWNjs.getLogLevel.call(void 0, config.logLevel) >= _chunkILLCSSWNjs.LogLevel.DEBUG ? true : false);
379
+ process.env.RUST_BACKTRACE = _chunkILLCSSWNjs.getLogLevel.call(void 0, config.logLevel) >= _chunkILLCSSWNjs.LogLevel.DEBUG ? "full" : "none";
370
380
  }
371
381
  process.env[`${prefix}CONFIG`] = JSON.stringify(config);
372
382
  for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
@@ -472,30 +482,69 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(vo
472
482
  }, "setBaseThemeColorConfigEnv");
473
483
 
474
484
  // ../config-tools/src/create-storm-config.ts
485
+ var _extension_cache = /* @__PURE__ */ new WeakMap();
475
486
  var _static_cache = void 0;
476
- var loadStormConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot) => {
477
- let config = {};
478
- if (_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) && _optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
479
- _chunkW6YNIJQDjs.writeTrace.call(void 0, `Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
480
- return _static_cache.data;
481
- }
482
- let _workspaceRoot = workspaceRoot;
483
- if (!_workspaceRoot) {
484
- _workspaceRoot = _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
485
- }
486
- const configFile = await getConfigFile(_workspaceRoot);
487
- if (!configFile) {
488
- _chunkW6YNIJQDjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
489
- logLevel: "all"
490
- });
487
+ var createStormConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
488
+ let result;
489
+ if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
490
+ let _workspaceRoot = workspaceRoot;
491
+ if (!_workspaceRoot) {
492
+ _workspaceRoot = _chunkILLCSSWNjs.findWorkspaceRoot.call(void 0, );
493
+ }
494
+ const configEnv = getConfigEnv();
495
+ const defaultConfig = await _chunkILLCSSWNjs.getDefaultConfig.call(void 0, _workspaceRoot);
496
+ const configFile = await getConfigFile(_workspaceRoot);
497
+ if (!configFile && !skipLogs) {
498
+ _chunkILLCSSWNjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
499
+ logLevel: "all"
500
+ });
501
+ }
502
+ result = await _chunkILLCSSWNjs.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
503
+ result.workspaceRoot ??= _workspaceRoot;
504
+ } else {
505
+ result = _static_cache.data;
491
506
  }
492
- config = _defu2.default.call(void 0, getConfigEnv(), configFile, _chunkW6YNIJQDjs.getDefaultConfig.call(void 0, _workspaceRoot));
507
+ if (schema && extensionName) {
508
+ result.extensions = {
509
+ ...result.extensions,
510
+ [extensionName]: createConfigExtension(extensionName, schema)
511
+ };
512
+ }
513
+ _static_cache = {
514
+ timestamp: Date.now(),
515
+ data: result
516
+ };
517
+ return result;
518
+ }, "createStormConfig");
519
+ var createConfigExtension = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (extensionName, schema) => {
520
+ const extension_cache_key = {
521
+ extensionName
522
+ };
523
+ if (_extension_cache.has(extension_cache_key)) {
524
+ return _extension_cache.get(extension_cache_key);
525
+ }
526
+ let extension = getExtensionEnv(extensionName);
527
+ if (schema) {
528
+ extension = schema.parse(extension);
529
+ }
530
+ _extension_cache.set(extension_cache_key, extension);
531
+ return extension;
532
+ }, "createConfigExtension");
533
+ var loadStormConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
534
+ const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
493
535
  setConfigEnv(config);
494
- _chunkW6YNIJQDjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
495
- ${_chunkW6YNIJQDjs.formatLogMessage.call(void 0, config)}`, config);
536
+ if (!skipLogs) {
537
+ _chunkILLCSSWNjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
538
+ ${_chunkILLCSSWNjs.formatLogMessage.call(void 0, config)}`, config);
539
+ }
496
540
  return config;
497
541
  }, "loadStormConfig");
498
542
 
543
+ // ../config-tools/src/get-config.ts
544
+ var getConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (workspaceRoot, skipLogs = false) => {
545
+ return loadStormConfig(workspaceRoot, skipLogs);
546
+ }, "getConfig");
547
+
499
548
 
500
549
 
501
- exports.loadStormConfig = loadStormConfig;
550
+ exports.getConfig = getConfig;