@storm-software/cloudflare-tools 0.53.1 → 0.54.1
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-L6Z7B2FZ.mjs → chunk-4UDIES3V.mjs} +1 -1
- package/dist/{chunk-CCD6A6BN.js → chunk-5WWJ6PHC.js} +1 -1
- package/dist/{chunk-GY2PQXHH.js → chunk-BAP6AE7N.js} +99 -141
- package/dist/{chunk-FBY3RXBP.js → chunk-H2PLVAKC.js} +2 -2
- package/dist/{chunk-RA7URPJI.mjs → chunk-NTZUGXQD.mjs} +50 -92
- package/dist/{chunk-O4TNQIAD.mjs → chunk-VE6PGD5B.mjs} +1 -1
- package/dist/executors.js +1 -1
- package/dist/executors.mjs +1 -1
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/src/executors/cloudflare-publish/executor.js +1 -1
- package/dist/src/executors/cloudflare-publish/executor.mjs +1 -1
- package/dist/src/executors/serve/executor.js +2 -2
- package/dist/src/executors/serve/executor.mjs +1 -1
- 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 +3 -3
- package/dist/src/generators/worker/generator.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.54.1 (2025-01-22)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **config-tools:** Resolved issue applying entire token parameters object ([5ccf3881](https://github.com/storm-software/storm-ops/commit/5ccf3881))
|
|
6
|
+
|
|
7
|
+
## 0.54.0 (2025-01-22)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **workspace-tools:** Enhanced option tokenization logic for executors ([14ed93d7](https://github.com/storm-software/storm-ops/commit/14ed93d7))
|
|
12
|
+
|
|
1
13
|
## 0.53.1 (2025-01-21)
|
|
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 -->
|
|
@@ -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.
|
|
11
|
+
version: "0.54.1",
|
|
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",
|
|
@@ -8,7 +8,7 @@ var require_package = _chunkJ5SB6L2Ljs.__commonJS.call(void 0, {
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@storm-software/cloudflare-tools",
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.54.1",
|
|
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",
|
|
@@ -27,48 +27,51 @@ var _chunkW6YNIJQDjs = require('./chunk-W6YNIJQD.js');
|
|
|
27
27
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
28
28
|
|
|
29
29
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
30
|
-
var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (option,
|
|
30
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (option, tokenParams) => {
|
|
31
31
|
let result = option;
|
|
32
32
|
if (!result) {
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
const optionKeys = Object.keys(
|
|
35
|
+
if (tokenParams) {
|
|
36
|
+
const optionKeys = Object.keys(tokenParams);
|
|
37
37
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
38
38
|
for (const optionKey of optionKeys) {
|
|
39
39
|
if (result.includes(`{${optionKey}}`)) {
|
|
40
|
-
result = result.replaceAll(`{${optionKey}}`,
|
|
40
|
+
result = result.replaceAll(`{${optionKey}}`, _optionalChain([tokenParams, 'optionalAccess', _2 => _2[optionKey]]) || "");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
if (
|
|
46
|
-
const configKeys = Object.keys(
|
|
45
|
+
if (tokenParams.config) {
|
|
46
|
+
const configKeys = Object.keys(tokenParams.config);
|
|
47
47
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
48
48
|
for (const configKey of configKeys) {
|
|
49
49
|
if (result.includes(`{${configKey}}`)) {
|
|
50
|
-
result = result.replaceAll(`{${configKey}}`,
|
|
50
|
+
result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(
|
|
56
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, ))));
|
|
57
57
|
}
|
|
58
58
|
return result;
|
|
59
59
|
}, "applyWorkspaceBaseTokens");
|
|
60
|
-
var
|
|
60
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option, tokenParams) => {
|
|
61
|
+
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
62
|
+
}, "applyWorkspaceProjectTokens");
|
|
63
|
+
var applyWorkspaceTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, tokenParams, tokenizerFn) => {
|
|
61
64
|
if (!options) {
|
|
62
65
|
return {};
|
|
63
66
|
}
|
|
64
67
|
const result = {};
|
|
65
68
|
for (const option of Object.keys(options)) {
|
|
66
69
|
if (typeof options[option] === "string") {
|
|
67
|
-
result[option] = await Promise.resolve(tokenizerFn(options[option],
|
|
70
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
|
|
68
71
|
} else if (Array.isArray(options[option])) {
|
|
69
|
-
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item,
|
|
72
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
|
|
70
73
|
} else if (typeof options[option] === "object") {
|
|
71
|
-
result[option] = await applyWorkspaceTokens(options[option],
|
|
74
|
+
result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
|
|
72
75
|
} else {
|
|
73
76
|
result[option] = options[option];
|
|
74
77
|
}
|
|
@@ -95,71 +98,24 @@ var run = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config, command,
|
|
|
95
98
|
});
|
|
96
99
|
}, "run");
|
|
97
100
|
|
|
98
|
-
// ../workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
99
|
-
var applyWorkspaceExecutorTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (option, tokenizerOptions) => {
|
|
100
|
-
let result = option;
|
|
101
|
-
if (!result) {
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
let projectName;
|
|
105
|
-
let projectRoot;
|
|
106
|
-
let sourceRoot;
|
|
107
|
-
if (_optionalChain([tokenizerOptions, 'optionalAccess', _6 => _6.projectName])) {
|
|
108
|
-
const context2 = tokenizerOptions;
|
|
109
|
-
projectName = context2.projectName;
|
|
110
|
-
projectRoot = context2.root;
|
|
111
|
-
sourceRoot = context2.sourceRoot;
|
|
112
|
-
} else {
|
|
113
|
-
const projectConfig = tokenizerOptions;
|
|
114
|
-
projectRoot = projectConfig.root;
|
|
115
|
-
if (projectConfig.name) {
|
|
116
|
-
projectName = projectConfig.name;
|
|
117
|
-
}
|
|
118
|
-
if (projectConfig.sourceRoot) {
|
|
119
|
-
sourceRoot = projectConfig.sourceRoot;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (tokenizerOptions.config) {
|
|
123
|
-
const configKeys = Object.keys(tokenizerOptions.config);
|
|
124
|
-
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
125
|
-
for (const configKey of configKeys) {
|
|
126
|
-
if (result.includes(`{${configKey}}`)) {
|
|
127
|
-
result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (result.includes("{projectName}")) {
|
|
133
|
-
result = result.replaceAll("{projectName}", projectName);
|
|
134
|
-
}
|
|
135
|
-
if (result.includes("{projectRoot}")) {
|
|
136
|
-
result = result.replaceAll("{projectRoot}", projectRoot);
|
|
137
|
-
}
|
|
138
|
-
if (result.includes("{sourceRoot}")) {
|
|
139
|
-
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
140
|
-
}
|
|
141
|
-
if (result.includes("{workspaceRoot}")) {
|
|
142
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, ))));
|
|
143
|
-
}
|
|
144
|
-
return result;
|
|
145
|
-
}, "applyWorkspaceExecutorTokens");
|
|
146
|
-
|
|
147
101
|
// ../workspace-tools/src/base/base-executor.ts
|
|
102
|
+
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
148
103
|
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context2) => {
|
|
149
104
|
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, name);
|
|
150
105
|
let options = _options;
|
|
151
106
|
let config = {};
|
|
152
107
|
try {
|
|
153
|
-
|
|
154
|
-
`, config);
|
|
155
|
-
if (!_optionalChain([context2, 'access', _7 => _7.projectsConfigurations, 'optionalAccess', _8 => _8.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
108
|
+
if (!_optionalChain([context2, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
156
109
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
157
110
|
}
|
|
158
111
|
const workspaceRoot3 = _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
|
|
159
|
-
const projectRoot =
|
|
160
|
-
const sourceRoot =
|
|
161
|
-
const projectName =
|
|
112
|
+
const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
|
|
113
|
+
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
114
|
+
const projectName = context2.projectName;
|
|
162
115
|
config.workspaceRoot = workspaceRoot3;
|
|
116
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `
|
|
117
|
+
\u26A1 Running the ${name} executor for ${projectName}
|
|
118
|
+
`, config);
|
|
163
119
|
if (!executorOptions.skipReadingConfig) {
|
|
164
120
|
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
165
121
|
- workspaceRoot: ${workspaceRoot3}
|
|
@@ -169,43 +125,45 @@ var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name
|
|
|
169
125
|
`, config);
|
|
170
126
|
config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
171
127
|
}
|
|
172
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
128
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
173
129
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
174
130
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
175
131
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
176
132
|
}
|
|
177
|
-
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
178
|
-
${
|
|
179
|
-
|
|
180
|
-
|
|
133
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
134
|
+
${_chunkW6YNIJQDjs.formatLogMessage.call(void 0, options)}
|
|
135
|
+
`, config);
|
|
136
|
+
const tokenized = await applyWorkspaceTokens(options, _defu.defu.call(void 0, {
|
|
181
137
|
workspaceRoot: workspaceRoot3,
|
|
182
138
|
projectRoot,
|
|
183
139
|
sourceRoot,
|
|
184
140
|
projectName,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
141
|
+
config
|
|
142
|
+
}, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
|
|
143
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
144
|
+
${_chunkW6YNIJQDjs.formatLogMessage.call(void 0, tokenized)}
|
|
145
|
+
`, config);
|
|
146
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
189
147
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
190
148
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
191
149
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
192
150
|
}
|
|
193
151
|
const ret = executorFn(tokenized, context2, config);
|
|
194
|
-
if (_isFunction(_optionalChain([ret, 'optionalAccess',
|
|
152
|
+
if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
|
|
195
153
|
const asyncGen = ret;
|
|
196
154
|
for await (const iter of asyncGen) {
|
|
197
155
|
}
|
|
198
156
|
}
|
|
199
157
|
const result = await Promise.resolve(ret);
|
|
200
|
-
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess',
|
|
158
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _12 => _12.error, 'optionalAccess', _13 => _13.message]) && typeof _optionalChain([result, 'optionalAccess', _14 => _14.error, 'optionalAccess', _15 => _15.message]) === "string" && _optionalChain([result, 'optionalAccess', _16 => _16.error, 'optionalAccess', _17 => _17.name]) && typeof _optionalChain([result, 'optionalAccess', _18 => _18.error, 'optionalAccess', _19 => _19.name]) === "string")) {
|
|
201
159
|
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
202
160
|
${_chunkW6YNIJQDjs.formatLogMessage.call(void 0, result)}`, config);
|
|
203
161
|
console.error(result);
|
|
204
162
|
throw new Error(`The ${name} executor failed to run`, {
|
|
205
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
163
|
+
cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
|
|
206
164
|
});
|
|
207
165
|
}
|
|
208
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
166
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
|
|
209
167
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
210
168
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
211
169
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
@@ -229,7 +187,7 @@ ${_chunkW6YNIJQDjs.formatLogMessage.call(void 0, result)}`, config);
|
|
|
229
187
|
}, "withRunExecutor");
|
|
230
188
|
var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) => {
|
|
231
189
|
try {
|
|
232
|
-
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess',
|
|
190
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _23 => _23.constructor]) && _optionalChain([value, 'optionalAccess', _24 => _24.call]) && _optionalChain([value, 'optionalAccess', _25 => _25.apply]));
|
|
233
191
|
} catch (e) {
|
|
234
192
|
return false;
|
|
235
193
|
}
|
|
@@ -294,10 +252,10 @@ async function cargoCommand(...args) {
|
|
|
294
252
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoCommand, "cargoCommand");
|
|
295
253
|
function cargoCommandSync(args = "", options) {
|
|
296
254
|
const normalizedOptions = {
|
|
297
|
-
stdio: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
255
|
+
stdio: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.stdio]), () => ( "inherit")),
|
|
298
256
|
env: {
|
|
299
257
|
...process.env,
|
|
300
|
-
..._optionalChain([options, 'optionalAccess',
|
|
258
|
+
..._optionalChain([options, 'optionalAccess', _27 => _27.env])
|
|
301
259
|
}
|
|
302
260
|
};
|
|
303
261
|
try {
|
|
@@ -332,7 +290,7 @@ function cargoMetadata() {
|
|
|
332
290
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoMetadata, "cargoMetadata");
|
|
333
291
|
function runProcess(processCmd, ...args) {
|
|
334
292
|
const metadata = cargoMetadata();
|
|
335
|
-
const targetDir = _nullishCoalesce(_optionalChain([metadata, 'optionalAccess',
|
|
293
|
+
const targetDir = _nullishCoalesce(_optionalChain([metadata, 'optionalAccess', _28 => _28.target_directory]), () => ( _devkit.joinPathFragments.call(void 0, _devkit.workspaceRoot, "dist", "cargo")));
|
|
336
294
|
return new Promise((resolve) => {
|
|
337
295
|
if (process.env.VERCEL) {
|
|
338
296
|
return resolve({
|
|
@@ -543,10 +501,10 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
543
501
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
544
502
|
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
545
503
|
const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
546
|
-
if (!_optionalChain([projectsConfigurations, 'optionalAccess',
|
|
504
|
+
if (!_optionalChain([projectsConfigurations, 'optionalAccess', _29 => _29.projects, 'optionalAccess', _30 => _30[projectName]])) {
|
|
547
505
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
548
506
|
}
|
|
549
|
-
const buildTarget = _optionalChain([projectsConfigurations, 'access',
|
|
507
|
+
const buildTarget = _optionalChain([projectsConfigurations, 'access', _31 => _31.projects, 'access', _32 => _32[projectName], 'access', _33 => _33.targets, 'optionalAccess', _34 => _34.build]);
|
|
550
508
|
if (!buildTarget) {
|
|
551
509
|
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 ${_chunkW6YNIJQDjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
|
|
552
510
|
}
|
|
@@ -780,7 +738,7 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
|
780
738
|
|
|
781
739
|
// ../esbuild/src/build.ts
|
|
782
740
|
var _chokidar = require('chokidar');
|
|
783
|
-
|
|
741
|
+
|
|
784
742
|
var _estoolkit = require('es-toolkit');
|
|
785
743
|
var _compat = require('es-toolkit/compat');
|
|
786
744
|
var _esbuild = require('esbuild'); var esbuild2 = _interopRequireWildcard(_esbuild); var esbuild = _interopRequireWildcard(_esbuild);
|
|
@@ -853,15 +811,15 @@ var RendererEngine = class {
|
|
|
853
811
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
854
812
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
855
813
|
}
|
|
856
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
814
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _35 => _35.outputs, 'access', _36 => _36[relativePath]]);
|
|
857
815
|
return {
|
|
858
816
|
type: "chunk",
|
|
859
817
|
path: file.path,
|
|
860
818
|
code: file.text,
|
|
861
|
-
map: _optionalChain([outputFiles, 'access',
|
|
862
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
863
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
864
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
819
|
+
map: _optionalChain([outputFiles, 'access', _37 => _37.find, 'call', _38 => _38((f) => f.path === `${file.path}.map`), 'optionalAccess', _39 => _39.text]),
|
|
820
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _40 => _40.entryPoint]),
|
|
821
|
+
exports: _optionalChain([meta, 'optionalAccess', _41 => _41.exports]),
|
|
822
|
+
imports: _optionalChain([meta, 'optionalAccess', _42 => _42.imports])
|
|
865
823
|
};
|
|
866
824
|
} else {
|
|
867
825
|
return {
|
|
@@ -944,7 +902,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
944
902
|
name: "storm:esm-split-code-to-cjs",
|
|
945
903
|
setup(build5) {
|
|
946
904
|
build5.onEnd(async (result) => {
|
|
947
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
905
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _43 => _43.metafile, 'optionalAccess', _44 => _44.outputs]), () => ( {})));
|
|
948
906
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
949
907
|
await esbuild.build({
|
|
950
908
|
outdir: resolvedOptions.outdir,
|
|
@@ -1066,7 +1024,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
1066
1024
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
1067
1025
|
|
|
1068
1026
|
function resolvePathsConfig(options, cwd) {
|
|
1069
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1027
|
+
if (_optionalChain([options, 'optionalAccess', _45 => _45.compilerOptions, 'optionalAccess', _46 => _46.paths])) {
|
|
1070
1028
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
1071
1029
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
1072
1030
|
return [
|
|
@@ -1094,7 +1052,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
1094
1052
|
build5.onResolve({
|
|
1095
1053
|
filter: packagesRegex
|
|
1096
1054
|
}, (args) => {
|
|
1097
|
-
if (_optionalChain([build5, 'access',
|
|
1055
|
+
if (_optionalChain([build5, 'access', _47 => _47.initialOptions, 'access', _48 => _48.external, 'optionalAccess', _49 => _49.includes, 'call', _50 => _50(args.path)])) {
|
|
1098
1056
|
return {
|
|
1099
1057
|
path: args.path,
|
|
1100
1058
|
external: true
|
|
@@ -1202,7 +1160,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1202
1160
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1203
1161
|
if (npmPackage.startsWith("@")) {
|
|
1204
1162
|
const [scope, name] = npmPackage.split("/");
|
|
1205
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1163
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _51 => _51.slice, 'call', _52 => _52(1)])}__${name}`;
|
|
1206
1164
|
}
|
|
1207
1165
|
return `@types/${npmPackage}`;
|
|
1208
1166
|
}
|
|
@@ -1409,7 +1367,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1409
1367
|
return (...args) => {
|
|
1410
1368
|
let result = fn(...args);
|
|
1411
1369
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1412
|
-
result = _optionalChain([fns, 'access',
|
|
1370
|
+
result = _optionalChain([fns, 'access', _53 => _53[i], 'optionalCall', _54 => _54(result)]);
|
|
1413
1371
|
}
|
|
1414
1372
|
return result;
|
|
1415
1373
|
};
|
|
@@ -1419,7 +1377,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1419
1377
|
return async (...args) => {
|
|
1420
1378
|
let result = await fn(...args);
|
|
1421
1379
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1422
|
-
result = await _optionalChain([fns, 'access',
|
|
1380
|
+
result = await _optionalChain([fns, 'access', _55 => _55[i], 'optionalCall', _56 => _56(result)]);
|
|
1423
1381
|
}
|
|
1424
1382
|
return result;
|
|
1425
1383
|
};
|
|
@@ -1448,7 +1406,7 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1448
1406
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1449
1407
|
const projectName = projectJson.name;
|
|
1450
1408
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1451
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1409
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _57 => _57.projects, 'optionalAccess', _58 => _58[projectName]])) {
|
|
1452
1410
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1453
1411
|
}
|
|
1454
1412
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
@@ -1624,7 +1582,7 @@ async function executeEsBuild(context2) {
|
|
|
1624
1582
|
}
|
|
1625
1583
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1626
1584
|
async function copyBuildAssets(context2) {
|
|
1627
|
-
if (_optionalChain([context2, 'access',
|
|
1585
|
+
if (_optionalChain([context2, 'access', _59 => _59.result, 'optionalAccess', _60 => _60.errors, 'access', _61 => _61.length]) === 0) {
|
|
1628
1586
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1629
1587
|
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1630
1588
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
|
|
@@ -1634,7 +1592,7 @@ async function copyBuildAssets(context2) {
|
|
|
1634
1592
|
}
|
|
1635
1593
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1636
1594
|
async function reportResults(context2) {
|
|
1637
|
-
if (_optionalChain([context2, 'access',
|
|
1595
|
+
if (_optionalChain([context2, 'access', _62 => _62.result, 'optionalAccess', _63 => _63.errors, 'access', _64 => _64.length]) === 0) {
|
|
1638
1596
|
if (context2.result.warnings.length > 0) {
|
|
1639
1597
|
_chunkW6YNIJQDjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
1640
1598
|
}
|
|
@@ -1732,14 +1690,14 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1732
1690
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1733
1691
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1734
1692
|
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1735
|
-
if (!_optionalChain([context2, 'access',
|
|
1693
|
+
if (!_optionalChain([context2, 'access', _65 => _65.projectsConfigurations, 'optionalAccess', _66 => _66.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'access', _69 => _69[context2.projectName], 'optionalAccess', _70 => _70.root])) {
|
|
1736
1694
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1737
1695
|
}
|
|
1738
1696
|
await build3({
|
|
1739
1697
|
...options,
|
|
1740
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1698
|
+
projectRoot: _optionalChain([context2, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'optionalAccess', _73 => _73[context2.projectName], 'access', _74 => _74.root]),
|
|
1741
1699
|
projectName: context2.projectName,
|
|
1742
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1700
|
+
sourceRoot: _optionalChain([context2, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'optionalAccess', _77 => _77[context2.projectName], 'optionalAccess', _78 => _78.sourceRoot]),
|
|
1743
1701
|
format: options.format,
|
|
1744
1702
|
platform: options.format
|
|
1745
1703
|
});
|
|
@@ -1782,7 +1740,7 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1782
1740
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1783
1741
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1784
1742
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1785
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1743
|
+
if (!_optionalChain([context2, 'optionalAccess', _79 => _79.projectName]) || !_optionalChain([context2, 'access', _80 => _80.projectsConfigurations, 'optionalAccess', _81 => _81.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1786
1744
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1787
1745
|
}
|
|
1788
1746
|
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
@@ -1791,7 +1749,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1791
1749
|
_esbuild3.default,
|
|
1792
1750
|
_esbuildwhy2.default
|
|
1793
1751
|
], {
|
|
1794
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1752
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _82 => _82.projectsConfigurations, 'access', _83 => _83.projects, 'access', _84 => _84[context2.projectName], 'optionalAccess', _85 => _85.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _86 => _86.projectsConfigurations, 'access', _87 => _87.projects, 'access', _88 => _88[context2.projectName], 'optionalAccess', _89 => _89.root]), () => ( "./")), "src")))
|
|
1795
1753
|
}).then((result) => {
|
|
1796
1754
|
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1797
1755
|
});
|
|
@@ -1868,7 +1826,7 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1868
1826
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1869
1827
|
const projectName = projectJson.name;
|
|
1870
1828
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1871
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1829
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _90 => _90.projects, 'optionalAccess', _91 => _91[projectName]])) {
|
|
1872
1830
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1873
1831
|
}
|
|
1874
1832
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
@@ -2048,14 +2006,14 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
|
2048
2006
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
2049
2007
|
async function tsdownExecutorFn(options, context2, config) {
|
|
2050
2008
|
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
2051
|
-
if (!_optionalChain([context2, 'access',
|
|
2009
|
+
if (!_optionalChain([context2, 'access', _92 => _92.projectsConfigurations, 'optionalAccess', _93 => _93.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _94 => _94.projectsConfigurations, 'access', _95 => _95.projects, 'access', _96 => _96[context2.projectName], 'optionalAccess', _97 => _97.root])) {
|
|
2052
2010
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2053
2011
|
}
|
|
2054
2012
|
await build4({
|
|
2055
2013
|
...options,
|
|
2056
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2014
|
+
projectRoot: _optionalChain([context2, 'access', _98 => _98.projectsConfigurations, 'access', _99 => _99.projects, 'optionalAccess', _100 => _100[context2.projectName], 'access', _101 => _101.root]),
|
|
2057
2015
|
projectName: context2.projectName,
|
|
2058
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2016
|
+
sourceRoot: _optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'optionalAccess', _104 => _104[context2.projectName], 'optionalAccess', _105 => _105.sourceRoot]),
|
|
2059
2017
|
format: options.format,
|
|
2060
2018
|
platform: options.platform
|
|
2061
2019
|
});
|
|
@@ -2119,8 +2077,14 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2119
2077
|
var _jiti = require('jiti');
|
|
2120
2078
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2121
2079
|
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2122
|
-
if (!_optionalChain([context2, 'access',
|
|
2123
|
-
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2080
|
+
if (!_optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'optionalAccess', _107 => _107.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
2081
|
+
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
2082
|
+
}
|
|
2083
|
+
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
2084
|
+
throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
|
|
2085
|
+
}
|
|
2086
|
+
if (!context2.projectsConfigurations.projects[context2.projectName].sourceRoot) {
|
|
2087
|
+
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2124
2088
|
}
|
|
2125
2089
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2126
2090
|
fsCache: config.skipCache ? false : _chunkW6YNIJQDjs.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
@@ -2129,11 +2093,10 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2129
2093
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
2130
2094
|
await stormUnbuild.build(_defu.defu.call(void 0, {
|
|
2131
2095
|
...options,
|
|
2132
|
-
projectRoot:
|
|
2096
|
+
projectRoot: context2.projectsConfigurations.projects[context2.projectName].root,
|
|
2133
2097
|
projectName: context2.projectName,
|
|
2134
|
-
sourceRoot:
|
|
2135
|
-
platform: options.platform
|
|
2136
|
-
name: context2.projectName
|
|
2098
|
+
sourceRoot: context2.projectsConfigurations.projects[context2.projectName].sourceRoot,
|
|
2099
|
+
platform: options.platform
|
|
2137
2100
|
}, {
|
|
2138
2101
|
stubOptions: {
|
|
2139
2102
|
jiti: {
|
|
@@ -2143,20 +2106,15 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2143
2106
|
rollup: {
|
|
2144
2107
|
emitCJS: true,
|
|
2145
2108
|
watch: false,
|
|
2146
|
-
cjsBridge: false,
|
|
2147
2109
|
dts: {
|
|
2148
2110
|
respectExternal: true
|
|
2149
2111
|
},
|
|
2150
|
-
replace: {},
|
|
2151
|
-
alias: {},
|
|
2152
|
-
resolve: {},
|
|
2153
|
-
json: {},
|
|
2154
|
-
commonjs: {},
|
|
2155
2112
|
esbuild: {
|
|
2156
2113
|
target: options.target,
|
|
2157
2114
|
format: "esm",
|
|
2158
2115
|
platform: options.platform,
|
|
2159
|
-
minify: options.minify,
|
|
2116
|
+
minify: _nullishCoalesce(options.minify, () => ( !options.debug)),
|
|
2117
|
+
sourcemap: _nullishCoalesce(options.sourcemap, () => ( options.debug)),
|
|
2160
2118
|
treeShaking: options.treeShaking
|
|
2161
2119
|
}
|
|
2162
2120
|
}
|
|
@@ -2203,7 +2161,7 @@ var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (nam
|
|
|
2203
2161
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2204
2162
|
config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
2205
2163
|
}
|
|
2206
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2164
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _108 => _108.hooks, 'optionalAccess', _109 => _109.applyDefaultOptions])) {
|
|
2207
2165
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2208
2166
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2209
2167
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
@@ -2214,22 +2172,22 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
2214
2172
|
workspaceRoot: tree.root,
|
|
2215
2173
|
config
|
|
2216
2174
|
}, applyWorkspaceBaseTokens);
|
|
2217
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2175
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _110 => _110.hooks, 'optionalAccess', _111 => _111.preProcess])) {
|
|
2218
2176
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2219
2177
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2220
2178
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2221
2179
|
}
|
|
2222
2180
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2223
2181
|
if (result) {
|
|
2224
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
2182
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _112 => _112.error, 'optionalAccess', _113 => _113.message]) && typeof _optionalChain([result, 'optionalAccess', _114 => _114.error, 'optionalAccess', _115 => _115.message]) === "string" && _optionalChain([result, 'optionalAccess', _116 => _116.error, 'optionalAccess', _117 => _117.name]) && typeof _optionalChain([result, 'optionalAccess', _118 => _118.error, 'optionalAccess', _119 => _119.name]) === "string") {
|
|
2225
2183
|
throw new Error(`The ${name} generator failed to run`, {
|
|
2226
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
2184
|
+
cause: _optionalChain([result, 'optionalAccess', _120 => _120.error])
|
|
2227
2185
|
});
|
|
2228
2186
|
} else if (result.success && result.data) {
|
|
2229
2187
|
return result;
|
|
2230
2188
|
}
|
|
2231
2189
|
}
|
|
2232
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2190
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _121 => _121.hooks, 'optionalAccess', _122 => _122.postProcess])) {
|
|
2233
2191
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2234
2192
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2235
2193
|
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
@@ -2339,15 +2297,15 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2339
2297
|
_devkit.addProjectConfiguration.call(void 0, tree, options.name, projectConfig);
|
|
2340
2298
|
let repository = {
|
|
2341
2299
|
type: "github",
|
|
2342
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2300
|
+
url: _optionalChain([config, 'optionalAccess', _123 => _123.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _124 => _124.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _125 => _125.namespace]) || _optionalChain([config, 'optionalAccess', _126 => _126.name]) || "repository"}.git`
|
|
2343
2301
|
};
|
|
2344
2302
|
let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2345
2303
|
if (tree.exists("package.json")) {
|
|
2346
2304
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2347
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2305
|
+
if (_optionalChain([packageJson, 'optionalAccess', _127 => _127.repository])) {
|
|
2348
2306
|
repository = packageJson.repository;
|
|
2349
2307
|
}
|
|
2350
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2308
|
+
if (_optionalChain([packageJson, 'optionalAccess', _128 => _128.description])) {
|
|
2351
2309
|
description = packageJson.description;
|
|
2352
2310
|
}
|
|
2353
2311
|
}
|
|
@@ -2402,9 +2360,9 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2402
2360
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2403
2361
|
...json,
|
|
2404
2362
|
pnpm: {
|
|
2405
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2363
|
+
..._optionalChain([json, 'optionalAccess', _129 => _129.pnpm]),
|
|
2406
2364
|
overrides: {
|
|
2407
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2365
|
+
..._optionalChain([json, 'optionalAccess', _130 => _130.pnpm, 'optionalAccess', _131 => _131.overrides]),
|
|
2408
2366
|
[_nullishCoalesce(options.importPath, () => ( ""))]: "workspace:*"
|
|
2409
2367
|
}
|
|
2410
2368
|
}
|
|
@@ -2418,10 +2376,10 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2418
2376
|
]);
|
|
2419
2377
|
if (tree.exists("package.json")) {
|
|
2420
2378
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2421
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2379
|
+
if (_optionalChain([packageJson, 'optionalAccess', _132 => _132.repository])) {
|
|
2422
2380
|
repository = packageJson.repository;
|
|
2423
2381
|
}
|
|
2424
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2382
|
+
if (_optionalChain([packageJson, 'optionalAccess', _133 => _133.description])) {
|
|
2425
2383
|
description = packageJson.description;
|
|
2426
2384
|
}
|
|
2427
2385
|
}
|
|
@@ -2469,24 +2427,24 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
|
2469
2427
|
function createProjectTsConfigJson(tree, options) {
|
|
2470
2428
|
const tsconfig = {
|
|
2471
2429
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2472
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2430
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _134 => _134.tsconfigOptions]), () => ( {})),
|
|
2473
2431
|
compilerOptions: {
|
|
2474
2432
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2475
2433
|
outDir: _chunkW6YNIJQDjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2476
2434
|
noEmit: true,
|
|
2477
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2435
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _135 => _135.tsconfigOptions, 'optionalAccess', _136 => _136.compilerOptions]), () => ( {}))
|
|
2478
2436
|
},
|
|
2479
2437
|
files: [
|
|
2480
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2438
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _137 => _137.tsconfigOptions, 'optionalAccess', _138 => _138.files]), () => ( []))
|
|
2481
2439
|
],
|
|
2482
2440
|
include: [
|
|
2483
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2441
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.tsconfigOptions, 'optionalAccess', _140 => _140.include]), () => ( [])),
|
|
2484
2442
|
"src/**/*.ts",
|
|
2485
2443
|
"src/**/*.js",
|
|
2486
2444
|
"bin/**/*"
|
|
2487
2445
|
],
|
|
2488
2446
|
exclude: [
|
|
2489
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2447
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _141 => _141.tsconfigOptions, 'optionalAccess', _142 => _142.exclude]), () => ( [])),
|
|
2490
2448
|
"jest.config.ts",
|
|
2491
2449
|
"src/**/*.spec.ts",
|
|
2492
2450
|
"src/**/*.test.ts"
|
|
@@ -2624,7 +2582,7 @@ async function configSchemaGeneratorFn(tree, options, config) {
|
|
|
2624
2582
|
name: "StormWorkspaceConfiguration"
|
|
2625
2583
|
});
|
|
2626
2584
|
_chunkW6YNIJQDjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2627
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2585
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _143 => _143.workspaceRoot]), () => ( _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _144 => _144.outputFile, 'optionalAccess', _145 => _145.startsWith, 'call', _146 => _146("./")]) ? "" : "./");
|
|
2628
2586
|
_chunkW6YNIJQDjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2629
2587
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2630
2588
|
spaces: 2
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunk5WWJ6PHCjs = require('./chunk-5WWJ6PHC.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkTHKJZT32js = require('./chunk-THKJZT32.js');
|
|
@@ -52,7 +52,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
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 _chunk5WWJ6PHCjs.generator_default.call(void 0, tree, {
|
|
56
56
|
...options,
|
|
57
57
|
skipFormat: true
|
|
58
58
|
}));
|
|
@@ -28,48 +28,51 @@ import {
|
|
|
28
28
|
} from "./chunk-A7FFSBE6.mjs";
|
|
29
29
|
|
|
30
30
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
31
|
-
var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option,
|
|
31
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams) => {
|
|
32
32
|
let result = option;
|
|
33
33
|
if (!result) {
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
|
-
if (
|
|
37
|
-
const optionKeys = Object.keys(
|
|
36
|
+
if (tokenParams) {
|
|
37
|
+
const optionKeys = Object.keys(tokenParams);
|
|
38
38
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
39
39
|
for (const optionKey of optionKeys) {
|
|
40
40
|
if (result.includes(`{${optionKey}}`)) {
|
|
41
|
-
result = result.replaceAll(`{${optionKey}}`,
|
|
41
|
+
result = result.replaceAll(`{${optionKey}}`, tokenParams?.[optionKey] || "");
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
if (
|
|
47
|
-
const configKeys = Object.keys(
|
|
46
|
+
if (tokenParams.config) {
|
|
47
|
+
const configKeys = Object.keys(tokenParams.config);
|
|
48
48
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
49
49
|
for (const configKey of configKeys) {
|
|
50
50
|
if (result.includes(`{${configKey}}`)) {
|
|
51
|
-
result = result.replaceAll(`{${configKey}}`,
|
|
51
|
+
result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
if (result.includes("{workspaceRoot}")) {
|
|
57
|
-
result = result.replaceAll("{workspaceRoot}",
|
|
57
|
+
result = result.replaceAll("{workspaceRoot}", tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot());
|
|
58
58
|
}
|
|
59
59
|
return result;
|
|
60
60
|
}, "applyWorkspaceBaseTokens");
|
|
61
|
-
var
|
|
61
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option, tokenParams) => {
|
|
62
|
+
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
63
|
+
}, "applyWorkspaceProjectTokens");
|
|
64
|
+
var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, tokenParams, tokenizerFn) => {
|
|
62
65
|
if (!options) {
|
|
63
66
|
return {};
|
|
64
67
|
}
|
|
65
68
|
const result = {};
|
|
66
69
|
for (const option of Object.keys(options)) {
|
|
67
70
|
if (typeof options[option] === "string") {
|
|
68
|
-
result[option] = await Promise.resolve(tokenizerFn(options[option],
|
|
71
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
|
|
69
72
|
} else if (Array.isArray(options[option])) {
|
|
70
|
-
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item,
|
|
73
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
|
|
71
74
|
} else if (typeof options[option] === "object") {
|
|
72
|
-
result[option] = await applyWorkspaceTokens(options[option],
|
|
75
|
+
result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
|
|
73
76
|
} else {
|
|
74
77
|
result[option] = options[option];
|
|
75
78
|
}
|
|
@@ -96,71 +99,24 @@ var run = /* @__PURE__ */ __name((config, command, cwd = config.workspaceRoot ??
|
|
|
96
99
|
});
|
|
97
100
|
}, "run");
|
|
98
101
|
|
|
99
|
-
// ../workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
100
|
-
var applyWorkspaceExecutorTokens = /* @__PURE__ */ __name(async (option, tokenizerOptions) => {
|
|
101
|
-
let result = option;
|
|
102
|
-
if (!result) {
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
let projectName;
|
|
106
|
-
let projectRoot;
|
|
107
|
-
let sourceRoot;
|
|
108
|
-
if (tokenizerOptions?.projectName) {
|
|
109
|
-
const context2 = tokenizerOptions;
|
|
110
|
-
projectName = context2.projectName;
|
|
111
|
-
projectRoot = context2.root;
|
|
112
|
-
sourceRoot = context2.sourceRoot;
|
|
113
|
-
} else {
|
|
114
|
-
const projectConfig = tokenizerOptions;
|
|
115
|
-
projectRoot = projectConfig.root;
|
|
116
|
-
if (projectConfig.name) {
|
|
117
|
-
projectName = projectConfig.name;
|
|
118
|
-
}
|
|
119
|
-
if (projectConfig.sourceRoot) {
|
|
120
|
-
sourceRoot = projectConfig.sourceRoot;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (tokenizerOptions.config) {
|
|
124
|
-
const configKeys = Object.keys(tokenizerOptions.config);
|
|
125
|
-
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
126
|
-
for (const configKey of configKeys) {
|
|
127
|
-
if (result.includes(`{${configKey}}`)) {
|
|
128
|
-
result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (result.includes("{projectName}")) {
|
|
134
|
-
result = result.replaceAll("{projectName}", projectName);
|
|
135
|
-
}
|
|
136
|
-
if (result.includes("{projectRoot}")) {
|
|
137
|
-
result = result.replaceAll("{projectRoot}", projectRoot);
|
|
138
|
-
}
|
|
139
|
-
if (result.includes("{sourceRoot}")) {
|
|
140
|
-
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
141
|
-
}
|
|
142
|
-
if (result.includes("{workspaceRoot}")) {
|
|
143
|
-
result = result.replaceAll("{workspaceRoot}", tokenizerOptions.workspaceRoot ?? findWorkspaceRoot());
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
}, "applyWorkspaceExecutorTokens");
|
|
147
|
-
|
|
148
102
|
// ../workspace-tools/src/base/base-executor.ts
|
|
103
|
+
import { defu } from "defu";
|
|
149
104
|
var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions = {}) => async (_options, context2) => {
|
|
150
105
|
const stopwatch = getStopwatch(name);
|
|
151
106
|
let options = _options;
|
|
152
107
|
let config = {};
|
|
153
108
|
try {
|
|
154
|
-
writeInfo(`\u26A1 Running the ${name} executor...
|
|
155
|
-
`, config);
|
|
156
109
|
if (!context2.projectsConfigurations?.projects || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
157
110
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
158
111
|
}
|
|
159
112
|
const workspaceRoot3 = findWorkspaceRoot();
|
|
160
|
-
const projectRoot = context2.projectsConfigurations.projects[context2.projectName]
|
|
161
|
-
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName]
|
|
162
|
-
const projectName = context2.
|
|
113
|
+
const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
|
|
114
|
+
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
115
|
+
const projectName = context2.projectName;
|
|
163
116
|
config.workspaceRoot = workspaceRoot3;
|
|
117
|
+
writeInfo(`
|
|
118
|
+
\u26A1 Running the ${name} executor for ${projectName}
|
|
119
|
+
`, config);
|
|
164
120
|
if (!executorOptions.skipReadingConfig) {
|
|
165
121
|
writeTrace(`Loading the Storm Config from environment variables and storm.config.js file...
|
|
166
122
|
- workspaceRoot: ${workspaceRoot3}
|
|
@@ -175,17 +131,19 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
|
|
|
175
131
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
176
132
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
177
133
|
}
|
|
178
|
-
writeTrace(`Executor schema options \u2699\uFE0F
|
|
179
|
-
${
|
|
180
|
-
|
|
181
|
-
|
|
134
|
+
writeTrace(`Executor schema options \u2699\uFE0F
|
|
135
|
+
${formatLogMessage(options)}
|
|
136
|
+
`, config);
|
|
137
|
+
const tokenized = await applyWorkspaceTokens(options, defu({
|
|
182
138
|
workspaceRoot: workspaceRoot3,
|
|
183
139
|
projectRoot,
|
|
184
140
|
sourceRoot,
|
|
185
141
|
projectName,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
142
|
+
config
|
|
143
|
+
}, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
|
|
144
|
+
writeTrace(`Executor schema tokenized options \u2699\uFE0F
|
|
145
|
+
${formatLogMessage(tokenized)}
|
|
146
|
+
`, config);
|
|
189
147
|
if (executorOptions?.hooks?.preProcess) {
|
|
190
148
|
writeDebug("Running the preProcess hook...", config);
|
|
191
149
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
@@ -781,7 +739,7 @@ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-r
|
|
|
781
739
|
|
|
782
740
|
// ../esbuild/src/build.ts
|
|
783
741
|
import { watch as createWatcher } from "chokidar";
|
|
784
|
-
import
|
|
742
|
+
import defu2 from "defu";
|
|
785
743
|
import { debounce, flatten } from "es-toolkit";
|
|
786
744
|
import { map } from "es-toolkit/compat";
|
|
787
745
|
import * as esbuild2 from "esbuild";
|
|
@@ -1452,7 +1410,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1452
1410
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
1453
1411
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1454
1412
|
}
|
|
1455
|
-
const options =
|
|
1413
|
+
const options = defu2(userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1456
1414
|
options.name ??= `${projectName}-${options.format}`;
|
|
1457
1415
|
options.target ??= DEFAULT_TARGET;
|
|
1458
1416
|
const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
@@ -1813,7 +1771,7 @@ var executor_default7 = withRunExecutor("Size-Limit Performance Test Executor",
|
|
|
1813
1771
|
// ../tsdown/src/build.ts
|
|
1814
1772
|
import { hfs as hfs5 } from "@humanfs/node";
|
|
1815
1773
|
import { createProjectGraphAsync as createProjectGraphAsync2, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph3, writeJsonFile as writeJsonFile2 } from "@nx/devkit";
|
|
1816
|
-
import
|
|
1774
|
+
import defu3 from "defu";
|
|
1817
1775
|
import { findWorkspaceRoot as findWorkspaceRoot3 } from "nx/src/utils/find-workspace-root";
|
|
1818
1776
|
import { build as tsdown } from "tsdown";
|
|
1819
1777
|
|
|
@@ -1872,7 +1830,7 @@ var resolveOptions2 = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1872
1830
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
1873
1831
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1874
1832
|
}
|
|
1875
|
-
const options =
|
|
1833
|
+
const options = defu3(userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
1876
1834
|
options.name ??= `${projectName}-${options.format}`;
|
|
1877
1835
|
options.target ??= DEFAULT_TARGET;
|
|
1878
1836
|
const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
@@ -2116,25 +2074,30 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2116
2074
|
});
|
|
2117
2075
|
|
|
2118
2076
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
2119
|
-
import { defu as
|
|
2077
|
+
import { defu as defu4 } from "defu";
|
|
2120
2078
|
import { createJiti } from "jiti";
|
|
2121
2079
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2122
2080
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2123
|
-
if (!context2.projectsConfigurations?.projects || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]
|
|
2124
|
-
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2081
|
+
if (!context2.projectsConfigurations?.projects || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
2082
|
+
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
2083
|
+
}
|
|
2084
|
+
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
2085
|
+
throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
|
|
2086
|
+
}
|
|
2087
|
+
if (!context2.projectsConfigurations.projects[context2.projectName].sourceRoot) {
|
|
2088
|
+
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2125
2089
|
}
|
|
2126
2090
|
const jiti = createJiti(config.workspaceRoot, {
|
|
2127
2091
|
fsCache: config.skipCache ? false : joinPaths(config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2128
2092
|
interopDefault: true
|
|
2129
2093
|
});
|
|
2130
2094
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
2131
|
-
await stormUnbuild.build(
|
|
2095
|
+
await stormUnbuild.build(defu4({
|
|
2132
2096
|
...options,
|
|
2133
|
-
projectRoot: context2.projectsConfigurations.projects
|
|
2097
|
+
projectRoot: context2.projectsConfigurations.projects[context2.projectName].root,
|
|
2134
2098
|
projectName: context2.projectName,
|
|
2135
|
-
sourceRoot: context2.projectsConfigurations.projects
|
|
2136
|
-
platform: options.platform
|
|
2137
|
-
name: context2.projectName
|
|
2099
|
+
sourceRoot: context2.projectsConfigurations.projects[context2.projectName].sourceRoot,
|
|
2100
|
+
platform: options.platform
|
|
2138
2101
|
}, {
|
|
2139
2102
|
stubOptions: {
|
|
2140
2103
|
jiti: {
|
|
@@ -2144,20 +2107,15 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2144
2107
|
rollup: {
|
|
2145
2108
|
emitCJS: true,
|
|
2146
2109
|
watch: false,
|
|
2147
|
-
cjsBridge: false,
|
|
2148
2110
|
dts: {
|
|
2149
2111
|
respectExternal: true
|
|
2150
2112
|
},
|
|
2151
|
-
replace: {},
|
|
2152
|
-
alias: {},
|
|
2153
|
-
resolve: {},
|
|
2154
|
-
json: {},
|
|
2155
|
-
commonjs: {},
|
|
2156
2113
|
esbuild: {
|
|
2157
2114
|
target: options.target,
|
|
2158
2115
|
format: "esm",
|
|
2159
2116
|
platform: options.platform,
|
|
2160
|
-
minify: options.minify,
|
|
2117
|
+
minify: options.minify ?? !options.debug,
|
|
2118
|
+
sourcemap: options.sourcemap ?? options.debug,
|
|
2161
2119
|
treeShaking: options.treeShaking
|
|
2162
2120
|
}
|
|
2163
2121
|
}
|
package/dist/executors.js
CHANGED
package/dist/executors.mjs
CHANGED
package/dist/generators.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkH2PLVAKCjs = require('./chunk-H2PLVAKC.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk5WWJ6PHCjs = require('./chunk-5WWJ6PHC.js');
|
|
10
10
|
require('./chunk-THKJZT32.js');
|
|
11
11
|
require('./chunk-W6YNIJQD.js');
|
|
12
12
|
require('./chunk-J5SB6L2L.js');
|
|
@@ -15,4 +15,4 @@ require('./chunk-J5SB6L2L.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.applicationGenerator =
|
|
18
|
+
exports.applicationGenerator = _chunkH2PLVAKCjs.applicationGenerator; exports.applicationSchematic = _chunkH2PLVAKCjs.applicationSchematic; exports.initGenerator = _chunk5WWJ6PHCjs.initGenerator; exports.initSchematic = _chunk5WWJ6PHCjs.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VE6PGD5B.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4UDIES3V.mjs";
|
|
10
10
|
import "./chunk-6H63LE3D.mjs";
|
|
11
11
|
import "./chunk-3D3WO4IH.mjs";
|
|
12
12
|
import "./chunk-A7FFSBE6.mjs";
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ require('./chunk-DHBG5ASJ.js');
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkH2PLVAKCjs = require('./chunk-H2PLVAKC.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk5WWJ6PHCjs = require('./chunk-5WWJ6PHC.js');
|
|
11
11
|
require('./chunk-CVGPWUNP.js');
|
|
12
12
|
require('./chunk-R7AIVBS7.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-BAP6AE7N.js');
|
|
14
14
|
require('./chunk-U6QKP7CG.js');
|
|
15
15
|
|
|
16
16
|
|
|
@@ -148,4 +148,4 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, createPackageJson, "createPackageJson");
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
|
|
151
|
-
exports.applicationGenerator =
|
|
151
|
+
exports.applicationGenerator = _chunkH2PLVAKCjs.applicationGenerator; exports.applicationSchematic = _chunkH2PLVAKCjs.applicationSchematic; exports.createNodes = createNodes; exports.getInternalDependencies = _chunkH63GI4CRjs.getInternalDependencies; exports.initGenerator = _chunk5WWJ6PHCjs.initGenerator; exports.initSchematic = _chunk5WWJ6PHCjs.initSchematic; exports.name = name; exports.r2UploadFile = _chunkH63GI4CRjs.r2UploadFile;
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
3
3
|
import {
|
|
4
4
|
applicationGenerator,
|
|
5
5
|
applicationSchematic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VE6PGD5B.mjs";
|
|
7
7
|
import {
|
|
8
8
|
initGenerator,
|
|
9
9
|
initSchematic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4UDIES3V.mjs";
|
|
11
11
|
import "./chunk-7Z5PILRU.mjs";
|
|
12
12
|
import "./chunk-QEWY5YJA.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-NTZUGXQD.mjs";
|
|
14
14
|
import "./chunk-BGWUN6JU.mjs";
|
|
15
15
|
import {
|
|
16
16
|
getInternalDependencies,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
var _chunkR7AIVBS7js = require('../../../chunk-R7AIVBS7.js');
|
|
4
|
-
require('../../../chunk-
|
|
4
|
+
require('../../../chunk-BAP6AE7N.js');
|
|
5
5
|
require('../../../chunk-VTHBMY4B.js');
|
|
6
6
|
require('../../../chunk-THKJZT32.js');
|
|
7
7
|
require('../../../chunk-W6YNIJQD.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunkBAP6AE7Njs = require('../../../chunk-BAP6AE7N.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkVTHBMY4Bjs = require('../../../chunk-VTHBMY4B.js');
|
|
@@ -60,7 +60,7 @@ async function* serveExecutor(options, context, config) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
_chunkJ5SB6L2Ljs.__name.call(void 0, serveExecutor, "serveExecutor");
|
|
63
|
-
var executor_default =
|
|
63
|
+
var executor_default = _chunkBAP6AE7Njs.withRunExecutor.call(void 0, "Cloudflare Serve executor", serveExecutor, {
|
|
64
64
|
skipReadingConfig: false,
|
|
65
65
|
hooks: {
|
|
66
66
|
applyDefaultOptions: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options) => {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk5WWJ6PHCjs = require('../../../chunk-5WWJ6PHC.js');
|
|
6
6
|
require('../../../chunk-J5SB6L2L.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunk5WWJ6PHCjs.generator_default; exports.initGenerator = _chunk5WWJ6PHCjs.initGenerator; exports.initSchematic = _chunk5WWJ6PHCjs.initSchematic;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../../chunk-
|
|
5
|
+
var _chunkH2PLVAKCjs = require('../../../chunk-H2PLVAKC.js');
|
|
6
|
+
require('../../../chunk-5WWJ6PHC.js');
|
|
7
7
|
require('../../../chunk-THKJZT32.js');
|
|
8
8
|
require('../../../chunk-W6YNIJQD.js');
|
|
9
9
|
require('../../../chunk-J5SB6L2L.js');
|
|
@@ -11,4 +11,4 @@ require('../../../chunk-J5SB6L2L.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.applicationGenerator =
|
|
14
|
+
exports.applicationGenerator = _chunkH2PLVAKCjs.applicationGenerator; exports.applicationSchematic = _chunkH2PLVAKCjs.applicationSchematic; exports.default = _chunkH2PLVAKCjs.generator_default;
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
applicationGenerator,
|
|
3
3
|
applicationSchematic,
|
|
4
4
|
generator_default
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-VE6PGD5B.mjs";
|
|
6
|
+
import "../../../chunk-4UDIES3V.mjs";
|
|
7
7
|
import "../../../chunk-6H63LE3D.mjs";
|
|
8
8
|
import "../../../chunk-3D3WO4IH.mjs";
|
|
9
9
|
import "../../../chunk-A7FFSBE6.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/cloudflare-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.1",
|
|
4
4
|
"description": "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "github",
|