@storm-software/cloudflare-tools 0.50.2 → 0.50.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{chunk-IUVV2SM4.js → chunk-3JJSMPBT.js} +41 -41
- package/dist/{chunk-MH545KJZ.js → chunk-6J7ASNGW.js} +12 -12
- package/dist/{chunk-T6VDL633.mjs → chunk-6PVMDNO7.mjs} +44 -482
- package/dist/{chunk-JCB2DTP6.js → chunk-ABCBYQGV.js} +3 -3
- package/dist/{chunk-4AK2RSE7.mjs → chunk-ITAWFL6G.mjs} +3 -3
- package/dist/{chunk-ULTJPRDX.js → chunk-MHBXIMZJ.js} +183 -621
- package/dist/{chunk-SUASGTND.js → chunk-O2XVQQLQ.js} +16 -16
- package/dist/{chunk-VYOULWAK.mjs → chunk-OTQ3T47C.mjs} +1 -1
- package/dist/{chunk-6RM4MALM.mjs → chunk-PSZIL5F5.mjs} +1 -1
- package/dist/{chunk-RCE3CC76.js → chunk-TH4KH35P.js} +1 -2
- package/dist/{chunk-HPCGVJ7R.mjs → chunk-TKQA6SOX.mjs} +3 -3
- package/dist/{chunk-4AMWR76J.mjs → chunk-UOZU7VQX.mjs} +1 -1
- package/dist/{chunk-7VU6EPB4.js → chunk-VXZZKKIL.js} +1 -1
- package/dist/{chunk-NSLK6ZDO.mjs → chunk-XBFOA367.mjs} +0 -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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk3JJSMPBTjs = require('./chunk-3JJSMPBT.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,8 +20,7 @@ var _chunkIUVV2SM4js = require('./chunk-IUVV2SM4.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
var _chunkRCE3CC76js = require('./chunk-RCE3CC76.js');
|
|
23
|
+
var _chunkTH4KH35Pjs = require('./chunk-TH4KH35P.js');
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
|
|
@@ -54,7 +53,7 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
if (result.includes("{workspaceRoot}")) {
|
|
57
|
-
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]))), () => ( _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, ))));
|
|
58
57
|
}
|
|
59
58
|
return result;
|
|
60
59
|
}, "applyWorkspaceBaseTokens");
|
|
@@ -140,42 +139,42 @@ var applyWorkspaceExecutorTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(
|
|
|
140
139
|
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
141
140
|
}
|
|
142
141
|
if (result.includes("{workspaceRoot}")) {
|
|
143
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => (
|
|
142
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, ))));
|
|
144
143
|
}
|
|
145
144
|
return result;
|
|
146
145
|
}, "applyWorkspaceExecutorTokens");
|
|
147
146
|
|
|
148
147
|
// ../workspace-tools/src/base/base-executor.ts
|
|
149
148
|
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context2) => {
|
|
150
|
-
const stopwatch =
|
|
149
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, name);
|
|
151
150
|
let options = _options;
|
|
152
151
|
let config = {};
|
|
153
152
|
try {
|
|
154
|
-
|
|
153
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor...
|
|
155
154
|
`, config);
|
|
156
155
|
if (!_optionalChain([context2, 'access', _7 => _7.projectsConfigurations, 'optionalAccess', _8 => _8.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
157
156
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
158
157
|
}
|
|
159
|
-
const workspaceRoot3 =
|
|
158
|
+
const workspaceRoot3 = _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, );
|
|
160
159
|
const projectRoot = _nullishCoalesce(_optionalChain([context2, 'access', _9 => _9.projectsConfigurations, 'access', _10 => _10.projects, 'access', _11 => _11[context2.projectName], 'optionalAccess', _12 => _12.root]), () => ( workspaceRoot3));
|
|
161
160
|
const sourceRoot = _nullishCoalesce(_optionalChain([context2, 'access', _13 => _13.projectsConfigurations, 'access', _14 => _14.projects, 'access', _15 => _15[context2.projectName], 'optionalAccess', _16 => _16.sourceRoot]), () => ( workspaceRoot3));
|
|
162
161
|
const projectName = _nullishCoalesce(_optionalChain([context2, 'access', _17 => _17.projectsConfigurations, 'access', _18 => _18.projects, 'access', _19 => _19[context2.projectName], 'optionalAccess', _20 => _20.name]), () => ( context2.projectName));
|
|
163
162
|
config.workspaceRoot = workspaceRoot3;
|
|
164
163
|
if (!executorOptions.skipReadingConfig) {
|
|
165
|
-
|
|
164
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
166
165
|
- workspaceRoot: ${workspaceRoot3}
|
|
167
166
|
- projectRoot: ${projectRoot}
|
|
168
167
|
- sourceRoot: ${sourceRoot}
|
|
169
168
|
- projectName: ${projectName}
|
|
170
169
|
`, config);
|
|
171
|
-
config = await
|
|
170
|
+
config = await _chunk3JJSMPBTjs.loadStormConfig.call(void 0, workspaceRoot3);
|
|
172
171
|
}
|
|
173
172
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.applyDefaultOptions])) {
|
|
174
|
-
|
|
173
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
175
174
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
176
|
-
|
|
175
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
177
176
|
}
|
|
178
|
-
|
|
177
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
179
178
|
${Object.keys(options).map((key) => ` - ${key}=${_isFunction(options[key]) ? "<function>" : JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
180
179
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
181
180
|
config,
|
|
@@ -187,9 +186,9 @@ ${Object.keys(options).map((key) => ` - ${key}=${_isFunction(options[key]) ? "<f
|
|
|
187
186
|
...executorOptions
|
|
188
187
|
}, applyWorkspaceExecutorTokens);
|
|
189
188
|
if (_optionalChain([executorOptions, 'optionalAccess', _23 => _23.hooks, 'optionalAccess', _24 => _24.preProcess])) {
|
|
190
|
-
|
|
189
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
191
190
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
192
|
-
|
|
191
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
193
192
|
}
|
|
194
193
|
const ret = executorFn(tokenized, context2, config);
|
|
195
194
|
if (_isFunction(_optionalChain([ret, 'optionalAccess', _25 => _25.next]))) {
|
|
@@ -199,26 +198,26 @@ ${Object.keys(options).map((key) => ` - ${key}=${_isFunction(options[key]) ? "<f
|
|
|
199
198
|
}
|
|
200
199
|
const result = await Promise.resolve(ret);
|
|
201
200
|
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _26 => _26.error, 'optionalAccess', _27 => _27.message]) && typeof _optionalChain([result, 'optionalAccess', _28 => _28.error, 'optionalAccess', _29 => _29.message]) === "string" && _optionalChain([result, 'optionalAccess', _30 => _30.error, 'optionalAccess', _31 => _31.name]) && typeof _optionalChain([result, 'optionalAccess', _32 => _32.error, 'optionalAccess', _33 => _33.name]) === "string")) {
|
|
202
|
-
|
|
203
|
-
${
|
|
201
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
202
|
+
${_chunkTH4KH35Pjs.formatLogMessage.call(void 0, result)}`, config);
|
|
204
203
|
console.error(result);
|
|
205
204
|
throw new Error(`The ${name} executor failed to run`, {
|
|
206
205
|
cause: _optionalChain([result, 'optionalAccess', _34 => _34.error])
|
|
207
206
|
});
|
|
208
207
|
}
|
|
209
208
|
if (_optionalChain([executorOptions, 'optionalAccess', _35 => _35.hooks, 'optionalAccess', _36 => _36.postProcess])) {
|
|
210
|
-
|
|
209
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
211
210
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
212
|
-
|
|
211
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
213
212
|
}
|
|
214
|
-
|
|
213
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
215
214
|
`, config);
|
|
216
215
|
return {
|
|
217
216
|
success: true
|
|
218
217
|
};
|
|
219
218
|
} catch (error) {
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
_chunkTH4KH35Pjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
220
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
222
221
|
- Details: ${error.message}
|
|
223
222
|
- Stacktrace: ${error.stack}`, config);
|
|
224
223
|
return {
|
|
@@ -503,10 +502,10 @@ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(
|
|
|
503
502
|
var readNxConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot3) => {
|
|
504
503
|
let rootDir = workspaceRoot3;
|
|
505
504
|
if (!rootDir) {
|
|
506
|
-
const config = await
|
|
505
|
+
const config = await _chunk3JJSMPBTjs.loadStormConfig.call(void 0, );
|
|
507
506
|
rootDir = config.workspaceRoot;
|
|
508
507
|
}
|
|
509
|
-
const nxJsonPath =
|
|
508
|
+
const nxJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, rootDir, "nx.json");
|
|
510
509
|
if (!_fs.existsSync.call(void 0, nxJsonPath)) {
|
|
511
510
|
throw new Error("Cannot find project.json configuration");
|
|
512
511
|
}
|
|
@@ -515,7 +514,7 @@ var readNxConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (w
|
|
|
515
514
|
}, "readNxConfig");
|
|
516
515
|
|
|
517
516
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
518
|
-
var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, assets, outputPath, projectRoot, projectName, sourceRoot,
|
|
517
|
+
var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
519
518
|
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
520
519
|
if (!_optionalChain([pendingAssets, 'optionalAccess', _43 => _43.some, 'call', _44 => _44((asset) => _optionalChain([asset, 'optionalAccess', _45 => _45.glob]) === "*.md")])) {
|
|
521
520
|
pendingAssets.push({
|
|
@@ -524,7 +523,7 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
524
523
|
output: "/"
|
|
525
524
|
});
|
|
526
525
|
}
|
|
527
|
-
if (
|
|
526
|
+
if (generatePackageJson3 === false) {
|
|
528
527
|
pendingAssets.push({
|
|
529
528
|
input: sourceRoot,
|
|
530
529
|
glob: "package.json",
|
|
@@ -553,7 +552,7 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
553
552
|
}
|
|
554
553
|
const buildTarget = _optionalChain([projectsConfigurations, 'access', _51 => _51.projects, 'access', _52 => _52[projectName], 'access', _53 => _53.targets, 'optionalAccess', _54 => _54.build]);
|
|
555
554
|
if (!buildTarget) {
|
|
556
|
-
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 ${
|
|
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 ${_chunkTH4KH35Pjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
|
|
557
556
|
}
|
|
558
557
|
const result = await _js.copyAssets.call(void 0, {
|
|
559
558
|
assets,
|
|
@@ -568,18 +567,18 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
568
567
|
projectsConfigurations,
|
|
569
568
|
nxJsonConfiguration: nxJson,
|
|
570
569
|
cwd: config.workspaceRoot,
|
|
571
|
-
isVerbose:
|
|
570
|
+
isVerbose: _chunkTH4KH35Pjs.isVerbose.call(void 0, config.logLevel)
|
|
572
571
|
});
|
|
573
572
|
if (!result.success) {
|
|
574
573
|
throw new Error("The Build process failed trying to copy assets");
|
|
575
574
|
}
|
|
576
575
|
if (includeSrc === true) {
|
|
577
|
-
|
|
576
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkTH4KH35Pjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
578
577
|
const files = await _glob.glob.call(void 0, [
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
579
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
580
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
581
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
583
582
|
]);
|
|
584
583
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
585
584
|
|
|
@@ -601,7 +600,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
601
600
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
602
601
|
const projectNode = project.node;
|
|
603
602
|
if (projectNode.data.root) {
|
|
604
|
-
const projectPackageJsonPath =
|
|
603
|
+
const projectPackageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
605
604
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
606
605
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
607
606
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -612,7 +611,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
612
611
|
}
|
|
613
612
|
}
|
|
614
613
|
if (localPackages.length > 0) {
|
|
615
|
-
|
|
614
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
616
615
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
617
616
|
if (!ret[localPackage.name]) {
|
|
618
617
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -634,13 +633,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
634
633
|
return ret;
|
|
635
634
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
636
635
|
} else {
|
|
637
|
-
|
|
636
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
638
637
|
}
|
|
639
638
|
return packageJson;
|
|
640
639
|
}, "addPackageDependencies");
|
|
641
640
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
642
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
643
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
641
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, );
|
|
642
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
644
643
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
645
644
|
packageJson.type ??= "module";
|
|
646
645
|
packageJson.sideEffects ??= false;
|
|
@@ -649,7 +648,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
649
648
|
if (distSrc.startsWith("/")) {
|
|
650
649
|
distSrc = distSrc.substring(1);
|
|
651
650
|
}
|
|
652
|
-
packageJson.source ??= `${
|
|
651
|
+
packageJson.source ??= `${_chunkTH4KH35Pjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
653
652
|
}
|
|
654
653
|
packageJson.files ??= [
|
|
655
654
|
"dist/**/*"
|
|
@@ -680,7 +679,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
680
679
|
];
|
|
681
680
|
}
|
|
682
681
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
683
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
682
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkTH4KH35Pjs.joinPaths.call(void 0, "packages", projectName);
|
|
684
683
|
return packageJson;
|
|
685
684
|
}, "addWorkspacePackageJsonFields");
|
|
686
685
|
var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -703,39 +702,11 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
|
703
702
|
}
|
|
704
703
|
};
|
|
705
704
|
}, "addPackageJsonExport");
|
|
706
|
-
var addPackageJsonExports = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (sourceRoot, packageJson) => {
|
|
707
|
-
packageJson.exports ??= {};
|
|
708
|
-
const files = await new (0, _glob.Glob)("**/*.{ts,tsx}", {
|
|
709
|
-
absolute: false,
|
|
710
|
-
cwd: sourceRoot,
|
|
711
|
-
root: sourceRoot
|
|
712
|
-
}).walk();
|
|
713
|
-
files.forEach((file) => {
|
|
714
|
-
addPackageJsonExport(file, packageJson.type, sourceRoot);
|
|
715
|
-
const split = file.split(".");
|
|
716
|
-
split.pop();
|
|
717
|
-
const entry = split.join(".").replaceAll("\\", "/");
|
|
718
|
-
packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, sourceRoot);
|
|
719
|
-
});
|
|
720
|
-
packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
721
|
-
packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
|
|
722
|
-
packageJson.types = "./dist/index.d.ts";
|
|
723
|
-
packageJson.exports ??= {};
|
|
724
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
725
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
726
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
727
|
-
}
|
|
728
|
-
return ret;
|
|
729
|
-
}, packageJson.exports);
|
|
730
|
-
packageJson.exports["./package.json"] ??= "./package.json";
|
|
731
|
-
packageJson.exports["."] = _nullishCoalesce(packageJson.exports["."], () => ( addPackageJsonExport("index", packageJson.type, sourceRoot)));
|
|
732
|
-
return packageJson;
|
|
733
|
-
}, "addPackageJsonExports");
|
|
734
705
|
|
|
735
706
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
736
707
|
|
|
737
708
|
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
738
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
709
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, );
|
|
739
710
|
const entryPoints = [];
|
|
740
711
|
if (entry) {
|
|
741
712
|
if (Array.isArray(entry)) {
|
|
@@ -747,7 +718,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
747
718
|
}
|
|
748
719
|
}
|
|
749
720
|
if (emitOnAll) {
|
|
750
|
-
entryPoints.push(
|
|
721
|
+
entryPoints.push(_chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
751
722
|
}
|
|
752
723
|
const results = [];
|
|
753
724
|
for (const entryPoint in entryPoints) {
|
|
@@ -756,9 +727,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
756
727
|
withFileTypes: true
|
|
757
728
|
});
|
|
758
729
|
results.push(...files.reduce((ret, filePath) => {
|
|
759
|
-
const result =
|
|
730
|
+
const result = _chunkTH4KH35Pjs.correctPaths.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkTH4KH35Pjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkTH4KH35Pjs.correctPaths.call(void 0, projectRoot), ""));
|
|
760
731
|
if (result) {
|
|
761
|
-
|
|
732
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkTH4KH35Pjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
762
733
|
if (!results.includes(result)) {
|
|
763
734
|
results.push(result);
|
|
764
735
|
}
|
|
@@ -964,8 +935,8 @@ var RendererEngine = class {
|
|
|
964
935
|
// ../esbuild/src/clean.ts
|
|
965
936
|
|
|
966
937
|
async function clean(name = "ESBuild", directory, config) {
|
|
967
|
-
|
|
968
|
-
const stopwatch =
|
|
938
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
939
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
969
940
|
await _node.hfs.deleteAll(directory);
|
|
970
941
|
stopwatch();
|
|
971
942
|
}
|
|
@@ -975,8 +946,8 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, clean, "clean");
|
|
|
975
946
|
|
|
976
947
|
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
977
948
|
name: "storm:esm-split-code-to-cjs",
|
|
978
|
-
setup(
|
|
979
|
-
|
|
949
|
+
setup(build5) {
|
|
950
|
+
build5.onEnd(async (result) => {
|
|
980
951
|
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _63 => _63.metafile, 'optionalAccess', _64 => _64.outputs]), () => ( {})));
|
|
981
952
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
982
953
|
await esbuild.build({
|
|
@@ -994,15 +965,15 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
994
965
|
// ../esbuild/src/plugins/fix-imports.ts
|
|
995
966
|
var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
996
967
|
name: "storm:fix-imports",
|
|
997
|
-
setup(
|
|
998
|
-
|
|
968
|
+
setup(build5) {
|
|
969
|
+
build5.onResolve({
|
|
999
970
|
filter: /^spdx-exceptions/
|
|
1000
971
|
}, () => {
|
|
1001
972
|
return {
|
|
1002
973
|
path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-exceptions")
|
|
1003
974
|
};
|
|
1004
975
|
});
|
|
1005
|
-
|
|
976
|
+
build5.onResolve({
|
|
1006
977
|
filter: /^spdx-license-ids/
|
|
1007
978
|
}, () => {
|
|
1008
979
|
return {
|
|
@@ -1017,8 +988,8 @@ var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (opt
|
|
|
1017
988
|
var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
1018
989
|
return {
|
|
1019
990
|
name: "native-node-modules",
|
|
1020
|
-
setup(
|
|
1021
|
-
|
|
991
|
+
setup(build5) {
|
|
992
|
+
build5.onResolve({
|
|
1022
993
|
filter: /\.node$/,
|
|
1023
994
|
namespace: "file"
|
|
1024
995
|
}, (args) => {
|
|
@@ -1037,7 +1008,7 @@ var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
1037
1008
|
path: resolvedId
|
|
1038
1009
|
};
|
|
1039
1010
|
});
|
|
1040
|
-
|
|
1011
|
+
build5.onLoad({
|
|
1041
1012
|
filter: /.*/,
|
|
1042
1013
|
namespace: "node-file"
|
|
1043
1014
|
}, (args) => {
|
|
@@ -1050,14 +1021,14 @@ var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
1050
1021
|
resolveDir: _path.dirname.call(void 0, args.path)
|
|
1051
1022
|
};
|
|
1052
1023
|
});
|
|
1053
|
-
|
|
1024
|
+
build5.onResolve({
|
|
1054
1025
|
filter: /\.node$/,
|
|
1055
1026
|
namespace: "node-file"
|
|
1056
1027
|
}, (args) => ({
|
|
1057
1028
|
path: args.path,
|
|
1058
1029
|
namespace: "file"
|
|
1059
1030
|
}));
|
|
1060
|
-
const opts =
|
|
1031
|
+
const opts = build5.initialOptions;
|
|
1061
1032
|
opts.loader = opts.loader || {};
|
|
1062
1033
|
opts.loader[".node"] = "file";
|
|
1063
1034
|
}
|
|
@@ -1083,10 +1054,10 @@ var nodeProtocolPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
1083
1054
|
// ../esbuild/src/plugins/on-error.ts
|
|
1084
1055
|
var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1085
1056
|
name: "storm:on-error",
|
|
1086
|
-
setup(
|
|
1087
|
-
|
|
1057
|
+
setup(build5) {
|
|
1058
|
+
build5.onEnd((result) => {
|
|
1088
1059
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
1089
|
-
|
|
1060
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
1090
1061
|
${result.errors.map((error) => error.text).join("\n")}
|
|
1091
1062
|
|
|
1092
1063
|
`, resolvedOptions.config);
|
|
@@ -1120,14 +1091,14 @@ function resolvePathsConfig(options, cwd) {
|
|
|
1120
1091
|
_chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
1121
1092
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1122
1093
|
name: "storm:resolve-paths",
|
|
1123
|
-
setup(
|
|
1124
|
-
const parentTsConfig =
|
|
1094
|
+
setup(build5) {
|
|
1095
|
+
const parentTsConfig = build5.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build5.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
1125
1096
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
1126
1097
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
1127
|
-
|
|
1098
|
+
build5.onResolve({
|
|
1128
1099
|
filter: packagesRegex
|
|
1129
1100
|
}, (args) => {
|
|
1130
|
-
if (_optionalChain([
|
|
1101
|
+
if (_optionalChain([build5, 'access', _67 => _67.initialOptions, 'access', _68 => _68.external, 'optionalAccess', _69 => _69.includes, 'call', _70 => _70(args.path)])) {
|
|
1131
1102
|
return {
|
|
1132
1103
|
path: args.path,
|
|
1133
1104
|
external: true
|
|
@@ -1144,7 +1115,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
1144
1115
|
|
|
1145
1116
|
var _apiextractor = require('@microsoft/api-extractor');
|
|
1146
1117
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1147
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1118
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1148
1119
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1149
1120
|
p,
|
|
1150
1121
|
getTypeDependencyPackageName(p)
|
|
@@ -1180,13 +1151,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1180
1151
|
},
|
|
1181
1152
|
dtsRollup: {
|
|
1182
1153
|
enabled: true,
|
|
1183
|
-
untrimmedFilePath:
|
|
1154
|
+
untrimmedFilePath: _chunkTH4KH35Pjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1184
1155
|
},
|
|
1185
1156
|
tsdocMetadata: {
|
|
1186
1157
|
enabled: false
|
|
1187
1158
|
}
|
|
1188
1159
|
},
|
|
1189
|
-
packageJsonFullPath:
|
|
1160
|
+
packageJsonFullPath: _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1190
1161
|
configObjectFullPath: void 0
|
|
1191
1162
|
});
|
|
1192
1163
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1194,18 +1165,18 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1194
1165
|
localBuild: true
|
|
1195
1166
|
});
|
|
1196
1167
|
if (extractorResult.succeeded === false) {
|
|
1197
|
-
|
|
1168
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1198
1169
|
throw new Error("API Extractor completed with errors");
|
|
1199
1170
|
}
|
|
1200
1171
|
}
|
|
1201
1172
|
_chunkJ5SB6L2Ljs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
1202
1173
|
var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1203
1174
|
name: "storm:tsc",
|
|
1204
|
-
setup(
|
|
1175
|
+
setup(build5) {
|
|
1205
1176
|
if (options.emitTypes === false) {
|
|
1206
1177
|
return;
|
|
1207
1178
|
}
|
|
1208
|
-
|
|
1179
|
+
build5.onStart(async () => {
|
|
1209
1180
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1210
1181
|
await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
1211
1182
|
}
|
|
@@ -1213,12 +1184,12 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1213
1184
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1214
1185
|
const typeOutDir = resolvedOptions.outdir;
|
|
1215
1186
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1216
|
-
const bundlePath =
|
|
1187
|
+
const bundlePath = _chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1217
1188
|
let dtsPath;
|
|
1218
|
-
if (await _node.hfs.isFile(
|
|
1219
|
-
dtsPath =
|
|
1220
|
-
} else if (await _node.hfs.isFile(
|
|
1221
|
-
dtsPath =
|
|
1189
|
+
if (await _node.hfs.isFile(_chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1190
|
+
dtsPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1191
|
+
} else if (await _node.hfs.isFile(_chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1192
|
+
dtsPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1222
1193
|
}
|
|
1223
1194
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1224
1195
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1328,7 +1299,7 @@ var missingIgnore = [
|
|
|
1328
1299
|
];
|
|
1329
1300
|
var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bundle) => ({
|
|
1330
1301
|
name: "storm:deps-check",
|
|
1331
|
-
setup(
|
|
1302
|
+
setup(build5) {
|
|
1332
1303
|
const pkgJsonPath = path6.default.join(process.cwd(), "package.json");
|
|
1333
1304
|
const pkgContents = _chunkJ5SB6L2Ljs.__require.call(void 0, pkgJsonPath);
|
|
1334
1305
|
const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
|
|
@@ -1340,7 +1311,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1340
1311
|
];
|
|
1341
1312
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
1342
1313
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
1343
|
-
|
|
1314
|
+
build5.onResolve({
|
|
1344
1315
|
filter: onlyPackages
|
|
1345
1316
|
}, (args) => {
|
|
1346
1317
|
if (args.importer.includes(process.cwd())) {
|
|
@@ -1356,7 +1327,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1356
1327
|
external: true
|
|
1357
1328
|
};
|
|
1358
1329
|
});
|
|
1359
|
-
|
|
1330
|
+
build5.onEnd(() => {
|
|
1360
1331
|
const unusedDependencies = [
|
|
1361
1332
|
...dependencies
|
|
1362
1333
|
].filter((dep) => {
|
|
@@ -1373,8 +1344,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1373
1344
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1374
1345
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1375
1346
|
});
|
|
1376
|
-
|
|
1377
|
-
|
|
1347
|
+
_chunkTH4KH35Pjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1348
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1378
1349
|
if (filteredMissingDeps.length > 0) {
|
|
1379
1350
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1380
1351
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1468,13 +1439,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1468
1439
|
if (!workspaceRoot3) {
|
|
1469
1440
|
throw new Error("Cannot find Nx workspace root");
|
|
1470
1441
|
}
|
|
1471
|
-
const config = await
|
|
1472
|
-
|
|
1473
|
-
const stopwatch =
|
|
1442
|
+
const config = await _chunk3JJSMPBTjs.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1443
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1444
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1474
1445
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1475
1446
|
exitOnError: true
|
|
1476
1447
|
});
|
|
1477
|
-
const projectJsonPath =
|
|
1448
|
+
const projectJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1478
1449
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
1479
1450
|
throw new Error("Cannot find project.json configuration");
|
|
1480
1451
|
}
|
|
@@ -1487,7 +1458,7 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1487
1458
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1488
1459
|
options.name ??= `${projectName}-${options.format}`;
|
|
1489
1460
|
options.target ??= DEFAULT_TARGET;
|
|
1490
|
-
const packageJsonPath =
|
|
1461
|
+
const packageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1491
1462
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1492
1463
|
throw new Error("Cannot find package.json configuration");
|
|
1493
1464
|
}
|
|
@@ -1511,20 +1482,20 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1511
1482
|
".node"
|
|
1512
1483
|
],
|
|
1513
1484
|
...userOptions,
|
|
1514
|
-
tsconfig:
|
|
1485
|
+
tsconfig: _chunkTH4KH35Pjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1515
1486
|
format: options.format || "cjs",
|
|
1516
1487
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1517
1488
|
"./src/index.ts"
|
|
1518
1489
|
], userOptions.emitOnAll),
|
|
1519
|
-
outdir: userOptions.outputPath ||
|
|
1490
|
+
outdir: userOptions.outputPath || _chunkTH4KH35Pjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1520
1491
|
plugins: [],
|
|
1521
1492
|
name: userOptions.name || projectName,
|
|
1522
1493
|
projectConfigurations,
|
|
1523
1494
|
projectName,
|
|
1524
1495
|
projectGraph,
|
|
1525
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1496
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkTH4KH35Pjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1526
1497
|
minify: userOptions.minify || !userOptions.debug,
|
|
1527
|
-
verbose: userOptions.verbose ||
|
|
1498
|
+
verbose: userOptions.verbose || _chunkTH4KH35Pjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1528
1499
|
includeSrc: userOptions.includeSrc === true,
|
|
1529
1500
|
metafile: userOptions.metafile !== false,
|
|
1530
1501
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1560,8 +1531,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1560
1531
|
}, {})
|
|
1561
1532
|
},
|
|
1562
1533
|
inject: [
|
|
1563
|
-
options.format === "cjs" && options.injectShims ?
|
|
1564
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1534
|
+
options.format === "cjs" && options.injectShims ? _chunkTH4KH35Pjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
1535
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkTH4KH35Pjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : "",
|
|
1565
1536
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
1566
1537
|
].filter(Boolean)
|
|
1567
1538
|
};
|
|
@@ -1570,14 +1541,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1570
1541
|
return result;
|
|
1571
1542
|
}, "resolveOptions");
|
|
1572
1543
|
async function generatePackageJson(context2) {
|
|
1573
|
-
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
1574
|
-
|
|
1575
|
-
const stopwatch =
|
|
1576
|
-
const packageJsonPath =
|
|
1544
|
+
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkTH4KH35Pjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1545
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1546
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1547
|
+
const packageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1577
1548
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1578
1549
|
throw new Error("Cannot find package.json configuration");
|
|
1579
1550
|
}
|
|
1580
|
-
let packageJson = await _node.hfs.json(
|
|
1551
|
+
let packageJson = await _node.hfs.json(_chunkTH4KH35Pjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
|
|
1581
1552
|
if (!packageJson) {
|
|
1582
1553
|
throw new Error("Cannot find package.json configuration file");
|
|
1583
1554
|
}
|
|
@@ -1615,7 +1586,7 @@ async function generatePackageJson(context2) {
|
|
|
1615
1586
|
}
|
|
1616
1587
|
return ret;
|
|
1617
1588
|
}, packageJson.exports);
|
|
1618
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1589
|
+
await _devkit.writeJsonFile.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1619
1590
|
stopwatch();
|
|
1620
1591
|
}
|
|
1621
1592
|
return context2;
|
|
@@ -1641,8 +1612,8 @@ async function generateContext(getOptions) {
|
|
|
1641
1612
|
}
|
|
1642
1613
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1643
1614
|
async function executeEsBuild(context2) {
|
|
1644
|
-
|
|
1645
|
-
const stopwatch =
|
|
1615
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1616
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1646
1617
|
if (process.env.WATCH === "true") {
|
|
1647
1618
|
const ctx = await esbuild2.context(context2.options);
|
|
1648
1619
|
watch(ctx, context2.options);
|
|
@@ -1658,8 +1629,8 @@ async function executeEsBuild(context2) {
|
|
|
1658
1629
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1659
1630
|
async function copyBuildAssets(context2) {
|
|
1660
1631
|
if (_optionalChain([context2, 'access', _79 => _79.result, 'optionalAccess', _80 => _80.errors, 'access', _81 => _81.length]) === 0) {
|
|
1661
|
-
|
|
1662
|
-
const stopwatch =
|
|
1632
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1633
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1663
1634
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
|
|
1664
1635
|
stopwatch();
|
|
1665
1636
|
}
|
|
@@ -1669,9 +1640,9 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
|
1669
1640
|
async function reportResults(context2) {
|
|
1670
1641
|
if (_optionalChain([context2, 'access', _82 => _82.result, 'optionalAccess', _83 => _83.errors, 'access', _84 => _84.length]) === 0) {
|
|
1671
1642
|
if (context2.result.warnings.length > 0) {
|
|
1672
|
-
|
|
1643
|
+
_chunkTH4KH35Pjs.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);
|
|
1673
1644
|
}
|
|
1674
|
-
|
|
1645
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1675
1646
|
}
|
|
1676
1647
|
}
|
|
1677
1648
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1713,8 +1684,8 @@ async function cleanOutputPath(context2) {
|
|
|
1713
1684
|
}
|
|
1714
1685
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1715
1686
|
async function build3(options) {
|
|
1716
|
-
|
|
1717
|
-
const stopwatch =
|
|
1687
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1688
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1718
1689
|
try {
|
|
1719
1690
|
const opts = Array.isArray(options) ? options : [
|
|
1720
1691
|
options
|
|
@@ -1724,9 +1695,9 @@ async function build3(options) {
|
|
|
1724
1695
|
}
|
|
1725
1696
|
void transduce.async(opts, dependencyCheck);
|
|
1726
1697
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1727
|
-
|
|
1698
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1728
1699
|
} catch (error) {
|
|
1729
|
-
|
|
1700
|
+
_chunkTH4KH35Pjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1730
1701
|
throw error;
|
|
1731
1702
|
} finally {
|
|
1732
1703
|
stopwatch();
|
|
@@ -1754,9 +1725,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1754
1725
|
return context2.rebuild();
|
|
1755
1726
|
});
|
|
1756
1727
|
if (rebuildResult instanceof Error) {
|
|
1757
|
-
|
|
1728
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, rebuildResult.message);
|
|
1758
1729
|
}
|
|
1759
|
-
|
|
1730
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1760
1731
|
}, 10);
|
|
1761
1732
|
changeWatcher.on("change", fastRebuild);
|
|
1762
1733
|
return void 0;
|
|
@@ -1764,7 +1735,7 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1764
1735
|
|
|
1765
1736
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1766
1737
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1767
|
-
|
|
1738
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1768
1739
|
if (!_optionalChain([context2, 'access', _85 => _85.projectsConfigurations, 'optionalAccess', _86 => _86.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'access', _88 => _88.projects, 'access', _89 => _89[context2.projectName], 'optionalAccess', _90 => _90.root])) {
|
|
1769
1740
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1770
1741
|
}
|
|
@@ -1818,7 +1789,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1818
1789
|
if (!_optionalChain([context2, 'optionalAccess', _99 => _99.projectName]) || !_optionalChain([context2, 'access', _100 => _100.projectsConfigurations, 'optionalAccess', _101 => _101.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1819
1790
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1820
1791
|
}
|
|
1821
|
-
|
|
1792
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1822
1793
|
_sizelimit2.default.call(void 0, [
|
|
1823
1794
|
_file2.default,
|
|
1824
1795
|
_esbuild3.default,
|
|
@@ -1826,7 +1797,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1826
1797
|
], {
|
|
1827
1798
|
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'access', _104 => _104[context2.projectName], 'optionalAccess', _105 => _105.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'access', _107 => _107.projects, 'access', _108 => _108[context2.projectName], 'optionalAccess', _109 => _109.root]), () => ( "./")), "src")))
|
|
1828
1799
|
}).then((result) => {
|
|
1829
|
-
|
|
1800
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1830
1801
|
});
|
|
1831
1802
|
return {
|
|
1832
1803
|
success: true
|
|
@@ -1852,8 +1823,8 @@ var _tsdown = require('tsdown');
|
|
|
1852
1823
|
// ../tsdown/src/clean.ts
|
|
1853
1824
|
|
|
1854
1825
|
async function clean2(name = "ESBuild", directory, config) {
|
|
1855
|
-
|
|
1856
|
-
const stopwatch =
|
|
1826
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
1827
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
1857
1828
|
await _node.hfs.deleteAll(directory);
|
|
1858
1829
|
stopwatch();
|
|
1859
1830
|
}
|
|
@@ -1888,13 +1859,13 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1888
1859
|
if (!workspaceRoot3) {
|
|
1889
1860
|
throw new Error("Cannot find Nx workspace root");
|
|
1890
1861
|
}
|
|
1891
|
-
const config = await
|
|
1892
|
-
|
|
1893
|
-
const stopwatch =
|
|
1862
|
+
const config = await _chunk3JJSMPBTjs.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1863
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1864
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1894
1865
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1895
1866
|
exitOnError: true
|
|
1896
1867
|
});
|
|
1897
|
-
const projectJsonPath =
|
|
1868
|
+
const projectJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1898
1869
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
1899
1870
|
throw new Error("Cannot find project.json configuration");
|
|
1900
1871
|
}
|
|
@@ -1907,7 +1878,7 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1907
1878
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
1908
1879
|
options.name ??= `${projectName}-${options.format}`;
|
|
1909
1880
|
options.target ??= DEFAULT_TARGET;
|
|
1910
|
-
const packageJsonPath =
|
|
1881
|
+
const packageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1911
1882
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1912
1883
|
throw new Error("Cannot find package.json configuration");
|
|
1913
1884
|
}
|
|
@@ -1916,20 +1887,20 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1916
1887
|
...options,
|
|
1917
1888
|
config,
|
|
1918
1889
|
...userOptions,
|
|
1919
|
-
tsconfig:
|
|
1890
|
+
tsconfig: _chunkTH4KH35Pjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1920
1891
|
format: options.format || "cjs",
|
|
1921
1892
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1922
1893
|
"./src/index.ts"
|
|
1923
1894
|
], userOptions.emitOnAll),
|
|
1924
|
-
outdir: userOptions.outputPath ||
|
|
1895
|
+
outdir: userOptions.outputPath || _chunkTH4KH35Pjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1925
1896
|
plugins: [],
|
|
1926
1897
|
name: userOptions.name || projectName,
|
|
1927
1898
|
projectConfigurations,
|
|
1928
1899
|
projectName,
|
|
1929
1900
|
projectGraph,
|
|
1930
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1901
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkTH4KH35Pjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1931
1902
|
minify: userOptions.minify || !userOptions.debug,
|
|
1932
|
-
verbose: userOptions.verbose ||
|
|
1903
|
+
verbose: userOptions.verbose || _chunkTH4KH35Pjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1933
1904
|
includeSrc: userOptions.includeSrc === true,
|
|
1934
1905
|
metafile: userOptions.metafile !== false,
|
|
1935
1906
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1963,14 +1934,14 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1963
1934
|
return result;
|
|
1964
1935
|
}, "resolveOptions");
|
|
1965
1936
|
async function generatePackageJson2(options) {
|
|
1966
|
-
if (options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
1967
|
-
|
|
1968
|
-
const stopwatch =
|
|
1969
|
-
const packageJsonPath =
|
|
1937
|
+
if (options.generatePackageJson !== false && await _node.hfs.isFile(_chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
1938
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
1939
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1940
|
+
const packageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
1970
1941
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
1971
1942
|
throw new Error("Cannot find package.json configuration");
|
|
1972
1943
|
}
|
|
1973
|
-
let packageJson = await _node.hfs.json(
|
|
1944
|
+
let packageJson = await _node.hfs.json(_chunkTH4KH35Pjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"));
|
|
1974
1945
|
if (!packageJson) {
|
|
1975
1946
|
throw new Error("Cannot find package.json configuration file");
|
|
1976
1947
|
}
|
|
@@ -2008,15 +1979,15 @@ async function generatePackageJson2(options) {
|
|
|
2008
1979
|
}
|
|
2009
1980
|
return ret;
|
|
2010
1981
|
}, packageJson.exports);
|
|
2011
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1982
|
+
await _devkit.writeJsonFile.call(void 0, _chunkTH4KH35Pjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
2012
1983
|
stopwatch();
|
|
2013
1984
|
}
|
|
2014
1985
|
return options;
|
|
2015
1986
|
}
|
|
2016
1987
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson2, "generatePackageJson");
|
|
2017
1988
|
async function executeTSDown(options) {
|
|
2018
|
-
|
|
2019
|
-
const stopwatch =
|
|
1989
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1990
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
2020
1991
|
await _tsdown.build.call(void 0, {
|
|
2021
1992
|
...options,
|
|
2022
1993
|
entry: options.entryPoints,
|
|
@@ -2028,15 +1999,15 @@ async function executeTSDown(options) {
|
|
|
2028
1999
|
}
|
|
2029
2000
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
2030
2001
|
async function copyBuildAssets2(options) {
|
|
2031
|
-
|
|
2032
|
-
const stopwatch =
|
|
2002
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
2003
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
2033
2004
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.projectName, options.sourceRoot, true, false);
|
|
2034
2005
|
stopwatch();
|
|
2035
2006
|
return options;
|
|
2036
2007
|
}
|
|
2037
2008
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets2, "copyBuildAssets");
|
|
2038
2009
|
async function reportResults2(options) {
|
|
2039
|
-
|
|
2010
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
2040
2011
|
}
|
|
2041
2012
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults2, "reportResults");
|
|
2042
2013
|
async function cleanOutputPath2(options) {
|
|
@@ -2047,8 +2018,8 @@ async function cleanOutputPath2(options) {
|
|
|
2047
2018
|
}
|
|
2048
2019
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath2, "cleanOutputPath");
|
|
2049
2020
|
async function build4(options) {
|
|
2050
|
-
|
|
2051
|
-
const stopwatch =
|
|
2021
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
2022
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
2052
2023
|
try {
|
|
2053
2024
|
const opts = Array.isArray(options) ? options : [
|
|
2054
2025
|
options
|
|
@@ -2066,11 +2037,11 @@ async function build4(options) {
|
|
|
2066
2037
|
await reportResults2(opt);
|
|
2067
2038
|
}));
|
|
2068
2039
|
} else {
|
|
2069
|
-
|
|
2040
|
+
_chunkTH4KH35Pjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
2070
2041
|
}
|
|
2071
|
-
|
|
2042
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
2072
2043
|
} catch (error) {
|
|
2073
|
-
|
|
2044
|
+
_chunkTH4KH35Pjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
2074
2045
|
throw error;
|
|
2075
2046
|
} finally {
|
|
2076
2047
|
stopwatch();
|
|
@@ -2080,7 +2051,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
|
2080
2051
|
|
|
2081
2052
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
2082
2053
|
async function tsdownExecutorFn(options, context2, config) {
|
|
2083
|
-
|
|
2054
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
2084
2055
|
if (!_optionalChain([context2, 'access', _112 => _112.projectsConfigurations, 'optionalAccess', _113 => _113.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _114 => _114.projectsConfigurations, 'access', _115 => _115.projects, 'access', _116 => _116[context2.projectName], 'optionalAccess', _117 => _117.root])) {
|
|
2085
2056
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2086
2057
|
}
|
|
@@ -2116,11 +2087,11 @@ var _fsextra = require('fs-extra');
|
|
|
2116
2087
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
2117
2088
|
async function typiaExecutorFn(options, _, config) {
|
|
2118
2089
|
if (options.clean !== false) {
|
|
2119
|
-
|
|
2090
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
2120
2091
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
2121
2092
|
}
|
|
2122
2093
|
await Promise.all(options.entry.map((entry) => {
|
|
2123
|
-
|
|
2094
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
2124
2095
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
2125
2096
|
input: entry,
|
|
2126
2097
|
output: options.outputPath,
|
|
@@ -2147,429 +2118,20 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2147
2118
|
}
|
|
2148
2119
|
});
|
|
2149
2120
|
|
|
2150
|
-
// ../unbuild/src/build.ts
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
var _jiti = require('jiti');
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
// ../unbuild/src/clean.ts
|
|
2162
|
-
|
|
2163
|
-
async function clean3(name = "Unbuild", directory, config) {
|
|
2164
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
2165
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${name} output clean`);
|
|
2166
|
-
await _promises.rm.call(void 0, directory, {
|
|
2167
|
-
recursive: true,
|
|
2168
|
-
force: true
|
|
2169
|
-
});
|
|
2170
|
-
stopwatch();
|
|
2171
|
-
}
|
|
2172
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, clean3, "clean");
|
|
2173
|
-
|
|
2174
|
-
// ../unbuild/src/plugins/analyze.ts
|
|
2175
|
-
var formatBytes = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bytes) => {
|
|
2176
|
-
if (bytes === 0) return "0 Byte";
|
|
2177
|
-
const k = 1e3;
|
|
2178
|
-
const dm = 3;
|
|
2179
|
-
const sizes = [
|
|
2180
|
-
"Bytes",
|
|
2181
|
-
"KB",
|
|
2182
|
-
"MB",
|
|
2183
|
-
"GB"
|
|
2184
|
-
];
|
|
2185
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2186
|
-
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
|
|
2187
|
-
}, "formatBytes");
|
|
2188
|
-
var analyzePlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
2189
|
-
return {
|
|
2190
|
-
name: "storm:analyzer",
|
|
2191
|
-
renderChunk(source, chunk) {
|
|
2192
|
-
const sourceBytes = formatBytes(source.length);
|
|
2193
|
-
const fileName = chunk.fileName;
|
|
2194
|
-
_chunkRCE3CC76js.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
|
|
2195
|
-
}
|
|
2196
|
-
};
|
|
2197
|
-
}, "analyzePlugin");
|
|
2198
|
-
|
|
2199
|
-
// ../unbuild/src/plugins/on-error.ts
|
|
2200
|
-
var onErrorPlugin2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
2201
|
-
name: "storm:on-error",
|
|
2202
|
-
buildEnd(error) {
|
|
2203
|
-
if (error) {
|
|
2204
|
-
_chunkRCE3CC76js.writeError.call(void 0, `The following errors occurred during the build:
|
|
2205
|
-
${error ? error.message : "Unknown build error"}
|
|
2206
|
-
|
|
2207
|
-
`, resolvedOptions.config);
|
|
2208
|
-
throw new Error("Storm unbuild process failed with errors.");
|
|
2209
|
-
}
|
|
2210
|
-
},
|
|
2211
|
-
renderError(error) {
|
|
2212
|
-
_chunkRCE3CC76js.writeError.call(void 0, `The following errors occurred during the build:
|
|
2213
|
-
${error ? error.message : "Unknown build error"}
|
|
2214
|
-
|
|
2215
|
-
`, resolvedOptions.config);
|
|
2216
|
-
throw new Error("Storm unbuild process failed with errors.");
|
|
2217
|
-
}
|
|
2218
|
-
}), "onErrorPlugin");
|
|
2219
|
-
|
|
2220
|
-
// ../unbuild/src/plugins/tsc.ts
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
var _compilerhelperdependency = require('@nx/js/src/utils/compiler-helper-dependency');
|
|
2224
|
-
var _rollupplugintypescript2 = require('rollup-plugin-typescript2'); var _rollupplugintypescript22 = _interopRequireDefault(_rollupplugintypescript2);
|
|
2225
|
-
|
|
2226
|
-
// ../unbuild/src/utilities/helpers.ts
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
var _url = require('url');
|
|
2231
|
-
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
|
|
2232
|
-
async function loadConfig(configPath) {
|
|
2233
|
-
if (!/\.(js|mjs)$/.test(_path.extname.call(void 0, configPath))) {
|
|
2234
|
-
throw new Error("Unsupported config file format");
|
|
2235
|
-
}
|
|
2236
|
-
return Promise.resolve().then(() => _interopRequireWildcard(require(_url.pathToFileURL.call(void 0, configPath).toString()))).then((config) => config.default);
|
|
2237
|
-
}
|
|
2238
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, loadConfig, "loadConfig");
|
|
2239
|
-
async function createTsCompilerOptions(config, tsConfigPath, projectRoot, dependencies) {
|
|
2240
|
-
const tsConfigFile = _typescript2.default.readConfigFile(_devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath), _typescript2.default.sys.readFile);
|
|
2241
|
-
const tsConfig = _typescript2.default.parseJsonConfigFileContent(tsConfigFile.config, _typescript2.default.sys, _path.dirname.call(void 0, _devkit.joinPathFragments.call(void 0, config.workspaceRoot, projectRoot, tsConfigPath)));
|
|
2242
|
-
const compilerOptions = {
|
|
2243
|
-
rootDir: projectRoot,
|
|
2244
|
-
declaration: true,
|
|
2245
|
-
paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
|
|
2246
|
-
};
|
|
2247
|
-
_chunkRCE3CC76js.writeTrace.call(void 0, compilerOptions, config);
|
|
2248
|
-
return compilerOptions;
|
|
2249
|
-
}
|
|
2250
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
|
|
2251
|
-
|
|
2252
|
-
// ../unbuild/src/plugins/tsc.ts
|
|
2253
|
-
var tscPlugin2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, resolvedOptions) => {
|
|
2254
|
-
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
2255
|
-
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2256
|
-
let dependencies = result.dependencies;
|
|
2257
|
-
const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
|
|
2258
|
-
if (tsLibDependency) {
|
|
2259
|
-
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
2260
|
-
dependencies.push(tsLibDependency);
|
|
2261
|
-
}
|
|
2262
|
-
return _rollupplugintypescript22.default.call(void 0, {
|
|
2263
|
-
check: options.emitTypes !== false,
|
|
2264
|
-
tsconfig: resolvedOptions.tsconfig,
|
|
2265
|
-
tsconfigOverride: {
|
|
2266
|
-
compilerOptions: await createTsCompilerOptions(resolvedOptions.config, resolvedOptions.tsconfig, resolvedOptions.projectRoot, dependencies)
|
|
2267
|
-
}
|
|
2268
|
-
});
|
|
2269
|
-
}, "tscPlugin");
|
|
2270
|
-
|
|
2271
|
-
// ../unbuild/src/plugins/type-definitions.ts
|
|
2272
|
-
|
|
2273
|
-
function typeDefinitions(projectRoot) {
|
|
2274
|
-
return {
|
|
2275
|
-
name: "storm:dts-bundle",
|
|
2276
|
-
async generateBundle(_opts, bundle) {
|
|
2277
|
-
for (const file of Object.values(bundle)) {
|
|
2278
|
-
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) {
|
|
2279
|
-
continue;
|
|
2280
|
-
}
|
|
2281
|
-
const hasDefaultExport = file.exports.includes("default");
|
|
2282
|
-
const entrySourceFileName = _path.relative.call(void 0, projectRoot, file.facadeModuleId);
|
|
2283
|
-
const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
|
|
2284
|
-
const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
|
|
2285
|
-
const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
|
|
2286
|
-
const dtsFileSource = hasDefaultExport ? `
|
|
2287
|
-
export * from ${relativeSourceDtsName};
|
|
2288
|
-
export { default } from ${relativeSourceDtsName};
|
|
2289
|
-
` : `export * from ${relativeSourceDtsName};
|
|
2290
|
-
`;
|
|
2291
|
-
this.emitFile({
|
|
2292
|
-
type: "asset",
|
|
2293
|
-
fileName: dtsFileName,
|
|
2294
|
-
source: dtsFileSource
|
|
2295
|
-
});
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
};
|
|
2299
|
-
}
|
|
2300
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, typeDefinitions, "typeDefinitions");
|
|
2301
|
-
|
|
2302
|
-
// ../unbuild/src/config.ts
|
|
2303
|
-
var getDefaultBuildPlugins2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
|
|
2304
|
-
analyzePlugin(options, resolvedOptions),
|
|
2305
|
-
typeDefinitions(resolvedOptions.projectRoot),
|
|
2306
|
-
tscPlugin2(options, resolvedOptions),
|
|
2307
|
-
onErrorPlugin2(options, resolvedOptions)
|
|
2308
|
-
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
2309
|
-
|
|
2310
|
-
// ../unbuild/src/build.ts
|
|
2311
|
-
async function resolveOptions3(options) {
|
|
2312
|
-
const projectRoot = options.projectRoot;
|
|
2313
|
-
if (!projectRoot) {
|
|
2314
|
-
throw new Error("Cannot find project root");
|
|
2315
|
-
}
|
|
2316
|
-
const outputPath = options.outputPath || _chunkRCE3CC76js.joinPaths.call(void 0, "dist", projectRoot);
|
|
2317
|
-
const workspaceRoot3 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
2318
|
-
if (!workspaceRoot3) {
|
|
2319
|
-
throw new Error("Cannot find workspace root");
|
|
2320
|
-
}
|
|
2321
|
-
const config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
2322
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
2323
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Build options resolution");
|
|
2324
|
-
if (options.configPath) {
|
|
2325
|
-
const configFile = await loadConfig(options.configPath);
|
|
2326
|
-
if (configFile) {
|
|
2327
|
-
options = _defu2.default.call(void 0, options, configFile);
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
2331
|
-
const projectJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
|
|
2332
|
-
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
2333
|
-
throw new Error("Cannot find project.json configuration");
|
|
2334
|
-
}
|
|
2335
|
-
const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
|
|
2336
|
-
const projectJson = JSON.parse(projectJsonContent);
|
|
2337
|
-
const projectName = projectJson.name;
|
|
2338
|
-
const packageJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "package.json");
|
|
2339
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
2340
|
-
throw new Error("Cannot find package.json configuration");
|
|
2341
|
-
}
|
|
2342
|
-
const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
2343
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
2344
|
-
let tsconfig = options.tsconfig;
|
|
2345
|
-
if (!tsconfig) {
|
|
2346
|
-
tsconfig = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "tsconfig.json");
|
|
2347
|
-
}
|
|
2348
|
-
if (!_fs.existsSync.call(void 0, tsconfig)) {
|
|
2349
|
-
throw new Error("Cannot find tsconfig.json configuration");
|
|
2350
|
-
}
|
|
2351
|
-
let sourceRoot = projectJson.sourceRoot;
|
|
2352
|
-
if (!sourceRoot) {
|
|
2353
|
-
sourceRoot = _chunkRCE3CC76js.joinPaths.call(void 0, projectRoot, "src");
|
|
2354
|
-
}
|
|
2355
|
-
if (!_fs.existsSync.call(void 0, sourceRoot)) {
|
|
2356
|
-
throw new Error("Cannot find sourceRoot directory");
|
|
2357
|
-
}
|
|
2358
|
-
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot3.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2359
|
-
let dependencies = result.dependencies;
|
|
2360
|
-
const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
|
|
2361
|
-
if (tsLibDependency) {
|
|
2362
|
-
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
2363
|
-
dependencies.push(tsLibDependency);
|
|
2364
|
-
}
|
|
2365
|
-
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2366
|
-
cache: true,
|
|
2367
|
-
fsCache: config.skipCache ? false : _chunkRCE3CC76js.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2368
|
-
interopDefault: true
|
|
2369
|
-
});
|
|
2370
|
-
const resolvedOptions = {
|
|
2371
|
-
name: projectName,
|
|
2372
|
-
config,
|
|
2373
|
-
projectRoot,
|
|
2374
|
-
sourceRoot,
|
|
2375
|
-
projectName,
|
|
2376
|
-
tsconfig,
|
|
2377
|
-
jiti,
|
|
2378
|
-
clean: false,
|
|
2379
|
-
entries: [
|
|
2380
|
-
{
|
|
2381
|
-
builder: "mkdist",
|
|
2382
|
-
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
2383
|
-
outDir: _chunkRCE3CC76js.joinPaths.call(void 0, _path.relative.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
2384
|
-
declaration: options.emitTypes !== false,
|
|
2385
|
-
format: "esm"
|
|
2386
|
-
},
|
|
2387
|
-
{
|
|
2388
|
-
builder: "mkdist",
|
|
2389
|
-
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
2390
|
-
outDir: _chunkRCE3CC76js.joinPaths.call(void 0, _path.relative.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
2391
|
-
declaration: options.emitTypes !== false,
|
|
2392
|
-
format: "cjs",
|
|
2393
|
-
ext: "cjs"
|
|
2394
|
-
}
|
|
2395
|
-
],
|
|
2396
|
-
declaration: options.emitTypes !== false ? "compatible" : false,
|
|
2397
|
-
failOnWarn: false,
|
|
2398
|
-
sourcemap: _nullishCoalesce(options.sourcemap, () => ( !!options.debug)),
|
|
2399
|
-
outDir: outputPath,
|
|
2400
|
-
parallel: true,
|
|
2401
|
-
stub: false,
|
|
2402
|
-
stubOptions: {
|
|
2403
|
-
jiti: {}
|
|
2404
|
-
},
|
|
2405
|
-
externals: _nullishCoalesce(options.external, () => ( [])),
|
|
2406
|
-
dependencies: [],
|
|
2407
|
-
peerDependencies: [],
|
|
2408
|
-
devDependencies: [],
|
|
2409
|
-
hooks: {},
|
|
2410
|
-
alias: {},
|
|
2411
|
-
replace: {},
|
|
2412
|
-
rollup: {
|
|
2413
|
-
replace: {},
|
|
2414
|
-
alias: {},
|
|
2415
|
-
json: {},
|
|
2416
|
-
commonjs: {
|
|
2417
|
-
sourceMap: _nullishCoalesce(options.sourcemap, () => ( true))
|
|
2418
|
-
},
|
|
2419
|
-
emitCJS: true,
|
|
2420
|
-
cjsBridge: true,
|
|
2421
|
-
dts: {
|
|
2422
|
-
respectExternal: true,
|
|
2423
|
-
tsconfig
|
|
2424
|
-
},
|
|
2425
|
-
output: {
|
|
2426
|
-
banner: options.banner || `
|
|
2427
|
-
// \u26A1 Built by Storm Software
|
|
2428
|
-
`,
|
|
2429
|
-
footer: options.footer
|
|
2430
|
-
},
|
|
2431
|
-
resolve: {
|
|
2432
|
-
preferBuiltins: true,
|
|
2433
|
-
extensions: [
|
|
2434
|
-
".cjs",
|
|
2435
|
-
".mjs",
|
|
2436
|
-
".js",
|
|
2437
|
-
".jsx",
|
|
2438
|
-
".ts",
|
|
2439
|
-
".tsx",
|
|
2440
|
-
".json"
|
|
2441
|
-
]
|
|
2442
|
-
},
|
|
2443
|
-
esbuild: {
|
|
2444
|
-
minify: options.minify !== false,
|
|
2445
|
-
splitting: options.splitting !== false,
|
|
2446
|
-
treeShaking: options.treeShaking !== false,
|
|
2447
|
-
color: true,
|
|
2448
|
-
logLevel: config.logLevel === _chunkRCE3CC76js.LogLevelLabel.FATAL ? _chunkRCE3CC76js.LogLevelLabel.ERROR : _chunkRCE3CC76js.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
};
|
|
2452
|
-
dependencies = dependencies.filter((dep) => dep.node.type === "npm" || dep.node.type === "lib" || dep.node.type === "app");
|
|
2453
|
-
if (dependencies.length > 0) {
|
|
2454
|
-
resolvedOptions.dependencies = dependencies.map((dep) => dep.name);
|
|
2455
|
-
}
|
|
2456
|
-
if (packageJson.devDependencies) {
|
|
2457
|
-
resolvedOptions.devDependencies = Object.keys(packageJson.devDependencies);
|
|
2458
|
-
}
|
|
2459
|
-
if (packageJson.peerDependencies) {
|
|
2460
|
-
resolvedOptions.peerDependencies = Object.keys(packageJson.peerDependencies);
|
|
2461
|
-
}
|
|
2462
|
-
if (options.rollup) {
|
|
2463
|
-
let rollup = {};
|
|
2464
|
-
if (typeof options.rollup === "string") {
|
|
2465
|
-
const rollupFile = await loadConfig(options.rollup);
|
|
2466
|
-
if (rollupFile) {
|
|
2467
|
-
rollup = rollupFile;
|
|
2468
|
-
}
|
|
2469
|
-
} else {
|
|
2470
|
-
rollup = options.rollup;
|
|
2471
|
-
}
|
|
2472
|
-
resolvedOptions.rollup = _defu2.default.call(void 0, _nullishCoalesce(resolvedOptions.rollup, () => ( {})), rollup);
|
|
2473
|
-
}
|
|
2474
|
-
resolvedOptions.hooks = {
|
|
2475
|
-
"rollup:options": /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (ctx, opts) => {
|
|
2476
|
-
opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await getDefaultBuildPlugins2(options, resolvedOptions)));
|
|
2477
|
-
}, "rollup:options")
|
|
2478
|
-
};
|
|
2479
|
-
stopwatch();
|
|
2480
|
-
return resolvedOptions;
|
|
2481
|
-
}
|
|
2482
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveOptions3, "resolveOptions");
|
|
2483
|
-
async function generatePackageJson3(options) {
|
|
2484
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
2485
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
2486
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Write package.json file");
|
|
2487
|
-
const packageJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
2488
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
2489
|
-
throw new Error("Cannot find package.json configuration");
|
|
2490
|
-
}
|
|
2491
|
-
let packageJsonContent = await _promises.readFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
2492
|
-
if (!packageJsonContent) {
|
|
2493
|
-
throw new Error("Cannot find package.json configuration file");
|
|
2494
|
-
}
|
|
2495
|
-
let packageJson = JSON.parse(packageJsonContent);
|
|
2496
|
-
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
2497
|
-
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
2498
|
-
await _devkit.writeJsonFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
|
|
2499
|
-
stopwatch();
|
|
2500
|
-
}
|
|
2501
|
-
return options;
|
|
2502
|
-
}
|
|
2503
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson3, "generatePackageJson");
|
|
2504
|
-
async function resolveUnbuild(options) {
|
|
2505
|
-
_chunkRCE3CC76js.writeTrace.call(void 0, `Resolving Unbuild package with Jiti`, options.config);
|
|
2506
|
-
try {
|
|
2507
|
-
return options.jiti.import("unbuild");
|
|
2508
|
-
} catch (error) {
|
|
2509
|
-
_chunkRCE3CC76js.writeError.call(void 0, " \u274C An error occurred while resolving the Unbuild package", options.config);
|
|
2510
|
-
throw new Error("An error occurred while resolving the Unbuild package", {
|
|
2511
|
-
cause: error
|
|
2512
|
-
});
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveUnbuild, "resolveUnbuild");
|
|
2516
|
-
async function executeUnbuild(options) {
|
|
2517
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
2518
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
|
|
2519
|
-
try {
|
|
2520
|
-
const unbuild = await resolveUnbuild(options);
|
|
2521
|
-
await unbuild.build(options.projectRoot, false, {
|
|
2522
|
-
...options,
|
|
2523
|
-
rootDir: options.projectRoot
|
|
2524
|
-
});
|
|
2525
|
-
} finally {
|
|
2526
|
-
stopwatch();
|
|
2527
|
-
}
|
|
2528
|
-
return options;
|
|
2529
|
-
}
|
|
2530
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, executeUnbuild, "executeUnbuild");
|
|
2531
|
-
async function copyBuildAssets3(options) {
|
|
2532
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
|
|
2533
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
2534
|
-
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
|
|
2535
|
-
stopwatch();
|
|
2536
|
-
return options;
|
|
2537
|
-
}
|
|
2538
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets3, "copyBuildAssets");
|
|
2539
|
-
async function cleanOutputPath3(options) {
|
|
2540
|
-
if (options.clean !== false && options.outDir) {
|
|
2541
|
-
await clean3(options.name, options.outDir, options.config);
|
|
2542
|
-
}
|
|
2543
|
-
return options;
|
|
2544
|
-
}
|
|
2545
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath3, "cleanOutputPath");
|
|
2546
|
-
async function build5(options) {
|
|
2547
|
-
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u26A1 Executing Storm Unbuild pipeline`);
|
|
2548
|
-
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Unbuild pipeline");
|
|
2549
|
-
try {
|
|
2550
|
-
const resolvedOptions = await resolveOptions3(options);
|
|
2551
|
-
await cleanOutputPath3(resolvedOptions);
|
|
2552
|
-
await generatePackageJson3(resolvedOptions);
|
|
2553
|
-
await executeUnbuild(resolvedOptions);
|
|
2554
|
-
await copyBuildAssets3(resolvedOptions);
|
|
2555
|
-
_chunkRCE3CC76js.writeSuccess.call(void 0, ` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, resolvedOptions.config);
|
|
2556
|
-
} catch (error) {
|
|
2557
|
-
_chunkRCE3CC76js.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
2558
|
-
throw error;
|
|
2559
|
-
} finally {
|
|
2560
|
-
stopwatch();
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, build5, "build");
|
|
2564
|
-
|
|
2565
2121
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
2566
2122
|
|
|
2123
|
+
var _jiti = require('jiti');
|
|
2567
2124
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2568
|
-
|
|
2125
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2569
2126
|
if (!_optionalChain([context2, 'access', _126 => _126.projectsConfigurations, 'optionalAccess', _127 => _127.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _128 => _128.projectsConfigurations, 'access', _129 => _129.projects, 'access', _130 => _130[context2.projectName], 'optionalAccess', _131 => _131.root])) {
|
|
2570
2127
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2571
2128
|
}
|
|
2572
|
-
|
|
2129
|
+
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2130
|
+
fsCache: config.skipCache ? false : _chunkTH4KH35Pjs.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2131
|
+
interopDefault: true
|
|
2132
|
+
});
|
|
2133
|
+
const stormUnbuild = await jiti.import("@storm-software/unbuild");
|
|
2134
|
+
await stormUnbuild.build(_defu.defu.call(void 0, {
|
|
2573
2135
|
...options,
|
|
2574
2136
|
projectRoot: _optionalChain([context2, 'access', _132 => _132.projectsConfigurations, 'access', _133 => _133.projects, 'optionalAccess', _134 => _134[context2.projectName], 'access', _135 => _135.root]),
|
|
2575
2137
|
projectName: context2.projectName,
|
|
@@ -2629,34 +2191,34 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2629
2191
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
2630
2192
|
skipReadingConfig: false
|
|
2631
2193
|
}) => async (tree, _options) => {
|
|
2632
|
-
const stopwatch =
|
|
2194
|
+
const stopwatch = _chunkTH4KH35Pjs.getStopwatch.call(void 0, name);
|
|
2633
2195
|
let options = _options;
|
|
2634
2196
|
let config;
|
|
2635
2197
|
try {
|
|
2636
|
-
|
|
2198
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
2637
2199
|
|
|
2638
2200
|
`, config);
|
|
2639
|
-
const workspaceRoot3 =
|
|
2201
|
+
const workspaceRoot3 = _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, );
|
|
2640
2202
|
if (!generatorOptions.skipReadingConfig) {
|
|
2641
|
-
|
|
2203
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2642
2204
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2643
|
-
config = await
|
|
2205
|
+
config = await _chunk3JJSMPBTjs.loadStormConfig.call(void 0, workspaceRoot3);
|
|
2644
2206
|
}
|
|
2645
2207
|
if (_optionalChain([generatorOptions, 'optionalAccess', _140 => _140.hooks, 'optionalAccess', _141 => _141.applyDefaultOptions])) {
|
|
2646
|
-
|
|
2208
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2647
2209
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2648
|
-
|
|
2210
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
2649
2211
|
}
|
|
2650
|
-
|
|
2212
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
2651
2213
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
2652
2214
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
2653
2215
|
workspaceRoot: tree.root,
|
|
2654
2216
|
config
|
|
2655
2217
|
}, applyWorkspaceBaseTokens);
|
|
2656
2218
|
if (_optionalChain([generatorOptions, 'optionalAccess', _142 => _142.hooks, 'optionalAccess', _143 => _143.preProcess])) {
|
|
2657
|
-
|
|
2219
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2658
2220
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2659
|
-
|
|
2221
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2660
2222
|
}
|
|
2661
2223
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2662
2224
|
if (result) {
|
|
@@ -2669,18 +2231,18 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
2669
2231
|
}
|
|
2670
2232
|
}
|
|
2671
2233
|
if (_optionalChain([generatorOptions, 'optionalAccess', _153 => _153.hooks, 'optionalAccess', _154 => _154.postProcess])) {
|
|
2672
|
-
|
|
2234
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2673
2235
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2674
|
-
|
|
2236
|
+
_chunkTH4KH35Pjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
2675
2237
|
}
|
|
2676
2238
|
return () => {
|
|
2677
|
-
|
|
2239
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
2678
2240
|
`, config);
|
|
2679
2241
|
};
|
|
2680
2242
|
} catch (error) {
|
|
2681
2243
|
return () => {
|
|
2682
|
-
|
|
2683
|
-
|
|
2244
|
+
_chunkTH4KH35Pjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
2245
|
+
_chunkTH4KH35Pjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
2684
2246
|
- Details: ${error.message}
|
|
2685
2247
|
- Stacktrace: ${error.stack}`, config);
|
|
2686
2248
|
};
|
|
@@ -2726,7 +2288,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2726
2288
|
const projectConfig = {
|
|
2727
2289
|
root: options.directory,
|
|
2728
2290
|
projectType: "library",
|
|
2729
|
-
sourceRoot:
|
|
2291
|
+
sourceRoot: _chunkTH4KH35Pjs.joinPaths.call(void 0, _nullishCoalesce(options.directory, () => ( "")), "src"),
|
|
2730
2292
|
targets: {
|
|
2731
2293
|
build: {
|
|
2732
2294
|
executor: schema.buildExecutor,
|
|
@@ -2735,11 +2297,11 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2735
2297
|
],
|
|
2736
2298
|
options: {
|
|
2737
2299
|
entry: [
|
|
2738
|
-
|
|
2300
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "src", "index.ts")
|
|
2739
2301
|
],
|
|
2740
2302
|
outputPath: getOutputPath(options),
|
|
2741
|
-
tsconfig:
|
|
2742
|
-
project:
|
|
2303
|
+
tsconfig: _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"),
|
|
2304
|
+
project: _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
2743
2305
|
defaultConfiguration: "production",
|
|
2744
2306
|
platform: "neutral",
|
|
2745
2307
|
assets: [
|
|
@@ -2793,7 +2355,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2793
2355
|
if (!options.importPath) {
|
|
2794
2356
|
options.importPath = options.name;
|
|
2795
2357
|
}
|
|
2796
|
-
const packageJsonPath =
|
|
2358
|
+
const packageJsonPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "package.json");
|
|
2797
2359
|
if (tree.exists(packageJsonPath)) {
|
|
2798
2360
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2799
2361
|
if (!options.importPath) {
|
|
@@ -2850,10 +2412,10 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2850
2412
|
}));
|
|
2851
2413
|
}
|
|
2852
2414
|
_js.addTsConfigPath.call(void 0, tree, options.importPath, [
|
|
2853
|
-
|
|
2415
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "./src", `index.${options.js ? "js" : "ts"}`)
|
|
2854
2416
|
]);
|
|
2855
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2856
|
-
|
|
2417
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkTH4KH35Pjs.joinPaths.call(void 0, options.importPath, "/*"), [
|
|
2418
|
+
_chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "./src", "/*")
|
|
2857
2419
|
]);
|
|
2858
2420
|
if (tree.exists("package.json")) {
|
|
2859
2421
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
@@ -2864,7 +2426,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2864
2426
|
description = packageJson.description;
|
|
2865
2427
|
}
|
|
2866
2428
|
}
|
|
2867
|
-
const tsconfigPath =
|
|
2429
|
+
const tsconfigPath = _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json");
|
|
2868
2430
|
if (tree.exists(tsconfigPath)) {
|
|
2869
2431
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2870
2432
|
json.composite ??= true;
|
|
@@ -2902,7 +2464,7 @@ function getOutputPath(options) {
|
|
|
2902
2464
|
} else {
|
|
2903
2465
|
parts.push(options.projectRoot);
|
|
2904
2466
|
}
|
|
2905
|
-
return
|
|
2467
|
+
return _chunkTH4KH35Pjs.joinPaths.call(void 0, ...parts);
|
|
2906
2468
|
}
|
|
2907
2469
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2908
2470
|
function createProjectTsConfigJson(tree, options) {
|
|
@@ -2911,7 +2473,7 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
2911
2473
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _166 => _166.tsconfigOptions]), () => ( {})),
|
|
2912
2474
|
compilerOptions: {
|
|
2913
2475
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2914
|
-
outDir:
|
|
2476
|
+
outDir: _chunkTH4KH35Pjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2915
2477
|
noEmit: true,
|
|
2916
2478
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _167 => _167.tsconfigOptions, 'optionalAccess', _168 => _168.compilerOptions]), () => ( {}))
|
|
2917
2479
|
},
|
|
@@ -2931,7 +2493,7 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
2931
2493
|
"src/**/*.test.ts"
|
|
2932
2494
|
]
|
|
2933
2495
|
};
|
|
2934
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2496
|
+
_devkit.writeJson.call(void 0, tree, _chunkTH4KH35Pjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2935
2497
|
}
|
|
2936
2498
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2937
2499
|
async function normalizeOptions(tree, options) {
|
|
@@ -3057,19 +2619,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
3057
2619
|
|
|
3058
2620
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
3059
2621
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2622
|
+
_chunkTH4KH35Pjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Configuration JSON Schema generator", config);
|
|
2623
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `Determining the Storm Configuration JSON Schema...`, config);
|
|
2624
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkTH4KH35Pjs.StormConfigSchema, {
|
|
3063
2625
|
name: "StormWorkspaceConfiguration"
|
|
3064
2626
|
});
|
|
3065
|
-
|
|
3066
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _175 => _175.workspaceRoot]), () => (
|
|
3067
|
-
|
|
2627
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2628
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _175 => _175.workspaceRoot]), () => ( _chunkTH4KH35Pjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _176 => _176.outputFile, 'optionalAccess', _177 => _177.startsWith, 'call', _178 => _178("./")]) ? "" : "./");
|
|
2629
|
+
_chunkTH4KH35Pjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
3068
2630
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
3069
2631
|
spaces: 2
|
|
3070
2632
|
});
|
|
3071
2633
|
await _devkit.formatFiles.call(void 0, tree);
|
|
3072
|
-
|
|
2634
|
+
_chunkTH4KH35Pjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
3073
2635
|
return {
|
|
3074
2636
|
success: true
|
|
3075
2637
|
};
|