@storm-software/cloudflare-tools 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{chunk-ISVNV2UX.mjs → chunk-3D3WO4IH.mjs} +15 -8
- package/dist/{chunk-TOEMUWVP.mjs → chunk-6H63LE3D.mjs} +1 -1
- package/dist/{chunk-42I5F5WI.mjs → chunk-BGWUN6JU.mjs} +3 -3
- package/dist/{chunk-AYOTXPQJ.mjs → chunk-EPJ3NXAN.mjs} +45 -92
- package/dist/{chunk-AZ4TIZKT.js → chunk-H63GI4CR.js} +3 -3
- package/dist/{chunk-M5TEDDIW.mjs → chunk-HSYTAPR3.mjs} +1 -1
- package/dist/{chunk-IU4KGUV4.mjs → chunk-KVL4WOIH.mjs} +1 -1
- package/dist/{chunk-7PSAJH4G.mjs → chunk-LYX4CNII.mjs} +3 -3
- package/dist/{chunk-YG677AGI.js → chunk-PCVUZFIE.js} +245 -292
- package/dist/{chunk-OQPC7VB6.js → chunk-THKJZT32.js} +41 -41
- package/dist/{chunk-YVLGBYMR.js → chunk-U6QKP7CG.js} +16 -16
- package/dist/{chunk-76BYR6TF.js → chunk-VV4FAXNW.js} +12 -12
- package/dist/{chunk-343PZDII.js → chunk-W6YNIJQD.js} +15 -8
- package/dist/{chunk-TYN4EHRJ.js → chunk-WTUD4B6O.js} +1 -1
- 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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkTHKJZT32js = require('./chunk-THKJZT32.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ var _chunkOQPC7VB6js = require('./chunk-OQPC7VB6.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkW6YNIJQDjs = require('./chunk-W6YNIJQD.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -53,10 +53,13 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _optionalChain([tokenizerOptions, 'access', _4 => _4.config, 'optionalAccess', _5 => _5.workspaceRoot]))), () => (
|
|
56
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _optionalChain([tokenizerOptions, 'access', _4 => _4.config, 'optionalAccess', _5 => _5.workspaceRoot]))), () => ( _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, ))));
|
|
57
57
|
}
|
|
58
58
|
return result;
|
|
59
59
|
}, "applyWorkspaceBaseTokens");
|
|
60
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option, tokenizerOptions) => {
|
|
61
|
+
return applyWorkspaceBaseTokens(option, tokenizerOptions);
|
|
62
|
+
}, "applyWorkspaceProjectTokens");
|
|
60
63
|
var applyWorkspaceTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, config, tokenizerFn) => {
|
|
61
64
|
if (!options) {
|
|
62
65
|
return {};
|
|
@@ -95,129 +98,84 @@ 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, () => ( _chunk343PZDIIjs.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
|
-
const stopwatch =
|
|
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', _6 => _6.projectsConfigurations, 'optionalAccess', _7 => _7.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
|
-
const workspaceRoot3 =
|
|
159
|
-
const projectRoot =
|
|
160
|
-
const sourceRoot =
|
|
161
|
-
const projectName =
|
|
111
|
+
const workspaceRoot3 = _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
|
|
112
|
+
const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
|
|
113
|
+
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || workspaceRoot3;
|
|
114
|
+
const projectName = context2.projectsConfigurations.projects[context2.projectName].name || 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}
|
|
166
122
|
- projectRoot: ${projectRoot}
|
|
167
123
|
- sourceRoot: ${sourceRoot}
|
|
168
124
|
- projectName: ${projectName}
|
|
169
125
|
`, config);
|
|
170
|
-
config = await
|
|
126
|
+
config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
171
127
|
}
|
|
172
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
173
|
-
|
|
128
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _8 => _8.hooks, 'optionalAccess', _9 => _9.applyDefaultOptions])) {
|
|
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
|
-
|
|
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
|
-
|
|
189
|
-
|
|
141
|
+
config
|
|
142
|
+
}, executorOptions, context2.projectsConfigurations.projects[context2.projectName], config), 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', _10 => _10.hooks, 'optionalAccess', _11 => _11.preProcess])) {
|
|
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', _12 => _12.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',
|
|
201
|
-
|
|
202
|
-
${
|
|
158
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _13 => _13.error, 'optionalAccess', _14 => _14.message]) && typeof _optionalChain([result, 'optionalAccess', _15 => _15.error, 'optionalAccess', _16 => _16.message]) === "string" && _optionalChain([result, 'optionalAccess', _17 => _17.error, 'optionalAccess', _18 => _18.name]) && typeof _optionalChain([result, 'optionalAccess', _19 => _19.error, 'optionalAccess', _20 => _20.name]) === "string")) {
|
|
159
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
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', _21 => _21.error])
|
|
206
164
|
});
|
|
207
165
|
}
|
|
208
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
209
|
-
|
|
166
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _22 => _22.hooks, 'optionalAccess', _23 => _23.postProcess])) {
|
|
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);
|
|
212
170
|
}
|
|
213
|
-
|
|
171
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
214
172
|
`, config);
|
|
215
173
|
return {
|
|
216
174
|
success: true
|
|
217
175
|
};
|
|
218
176
|
} catch (error) {
|
|
219
|
-
|
|
220
|
-
|
|
177
|
+
_chunkW6YNIJQDjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
178
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
221
179
|
- Details: ${error.message}
|
|
222
180
|
- Stacktrace: ${error.stack}`, config);
|
|
223
181
|
return {
|
|
@@ -229,7 +187,7 @@ ${_chunk343PZDIIjs.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', _24 => _24.constructor]) && _optionalChain([value, 'optionalAccess', _25 => _25.call]) && _optionalChain([value, 'optionalAccess', _26 => _26.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', _27 => _27.stdio]), () => ( "inherit")),
|
|
298
256
|
env: {
|
|
299
257
|
...process.env,
|
|
300
|
-
..._optionalChain([options, 'optionalAccess',
|
|
258
|
+
..._optionalChain([options, 'optionalAccess', _28 => _28.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', _29 => _29.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({
|
|
@@ -502,10 +460,10 @@ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(
|
|
|
502
460
|
var readNxConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot3) => {
|
|
503
461
|
let rootDir = workspaceRoot3;
|
|
504
462
|
if (!rootDir) {
|
|
505
|
-
const config = await
|
|
463
|
+
const config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, );
|
|
506
464
|
rootDir = config.workspaceRoot;
|
|
507
465
|
}
|
|
508
|
-
const nxJsonPath =
|
|
466
|
+
const nxJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, rootDir, "nx.json");
|
|
509
467
|
if (!_fs.existsSync.call(void 0, nxJsonPath)) {
|
|
510
468
|
throw new Error("Cannot find project.json configuration");
|
|
511
469
|
}
|
|
@@ -516,27 +474,23 @@ var readNxConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (w
|
|
|
516
474
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
517
475
|
var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
518
476
|
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
477
|
+
pendingAssets.push({
|
|
478
|
+
input: projectRoot,
|
|
479
|
+
glob: "*.md",
|
|
480
|
+
output: "."
|
|
481
|
+
});
|
|
482
|
+
pendingAssets.push({
|
|
483
|
+
input: config.workspaceRoot,
|
|
484
|
+
glob: "LICENSE",
|
|
485
|
+
output: "."
|
|
486
|
+
});
|
|
526
487
|
if (generatePackageJson3 === false) {
|
|
527
488
|
pendingAssets.push({
|
|
528
|
-
input:
|
|
489
|
+
input: projectRoot,
|
|
529
490
|
glob: "package.json",
|
|
530
491
|
output: "."
|
|
531
492
|
});
|
|
532
493
|
}
|
|
533
|
-
if (!_optionalChain([pendingAssets, 'optionalAccess', _46 => _46.some, 'call', _47 => _47((asset) => _optionalChain([asset, 'optionalAccess', _48 => _48.glob]) === "LICENSE")])) {
|
|
534
|
-
pendingAssets.push({
|
|
535
|
-
input: "",
|
|
536
|
-
glob: "LICENSE",
|
|
537
|
-
output: "."
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
494
|
if (includeSrc === true) {
|
|
541
495
|
pendingAssets.push({
|
|
542
496
|
input: sourceRoot,
|
|
@@ -547,12 +501,12 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
547
501
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
548
502
|
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
549
503
|
const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
550
|
-
if (!_optionalChain([projectsConfigurations, 'optionalAccess',
|
|
504
|
+
if (!_optionalChain([projectsConfigurations, 'optionalAccess', _30 => _30.projects, 'optionalAccess', _31 => _31[projectName]])) {
|
|
551
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.");
|
|
552
506
|
}
|
|
553
|
-
const buildTarget = _optionalChain([projectsConfigurations, 'access',
|
|
507
|
+
const buildTarget = _optionalChain([projectsConfigurations, 'access', _32 => _32.projects, 'access', _33 => _33[projectName], 'access', _34 => _34.targets, 'optionalAccess', _35 => _35.build]);
|
|
554
508
|
if (!buildTarget) {
|
|
555
|
-
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 ${
|
|
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")}`);
|
|
556
510
|
}
|
|
557
511
|
const result = await _js.copyAssets.call(void 0, {
|
|
558
512
|
assets,
|
|
@@ -567,18 +521,18 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
567
521
|
projectsConfigurations,
|
|
568
522
|
nxJsonConfiguration: nxJson,
|
|
569
523
|
cwd: config.workspaceRoot,
|
|
570
|
-
isVerbose:
|
|
524
|
+
isVerbose: _chunkW6YNIJQDjs.isVerbose.call(void 0, config.logLevel)
|
|
571
525
|
});
|
|
572
526
|
if (!result.success) {
|
|
573
527
|
throw new Error("The Build process failed trying to copy assets");
|
|
574
528
|
}
|
|
575
529
|
if (includeSrc === true) {
|
|
576
|
-
|
|
530
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkW6YNIJQDjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
577
531
|
const files = await _glob.glob.call(void 0, [
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
532
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
533
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
534
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
535
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
582
536
|
]);
|
|
583
537
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
584
538
|
|
|
@@ -600,7 +554,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
600
554
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
601
555
|
const projectNode = project.node;
|
|
602
556
|
if (projectNode.data.root) {
|
|
603
|
-
const projectPackageJsonPath =
|
|
557
|
+
const projectPackageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
604
558
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
605
559
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
606
560
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -611,7 +565,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
611
565
|
}
|
|
612
566
|
}
|
|
613
567
|
if (localPackages.length > 0) {
|
|
614
|
-
|
|
568
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
615
569
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
616
570
|
if (!ret[localPackage.name]) {
|
|
617
571
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -633,13 +587,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
633
587
|
return ret;
|
|
634
588
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
635
589
|
} else {
|
|
636
|
-
|
|
590
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
637
591
|
}
|
|
638
592
|
return packageJson;
|
|
639
593
|
}, "addPackageDependencies");
|
|
640
594
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
641
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
642
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
595
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
|
|
596
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
643
597
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
644
598
|
packageJson.type ??= "module";
|
|
645
599
|
packageJson.sideEffects ??= false;
|
|
@@ -648,7 +602,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
648
602
|
if (distSrc.startsWith("/")) {
|
|
649
603
|
distSrc = distSrc.substring(1);
|
|
650
604
|
}
|
|
651
|
-
packageJson.source ??= `${
|
|
605
|
+
packageJson.source ??= `${_chunkW6YNIJQDjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
652
606
|
}
|
|
653
607
|
packageJson.files ??= [
|
|
654
608
|
"dist/**/*"
|
|
@@ -679,7 +633,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
679
633
|
];
|
|
680
634
|
}
|
|
681
635
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
682
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
636
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkW6YNIJQDjs.joinPaths.call(void 0, "packages", projectName);
|
|
683
637
|
return packageJson;
|
|
684
638
|
}, "addWorkspacePackageJsonFields");
|
|
685
639
|
var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -706,7 +660,7 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
|
706
660
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
707
661
|
|
|
708
662
|
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
709
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
663
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
|
|
710
664
|
const entryPoints = [];
|
|
711
665
|
if (entry) {
|
|
712
666
|
if (Array.isArray(entry)) {
|
|
@@ -718,7 +672,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
718
672
|
}
|
|
719
673
|
}
|
|
720
674
|
if (emitOnAll) {
|
|
721
|
-
entryPoints.push(
|
|
675
|
+
entryPoints.push(_chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
722
676
|
}
|
|
723
677
|
const results = [];
|
|
724
678
|
for (const entryPoint in entryPoints) {
|
|
@@ -727,9 +681,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
727
681
|
withFileTypes: true
|
|
728
682
|
});
|
|
729
683
|
results.push(...files.reduce((ret, filePath) => {
|
|
730
|
-
const result =
|
|
684
|
+
const result = _chunkW6YNIJQDjs.correctPaths.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkW6YNIJQDjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkW6YNIJQDjs.correctPaths.call(void 0, projectRoot), ""));
|
|
731
685
|
if (result) {
|
|
732
|
-
|
|
686
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkW6YNIJQDjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
733
687
|
if (!results.includes(result)) {
|
|
734
688
|
results.push(result);
|
|
735
689
|
}
|
|
@@ -784,7 +738,7 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
|
784
738
|
|
|
785
739
|
// ../esbuild/src/build.ts
|
|
786
740
|
var _chokidar = require('chokidar');
|
|
787
|
-
|
|
741
|
+
|
|
788
742
|
var _estoolkit = require('es-toolkit');
|
|
789
743
|
var _compat = require('es-toolkit/compat');
|
|
790
744
|
var _esbuild = require('esbuild'); var esbuild2 = _interopRequireWildcard(_esbuild); var esbuild = _interopRequireWildcard(_esbuild);
|
|
@@ -857,15 +811,15 @@ var RendererEngine = class {
|
|
|
857
811
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
858
812
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
859
813
|
}
|
|
860
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
814
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _36 => _36.outputs, 'access', _37 => _37[relativePath]]);
|
|
861
815
|
return {
|
|
862
816
|
type: "chunk",
|
|
863
817
|
path: file.path,
|
|
864
818
|
code: file.text,
|
|
865
|
-
map: _optionalChain([outputFiles, 'access',
|
|
866
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
867
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
868
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
819
|
+
map: _optionalChain([outputFiles, 'access', _38 => _38.find, 'call', _39 => _39((f) => f.path === `${file.path}.map`), 'optionalAccess', _40 => _40.text]),
|
|
820
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _41 => _41.entryPoint]),
|
|
821
|
+
exports: _optionalChain([meta, 'optionalAccess', _42 => _42.exports]),
|
|
822
|
+
imports: _optionalChain([meta, 'optionalAccess', _43 => _43.imports])
|
|
869
823
|
};
|
|
870
824
|
} else {
|
|
871
825
|
return {
|
|
@@ -935,8 +889,8 @@ var RendererEngine = class {
|
|
|
935
889
|
// ../esbuild/src/clean.ts
|
|
936
890
|
|
|
937
891
|
async function clean(name = "ESBuild", directory, config) {
|
|
938
|
-
|
|
939
|
-
const stopwatch =
|
|
892
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
893
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
940
894
|
await _node.hfs.deleteAll(directory);
|
|
941
895
|
stopwatch();
|
|
942
896
|
}
|
|
@@ -948,7 +902,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
948
902
|
name: "storm:esm-split-code-to-cjs",
|
|
949
903
|
setup(build5) {
|
|
950
904
|
build5.onEnd(async (result) => {
|
|
951
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
905
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _44 => _44.metafile, 'optionalAccess', _45 => _45.outputs]), () => ( {})));
|
|
952
906
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
953
907
|
await esbuild.build({
|
|
954
908
|
outdir: resolvedOptions.outdir,
|
|
@@ -1057,7 +1011,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option
|
|
|
1057
1011
|
setup(build5) {
|
|
1058
1012
|
build5.onEnd((result) => {
|
|
1059
1013
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
1060
|
-
|
|
1014
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
1061
1015
|
${result.errors.map((error) => error.text).join("\n")}
|
|
1062
1016
|
|
|
1063
1017
|
`, resolvedOptions.config);
|
|
@@ -1070,7 +1024,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
1070
1024
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
1071
1025
|
|
|
1072
1026
|
function resolvePathsConfig(options, cwd) {
|
|
1073
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1027
|
+
if (_optionalChain([options, 'optionalAccess', _46 => _46.compilerOptions, 'optionalAccess', _47 => _47.paths])) {
|
|
1074
1028
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
1075
1029
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
1076
1030
|
return [
|
|
@@ -1092,13 +1046,13 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
1092
1046
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1093
1047
|
name: "storm:resolve-paths",
|
|
1094
1048
|
setup(build5) {
|
|
1095
|
-
const parentTsConfig = build5.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1049
|
+
const parentTsConfig = build5.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build5.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
1096
1050
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
1097
1051
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
1098
1052
|
build5.onResolve({
|
|
1099
1053
|
filter: packagesRegex
|
|
1100
1054
|
}, (args) => {
|
|
1101
|
-
if (_optionalChain([build5, 'access',
|
|
1055
|
+
if (_optionalChain([build5, 'access', _48 => _48.initialOptions, 'access', _49 => _49.external, 'optionalAccess', _50 => _50.includes, 'call', _51 => _51(args.path)])) {
|
|
1102
1056
|
return {
|
|
1103
1057
|
path: args.path,
|
|
1104
1058
|
external: true
|
|
@@ -1115,7 +1069,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
1115
1069
|
|
|
1116
1070
|
var _apiextractor = require('@microsoft/api-extractor');
|
|
1117
1071
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1118
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1072
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1119
1073
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1120
1074
|
p,
|
|
1121
1075
|
getTypeDependencyPackageName(p)
|
|
@@ -1151,13 +1105,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1151
1105
|
},
|
|
1152
1106
|
dtsRollup: {
|
|
1153
1107
|
enabled: true,
|
|
1154
|
-
untrimmedFilePath:
|
|
1108
|
+
untrimmedFilePath: _chunkW6YNIJQDjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1155
1109
|
},
|
|
1156
1110
|
tsdocMetadata: {
|
|
1157
1111
|
enabled: false
|
|
1158
1112
|
}
|
|
1159
1113
|
},
|
|
1160
|
-
packageJsonFullPath:
|
|
1114
|
+
packageJsonFullPath: _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1161
1115
|
configObjectFullPath: void 0
|
|
1162
1116
|
});
|
|
1163
1117
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1165,7 +1119,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1165
1119
|
localBuild: true
|
|
1166
1120
|
});
|
|
1167
1121
|
if (extractorResult.succeeded === false) {
|
|
1168
|
-
|
|
1122
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1169
1123
|
throw new Error("API Extractor completed with errors");
|
|
1170
1124
|
}
|
|
1171
1125
|
}
|
|
@@ -1184,12 +1138,12 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1184
1138
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1185
1139
|
const typeOutDir = resolvedOptions.outdir;
|
|
1186
1140
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1187
|
-
const bundlePath =
|
|
1141
|
+
const bundlePath = _chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1188
1142
|
let dtsPath;
|
|
1189
|
-
if (await _node.hfs.isFile(
|
|
1190
|
-
dtsPath =
|
|
1191
|
-
} else if (await _node.hfs.isFile(
|
|
1192
|
-
dtsPath =
|
|
1143
|
+
if (await _node.hfs.isFile(_chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1144
|
+
dtsPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1145
|
+
} else if (await _node.hfs.isFile(_chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1146
|
+
dtsPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1193
1147
|
}
|
|
1194
1148
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1195
1149
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1206,7 +1160,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1206
1160
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1207
1161
|
if (npmPackage.startsWith("@")) {
|
|
1208
1162
|
const [scope, name] = npmPackage.split("/");
|
|
1209
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1163
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _52 => _52.slice, 'call', _53 => _53(1)])}__${name}`;
|
|
1210
1164
|
}
|
|
1211
1165
|
return `@types/${npmPackage}`;
|
|
1212
1166
|
}
|
|
@@ -1344,8 +1298,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1344
1298
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1345
1299
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1346
1300
|
});
|
|
1347
|
-
|
|
1348
|
-
|
|
1301
|
+
_chunkW6YNIJQDjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1302
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1349
1303
|
if (filteredMissingDeps.length > 0) {
|
|
1350
1304
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1351
1305
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1413,7 +1367,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1413
1367
|
return (...args) => {
|
|
1414
1368
|
let result = fn(...args);
|
|
1415
1369
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1416
|
-
result = _optionalChain([fns, 'access',
|
|
1370
|
+
result = _optionalChain([fns, 'access', _54 => _54[i], 'optionalCall', _55 => _55(result)]);
|
|
1417
1371
|
}
|
|
1418
1372
|
return result;
|
|
1419
1373
|
};
|
|
@@ -1423,7 +1377,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1423
1377
|
return async (...args) => {
|
|
1424
1378
|
let result = await fn(...args);
|
|
1425
1379
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1426
|
-
result = await _optionalChain([fns, 'access',
|
|
1380
|
+
result = await _optionalChain([fns, 'access', _56 => _56[i], 'optionalCall', _57 => _57(result)]);
|
|
1427
1381
|
}
|
|
1428
1382
|
return result;
|
|
1429
1383
|
};
|
|
@@ -1439,26 +1393,26 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1439
1393
|
if (!workspaceRoot3) {
|
|
1440
1394
|
throw new Error("Cannot find Nx workspace root");
|
|
1441
1395
|
}
|
|
1442
|
-
const config = await
|
|
1443
|
-
|
|
1444
|
-
const stopwatch =
|
|
1396
|
+
const config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1397
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1398
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1445
1399
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1446
1400
|
exitOnError: true
|
|
1447
1401
|
});
|
|
1448
|
-
const projectJsonPath =
|
|
1402
|
+
const projectJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1449
1403
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
1450
1404
|
throw new Error("Cannot find project.json configuration");
|
|
1451
1405
|
}
|
|
1452
1406
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1453
1407
|
const projectName = projectJson.name;
|
|
1454
1408
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1455
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1409
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _58 => _58.projects, 'optionalAccess', _59 => _59[projectName]])) {
|
|
1456
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.");
|
|
1457
1411
|
}
|
|
1458
1412
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1459
1413
|
options.name ??= `${projectName}-${options.format}`;
|
|
1460
1414
|
options.target ??= DEFAULT_TARGET;
|
|
1461
|
-
const packageJsonPath =
|
|
1415
|
+
const packageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1462
1416
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1463
1417
|
throw new Error("Cannot find package.json configuration");
|
|
1464
1418
|
}
|
|
@@ -1482,20 +1436,20 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1482
1436
|
".node"
|
|
1483
1437
|
],
|
|
1484
1438
|
...userOptions,
|
|
1485
|
-
tsconfig:
|
|
1439
|
+
tsconfig: _chunkW6YNIJQDjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1486
1440
|
format: options.format || "cjs",
|
|
1487
1441
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1488
1442
|
"./src/index.ts"
|
|
1489
1443
|
], userOptions.emitOnAll),
|
|
1490
|
-
outdir: userOptions.outputPath ||
|
|
1444
|
+
outdir: userOptions.outputPath || _chunkW6YNIJQDjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1491
1445
|
plugins: [],
|
|
1492
1446
|
name: userOptions.name || projectName,
|
|
1493
1447
|
projectConfigurations,
|
|
1494
1448
|
projectName,
|
|
1495
1449
|
projectGraph,
|
|
1496
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1450
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkW6YNIJQDjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1497
1451
|
minify: userOptions.minify || !userOptions.debug,
|
|
1498
|
-
verbose: userOptions.verbose ||
|
|
1452
|
+
verbose: userOptions.verbose || _chunkW6YNIJQDjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1499
1453
|
includeSrc: userOptions.includeSrc === true,
|
|
1500
1454
|
metafile: userOptions.metafile !== false,
|
|
1501
1455
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1531,8 +1485,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1531
1485
|
}, {})
|
|
1532
1486
|
},
|
|
1533
1487
|
inject: [
|
|
1534
|
-
options.format === "cjs" && options.injectShims ?
|
|
1535
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1488
|
+
options.format === "cjs" && options.injectShims ? _chunkW6YNIJQDjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
1489
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkW6YNIJQDjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : "",
|
|
1536
1490
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
1537
1491
|
].filter(Boolean)
|
|
1538
1492
|
};
|
|
@@ -1541,14 +1495,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1541
1495
|
return result;
|
|
1542
1496
|
}, "resolveOptions");
|
|
1543
1497
|
async function generatePackageJson(context2) {
|
|
1544
|
-
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
1545
|
-
|
|
1546
|
-
const stopwatch =
|
|
1547
|
-
const packageJsonPath =
|
|
1498
|
+
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkW6YNIJQDjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1499
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1500
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1501
|
+
const packageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1548
1502
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1549
1503
|
throw new Error("Cannot find package.json configuration");
|
|
1550
1504
|
}
|
|
1551
|
-
let packageJson = await _node.hfs.json(
|
|
1505
|
+
let packageJson = await _node.hfs.json(_chunkW6YNIJQDjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
|
|
1552
1506
|
if (!packageJson) {
|
|
1553
1507
|
throw new Error("Cannot find package.json configuration file");
|
|
1554
1508
|
}
|
|
@@ -1586,7 +1540,7 @@ async function generatePackageJson(context2) {
|
|
|
1586
1540
|
}
|
|
1587
1541
|
return ret;
|
|
1588
1542
|
}, packageJson.exports);
|
|
1589
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1543
|
+
await _devkit.writeJsonFile.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1590
1544
|
stopwatch();
|
|
1591
1545
|
}
|
|
1592
1546
|
return context2;
|
|
@@ -1612,8 +1566,8 @@ async function generateContext(getOptions) {
|
|
|
1612
1566
|
}
|
|
1613
1567
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1614
1568
|
async function executeEsBuild(context2) {
|
|
1615
|
-
|
|
1616
|
-
const stopwatch =
|
|
1569
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1570
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1617
1571
|
if (process.env.WATCH === "true") {
|
|
1618
1572
|
const ctx = await esbuild2.context(context2.options);
|
|
1619
1573
|
watch(ctx, context2.options);
|
|
@@ -1628,9 +1582,9 @@ async function executeEsBuild(context2) {
|
|
|
1628
1582
|
}
|
|
1629
1583
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1630
1584
|
async function copyBuildAssets(context2) {
|
|
1631
|
-
if (_optionalChain([context2, 'access',
|
|
1632
|
-
|
|
1633
|
-
const stopwatch =
|
|
1585
|
+
if (_optionalChain([context2, 'access', _60 => _60.result, 'optionalAccess', _61 => _61.errors, 'access', _62 => _62.length]) === 0) {
|
|
1586
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1587
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1634
1588
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
|
|
1635
1589
|
stopwatch();
|
|
1636
1590
|
}
|
|
@@ -1638,11 +1592,11 @@ async function copyBuildAssets(context2) {
|
|
|
1638
1592
|
}
|
|
1639
1593
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1640
1594
|
async function reportResults(context2) {
|
|
1641
|
-
if (_optionalChain([context2, 'access',
|
|
1595
|
+
if (_optionalChain([context2, 'access', _63 => _63.result, 'optionalAccess', _64 => _64.errors, 'access', _65 => _65.length]) === 0) {
|
|
1642
1596
|
if (context2.result.warnings.length > 0) {
|
|
1643
|
-
|
|
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);
|
|
1644
1598
|
}
|
|
1645
|
-
|
|
1599
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1646
1600
|
}
|
|
1647
1601
|
}
|
|
1648
1602
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1684,8 +1638,8 @@ async function cleanOutputPath(context2) {
|
|
|
1684
1638
|
}
|
|
1685
1639
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1686
1640
|
async function build3(options) {
|
|
1687
|
-
|
|
1688
|
-
const stopwatch =
|
|
1641
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1642
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1689
1643
|
try {
|
|
1690
1644
|
const opts = Array.isArray(options) ? options : [
|
|
1691
1645
|
options
|
|
@@ -1695,9 +1649,9 @@ async function build3(options) {
|
|
|
1695
1649
|
}
|
|
1696
1650
|
void transduce.async(opts, dependencyCheck);
|
|
1697
1651
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1698
|
-
|
|
1652
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1699
1653
|
} catch (error) {
|
|
1700
|
-
|
|
1654
|
+
_chunkW6YNIJQDjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1701
1655
|
throw error;
|
|
1702
1656
|
} finally {
|
|
1703
1657
|
stopwatch();
|
|
@@ -1725,9 +1679,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1725
1679
|
return context2.rebuild();
|
|
1726
1680
|
});
|
|
1727
1681
|
if (rebuildResult instanceof Error) {
|
|
1728
|
-
|
|
1682
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, rebuildResult.message);
|
|
1729
1683
|
}
|
|
1730
|
-
|
|
1684
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1731
1685
|
}, 10);
|
|
1732
1686
|
changeWatcher.on("change", fastRebuild);
|
|
1733
1687
|
return void 0;
|
|
@@ -1735,15 +1689,15 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1735
1689
|
|
|
1736
1690
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1737
1691
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1738
|
-
|
|
1739
|
-
if (!_optionalChain([context2, 'access',
|
|
1692
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1693
|
+
if (!_optionalChain([context2, 'access', _66 => _66.projectsConfigurations, 'optionalAccess', _67 => _67.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _68 => _68.projectsConfigurations, 'access', _69 => _69.projects, 'access', _70 => _70[context2.projectName], 'optionalAccess', _71 => _71.root])) {
|
|
1740
1694
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1741
1695
|
}
|
|
1742
1696
|
await build3({
|
|
1743
1697
|
...options,
|
|
1744
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1698
|
+
projectRoot: _optionalChain([context2, 'access', _72 => _72.projectsConfigurations, 'access', _73 => _73.projects, 'optionalAccess', _74 => _74[context2.projectName], 'access', _75 => _75.root]),
|
|
1745
1699
|
projectName: context2.projectName,
|
|
1746
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1700
|
+
sourceRoot: _optionalChain([context2, 'access', _76 => _76.projectsConfigurations, 'access', _77 => _77.projects, 'optionalAccess', _78 => _78[context2.projectName], 'optionalAccess', _79 => _79.sourceRoot]),
|
|
1747
1701
|
format: options.format,
|
|
1748
1702
|
platform: options.format
|
|
1749
1703
|
});
|
|
@@ -1786,18 +1740,18 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1786
1740
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1787
1741
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1788
1742
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1789
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1743
|
+
if (!_optionalChain([context2, 'optionalAccess', _80 => _80.projectName]) || !_optionalChain([context2, 'access', _81 => _81.projectsConfigurations, 'optionalAccess', _82 => _82.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1790
1744
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1791
1745
|
}
|
|
1792
|
-
|
|
1746
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1793
1747
|
_sizelimit2.default.call(void 0, [
|
|
1794
1748
|
_file2.default,
|
|
1795
1749
|
_esbuild3.default,
|
|
1796
1750
|
_esbuildwhy2.default
|
|
1797
1751
|
], {
|
|
1798
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1752
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _83 => _83.projectsConfigurations, 'access', _84 => _84.projects, 'access', _85 => _85[context2.projectName], 'optionalAccess', _86 => _86.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'access', _88 => _88.projects, 'access', _89 => _89[context2.projectName], 'optionalAccess', _90 => _90.root]), () => ( "./")), "src")))
|
|
1799
1753
|
}).then((result) => {
|
|
1800
|
-
|
|
1754
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1801
1755
|
});
|
|
1802
1756
|
return {
|
|
1803
1757
|
success: true
|
|
@@ -1823,8 +1777,8 @@ var _tsdown = require('tsdown');
|
|
|
1823
1777
|
// ../tsdown/src/clean.ts
|
|
1824
1778
|
|
|
1825
1779
|
async function clean2(name = "ESBuild", directory, config) {
|
|
1826
|
-
|
|
1827
|
-
const stopwatch =
|
|
1780
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
1781
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
1828
1782
|
await _node.hfs.deleteAll(directory);
|
|
1829
1783
|
stopwatch();
|
|
1830
1784
|
}
|
|
@@ -1859,26 +1813,26 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1859
1813
|
if (!workspaceRoot3) {
|
|
1860
1814
|
throw new Error("Cannot find Nx workspace root");
|
|
1861
1815
|
}
|
|
1862
|
-
const config = await
|
|
1863
|
-
|
|
1864
|
-
const stopwatch =
|
|
1816
|
+
const config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1817
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1818
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1865
1819
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1866
1820
|
exitOnError: true
|
|
1867
1821
|
});
|
|
1868
|
-
const projectJsonPath =
|
|
1822
|
+
const projectJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1869
1823
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
1870
1824
|
throw new Error("Cannot find project.json configuration");
|
|
1871
1825
|
}
|
|
1872
1826
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1873
1827
|
const projectName = projectJson.name;
|
|
1874
1828
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1875
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1829
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _91 => _91.projects, 'optionalAccess', _92 => _92[projectName]])) {
|
|
1876
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.");
|
|
1877
1831
|
}
|
|
1878
1832
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
1879
1833
|
options.name ??= `${projectName}-${options.format}`;
|
|
1880
1834
|
options.target ??= DEFAULT_TARGET;
|
|
1881
|
-
const packageJsonPath =
|
|
1835
|
+
const packageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1882
1836
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1883
1837
|
throw new Error("Cannot find package.json configuration");
|
|
1884
1838
|
}
|
|
@@ -1887,20 +1841,20 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1887
1841
|
...options,
|
|
1888
1842
|
config,
|
|
1889
1843
|
...userOptions,
|
|
1890
|
-
tsconfig:
|
|
1844
|
+
tsconfig: _chunkW6YNIJQDjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1891
1845
|
format: options.format || "cjs",
|
|
1892
1846
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1893
1847
|
"./src/index.ts"
|
|
1894
1848
|
], userOptions.emitOnAll),
|
|
1895
|
-
outdir: userOptions.outputPath ||
|
|
1849
|
+
outdir: userOptions.outputPath || _chunkW6YNIJQDjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1896
1850
|
plugins: [],
|
|
1897
1851
|
name: userOptions.name || projectName,
|
|
1898
1852
|
projectConfigurations,
|
|
1899
1853
|
projectName,
|
|
1900
1854
|
projectGraph,
|
|
1901
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1855
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkW6YNIJQDjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1902
1856
|
minify: userOptions.minify || !userOptions.debug,
|
|
1903
|
-
verbose: userOptions.verbose ||
|
|
1857
|
+
verbose: userOptions.verbose || _chunkW6YNIJQDjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1904
1858
|
includeSrc: userOptions.includeSrc === true,
|
|
1905
1859
|
metafile: userOptions.metafile !== false,
|
|
1906
1860
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1934,14 +1888,14 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1934
1888
|
return result;
|
|
1935
1889
|
}, "resolveOptions");
|
|
1936
1890
|
async function generatePackageJson2(options) {
|
|
1937
|
-
if (options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
1938
|
-
|
|
1939
|
-
const stopwatch =
|
|
1940
|
-
const packageJsonPath =
|
|
1891
|
+
if (options.generatePackageJson !== false && await _node.hfs.isFile(_chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
1892
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
1893
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1894
|
+
const packageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
1941
1895
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1942
1896
|
throw new Error("Cannot find package.json configuration");
|
|
1943
1897
|
}
|
|
1944
|
-
let packageJson = await _node.hfs.json(
|
|
1898
|
+
let packageJson = await _node.hfs.json(_chunkW6YNIJQDjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"));
|
|
1945
1899
|
if (!packageJson) {
|
|
1946
1900
|
throw new Error("Cannot find package.json configuration file");
|
|
1947
1901
|
}
|
|
@@ -1979,15 +1933,15 @@ async function generatePackageJson2(options) {
|
|
|
1979
1933
|
}
|
|
1980
1934
|
return ret;
|
|
1981
1935
|
}, packageJson.exports);
|
|
1982
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1936
|
+
await _devkit.writeJsonFile.call(void 0, _chunkW6YNIJQDjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
1983
1937
|
stopwatch();
|
|
1984
1938
|
}
|
|
1985
1939
|
return options;
|
|
1986
1940
|
}
|
|
1987
1941
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson2, "generatePackageJson");
|
|
1988
1942
|
async function executeTSDown(options) {
|
|
1989
|
-
|
|
1990
|
-
const stopwatch =
|
|
1943
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1944
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
1991
1945
|
await _tsdown.build.call(void 0, {
|
|
1992
1946
|
...options,
|
|
1993
1947
|
entry: options.entryPoints,
|
|
@@ -1999,15 +1953,15 @@ async function executeTSDown(options) {
|
|
|
1999
1953
|
}
|
|
2000
1954
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
2001
1955
|
async function copyBuildAssets2(options) {
|
|
2002
|
-
|
|
2003
|
-
const stopwatch =
|
|
1956
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
1957
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
2004
1958
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.projectName, options.sourceRoot, true, false);
|
|
2005
1959
|
stopwatch();
|
|
2006
1960
|
return options;
|
|
2007
1961
|
}
|
|
2008
1962
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets2, "copyBuildAssets");
|
|
2009
1963
|
async function reportResults2(options) {
|
|
2010
|
-
|
|
1964
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
2011
1965
|
}
|
|
2012
1966
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults2, "reportResults");
|
|
2013
1967
|
async function cleanOutputPath2(options) {
|
|
@@ -2018,8 +1972,8 @@ async function cleanOutputPath2(options) {
|
|
|
2018
1972
|
}
|
|
2019
1973
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath2, "cleanOutputPath");
|
|
2020
1974
|
async function build4(options) {
|
|
2021
|
-
|
|
2022
|
-
const stopwatch =
|
|
1975
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1976
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
2023
1977
|
try {
|
|
2024
1978
|
const opts = Array.isArray(options) ? options : [
|
|
2025
1979
|
options
|
|
@@ -2037,11 +1991,11 @@ async function build4(options) {
|
|
|
2037
1991
|
await reportResults2(opt);
|
|
2038
1992
|
}));
|
|
2039
1993
|
} else {
|
|
2040
|
-
|
|
1994
|
+
_chunkW6YNIJQDjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
2041
1995
|
}
|
|
2042
|
-
|
|
1996
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
2043
1997
|
} catch (error) {
|
|
2044
|
-
|
|
1998
|
+
_chunkW6YNIJQDjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
2045
1999
|
throw error;
|
|
2046
2000
|
} finally {
|
|
2047
2001
|
stopwatch();
|
|
@@ -2051,15 +2005,15 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
|
2051
2005
|
|
|
2052
2006
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
2053
2007
|
async function tsdownExecutorFn(options, context2, config) {
|
|
2054
|
-
|
|
2055
|
-
if (!_optionalChain([context2, 'access',
|
|
2008
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
2009
|
+
if (!_optionalChain([context2, 'access', _93 => _93.projectsConfigurations, 'optionalAccess', _94 => _94.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _95 => _95.projectsConfigurations, 'access', _96 => _96.projects, 'access', _97 => _97[context2.projectName], 'optionalAccess', _98 => _98.root])) {
|
|
2056
2010
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2057
2011
|
}
|
|
2058
2012
|
await build4({
|
|
2059
2013
|
...options,
|
|
2060
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2014
|
+
projectRoot: _optionalChain([context2, 'access', _99 => _99.projectsConfigurations, 'access', _100 => _100.projects, 'optionalAccess', _101 => _101[context2.projectName], 'access', _102 => _102.root]),
|
|
2061
2015
|
projectName: context2.projectName,
|
|
2062
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2016
|
+
sourceRoot: _optionalChain([context2, 'access', _103 => _103.projectsConfigurations, 'access', _104 => _104.projects, 'optionalAccess', _105 => _105[context2.projectName], 'optionalAccess', _106 => _106.sourceRoot]),
|
|
2063
2017
|
format: options.format,
|
|
2064
2018
|
platform: options.platform
|
|
2065
2019
|
});
|
|
@@ -2087,11 +2041,11 @@ var _fsextra = require('fs-extra');
|
|
|
2087
2041
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
2088
2042
|
async function typiaExecutorFn(options, _, config) {
|
|
2089
2043
|
if (options.clean !== false) {
|
|
2090
|
-
|
|
2044
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
2091
2045
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
2092
2046
|
}
|
|
2093
2047
|
await Promise.all(options.entry.map((entry) => {
|
|
2094
|
-
|
|
2048
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
2095
2049
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
2096
2050
|
input: entry,
|
|
2097
2051
|
output: options.outputPath,
|
|
@@ -2122,20 +2076,20 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2122
2076
|
|
|
2123
2077
|
var _jiti = require('jiti');
|
|
2124
2078
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2125
|
-
|
|
2126
|
-
if (!_optionalChain([context2, 'access',
|
|
2079
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2080
|
+
if (!_optionalChain([context2, 'access', _107 => _107.projectsConfigurations, 'optionalAccess', _108 => _108.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _109 => _109.projectsConfigurations, 'access', _110 => _110.projects, 'access', _111 => _111[context2.projectName], 'optionalAccess', _112 => _112.root])) {
|
|
2127
2081
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2128
2082
|
}
|
|
2129
2083
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2130
|
-
fsCache: config.skipCache ? false :
|
|
2084
|
+
fsCache: config.skipCache ? false : _chunkW6YNIJQDjs.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2131
2085
|
interopDefault: true
|
|
2132
2086
|
});
|
|
2133
2087
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
2134
2088
|
await stormUnbuild.build(_defu.defu.call(void 0, {
|
|
2135
2089
|
...options,
|
|
2136
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2090
|
+
projectRoot: _optionalChain([context2, 'access', _113 => _113.projectsConfigurations, 'access', _114 => _114.projects, 'optionalAccess', _115 => _115[context2.projectName], 'access', _116 => _116.root]),
|
|
2137
2091
|
projectName: context2.projectName,
|
|
2138
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2092
|
+
sourceRoot: _optionalChain([context2, 'access', _117 => _117.projectsConfigurations, 'access', _118 => _118.projects, 'optionalAccess', _119 => _119[context2.projectName], 'optionalAccess', _120 => _120.sourceRoot]),
|
|
2139
2093
|
platform: options.platform,
|
|
2140
2094
|
name: context2.projectName
|
|
2141
2095
|
}, {
|
|
@@ -2174,6 +2128,9 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2174
2128
|
skipReadingConfig: false,
|
|
2175
2129
|
hooks: {
|
|
2176
2130
|
applyDefaultOptions: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, config) => {
|
|
2131
|
+
options.debug ??= false;
|
|
2132
|
+
options.treeShaking ??= true;
|
|
2133
|
+
options.platform ??= "neutral";
|
|
2177
2134
|
options.entry ??= [
|
|
2178
2135
|
"{sourceRoot}"
|
|
2179
2136
|
];
|
|
@@ -2191,58 +2148,58 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2191
2148
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
2192
2149
|
skipReadingConfig: false
|
|
2193
2150
|
}) => async (tree, _options) => {
|
|
2194
|
-
const stopwatch =
|
|
2151
|
+
const stopwatch = _chunkW6YNIJQDjs.getStopwatch.call(void 0, name);
|
|
2195
2152
|
let options = _options;
|
|
2196
2153
|
let config;
|
|
2197
2154
|
try {
|
|
2198
|
-
|
|
2155
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
2199
2156
|
|
|
2200
2157
|
`, config);
|
|
2201
|
-
const workspaceRoot3 =
|
|
2158
|
+
const workspaceRoot3 = _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, );
|
|
2202
2159
|
if (!generatorOptions.skipReadingConfig) {
|
|
2203
|
-
|
|
2160
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2204
2161
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2205
|
-
config = await
|
|
2162
|
+
config = await _chunkTHKJZT32js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
2206
2163
|
}
|
|
2207
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2208
|
-
|
|
2164
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _121 => _121.hooks, 'optionalAccess', _122 => _122.applyDefaultOptions])) {
|
|
2165
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2209
2166
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2210
|
-
|
|
2167
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
2211
2168
|
}
|
|
2212
|
-
|
|
2169
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
2213
2170
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
2214
2171
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
2215
2172
|
workspaceRoot: tree.root,
|
|
2216
2173
|
config
|
|
2217
2174
|
}, applyWorkspaceBaseTokens);
|
|
2218
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2219
|
-
|
|
2175
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _123 => _123.hooks, 'optionalAccess', _124 => _124.preProcess])) {
|
|
2176
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2220
2177
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2221
|
-
|
|
2178
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2222
2179
|
}
|
|
2223
2180
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2224
2181
|
if (result) {
|
|
2225
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
2182
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _125 => _125.error, 'optionalAccess', _126 => _126.message]) && typeof _optionalChain([result, 'optionalAccess', _127 => _127.error, 'optionalAccess', _128 => _128.message]) === "string" && _optionalChain([result, 'optionalAccess', _129 => _129.error, 'optionalAccess', _130 => _130.name]) && typeof _optionalChain([result, 'optionalAccess', _131 => _131.error, 'optionalAccess', _132 => _132.name]) === "string") {
|
|
2226
2183
|
throw new Error(`The ${name} generator failed to run`, {
|
|
2227
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
2184
|
+
cause: _optionalChain([result, 'optionalAccess', _133 => _133.error])
|
|
2228
2185
|
});
|
|
2229
2186
|
} else if (result.success && result.data) {
|
|
2230
2187
|
return result;
|
|
2231
2188
|
}
|
|
2232
2189
|
}
|
|
2233
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2234
|
-
|
|
2190
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _134 => _134.hooks, 'optionalAccess', _135 => _135.postProcess])) {
|
|
2191
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2235
2192
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2236
|
-
|
|
2193
|
+
_chunkW6YNIJQDjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
2237
2194
|
}
|
|
2238
2195
|
return () => {
|
|
2239
|
-
|
|
2196
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
2240
2197
|
`, config);
|
|
2241
2198
|
};
|
|
2242
2199
|
} catch (error) {
|
|
2243
2200
|
return () => {
|
|
2244
|
-
|
|
2245
|
-
|
|
2201
|
+
_chunkW6YNIJQDjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
2202
|
+
_chunkW6YNIJQDjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
2246
2203
|
- Details: ${error.message}
|
|
2247
2204
|
- Stacktrace: ${error.stack}`, config);
|
|
2248
2205
|
};
|
|
@@ -2288,7 +2245,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2288
2245
|
const projectConfig = {
|
|
2289
2246
|
root: options.directory,
|
|
2290
2247
|
projectType: "library",
|
|
2291
|
-
sourceRoot:
|
|
2248
|
+
sourceRoot: _chunkW6YNIJQDjs.joinPaths.call(void 0, _nullishCoalesce(options.directory, () => ( "")), "src"),
|
|
2292
2249
|
targets: {
|
|
2293
2250
|
build: {
|
|
2294
2251
|
executor: schema.buildExecutor,
|
|
@@ -2297,11 +2254,11 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2297
2254
|
],
|
|
2298
2255
|
options: {
|
|
2299
2256
|
entry: [
|
|
2300
|
-
|
|
2257
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "src", "index.ts")
|
|
2301
2258
|
],
|
|
2302
2259
|
outputPath: getOutputPath(options),
|
|
2303
|
-
tsconfig:
|
|
2304
|
-
project:
|
|
2260
|
+
tsconfig: _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"),
|
|
2261
|
+
project: _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
2305
2262
|
defaultConfiguration: "production",
|
|
2306
2263
|
platform: "neutral",
|
|
2307
2264
|
assets: [
|
|
@@ -2340,22 +2297,22 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2340
2297
|
_devkit.addProjectConfiguration.call(void 0, tree, options.name, projectConfig);
|
|
2341
2298
|
let repository = {
|
|
2342
2299
|
type: "github",
|
|
2343
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2300
|
+
url: _optionalChain([config, 'optionalAccess', _136 => _136.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _137 => _137.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _138 => _138.namespace]) || _optionalChain([config, 'optionalAccess', _139 => _139.name]) || "repository"}.git`
|
|
2344
2301
|
};
|
|
2345
2302
|
let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2346
2303
|
if (tree.exists("package.json")) {
|
|
2347
2304
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2348
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2305
|
+
if (_optionalChain([packageJson, 'optionalAccess', _140 => _140.repository])) {
|
|
2349
2306
|
repository = packageJson.repository;
|
|
2350
2307
|
}
|
|
2351
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2308
|
+
if (_optionalChain([packageJson, 'optionalAccess', _141 => _141.description])) {
|
|
2352
2309
|
description = packageJson.description;
|
|
2353
2310
|
}
|
|
2354
2311
|
}
|
|
2355
2312
|
if (!options.importPath) {
|
|
2356
2313
|
options.importPath = options.name;
|
|
2357
2314
|
}
|
|
2358
|
-
const packageJsonPath =
|
|
2315
|
+
const packageJsonPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "package.json");
|
|
2359
2316
|
if (tree.exists(packageJsonPath)) {
|
|
2360
2317
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2361
2318
|
if (!options.importPath) {
|
|
@@ -2403,30 +2360,30 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2403
2360
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2404
2361
|
...json,
|
|
2405
2362
|
pnpm: {
|
|
2406
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2363
|
+
..._optionalChain([json, 'optionalAccess', _142 => _142.pnpm]),
|
|
2407
2364
|
overrides: {
|
|
2408
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2365
|
+
..._optionalChain([json, 'optionalAccess', _143 => _143.pnpm, 'optionalAccess', _144 => _144.overrides]),
|
|
2409
2366
|
[_nullishCoalesce(options.importPath, () => ( ""))]: "workspace:*"
|
|
2410
2367
|
}
|
|
2411
2368
|
}
|
|
2412
2369
|
}));
|
|
2413
2370
|
}
|
|
2414
2371
|
_js.addTsConfigPath.call(void 0, tree, options.importPath, [
|
|
2415
|
-
|
|
2372
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "./src", `index.${options.js ? "js" : "ts"}`)
|
|
2416
2373
|
]);
|
|
2417
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2418
|
-
|
|
2374
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkW6YNIJQDjs.joinPaths.call(void 0, options.importPath, "/*"), [
|
|
2375
|
+
_chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "./src", "/*")
|
|
2419
2376
|
]);
|
|
2420
2377
|
if (tree.exists("package.json")) {
|
|
2421
2378
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2422
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2379
|
+
if (_optionalChain([packageJson, 'optionalAccess', _145 => _145.repository])) {
|
|
2423
2380
|
repository = packageJson.repository;
|
|
2424
2381
|
}
|
|
2425
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2382
|
+
if (_optionalChain([packageJson, 'optionalAccess', _146 => _146.description])) {
|
|
2426
2383
|
description = packageJson.description;
|
|
2427
2384
|
}
|
|
2428
2385
|
}
|
|
2429
|
-
const tsconfigPath =
|
|
2386
|
+
const tsconfigPath = _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json");
|
|
2430
2387
|
if (tree.exists(tsconfigPath)) {
|
|
2431
2388
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2432
2389
|
json.composite ??= true;
|
|
@@ -2464,36 +2421,36 @@ function getOutputPath(options) {
|
|
|
2464
2421
|
} else {
|
|
2465
2422
|
parts.push(options.projectRoot);
|
|
2466
2423
|
}
|
|
2467
|
-
return
|
|
2424
|
+
return _chunkW6YNIJQDjs.joinPaths.call(void 0, ...parts);
|
|
2468
2425
|
}
|
|
2469
2426
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2470
2427
|
function createProjectTsConfigJson(tree, options) {
|
|
2471
2428
|
const tsconfig = {
|
|
2472
2429
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2473
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2430
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _147 => _147.tsconfigOptions]), () => ( {})),
|
|
2474
2431
|
compilerOptions: {
|
|
2475
2432
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2476
|
-
outDir:
|
|
2433
|
+
outDir: _chunkW6YNIJQDjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2477
2434
|
noEmit: true,
|
|
2478
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2435
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _148 => _148.tsconfigOptions, 'optionalAccess', _149 => _149.compilerOptions]), () => ( {}))
|
|
2479
2436
|
},
|
|
2480
2437
|
files: [
|
|
2481
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2438
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _150 => _150.tsconfigOptions, 'optionalAccess', _151 => _151.files]), () => ( []))
|
|
2482
2439
|
],
|
|
2483
2440
|
include: [
|
|
2484
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2441
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _152 => _152.tsconfigOptions, 'optionalAccess', _153 => _153.include]), () => ( [])),
|
|
2485
2442
|
"src/**/*.ts",
|
|
2486
2443
|
"src/**/*.js",
|
|
2487
2444
|
"bin/**/*"
|
|
2488
2445
|
],
|
|
2489
2446
|
exclude: [
|
|
2490
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2447
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _154 => _154.tsconfigOptions, 'optionalAccess', _155 => _155.exclude]), () => ( [])),
|
|
2491
2448
|
"jest.config.ts",
|
|
2492
2449
|
"src/**/*.spec.ts",
|
|
2493
2450
|
"src/**/*.test.ts"
|
|
2494
2451
|
]
|
|
2495
2452
|
};
|
|
2496
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2453
|
+
_devkit.writeJson.call(void 0, tree, _chunkW6YNIJQDjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2497
2454
|
}
|
|
2498
2455
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2499
2456
|
async function normalizeOptions(tree, options) {
|
|
@@ -2619,19 +2576,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2619
2576
|
|
|
2620
2577
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2621
2578
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2579
|
+
_chunkW6YNIJQDjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Configuration JSON Schema generator", config);
|
|
2580
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `Determining the Storm Configuration JSON Schema...`, config);
|
|
2581
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkW6YNIJQDjs.StormConfigSchema, {
|
|
2625
2582
|
name: "StormWorkspaceConfiguration"
|
|
2626
2583
|
});
|
|
2627
|
-
|
|
2628
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2629
|
-
|
|
2584
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2585
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _156 => _156.workspaceRoot]), () => ( _chunkW6YNIJQDjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _157 => _157.outputFile, 'optionalAccess', _158 => _158.startsWith, 'call', _159 => _159("./")]) ? "" : "./");
|
|
2586
|
+
_chunkW6YNIJQDjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2630
2587
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2631
2588
|
spaces: 2
|
|
2632
2589
|
});
|
|
2633
2590
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2634
|
-
|
|
2591
|
+
_chunkW6YNIJQDjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2635
2592
|
return {
|
|
2636
2593
|
success: true
|
|
2637
2594
|
};
|
|
@@ -3154,32 +3111,28 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
3154
3111
|
title: "Bundle",
|
|
3155
3112
|
type: "boolean",
|
|
3156
3113
|
description: "Bundle the output"
|
|
3157
|
-
}
|
|
3158
|
-
$default: false
|
|
3114
|
+
}
|
|
3159
3115
|
},
|
|
3160
3116
|
minify: {
|
|
3161
3117
|
$schema: {
|
|
3162
3118
|
title: "Minify",
|
|
3163
3119
|
type: "boolean",
|
|
3164
3120
|
description: "Minify the output"
|
|
3165
|
-
}
|
|
3166
|
-
$default: false
|
|
3121
|
+
}
|
|
3167
3122
|
},
|
|
3168
3123
|
debug: {
|
|
3169
3124
|
$schema: {
|
|
3170
3125
|
title: "Debug",
|
|
3171
3126
|
type: "boolean",
|
|
3172
3127
|
description: "Debug the output"
|
|
3173
|
-
}
|
|
3174
|
-
$default: false
|
|
3128
|
+
}
|
|
3175
3129
|
},
|
|
3176
3130
|
sourcemap: {
|
|
3177
3131
|
$schema: {
|
|
3178
3132
|
title: "Sourcemap",
|
|
3179
3133
|
type: "boolean",
|
|
3180
3134
|
description: "Generate a sourcemap"
|
|
3181
|
-
}
|
|
3182
|
-
$default: false
|
|
3135
|
+
}
|
|
3183
3136
|
},
|
|
3184
3137
|
silent: {
|
|
3185
3138
|
$schema: {
|