@storm-software/cloudflare-tools 0.54.7 → 0.54.8
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 +6 -0
- package/README.md +1 -1
- package/dist/{chunk-ILLCSSWN.js → chunk-43HWVEIC.js} +12 -6
- package/dist/{chunk-DFG3KJWS.js → chunk-6Q4S7VSU.js} +41 -41
- package/dist/{chunk-BM5BCBD5.js → chunk-ADRS43PR.js} +3 -3
- package/dist/{chunk-DQHMNZ47.mjs → chunk-BKBJDKMA.mjs} +1 -1
- package/dist/{chunk-V6AZAO6I.mjs → chunk-FRA27Q4O.mjs} +8 -2
- package/dist/{chunk-LXXVBXFM.js → chunk-GCD4ACJC.js} +16 -16
- package/dist/{chunk-AHH4H2KV.mjs → chunk-GFBCXKWS.mjs} +1 -1
- package/dist/{chunk-IXEWBCGZ.mjs → chunk-GMLMIRU7.mjs} +16 -10
- package/dist/{chunk-OG2Q7NAH.js → chunk-J4ZEL2FS.js} +160 -154
- package/dist/{chunk-4CRTRUC2.mjs → chunk-KZ4CEGFR.mjs} +3 -3
- package/dist/{chunk-PSWKGEBI.js → chunk-MRGXWXWO.js} +1 -1
- package/dist/{chunk-23YXGFBU.mjs → chunk-NP7DE7UM.mjs} +1 -1
- package/dist/{chunk-QBGHFLOI.js → chunk-OPYQILOY.js} +12 -12
- package/dist/{chunk-XIDK2YZE.mjs → chunk-XSVPXWSA.mjs} +3 -3
- 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.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
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 -->
|
|
@@ -3,26 +3,32 @@
|
|
|
3
3
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
4
4
|
|
|
5
5
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
|
-
var
|
|
6
|
+
var _path = require('path');
|
|
7
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (osSpecificPath) => {
|
|
8
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
9
|
+
}, "removeWindowsDriveLetter");
|
|
7
10
|
var correctPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path) => {
|
|
8
11
|
if (!path) {
|
|
9
12
|
return "";
|
|
10
13
|
}
|
|
11
|
-
if (
|
|
12
|
-
path
|
|
14
|
+
if (path.includes("\\")) {
|
|
15
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
16
|
+
path = `C:${path}`;
|
|
17
|
+
}
|
|
18
|
+
return path.replaceAll("/", "\\");
|
|
13
19
|
}
|
|
14
|
-
return path.
|
|
20
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
15
21
|
}, "correctPaths");
|
|
16
22
|
var joinPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (...paths) => {
|
|
17
23
|
if (!paths || paths.length === 0) {
|
|
18
24
|
return "";
|
|
19
25
|
}
|
|
20
|
-
return correctPaths(
|
|
26
|
+
return correctPaths(_path.join.call(void 0, ...paths));
|
|
21
27
|
}, "joinPaths");
|
|
22
28
|
|
|
23
29
|
// ../config-tools/src/utilities/find-up.ts
|
|
24
30
|
var _fs = require('fs');
|
|
25
|
-
|
|
31
|
+
|
|
26
32
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
27
33
|
var depth = 0;
|
|
28
34
|
function findFolderUp(startPath, endFileNames) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk43HWVEICjs = require('./chunk-43HWVEIC.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
@@ -26,7 +26,7 @@ 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 ||
|
|
29
|
+
const workspacePath = filePath || _chunk43HWVEICjs.findWorkspaceRoot.call(void 0, filePath);
|
|
30
30
|
const configs = await Promise.all([
|
|
31
31
|
_c12.loadConfig.call(void 0, {
|
|
32
32
|
cwd: workspacePath,
|
|
@@ -35,7 +35,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, a
|
|
|
35
35
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
36
36
|
jitiOptions: {
|
|
37
37
|
debug: false,
|
|
38
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
38
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk43HWVEICjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
39
39
|
},
|
|
40
40
|
...options
|
|
41
41
|
}),
|
|
@@ -46,7 +46,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, a
|
|
|
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 : _chunk43HWVEICjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
50
50
|
},
|
|
51
51
|
configFile: fileName,
|
|
52
52
|
...options
|
|
@@ -55,12 +55,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, a
|
|
|
55
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 : _chunk43HWVEICjs.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
|
+
_chunk43HWVEICjs.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
|
+
_chunk43HWVEICjs.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, () => ( {})));
|
|
@@ -112,15 +112,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
|
|
|
112
112
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
113
113
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
114
114
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
115
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
116
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
115
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
116
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
117
117
|
directories: {
|
|
118
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
119
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
120
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
121
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
122
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
123
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
118
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
119
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
120
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
121
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
122
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
123
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunk43HWVEICjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
124
124
|
},
|
|
125
125
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
126
126
|
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -143,23 +143,23 @@ var getConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
|
|
|
143
143
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
144
144
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
145
145
|
},
|
|
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`])) ?
|
|
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`])) ? _chunk43HWVEICjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
147
147
|
};
|
|
148
|
-
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_`) && _chunk43HWVEICjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
149
149
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
150
150
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
151
151
|
return ret;
|
|
152
152
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
153
|
-
if (config.docs ===
|
|
154
|
-
if (config.homepage ===
|
|
155
|
-
config.docs = `${
|
|
153
|
+
if (config.docs === _chunk43HWVEICjs.STORM_DEFAULT_DOCS) {
|
|
154
|
+
if (config.homepage === _chunk43HWVEICjs.STORM_DEFAULT_HOMEPAGE) {
|
|
155
|
+
config.docs = `${_chunk43HWVEICjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
156
156
|
} else {
|
|
157
157
|
config.docs = `${config.homepage}/docs`;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
if (config.licensing ===
|
|
161
|
-
if (config.homepage ===
|
|
162
|
-
config.licensing = `${
|
|
160
|
+
if (config.licensing === _chunk43HWVEICjs.STORM_DEFAULT_LICENSING) {
|
|
161
|
+
if (config.homepage === _chunk43HWVEICjs.STORM_DEFAULT_HOMEPAGE) {
|
|
162
|
+
config.licensing = `${_chunk43HWVEICjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
163
163
|
} else {
|
|
164
164
|
config.licensing = `${config.homepage}/docs`;
|
|
165
165
|
}
|
|
@@ -297,31 +297,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config)
|
|
|
297
297
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
298
298
|
}
|
|
299
299
|
if (config.configFile) {
|
|
300
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
300
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.configFile);
|
|
301
301
|
}
|
|
302
302
|
if (config.workspaceRoot) {
|
|
303
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
304
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
305
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
303
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
304
|
+
process.env.NX_WORKSPACE_ROOT = _chunk43HWVEICjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
305
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunk43HWVEICjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
306
306
|
}
|
|
307
307
|
if (config.directories) {
|
|
308
308
|
if (!config.skipCache && config.directories.cache) {
|
|
309
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
309
|
+
process.env[`${prefix}CACHE_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.cache);
|
|
310
310
|
}
|
|
311
311
|
if (config.directories.data) {
|
|
312
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
312
|
+
process.env[`${prefix}DATA_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.data);
|
|
313
313
|
}
|
|
314
314
|
if (config.directories.config) {
|
|
315
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
315
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.config);
|
|
316
316
|
}
|
|
317
317
|
if (config.directories.temp) {
|
|
318
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
318
|
+
process.env[`${prefix}TEMP_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.temp);
|
|
319
319
|
}
|
|
320
320
|
if (config.directories.log) {
|
|
321
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
321
|
+
process.env[`${prefix}LOG_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.log);
|
|
322
322
|
}
|
|
323
323
|
if (config.directories.build) {
|
|
324
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
324
|
+
process.env[`${prefix}BUILD_DIR`] = _chunk43HWVEICjs.correctPaths.call(void 0, config.directories.build);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
if (config.skipCache !== void 0) {
|
|
@@ -375,8 +375,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config)
|
|
|
375
375
|
if (config.logLevel) {
|
|
376
376
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
377
377
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
378
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
379
|
-
process.env.RUST_BACKTRACE =
|
|
378
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunk43HWVEICjs.getLogLevel.call(void 0, config.logLevel) >= _chunk43HWVEICjs.LogLevel.DEBUG ? true : false);
|
|
379
|
+
process.env.RUST_BACKTRACE = _chunk43HWVEICjs.getLogLevel.call(void 0, config.logLevel) >= _chunk43HWVEICjs.LogLevel.DEBUG ? "full" : "none";
|
|
380
380
|
}
|
|
381
381
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
382
382
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
@@ -489,17 +489,17 @@ var createStormConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, asy
|
|
|
489
489
|
if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
490
490
|
let _workspaceRoot = workspaceRoot;
|
|
491
491
|
if (!_workspaceRoot) {
|
|
492
|
-
_workspaceRoot =
|
|
492
|
+
_workspaceRoot = _chunk43HWVEICjs.findWorkspaceRoot.call(void 0, );
|
|
493
493
|
}
|
|
494
494
|
const configEnv = getConfigEnv();
|
|
495
|
-
const defaultConfig = await
|
|
495
|
+
const defaultConfig = await _chunk43HWVEICjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
496
496
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
497
497
|
if (!configFile && !skipLogs) {
|
|
498
|
-
|
|
498
|
+
_chunk43HWVEICjs.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
499
|
logLevel: "all"
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
|
-
result = await
|
|
502
|
+
result = await _chunk43HWVEICjs.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
503
503
|
result.workspaceRoot ??= _workspaceRoot;
|
|
504
504
|
} else {
|
|
505
505
|
result = _static_cache.data;
|
|
@@ -534,8 +534,8 @@ var loadStormConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
534
534
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
535
535
|
setConfigEnv(config);
|
|
536
536
|
if (!skipLogs) {
|
|
537
|
-
|
|
538
|
-
${
|
|
537
|
+
_chunk43HWVEICjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
|
|
538
|
+
${_chunk43HWVEICjs.formatLogMessage.call(void 0, config)}`, config);
|
|
539
539
|
}
|
|
540
540
|
return config;
|
|
541
541
|
}, "loadStormConfig");
|
|
@@ -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 _chunk43HWVEICjs = require('./chunk-43HWVEIC.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
|
+
_chunk43HWVEICjs.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
|
+
_chunk43HWVEICjs.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) => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-XU6MTFCV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BKBJDKMA.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-
|
|
23
|
+
} from "./chunk-GMLMIRU7.mjs";
|
|
24
24
|
import {
|
|
25
25
|
__dirname,
|
|
26
26
|
__name,
|
|
@@ -3503,6 +3503,12 @@ var YARN_LOCK_PATH = join2(workspaceRoot2, YARN_LOCK_FILE);
|
|
|
3503
3503
|
var NPM_LOCK_PATH = join2(workspaceRoot2, NPM_LOCK_FILE);
|
|
3504
3504
|
var PNPM_LOCK_PATH = join2(workspaceRoot2, PNPM_LOCK_FILE);
|
|
3505
3505
|
|
|
3506
|
+
// ../workspace-tools/src/utils/plugin-helpers.ts
|
|
3507
|
+
import { readJsonFile as readJsonFile2 } from "@nx/devkit";
|
|
3508
|
+
import defu5 from "defu";
|
|
3509
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
3510
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
3511
|
+
|
|
3506
3512
|
// ../workspace-tools/src/utils/typia-transform.ts
|
|
3507
3513
|
import transform2 from "typia/lib/transform";
|
|
3508
3514
|
|
|
@@ -1,21 +1,21 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkADRS43PRjs = require('./chunk-ADRS43PR.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk6Q4S7VSUjs = require('./chunk-6Q4S7VSU.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk43HWVEICjs = require('./chunk-43HWVEIC.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
@@ -36,8 +36,8 @@ async function runExecutor(options, context) {
|
|
|
36
36
|
throw new Error("The executor requires projectsConfigurations.");
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
|
-
const workspaceRoot =
|
|
40
|
-
const config = await
|
|
39
|
+
const workspaceRoot = _chunk43HWVEICjs.findWorkspaceRoot.call(void 0, );
|
|
40
|
+
const config = await _chunk6Q4S7VSUjs.getConfig.call(void 0, workspaceRoot);
|
|
41
41
|
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
42
42
|
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
43
43
|
const projectDetails = _chunkVTHBMY4Bjs.getPackageInfo.call(void 0, context.projectsConfigurations.projects[context.projectName]);
|
|
@@ -62,7 +62,7 @@ async function runExecutor(options, context) {
|
|
|
62
62
|
if (!projectGraph) {
|
|
63
63
|
throw new Error("No project graph found in cache");
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
_chunk43HWVEICjs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
|
|
66
66
|
const s3Client = new (0, _clients3.S3)({
|
|
67
67
|
region: "auto",
|
|
68
68
|
endpoint,
|
|
@@ -72,12 +72,12 @@ async function runExecutor(options, context) {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
|
|
75
|
-
|
|
75
|
+
_chunk43HWVEICjs.writeInfo.call(void 0, `Generated component version: ${version}`);
|
|
76
76
|
const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
|
|
77
77
|
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
78
78
|
});
|
|
79
79
|
const projectPath = `registry/${context.projectName}`;
|
|
80
|
-
const internalDependencies = await
|
|
80
|
+
const internalDependencies = await _chunkADRS43PRjs.getInternalDependencies.call(void 0, context.projectName, projectGraph);
|
|
81
81
|
const dependencies = internalDependencies.filter((projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")).reduce((ret, dep) => {
|
|
82
82
|
if (!ret[dep.name]) {
|
|
83
83
|
ret[dep.name] = "latest";
|
|
@@ -85,14 +85,14 @@ async function runExecutor(options, context) {
|
|
|
85
85
|
return ret;
|
|
86
86
|
}, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
|
|
87
87
|
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
88
|
-
|
|
88
|
+
_chunk43HWVEICjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
|
|
89
89
|
if (!isDryRun) {
|
|
90
90
|
const response = await s3Client.listObjects({
|
|
91
91
|
Bucket: options.bucketId,
|
|
92
92
|
Prefix: projectPath
|
|
93
93
|
});
|
|
94
94
|
if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
|
|
95
|
-
|
|
95
|
+
_chunk43HWVEICjs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
|
|
96
96
|
await Promise.all(response.Contents.map((item) => s3Client.deleteObjects({
|
|
97
97
|
Bucket: options.bucketId,
|
|
98
98
|
Delete: {
|
|
@@ -105,10 +105,10 @@ async function runExecutor(options, context) {
|
|
|
105
105
|
}
|
|
106
106
|
})));
|
|
107
107
|
} else {
|
|
108
|
-
|
|
108
|
+
_chunk43HWVEICjs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
|
|
109
109
|
}
|
|
110
110
|
} else {
|
|
111
|
-
|
|
111
|
+
_chunk43HWVEICjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
112
112
|
}
|
|
113
113
|
const meta = {
|
|
114
114
|
name: context.projectName,
|
|
@@ -124,16 +124,16 @@ async function runExecutor(options, context) {
|
|
|
124
124
|
meta.devDependencies = projectDetails.content.devDependencies;
|
|
125
125
|
}
|
|
126
126
|
const metaJson = JSON.stringify(meta);
|
|
127
|
-
|
|
127
|
+
_chunk43HWVEICjs.writeInfo.call(void 0, `Generating meta.json file:
|
|
128
128
|
${metaJson}`);
|
|
129
|
-
await
|
|
129
|
+
await _chunkADRS43PRjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
|
|
130
130
|
await Promise.all(files.map((file) => {
|
|
131
131
|
const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
|
|
132
132
|
return _promises.readFile.call(void 0, file, {
|
|
133
133
|
encoding: "utf8"
|
|
134
|
-
}).then((fileContent) =>
|
|
134
|
+
}).then((fileContent) => _chunkADRS43PRjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
|
|
135
135
|
}));
|
|
136
|
-
|
|
136
|
+
_chunk43HWVEICjs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
|
|
137
137
|
return {
|
|
138
138
|
success: true
|
|
139
139
|
};
|
|
@@ -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.8",
|
|
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",
|
|
@@ -3,35 +3,41 @@ import {
|
|
|
3
3
|
} from "./chunk-A7FFSBE6.mjs";
|
|
4
4
|
|
|
5
5
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
|
-
import {
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
8
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
9
|
+
}, "removeWindowsDriveLetter");
|
|
7
10
|
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
8
11
|
if (!path) {
|
|
9
12
|
return "";
|
|
10
13
|
}
|
|
11
|
-
if (
|
|
12
|
-
path
|
|
14
|
+
if (path.includes("\\")) {
|
|
15
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
16
|
+
path = `C:${path}`;
|
|
17
|
+
}
|
|
18
|
+
return path.replaceAll("/", "\\");
|
|
13
19
|
}
|
|
14
|
-
return path.
|
|
20
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
15
21
|
}, "correctPaths");
|
|
16
22
|
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
17
23
|
if (!paths || paths.length === 0) {
|
|
18
24
|
return "";
|
|
19
25
|
}
|
|
20
|
-
return correctPaths(
|
|
26
|
+
return correctPaths(join(...paths));
|
|
21
27
|
}, "joinPaths");
|
|
22
28
|
|
|
23
29
|
// ../config-tools/src/utilities/find-up.ts
|
|
24
30
|
import { existsSync } from "node:fs";
|
|
25
|
-
import { join } from "node:path";
|
|
31
|
+
import { join as join2 } from "node:path";
|
|
26
32
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
27
33
|
var depth = 0;
|
|
28
34
|
function findFolderUp(startPath, endFileNames) {
|
|
29
35
|
const _startPath = startPath ?? process.cwd();
|
|
30
|
-
if (endFileNames.some((endFileName) => existsSync(
|
|
36
|
+
if (endFileNames.some((endFileName) => existsSync(join2(_startPath, endFileName)))) {
|
|
31
37
|
return _startPath;
|
|
32
38
|
}
|
|
33
39
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
34
|
-
const parent =
|
|
40
|
+
const parent = join2(_startPath, "..");
|
|
35
41
|
return findFolderUp(parent, endFileNames);
|
|
36
42
|
}
|
|
37
43
|
return void 0;
|
|
@@ -290,7 +296,7 @@ var COLOR_KEYS = [
|
|
|
290
296
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
291
297
|
import { existsSync as existsSync2 } from "node:fs";
|
|
292
298
|
import { readFile } from "node:fs/promises";
|
|
293
|
-
import { join as
|
|
299
|
+
import { join as join3 } from "node:path";
|
|
294
300
|
var DEFAULT_COLOR_CONFIG = {
|
|
295
301
|
"light": {
|
|
296
302
|
"background": "#fafafa",
|
|
@@ -326,7 +332,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
326
332
|
let namespace = void 0;
|
|
327
333
|
let repository = void 0;
|
|
328
334
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
329
|
-
if (existsSync2(
|
|
335
|
+
if (existsSync2(join3(workspaceRoot, "package.json"))) {
|
|
330
336
|
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
331
337
|
if (file) {
|
|
332
338
|
const packageJson = JSON.parse(file);
|