@storm-software/cloudflare-tools 0.54.2 → 0.54.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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{chunk-KVL4WOIH.mjs → chunk-23YXGFBU.mjs} +1 -1
- package/dist/{chunk-ZPVFJJMY.js → chunk-4FP3SZAK.js} +12 -12
- package/dist/{chunk-H63GI4CR.js → chunk-BM5BCBD5.js} +3 -3
- package/dist/{chunk-6OLSW63F.mjs → chunk-CYTUL65E.mjs} +1 -1
- package/dist/{chunk-THKJZT32.js → chunk-DFG3KJWS.js} +119 -70
- package/dist/{chunk-6H63LE3D.mjs → chunk-DQHMNZ47.mjs} +88 -39
- package/dist/{chunk-W6YNIJQD.js → chunk-ILLCSSWN.js} +20 -17
- package/dist/{chunk-3D3WO4IH.mjs → chunk-IXEWBCGZ.mjs} +17 -14
- package/dist/{chunk-U6QKP7CG.js → chunk-LXXVBXFM.js} +16 -16
- package/dist/{chunk-WL2BHAOY.js → chunk-PR2M4S7F.js} +1 -1
- package/dist/{chunk-H43VNU3H.js → chunk-TDFLX6AI.js} +211 -248
- package/dist/{chunk-UJORUWGK.mjs → chunk-WG5F7OJK.mjs} +5 -5
- package/dist/{chunk-BGWUN6JU.mjs → chunk-XIDK2YZE.mjs} +5 -5
- package/dist/{chunk-CU5DCV52.mjs → chunk-YBA7ROY5.mjs} +35 -72
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.d.mts +3 -3
- package/dist/src/executors/serve/executor.d.ts +3 -3
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.54.4 (2025-01-23)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **monorepo:** Resolve issue with internal package referencing ([cdc11477](https://github.com/storm-software/storm-ops/commit/cdc11477))
|
|
6
|
+
|
|
7
|
+
## 0.54.3 (2025-01-22)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous
|
|
10
|
+
|
|
11
|
+
- **monorepo:** Update the workspace's `storm.json` config to use the new preset repository ([95067c70](https://github.com/storm-software/storm-ops/commit/95067c70))
|
|
12
|
+
|
|
1
13
|
## 0.54.2 (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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPR2M4S7Fjs = require('./chunk-PR2M4S7F.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkDFG3KJWSjs = require('./chunk-DFG3KJWS.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ var _chunkTHKJZT32js = require('./chunk-THKJZT32.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkILLCSSWNjs = require('./chunk-ILLCSSWN.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
@@ -38,21 +38,21 @@ var vitestScript = `"test": "vitest run"`;
|
|
|
38
38
|
|
|
39
39
|
// src/generators/worker/generator.ts
|
|
40
40
|
async function applicationGenerator(tree, schema) {
|
|
41
|
-
const stopwatch =
|
|
41
|
+
const stopwatch = _chunkILLCSSWNjs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
42
42
|
let config;
|
|
43
43
|
try {
|
|
44
|
-
|
|
44
|
+
_chunkILLCSSWNjs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
45
45
|
|
|
46
46
|
`, config);
|
|
47
|
-
const workspaceRoot =
|
|
48
|
-
|
|
47
|
+
const workspaceRoot = _chunkILLCSSWNjs.findWorkspaceRoot.call(void 0, );
|
|
48
|
+
_chunkILLCSSWNjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.json file...
|
|
49
49
|
- workspaceRoot: ${workspaceRoot}`, config);
|
|
50
|
-
config = await
|
|
51
|
-
|
|
50
|
+
config = await _chunkDFG3KJWSjs.getConfig.call(void 0, workspaceRoot);
|
|
51
|
+
_chunkILLCSSWNjs.writeTrace.call(void 0, `Loaded Storm config into env:
|
|
52
52
|
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`, config);
|
|
53
53
|
const options = await normalizeOptions(tree, schema, config);
|
|
54
54
|
const tasks = [];
|
|
55
|
-
tasks.push(await
|
|
55
|
+
tasks.push(await _chunkPR2M4S7Fjs.generator_default.call(void 0, tree, {
|
|
56
56
|
...options,
|
|
57
57
|
skipFormat: true
|
|
58
58
|
}));
|
|
@@ -107,8 +107,8 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
107
107
|
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
108
108
|
} catch (error) {
|
|
109
109
|
return () => {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
_chunkILLCSSWNjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
111
|
+
_chunkILLCSSWNjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
112
112
|
- Details: ${error.message}
|
|
113
113
|
- Stacktrace: ${error.stack}`, config);
|
|
114
114
|
};
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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) => {
|
|
@@ -8,7 +8,7 @@ var require_package = __commonJS({
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@storm-software/cloudflare-tools",
|
|
11
|
-
version: "0.54.
|
|
11
|
+
version: "0.54.4",
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
repository: {
|
|
14
14
|
type: "github",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
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 ||
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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 :
|
|
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
|
|
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 :
|
|
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
|
-
|
|
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
|
-
|
|
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`] ?
|
|
106
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
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`] ?
|
|
109
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
110
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
111
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
112
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
113
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
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`])) ?
|
|
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_`) &&
|
|
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 ===
|
|
144
|
-
if (config.homepage ===
|
|
145
|
-
config.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 ===
|
|
151
|
-
if (config.homepage ===
|
|
152
|
-
config.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`] =
|
|
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`] =
|
|
294
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
295
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
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`] =
|
|
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`] =
|
|
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`] =
|
|
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`] =
|
|
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`] =
|
|
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`] =
|
|
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(
|
|
369
|
-
process.env.RUST_BACKTRACE =
|
|
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
|
|
477
|
-
let
|
|
478
|
-
if (_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data])
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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
|
-
|
|
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
|
-
|
|
495
|
-
|
|
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.
|
|
550
|
+
exports.getConfig = getConfig;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
STORM_DEFAULT_DOCS,
|
|
5
5
|
STORM_DEFAULT_HOMEPAGE,
|
|
6
6
|
STORM_DEFAULT_LICENSING,
|
|
7
|
+
StormConfigSchema,
|
|
7
8
|
correctPaths,
|
|
8
9
|
findWorkspaceRoot,
|
|
9
10
|
formatLogMessage,
|
|
@@ -11,10 +12,9 @@ import {
|
|
|
11
12
|
getLogLevel,
|
|
12
13
|
getLogLevelLabel,
|
|
13
14
|
joinPaths,
|
|
14
|
-
writeSystem,
|
|
15
15
|
writeTrace,
|
|
16
16
|
writeWarning
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IXEWBCGZ.mjs";
|
|
18
18
|
import {
|
|
19
19
|
__name
|
|
20
20
|
} from "./chunk-A7FFSBE6.mjs";
|
|
@@ -27,19 +27,19 @@ import { loadConfig } from "c12";
|
|
|
27
27
|
import defu from "defu";
|
|
28
28
|
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
29
29
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
const configs = await Promise.all([
|
|
31
|
+
loadConfig({
|
|
32
|
+
cwd: workspacePath,
|
|
33
|
+
packageJson: true,
|
|
34
|
+
name: fileName,
|
|
35
|
+
envName: fileName?.toUpperCase(),
|
|
36
|
+
jitiOptions: {
|
|
37
|
+
debug: false,
|
|
38
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
39
|
+
},
|
|
40
|
+
...options
|
|
41
|
+
}),
|
|
42
|
+
loadConfig({
|
|
43
43
|
cwd: workspacePath,
|
|
44
44
|
packageJson: true,
|
|
45
45
|
name: fileName,
|
|
@@ -50,9 +50,9 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
50
50
|
},
|
|
51
51
|
configFile: fileName,
|
|
52
52
|
...options
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
return
|
|
53
|
+
})
|
|
54
|
+
]);
|
|
55
|
+
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
56
56
|
}, "getConfigFileByName");
|
|
57
57
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
58
58
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
@@ -60,7 +60,7 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
60
60
|
let config = result.config;
|
|
61
61
|
const configFile = result.configFile;
|
|
62
62
|
if (config && configFile && Object.keys(config).length > 0) {
|
|
63
|
-
|
|
63
|
+
writeTrace(`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__ */ __name(async (filePath, additionalFileNames
|
|
|
68
68
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
69
69
|
for (const result2 of results) {
|
|
70
70
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
71
|
-
|
|
71
|
+
writeTrace(`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 = defu(result2.config ?? {}, config ?? {});
|
|
@@ -83,6 +83,16 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
83
83
|
}, "getConfigFile");
|
|
84
84
|
|
|
85
85
|
// ../config-tools/src/env/get-env.ts
|
|
86
|
+
var getExtensionEnv = /* @__PURE__ */ __name((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__ */ __name(() => {
|
|
87
97
|
const prefix = "STORM_";
|
|
88
98
|
let config = {
|
|
@@ -242,7 +252,7 @@ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
|
242
252
|
var setConfigEnv = /* @__PURE__ */ __name((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;
|
|
@@ -472,30 +482,69 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
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
|
|
477
|
-
let
|
|
478
|
-
if (_static_cache?.data
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
487
|
+
var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
488
|
+
let result;
|
|
489
|
+
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
490
|
+
let _workspaceRoot = workspaceRoot;
|
|
491
|
+
if (!_workspaceRoot) {
|
|
492
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
493
|
+
}
|
|
494
|
+
const configEnv = getConfigEnv();
|
|
495
|
+
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
496
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
497
|
+
if (!configFile && !skipLogs) {
|
|
498
|
+
writeWarning("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 StormConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
|
|
503
|
+
result.workspaceRoot ??= _workspaceRoot;
|
|
504
|
+
} else {
|
|
505
|
+
result = _static_cache.data;
|
|
491
506
|
}
|
|
492
|
-
|
|
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__ */ __name((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__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
534
|
+
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
493
535
|
setConfigEnv(config);
|
|
494
|
-
|
|
536
|
+
if (!skipLogs) {
|
|
537
|
+
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
495
538
|
${formatLogMessage(config)}`, config);
|
|
539
|
+
}
|
|
496
540
|
return config;
|
|
497
541
|
}, "loadStormConfig");
|
|
498
542
|
|
|
543
|
+
// ../config-tools/src/get-config.ts
|
|
544
|
+
var getConfig = /* @__PURE__ */ __name((workspaceRoot, skipLogs = false) => {
|
|
545
|
+
return loadStormConfig(workspaceRoot, skipLogs);
|
|
546
|
+
}, "getConfig");
|
|
547
|
+
|
|
499
548
|
export {
|
|
500
|
-
|
|
549
|
+
getConfig
|
|
501
550
|
};
|