@storm-software/cloudflare-tools 0.55.39 → 0.55.41
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 +172 -75
- package/README.md +7 -7
- package/dist/{chunk-ZBM3I5Z7.mjs → chunk-2GWCBDS7.mjs} +4 -4
- package/dist/{chunk-Y3XZCCPP.mjs → chunk-3HMZSKJD.mjs} +1 -1
- package/dist/{chunk-J22YL4DC.mjs → chunk-BV5FWJGL.mjs} +2 -2
- package/dist/{chunk-HZON5W3G.js → chunk-FK6PN2T3.js} +42 -14
- package/dist/{chunk-KLCTLDIH.js → chunk-H2ML72QF.js} +91 -47
- package/dist/{chunk-I6XBWBZN.js → chunk-HF5FM2V2.js} +3 -3
- package/dist/{chunk-B6ZQTLTY.js → chunk-IA5NNUZK.js} +1 -1
- package/dist/{chunk-FSZS6NDT.js → chunk-JF2LLENH.js} +12 -12
- package/dist/{chunk-HWRWRM5W.mjs → chunk-LEXIFHU6.mjs} +2 -2
- package/dist/{chunk-QD7ZKWKB.mjs → chunk-M4FHQYTZ.mjs} +43 -15
- package/dist/{chunk-MVGAJ7Q4.js → chunk-MCQ4YOON.js} +16 -16
- package/dist/{chunk-VAVNPHSE.mjs → chunk-MESLYSHV.mjs} +52 -8
- package/dist/{chunk-XYJVYVYX.js → chunk-NGA2REMH.js} +488 -570
- package/dist/{chunk-MBAVTLIK.mjs → chunk-PDLA5ACW.mjs} +327 -409
- package/dist/{chunk-5OCPVWBL.mjs → chunk-S3S7EN37.mjs} +5 -5
- package/dist/{chunk-PDHMNSTI.mjs → chunk-VNLZQQ5C.mjs} +2 -2
- package/dist/{chunk-KFNKJP2U.mjs → chunk-YYEF6TFG.mjs} +1 -1
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +8 -8
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +5 -5
- package/dist/index.js +8 -8
- package/dist/index.mjs +10 -10
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
- package/dist/src/executors/serve/executor.d.mts +67 -3
- package/dist/src/executors/serve/executor.d.ts +67 -3
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +5 -5
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +5 -5
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
- package/dist/tsup.config.mjs +1 -1
- package/package.json +11 -11
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkH2ML72QFjs = require('./chunk-H2ML72QF.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ var _chunkKLCTLDIHjs = require('./chunk-KLCTLDIH.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkFK6PN2T3js = require('./chunk-FK6PN2T3.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -53,7 +53,7 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => (
|
|
56
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, ))));
|
|
57
57
|
}
|
|
58
58
|
return result;
|
|
59
59
|
}, "applyWorkspaceBaseTokens");
|
|
@@ -101,35 +101,35 @@ var run = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config, command,
|
|
|
101
101
|
// ../workspace-tools/src/base/base-executor.ts
|
|
102
102
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
103
103
|
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context2) => {
|
|
104
|
-
const stopwatch =
|
|
104
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, name);
|
|
105
105
|
let options = _options;
|
|
106
106
|
let config = {};
|
|
107
107
|
try {
|
|
108
108
|
if (!_optionalChain([context2, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
109
109
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
110
110
|
}
|
|
111
|
-
const workspaceRoot3 =
|
|
111
|
+
const workspaceRoot3 = _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, );
|
|
112
112
|
const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
|
|
113
113
|
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
114
114
|
const projectName = context2.projectName;
|
|
115
115
|
config.workspaceRoot = workspaceRoot3;
|
|
116
|
-
|
|
116
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
117
117
|
if (!executorOptions.skipReadingConfig) {
|
|
118
|
-
|
|
118
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
119
119
|
- workspaceRoot: ${workspaceRoot3}
|
|
120
120
|
- projectRoot: ${projectRoot}
|
|
121
121
|
- sourceRoot: ${sourceRoot}
|
|
122
122
|
- projectName: ${projectName}
|
|
123
123
|
`, config);
|
|
124
|
-
config = await
|
|
124
|
+
config = await _chunkH2ML72QFjs.getConfig.call(void 0, workspaceRoot3);
|
|
125
125
|
}
|
|
126
126
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
127
|
-
|
|
127
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
128
128
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
129
|
-
|
|
129
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
${
|
|
131
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
132
|
+
${_chunkFK6PN2T3js.formatLogMessage.call(void 0, options)}
|
|
133
133
|
`, config);
|
|
134
134
|
const tokenized = await applyWorkspaceTokens(options, _defu.defu.call(void 0, {
|
|
135
135
|
workspaceRoot: workspaceRoot3,
|
|
@@ -138,13 +138,13 @@ ${_chunkHZON5W3Gjs.formatLogMessage.call(void 0, options)}
|
|
|
138
138
|
projectName,
|
|
139
139
|
config
|
|
140
140
|
}, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
|
|
141
|
-
|
|
142
|
-
${
|
|
141
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
142
|
+
${_chunkFK6PN2T3js.formatLogMessage.call(void 0, tokenized)}
|
|
143
143
|
`, config);
|
|
144
144
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
145
|
-
|
|
145
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
146
146
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
147
|
-
|
|
147
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
148
148
|
}
|
|
149
149
|
const ret = executorFn(tokenized, context2, config);
|
|
150
150
|
if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
|
|
@@ -154,26 +154,26 @@ ${_chunkHZON5W3Gjs.formatLogMessage.call(void 0, tokenized)}
|
|
|
154
154
|
}
|
|
155
155
|
const result = await Promise.resolve(ret);
|
|
156
156
|
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _12 => _12.error, 'optionalAccess', _13 => _13.message]) && typeof _optionalChain([result, 'optionalAccess', _14 => _14.error, 'optionalAccess', _15 => _15.message]) === "string" && _optionalChain([result, 'optionalAccess', _16 => _16.error, 'optionalAccess', _17 => _17.name]) && typeof _optionalChain([result, 'optionalAccess', _18 => _18.error, 'optionalAccess', _19 => _19.name]) === "string")) {
|
|
157
|
-
|
|
158
|
-
${
|
|
157
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
158
|
+
${_chunkFK6PN2T3js.formatLogMessage.call(void 0, result)}`, config);
|
|
159
159
|
console.error(result);
|
|
160
160
|
throw new Error(`The ${name} executor failed to run`, {
|
|
161
161
|
cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
|
|
165
|
-
|
|
165
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
166
166
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
167
|
-
|
|
167
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
_chunkFK6PN2T3js.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
170
170
|
`, config);
|
|
171
171
|
return {
|
|
172
172
|
success: true
|
|
173
173
|
};
|
|
174
174
|
} catch (error) {
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
_chunkFK6PN2T3js.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
176
|
+
_chunkFK6PN2T3js.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
177
177
|
- Details: ${error.message}
|
|
178
178
|
- Stacktrace: ${error.stack}`, config);
|
|
179
179
|
return {
|
|
@@ -423,11 +423,11 @@ var LARGE_BUFFER2 = 1024 * 1e6;
|
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
// ../build-tools/src/config.ts
|
|
426
|
-
var DEFAULT_COMPILED_BANNER =
|
|
427
|
-
|
|
426
|
+
var DEFAULT_COMPILED_BANNER = `/*****************************************
|
|
427
|
+
*
|
|
428
428
|
* \u26A1 Built by Storm Software
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
*
|
|
430
|
+
*****************************************/
|
|
431
431
|
`;
|
|
432
432
|
var DEFAULT_ENVIRONMENT = "production";
|
|
433
433
|
var DEFAULT_TARGET = "esnext";
|
|
@@ -450,7 +450,7 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
450
450
|
var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
|
|
451
451
|
var _glob = require('glob');
|
|
452
452
|
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
453
|
-
var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, assets, outputPath, projectRoot, sourceRoot,
|
|
453
|
+
var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
454
454
|
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
455
455
|
pendingAssets.push({
|
|
456
456
|
input: projectRoot,
|
|
@@ -462,7 +462,7 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
462
462
|
glob: "LICENSE",
|
|
463
463
|
output: "."
|
|
464
464
|
});
|
|
465
|
-
if (
|
|
465
|
+
if (generatePackageJson2 === false) {
|
|
466
466
|
pendingAssets.push({
|
|
467
467
|
input: projectRoot,
|
|
468
468
|
glob: "package.json",
|
|
@@ -476,8 +476,8 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
476
476
|
output: "src/"
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
|
-
|
|
480
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
479
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
480
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkFK6PN2T3js.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
481
481
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
482
482
|
projectDir: projectRoot,
|
|
483
483
|
rootDir: config.workspaceRoot,
|
|
@@ -486,12 +486,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
486
486
|
});
|
|
487
487
|
await assetHandler.processAllAssetsOnce();
|
|
488
488
|
if (includeSrc === true) {
|
|
489
|
-
|
|
489
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkFK6PN2T3js.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
490
490
|
const files = await _glob.glob.call(void 0, [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
492
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
493
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
494
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
495
495
|
]);
|
|
496
496
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
497
497
|
|
|
@@ -511,10 +511,10 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
511
511
|
const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
512
512
|
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
513
513
|
const localPackages = [];
|
|
514
|
-
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
514
|
+
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _29 => _29.node, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.root]) !== projectRoot && _optionalChain([dep, 'access', _32 => _32.node, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.root]) !== workspaceRoot3)) {
|
|
515
515
|
const projectNode = project.node;
|
|
516
516
|
if (projectNode.data.root) {
|
|
517
|
-
const projectPackageJsonPath =
|
|
517
|
+
const projectPackageJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
518
518
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
519
519
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
520
520
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -525,17 +525,17 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
if (localPackages.length > 0) {
|
|
528
|
-
|
|
529
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
528
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
529
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
530
530
|
const projectJson = JSON.parse(projectJsonFile);
|
|
531
531
|
const projectName2 = projectJson.name;
|
|
532
532
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
533
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
533
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _35 => _35.projects, 'optionalAccess', _36 => _36[projectName2]])) {
|
|
534
534
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
535
535
|
}
|
|
536
|
-
const implicitDependencies = _optionalChain([projectConfigurations, 'access',
|
|
537
|
-
if (_optionalChain([projectConfigurations, 'access',
|
|
538
|
-
const depPackageJsonPath =
|
|
536
|
+
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _37 => _37.projects, 'optionalAccess', _38 => _38[projectName2], 'access', _39 => _39.implicitDependencies, 'optionalAccess', _40 => _40.reduce, 'call', _41 => _41((ret, dep) => {
|
|
537
|
+
if (_optionalChain([projectConfigurations, 'access', _42 => _42.projects, 'optionalAccess', _43 => _43[dep]])) {
|
|
538
|
+
const depPackageJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
|
|
539
539
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
540
540
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
541
541
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -547,25 +547,25 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
547
547
|
return ret;
|
|
548
548
|
}, [])]);
|
|
549
549
|
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
550
|
-
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess',
|
|
550
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _44 => _44.includes, 'call', _45 => _45(localPackage.name)])) {
|
|
551
551
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
552
552
|
}
|
|
553
553
|
return ret;
|
|
554
554
|
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
555
555
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
556
|
-
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess',
|
|
556
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _46 => _46.includes, 'call', _47 => _47(localPackage.name)])) {
|
|
557
557
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
558
558
|
}
|
|
559
559
|
return ret;
|
|
560
560
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
561
561
|
} else {
|
|
562
|
-
|
|
562
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
563
563
|
}
|
|
564
564
|
return packageJson;
|
|
565
565
|
}, "addPackageDependencies");
|
|
566
566
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
567
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
568
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
567
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, );
|
|
568
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
569
569
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
570
570
|
packageJson.type ??= "module";
|
|
571
571
|
packageJson.sideEffects ??= false;
|
|
@@ -574,7 +574,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
574
574
|
if (distSrc.startsWith("/")) {
|
|
575
575
|
distSrc = distSrc.substring(1);
|
|
576
576
|
}
|
|
577
|
-
packageJson.source ??= `${
|
|
577
|
+
packageJson.source ??= `${_chunkFK6PN2T3js.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
578
578
|
}
|
|
579
579
|
packageJson.files ??= [
|
|
580
580
|
"dist/**/*"
|
|
@@ -605,68 +605,59 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
605
605
|
];
|
|
606
606
|
}
|
|
607
607
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
608
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
608
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkFK6PN2T3js.joinPaths.call(void 0, "packages", projectName);
|
|
609
609
|
return packageJson;
|
|
610
610
|
}, "addWorkspacePackageJsonFields");
|
|
611
|
-
var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
612
|
-
let entry = file.replaceAll("\\", "/");
|
|
613
|
-
if (sourceRoot) {
|
|
614
|
-
entry = entry.replace(sourceRoot, "");
|
|
615
|
-
}
|
|
616
|
-
return {
|
|
617
|
-
import: {
|
|
618
|
-
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
619
|
-
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
620
|
-
},
|
|
621
|
-
require: {
|
|
622
|
-
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
623
|
-
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
624
|
-
},
|
|
625
|
-
default: {
|
|
626
|
-
types: `./dist/${entry}.d.ts`,
|
|
627
|
-
default: `./dist/${entry}.js`
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
}, "addPackageJsonExport");
|
|
631
611
|
|
|
632
612
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
633
613
|
|
|
634
614
|
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
635
|
-
const workspaceRoot3 = config.workspaceRoot
|
|
615
|
+
const workspaceRoot3 = config.workspaceRoot || _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, );
|
|
636
616
|
const entryPoints = [];
|
|
637
617
|
if (entry) {
|
|
638
|
-
if (
|
|
639
|
-
entryPoints.push(...entry);
|
|
640
|
-
} else if (typeof entry === "string") {
|
|
618
|
+
if (typeof entry === "string") {
|
|
641
619
|
entryPoints.push(entry);
|
|
620
|
+
} else if (Array.isArray(entry)) {
|
|
621
|
+
entryPoints.push(...entry);
|
|
642
622
|
} else {
|
|
643
623
|
entryPoints.push(...Object.values(entry));
|
|
644
624
|
}
|
|
645
625
|
}
|
|
646
626
|
if (emitOnAll) {
|
|
647
|
-
entryPoints.push(
|
|
627
|
+
entryPoints.push(_chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
648
628
|
}
|
|
649
|
-
const results =
|
|
650
|
-
|
|
629
|
+
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
630
|
+
const paths = [];
|
|
651
631
|
if (entryPoint.includes("*")) {
|
|
652
632
|
const files = await _glob.glob.call(void 0, entryPoint, {
|
|
653
|
-
withFileTypes: true
|
|
633
|
+
withFileTypes: true,
|
|
634
|
+
ignore: [
|
|
635
|
+
"**/node_modules/**"
|
|
636
|
+
]
|
|
654
637
|
});
|
|
655
|
-
|
|
656
|
-
const result =
|
|
638
|
+
paths.push(...files.reduce((ret, filePath) => {
|
|
639
|
+
const result = _chunkFK6PN2T3js.correctPaths.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkFK6PN2T3js.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkFK6PN2T3js.correctPaths.call(void 0, projectRoot), ""));
|
|
657
640
|
if (result) {
|
|
658
|
-
|
|
659
|
-
if (!
|
|
660
|
-
|
|
641
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkFK6PN2T3js.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
642
|
+
if (!paths.includes(result)) {
|
|
643
|
+
paths.push(result);
|
|
661
644
|
}
|
|
662
645
|
}
|
|
663
646
|
return ret;
|
|
664
647
|
}, []));
|
|
665
648
|
} else {
|
|
666
|
-
|
|
649
|
+
paths.push(entryPoint);
|
|
667
650
|
}
|
|
668
|
-
|
|
669
|
-
|
|
651
|
+
return paths;
|
|
652
|
+
}));
|
|
653
|
+
return results.filter(Boolean).reduce((ret, result) => {
|
|
654
|
+
result.forEach((res) => {
|
|
655
|
+
if (res && !ret.includes(res)) {
|
|
656
|
+
ret.push(res);
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
return ret;
|
|
660
|
+
}, []);
|
|
670
661
|
}, "getEntryPoints");
|
|
671
662
|
|
|
672
663
|
// ../build-tools/src/utilities/get-env.ts
|
|
@@ -675,7 +666,7 @@ var getEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (builder, opti
|
|
|
675
666
|
STORM_BUILD: builder,
|
|
676
667
|
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
677
668
|
STORM_NAME: options.name,
|
|
678
|
-
|
|
669
|
+
STORM_MODE: options.mode || DEFAULT_ENVIRONMENT,
|
|
679
670
|
STORM_PLATFORM: options.platform,
|
|
680
671
|
STORM_FORMAT: JSON.stringify(options.format),
|
|
681
672
|
STORM_TARGET: JSON.stringify(options.target),
|
|
@@ -683,28 +674,6 @@ var getEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (builder, opti
|
|
|
683
674
|
};
|
|
684
675
|
}, "getEnv");
|
|
685
676
|
|
|
686
|
-
// ../build-tools/src/utilities/get-out-extension.ts
|
|
687
|
-
function getOutExtension(format2, pkgType) {
|
|
688
|
-
let jsExtension = ".js";
|
|
689
|
-
let dtsExtension = ".d.ts";
|
|
690
|
-
if (pkgType === "module" && format2 === "cjs") {
|
|
691
|
-
jsExtension = ".cjs";
|
|
692
|
-
dtsExtension = ".d.cts";
|
|
693
|
-
}
|
|
694
|
-
if (pkgType !== "module" && format2 === "esm") {
|
|
695
|
-
jsExtension = ".mjs";
|
|
696
|
-
dtsExtension = ".d.mts";
|
|
697
|
-
}
|
|
698
|
-
if (format2 === "iife") {
|
|
699
|
-
jsExtension = ".global.js";
|
|
700
|
-
}
|
|
701
|
-
return {
|
|
702
|
-
js: jsExtension,
|
|
703
|
-
dts: dtsExtension
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutExtension, "getOutExtension");
|
|
707
|
-
|
|
708
677
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
709
678
|
|
|
710
679
|
|
|
@@ -789,15 +758,15 @@ var RendererEngine = class {
|
|
|
789
758
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
790
759
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
791
760
|
}
|
|
792
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
761
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _48 => _48.outputs, 'access', _49 => _49[relativePath]]);
|
|
793
762
|
return {
|
|
794
763
|
type: "chunk",
|
|
795
764
|
path: file.path,
|
|
796
765
|
code: file.text,
|
|
797
|
-
map: _optionalChain([outputFiles, 'access',
|
|
798
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
799
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
800
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
766
|
+
map: _optionalChain([outputFiles, 'access', _50 => _50.find, 'call', _51 => _51((f) => f.path === `${file.path}.map`), 'optionalAccess', _52 => _52.text]),
|
|
767
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _53 => _53.entryPoint]),
|
|
768
|
+
exports: _optionalChain([meta, 'optionalAccess', _54 => _54.exports]),
|
|
769
|
+
imports: _optionalChain([meta, 'optionalAccess', _55 => _55.imports])
|
|
801
770
|
};
|
|
802
771
|
} else {
|
|
803
772
|
return {
|
|
@@ -878,9 +847,9 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
|
878
847
|
|
|
879
848
|
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
880
849
|
name: "storm:esm-split-code-to-cjs",
|
|
881
|
-
setup(
|
|
882
|
-
|
|
883
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
850
|
+
setup(build4) {
|
|
851
|
+
build4.onEnd(async (result) => {
|
|
852
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _56 => _56.metafile, 'optionalAccess', _57 => _57.outputs]), () => ( {})));
|
|
884
853
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
885
854
|
await esbuild.build({
|
|
886
855
|
outdir: resolvedOptions.outdir,
|
|
@@ -897,15 +866,15 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
897
866
|
// ../esbuild/src/plugins/fix-imports.ts
|
|
898
867
|
var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
899
868
|
name: "storm:fix-imports",
|
|
900
|
-
setup(
|
|
901
|
-
|
|
869
|
+
setup(build4) {
|
|
870
|
+
build4.onResolve({
|
|
902
871
|
filter: /^spdx-exceptions/
|
|
903
872
|
}, () => {
|
|
904
873
|
return {
|
|
905
874
|
path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-exceptions")
|
|
906
875
|
};
|
|
907
876
|
});
|
|
908
|
-
|
|
877
|
+
build4.onResolve({
|
|
909
878
|
filter: /^spdx-license-ids/
|
|
910
879
|
}, () => {
|
|
911
880
|
return {
|
|
@@ -920,8 +889,8 @@ var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (opt
|
|
|
920
889
|
var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
921
890
|
return {
|
|
922
891
|
name: "native-node-modules",
|
|
923
|
-
setup(
|
|
924
|
-
|
|
892
|
+
setup(build4) {
|
|
893
|
+
build4.onResolve({
|
|
925
894
|
filter: /\.node$/,
|
|
926
895
|
namespace: "file"
|
|
927
896
|
}, (args) => {
|
|
@@ -940,7 +909,7 @@ var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
940
909
|
path: resolvedId
|
|
941
910
|
};
|
|
942
911
|
});
|
|
943
|
-
|
|
912
|
+
build4.onLoad({
|
|
944
913
|
filter: /.*/,
|
|
945
914
|
namespace: "node-file"
|
|
946
915
|
}, (args) => {
|
|
@@ -953,14 +922,14 @@ var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
953
922
|
resolveDir: _path.dirname.call(void 0, args.path)
|
|
954
923
|
};
|
|
955
924
|
});
|
|
956
|
-
|
|
925
|
+
build4.onResolve({
|
|
957
926
|
filter: /\.node$/,
|
|
958
927
|
namespace: "node-file"
|
|
959
928
|
}, (args) => ({
|
|
960
929
|
path: args.path,
|
|
961
930
|
namespace: "file"
|
|
962
931
|
}));
|
|
963
|
-
const opts =
|
|
932
|
+
const opts = build4.initialOptions;
|
|
964
933
|
opts.loader = opts.loader || {};
|
|
965
934
|
opts.loader[".node"] = "file";
|
|
966
935
|
}
|
|
@@ -986,10 +955,10 @@ var nodeProtocolPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
986
955
|
// ../esbuild/src/plugins/on-error.ts
|
|
987
956
|
var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
988
957
|
name: "storm:on-error",
|
|
989
|
-
setup(
|
|
990
|
-
|
|
958
|
+
setup(build4) {
|
|
959
|
+
build4.onEnd((result) => {
|
|
991
960
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
992
|
-
|
|
961
|
+
_chunkFK6PN2T3js.writeError.call(void 0, `The following errors occurred during the build:
|
|
993
962
|
${result.errors.map((error) => error.text).join("\n")}
|
|
994
963
|
|
|
995
964
|
`, resolvedOptions.config);
|
|
@@ -1002,7 +971,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
1002
971
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
1003
972
|
|
|
1004
973
|
function resolvePathsConfig(options, cwd) {
|
|
1005
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
974
|
+
if (_optionalChain([options, 'optionalAccess', _58 => _58.compilerOptions, 'optionalAccess', _59 => _59.paths])) {
|
|
1006
975
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
1007
976
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
1008
977
|
return [
|
|
@@ -1023,14 +992,14 @@ function resolvePathsConfig(options, cwd) {
|
|
|
1023
992
|
_chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
1024
993
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1025
994
|
name: "storm:resolve-paths",
|
|
1026
|
-
setup(
|
|
1027
|
-
const parentTsConfig =
|
|
995
|
+
setup(build4) {
|
|
996
|
+
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
1028
997
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
1029
998
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
1030
|
-
|
|
999
|
+
build4.onResolve({
|
|
1031
1000
|
filter: packagesRegex
|
|
1032
1001
|
}, (args) => {
|
|
1033
|
-
if (_optionalChain([
|
|
1002
|
+
if (_optionalChain([build4, 'access', _60 => _60.initialOptions, 'access', _61 => _61.external, 'optionalAccess', _62 => _62.includes, 'call', _63 => _63(args.path)])) {
|
|
1034
1003
|
return {
|
|
1035
1004
|
path: args.path,
|
|
1036
1005
|
external: true
|
|
@@ -1048,7 +1017,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
1048
1017
|
|
|
1049
1018
|
|
|
1050
1019
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1051
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1020
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1052
1021
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1053
1022
|
p,
|
|
1054
1023
|
getTypeDependencyPackageName(p)
|
|
@@ -1078,18 +1047,19 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1078
1047
|
overrideTsconfig: {
|
|
1079
1048
|
compilerOptions: {
|
|
1080
1049
|
paths: {}
|
|
1050
|
+
// bug with api extract + paths
|
|
1081
1051
|
}
|
|
1082
1052
|
}
|
|
1083
1053
|
},
|
|
1084
1054
|
dtsRollup: {
|
|
1085
1055
|
enabled: true,
|
|
1086
|
-
untrimmedFilePath:
|
|
1056
|
+
untrimmedFilePath: _chunkFK6PN2T3js.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1087
1057
|
},
|
|
1088
1058
|
tsdocMetadata: {
|
|
1089
1059
|
enabled: false
|
|
1090
1060
|
}
|
|
1091
1061
|
},
|
|
1092
|
-
packageJsonFullPath:
|
|
1062
|
+
packageJsonFullPath: _chunkFK6PN2T3js.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1093
1063
|
configObjectFullPath: void 0
|
|
1094
1064
|
});
|
|
1095
1065
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1097,18 +1067,18 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1097
1067
|
localBuild: true
|
|
1098
1068
|
});
|
|
1099
1069
|
if (extractorResult.succeeded === false) {
|
|
1100
|
-
|
|
1070
|
+
_chunkFK6PN2T3js.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1101
1071
|
throw new Error("API Extractor completed with errors");
|
|
1102
1072
|
}
|
|
1103
1073
|
}
|
|
1104
1074
|
_chunkJ5SB6L2Ljs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
1105
1075
|
var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1106
1076
|
name: "storm:tsc",
|
|
1107
|
-
setup(
|
|
1077
|
+
setup(build4) {
|
|
1108
1078
|
if (options.emitTypes === false) {
|
|
1109
1079
|
return;
|
|
1110
1080
|
}
|
|
1111
|
-
|
|
1081
|
+
build4.onStart(async () => {
|
|
1112
1082
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1113
1083
|
await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
1114
1084
|
}
|
|
@@ -1116,14 +1086,14 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1116
1086
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1117
1087
|
const typeOutDir = resolvedOptions.outdir;
|
|
1118
1088
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1119
|
-
const bundlePath =
|
|
1089
|
+
const bundlePath = _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1120
1090
|
let dtsPath;
|
|
1121
|
-
if (_fs.existsSync.call(void 0,
|
|
1122
|
-
dtsPath =
|
|
1123
|
-
} else if (_fs.existsSync.call(void 0,
|
|
1124
|
-
dtsPath =
|
|
1091
|
+
if (_fs.existsSync.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1092
|
+
dtsPath = _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1093
|
+
} else if (_fs.existsSync.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1094
|
+
dtsPath = _chunkFK6PN2T3js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1125
1095
|
}
|
|
1126
|
-
const ext = resolvedOptions.
|
|
1096
|
+
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1127
1097
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1128
1098
|
bundleTypeDefinitions(dtsPath, bundlePath, _nullishCoalesce(resolvedOptions.external, () => ( [])), resolvedOptions);
|
|
1129
1099
|
const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
|
|
@@ -1138,16 +1108,13 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1138
1108
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1139
1109
|
if (npmPackage.startsWith("@")) {
|
|
1140
1110
|
const [scope, name] = npmPackage.split("/");
|
|
1141
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1111
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _64 => _64.slice, 'call', _65 => _65(1)])}__${name}`;
|
|
1142
1112
|
}
|
|
1143
1113
|
return `@types/${npmPackage}`;
|
|
1144
1114
|
}
|
|
1145
1115
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDependencyPackageName");
|
|
1146
1116
|
|
|
1147
1117
|
// ../esbuild/src/config.ts
|
|
1148
|
-
var getOutputExtensionMap = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, pkgType) => {
|
|
1149
|
-
return options.outExtension ? options.outExtension(options.format, pkgType) : getOutExtension(options.format, pkgType);
|
|
1150
|
-
}, "getOutputExtensionMap");
|
|
1151
1118
|
var getDefaultBuildPlugins = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => [
|
|
1152
1119
|
nodeProtocolPlugin(options, resolvedOptions),
|
|
1153
1120
|
resolvePathsPlugin(options, resolvedOptions),
|
|
@@ -1164,7 +1131,7 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
1164
1131
|
external: [],
|
|
1165
1132
|
logLevel: "error",
|
|
1166
1133
|
tsconfig: "tsconfig.json",
|
|
1167
|
-
|
|
1134
|
+
mode: "production",
|
|
1168
1135
|
keepNames: true,
|
|
1169
1136
|
metafile: true,
|
|
1170
1137
|
injectShims: true,
|
|
@@ -1173,6 +1140,18 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
1173
1140
|
bundle: true,
|
|
1174
1141
|
clean: true,
|
|
1175
1142
|
debug: false,
|
|
1143
|
+
resolveExtensions: [
|
|
1144
|
+
".tsx",
|
|
1145
|
+
".ts",
|
|
1146
|
+
".cts",
|
|
1147
|
+
".mts",
|
|
1148
|
+
".jsx",
|
|
1149
|
+
".js",
|
|
1150
|
+
".cjs",
|
|
1151
|
+
".mjs",
|
|
1152
|
+
".css",
|
|
1153
|
+
".json"
|
|
1154
|
+
],
|
|
1176
1155
|
loader: {
|
|
1177
1156
|
".aac": "file",
|
|
1178
1157
|
".css": "file",
|
|
@@ -1231,7 +1210,7 @@ var missingIgnore = [
|
|
|
1231
1210
|
];
|
|
1232
1211
|
var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bundle) => ({
|
|
1233
1212
|
name: "storm:deps-check",
|
|
1234
|
-
setup(
|
|
1213
|
+
setup(build4) {
|
|
1235
1214
|
const pkgJsonPath = path6.default.join(process.cwd(), "package.json");
|
|
1236
1215
|
const pkgContents = _chunkJ5SB6L2Ljs.__require.call(void 0, pkgJsonPath);
|
|
1237
1216
|
const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
|
|
@@ -1243,7 +1222,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1243
1222
|
];
|
|
1244
1223
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
1245
1224
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
1246
|
-
|
|
1225
|
+
build4.onResolve({
|
|
1247
1226
|
filter: onlyPackages
|
|
1248
1227
|
}, (args) => {
|
|
1249
1228
|
if (args.importer.includes(process.cwd())) {
|
|
@@ -1259,7 +1238,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1259
1238
|
external: true
|
|
1260
1239
|
};
|
|
1261
1240
|
});
|
|
1262
|
-
|
|
1241
|
+
build4.onEnd(() => {
|
|
1263
1242
|
const unusedDependencies = [
|
|
1264
1243
|
...dependencies
|
|
1265
1244
|
].filter((dep) => {
|
|
@@ -1276,8 +1255,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1276
1255
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1277
1256
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1278
1257
|
});
|
|
1279
|
-
|
|
1280
|
-
|
|
1258
|
+
_chunkFK6PN2T3js.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1259
|
+
_chunkFK6PN2T3js.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1281
1260
|
if (filteredMissingDeps.length > 0) {
|
|
1282
1261
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1283
1262
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1345,7 +1324,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1345
1324
|
return (...args) => {
|
|
1346
1325
|
let result = fn(...args);
|
|
1347
1326
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1348
|
-
result = _optionalChain([fns, 'access',
|
|
1327
|
+
result = _optionalChain([fns, 'access', _66 => _66[i], 'optionalCall', _67 => _67(result)]);
|
|
1349
1328
|
}
|
|
1350
1329
|
return result;
|
|
1351
1330
|
};
|
|
@@ -1355,7 +1334,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1355
1334
|
return async (...args) => {
|
|
1356
1335
|
let result = await fn(...args);
|
|
1357
1336
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1358
|
-
result = await _optionalChain([fns, 'access',
|
|
1337
|
+
result = await _optionalChain([fns, 'access', _68 => _68[i], 'optionalCall', _69 => _69(result)]);
|
|
1359
1338
|
}
|
|
1360
1339
|
return result;
|
|
1361
1340
|
};
|
|
@@ -1371,13 +1350,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1371
1350
|
if (!workspaceRoot3) {
|
|
1372
1351
|
throw new Error("Cannot find Nx workspace root");
|
|
1373
1352
|
}
|
|
1374
|
-
const config = await
|
|
1375
|
-
|
|
1376
|
-
const stopwatch =
|
|
1353
|
+
const config = await _chunkH2ML72QFjs.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1354
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1355
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, "Build options resolution");
|
|
1377
1356
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1378
1357
|
exitOnError: true
|
|
1379
1358
|
});
|
|
1380
|
-
const projectJsonPath =
|
|
1359
|
+
const projectJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1381
1360
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1382
1361
|
throw new Error("Cannot find project.json configuration");
|
|
1383
1362
|
}
|
|
@@ -1385,19 +1364,16 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1385
1364
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1386
1365
|
const projectName = projectJson.name;
|
|
1387
1366
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1388
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1367
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _70 => _70.projects, 'optionalAccess', _71 => _71[projectName]])) {
|
|
1389
1368
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1390
1369
|
}
|
|
1391
1370
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1392
1371
|
options.name ??= `${projectName}-${options.format}`;
|
|
1393
1372
|
options.target ??= DEFAULT_TARGET;
|
|
1394
|
-
const packageJsonPath =
|
|
1373
|
+
const packageJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1395
1374
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1396
1375
|
throw new Error("Cannot find package.json configuration");
|
|
1397
1376
|
}
|
|
1398
|
-
const packageJsonFile = await _promises2.default.readFile(packageJsonPath, "utf8");
|
|
1399
|
-
const packageJson = JSON.parse(packageJsonFile);
|
|
1400
|
-
const outExtension = getOutputExtensionMap(options, packageJson.type);
|
|
1401
1377
|
const env = getEnv("esbuild", options);
|
|
1402
1378
|
const result = {
|
|
1403
1379
|
...options,
|
|
@@ -1410,26 +1386,20 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1410
1386
|
"module",
|
|
1411
1387
|
"main"
|
|
1412
1388
|
],
|
|
1413
|
-
resolveExtensions: [
|
|
1414
|
-
".ts",
|
|
1415
|
-
".js",
|
|
1416
|
-
".node"
|
|
1417
|
-
],
|
|
1418
1389
|
...userOptions,
|
|
1419
|
-
tsconfig:
|
|
1390
|
+
tsconfig: _chunkFK6PN2T3js.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1420
1391
|
format: options.format || "cjs",
|
|
1421
|
-
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
outdir: userOptions.outputPath || _chunkHZON5W3Gjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1392
|
+
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), userOptions.emitOnAll === true),
|
|
1393
|
+
outdir: userOptions.outputPath || _chunkFK6PN2T3js.joinPaths.call(void 0, "dist", projectRoot),
|
|
1394
|
+
distDir: userOptions.distDir || "dist",
|
|
1425
1395
|
plugins: [],
|
|
1426
1396
|
name: userOptions.name || projectName,
|
|
1427
1397
|
projectConfigurations,
|
|
1428
1398
|
projectName,
|
|
1429
1399
|
projectGraph,
|
|
1430
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1400
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkFK6PN2T3js.joinPaths.call(void 0, projectRoot, "src"),
|
|
1431
1401
|
minify: userOptions.minify || !userOptions.debug,
|
|
1432
|
-
verbose: userOptions.verbose ||
|
|
1402
|
+
verbose: userOptions.verbose || _chunkFK6PN2T3js.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1433
1403
|
includeSrc: userOptions.includeSrc === true,
|
|
1434
1404
|
metafile: userOptions.metafile !== false,
|
|
1435
1405
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1440,7 +1410,6 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1440
1410
|
bundle: userOptions.bundle !== false,
|
|
1441
1411
|
keepNames: true,
|
|
1442
1412
|
watch: userOptions.watch === true,
|
|
1443
|
-
outExtension,
|
|
1444
1413
|
footer: userOptions.footer,
|
|
1445
1414
|
banner: {
|
|
1446
1415
|
js: options.banner || DEFAULT_COMPILED_BANNER,
|
|
@@ -1457,32 +1426,38 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1457
1426
|
...options.define,
|
|
1458
1427
|
...Object.keys(env || {}).reduce((res, key) => {
|
|
1459
1428
|
const value = JSON.stringify(env[key]);
|
|
1429
|
+
const safeKey = key.replaceAll("(", "").replaceAll(")", "");
|
|
1460
1430
|
return {
|
|
1461
1431
|
...res,
|
|
1462
|
-
[`process.env.${
|
|
1463
|
-
[`import.meta.env.${
|
|
1432
|
+
[`process.env.${safeKey}`]: value,
|
|
1433
|
+
[`import.meta.env.${safeKey}`]: value
|
|
1464
1434
|
};
|
|
1465
1435
|
}, {})
|
|
1466
1436
|
},
|
|
1467
1437
|
inject: [
|
|
1468
|
-
options.format === "cjs" && options.injectShims ?
|
|
1469
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1470
|
-
|
|
1471
|
-
].filter(Boolean)
|
|
1438
|
+
options.format === "cjs" && options.injectShims ? _chunkFK6PN2T3js.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
1439
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkFK6PN2T3js.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : ""
|
|
1440
|
+
]
|
|
1472
1441
|
};
|
|
1473
1442
|
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
1443
|
+
if (options.inject) {
|
|
1444
|
+
options.inject = _defu2.default.call(void 0, result.inject, options.inject);
|
|
1445
|
+
}
|
|
1446
|
+
_optionalChain([options, 'access', _72 => _72.inject, 'optionalAccess', _73 => _73.filter, 'call', _74 => _74(Boolean)]);
|
|
1447
|
+
delete result.entry;
|
|
1448
|
+
delete result.outputPath;
|
|
1474
1449
|
stopwatch();
|
|
1475
1450
|
return result;
|
|
1476
1451
|
}, "resolveOptions");
|
|
1477
1452
|
async function generatePackageJson(context2) {
|
|
1478
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1479
|
-
|
|
1480
|
-
const stopwatch =
|
|
1481
|
-
const packageJsonPath =
|
|
1453
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1454
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1455
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, "Write package.json file");
|
|
1456
|
+
const packageJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1482
1457
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1483
1458
|
throw new Error("Cannot find package.json configuration");
|
|
1484
1459
|
}
|
|
1485
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1460
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkFK6PN2T3js.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1486
1461
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1487
1462
|
if (!packageJson) {
|
|
1488
1463
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1491,7 +1466,7 @@ async function generatePackageJson(context2) {
|
|
|
1491
1466
|
packageJson = await addWorkspacePackageJsonFields(context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
|
|
1492
1467
|
packageJson.exports ??= {};
|
|
1493
1468
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
1494
|
-
packageJson.exports["."] ??=
|
|
1469
|
+
packageJson.exports["."] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js`;
|
|
1495
1470
|
let entryPoints = [
|
|
1496
1471
|
{
|
|
1497
1472
|
in: "./src/index.ts",
|
|
@@ -1509,19 +1484,22 @@ async function generatePackageJson(context2) {
|
|
|
1509
1484
|
const split = entryPoint.out.split(".");
|
|
1510
1485
|
split.pop();
|
|
1511
1486
|
const entry = split.join(".").replaceAll("\\", "/");
|
|
1512
|
-
packageJson.exports[`./${entry}`] ??=
|
|
1487
|
+
packageJson.exports[`./${entry}`] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/${entry}.js`;
|
|
1513
1488
|
}
|
|
1514
1489
|
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1490
|
+
if (context2.options.format === "esm") {
|
|
1491
|
+
packageJson.module = packageJson.type === "module" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.mjs`;
|
|
1492
|
+
} else {
|
|
1493
|
+
packageJson.main = packageJson.type === "commonjs" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.cjs`;
|
|
1494
|
+
}
|
|
1495
|
+
packageJson.types = `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.d.ts`;
|
|
1518
1496
|
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
1519
1497
|
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1520
1498
|
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
1521
1499
|
}
|
|
1522
1500
|
return ret;
|
|
1523
1501
|
}, packageJson.exports);
|
|
1524
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1502
|
+
await _devkit.writeJsonFile.call(void 0, _chunkFK6PN2T3js.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1525
1503
|
stopwatch();
|
|
1526
1504
|
}
|
|
1527
1505
|
return context2;
|
|
@@ -1547,13 +1525,41 @@ async function generateContext(getOptions) {
|
|
|
1547
1525
|
}
|
|
1548
1526
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1549
1527
|
async function executeEsBuild(context2) {
|
|
1550
|
-
|
|
1551
|
-
const stopwatch =
|
|
1552
|
-
if (process.env.
|
|
1528
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1529
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1530
|
+
if (process.env.STORM_WATCH) {
|
|
1553
1531
|
const ctx = await esbuild2.context(context2.options);
|
|
1554
1532
|
watch(ctx, context2.options);
|
|
1555
1533
|
}
|
|
1556
|
-
const
|
|
1534
|
+
const options = {
|
|
1535
|
+
...context2.options
|
|
1536
|
+
};
|
|
1537
|
+
options.outdir = _chunkFK6PN2T3js.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1538
|
+
delete options.env;
|
|
1539
|
+
delete options.name;
|
|
1540
|
+
delete options.assets;
|
|
1541
|
+
delete options.mode;
|
|
1542
|
+
delete options.orgName;
|
|
1543
|
+
delete options.watch;
|
|
1544
|
+
delete options.clean;
|
|
1545
|
+
delete options.debug;
|
|
1546
|
+
delete options.generatePackageJson;
|
|
1547
|
+
delete options.emitOnAll;
|
|
1548
|
+
delete options.distDir;
|
|
1549
|
+
delete options.includeSrc;
|
|
1550
|
+
delete options.verbose;
|
|
1551
|
+
delete options.projectRoot;
|
|
1552
|
+
delete options.projectName;
|
|
1553
|
+
delete options.projectGraph;
|
|
1554
|
+
delete options.projectConfigurations;
|
|
1555
|
+
delete options.renderers;
|
|
1556
|
+
delete options.config;
|
|
1557
|
+
delete options.injectShims;
|
|
1558
|
+
delete options.external;
|
|
1559
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1560
|
+
${_chunkFK6PN2T3js.formatLogMessage.call(void 0, options)}`, context2.options.config);
|
|
1561
|
+
const result = await esbuild2.build(options);
|
|
1562
|
+
await esbuild2.stop();
|
|
1557
1563
|
if (result.metafile) {
|
|
1558
1564
|
const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
|
|
1559
1565
|
await _promises2.default.writeFile(metafilePath, JSON.stringify(result.metafile));
|
|
@@ -1563,9 +1569,9 @@ async function executeEsBuild(context2) {
|
|
|
1563
1569
|
}
|
|
1564
1570
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1565
1571
|
async function copyBuildAssets(context2) {
|
|
1566
|
-
if (_optionalChain([context2, 'access',
|
|
1567
|
-
|
|
1568
|
-
const stopwatch =
|
|
1572
|
+
if (_optionalChain([context2, 'access', _75 => _75.result, 'optionalAccess', _76 => _76.errors, 'access', _77 => _77.length]) === 0) {
|
|
1573
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1574
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1569
1575
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1570
1576
|
stopwatch();
|
|
1571
1577
|
}
|
|
@@ -1573,11 +1579,11 @@ async function copyBuildAssets(context2) {
|
|
|
1573
1579
|
}
|
|
1574
1580
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1575
1581
|
async function reportResults(context2) {
|
|
1576
|
-
if (_optionalChain([context2, 'access',
|
|
1582
|
+
if (_optionalChain([context2, 'access', _78 => _78.result, 'optionalAccess', _79 => _79.errors, 'access', _80 => _80.length]) === 0) {
|
|
1577
1583
|
if (context2.result.warnings.length > 0) {
|
|
1578
|
-
|
|
1584
|
+
_chunkFK6PN2T3js.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);
|
|
1579
1585
|
}
|
|
1580
|
-
|
|
1586
|
+
_chunkFK6PN2T3js.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1581
1587
|
}
|
|
1582
1588
|
}
|
|
1583
1589
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1613,8 +1619,8 @@ async function dependencyCheck(options) {
|
|
|
1613
1619
|
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1614
1620
|
async function cleanOutputPath(context2) {
|
|
1615
1621
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
1616
|
-
|
|
1617
|
-
const stopwatch =
|
|
1622
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1623
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, `${context2.options.name} output clean`);
|
|
1618
1624
|
await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
|
|
1619
1625
|
stopwatch();
|
|
1620
1626
|
}
|
|
@@ -1622,8 +1628,8 @@ async function cleanOutputPath(context2) {
|
|
|
1622
1628
|
}
|
|
1623
1629
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1624
1630
|
async function build3(options) {
|
|
1625
|
-
|
|
1626
|
-
const stopwatch =
|
|
1631
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1632
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1627
1633
|
try {
|
|
1628
1634
|
const opts = Array.isArray(options) ? options : [
|
|
1629
1635
|
options
|
|
@@ -1633,9 +1639,9 @@ async function build3(options) {
|
|
|
1633
1639
|
}
|
|
1634
1640
|
void transduce.async(opts, dependencyCheck);
|
|
1635
1641
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1636
|
-
|
|
1642
|
+
_chunkFK6PN2T3js.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1637
1643
|
} catch (error) {
|
|
1638
|
-
|
|
1644
|
+
_chunkFK6PN2T3js.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1639
1645
|
throw error;
|
|
1640
1646
|
} finally {
|
|
1641
1647
|
stopwatch();
|
|
@@ -1663,9 +1669,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1663
1669
|
return context2.rebuild();
|
|
1664
1670
|
});
|
|
1665
1671
|
if (rebuildResult instanceof Error) {
|
|
1666
|
-
|
|
1672
|
+
_chunkFK6PN2T3js.writeError.call(void 0, rebuildResult.message);
|
|
1667
1673
|
}
|
|
1668
|
-
|
|
1674
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1669
1675
|
}, 10);
|
|
1670
1676
|
changeWatcher.on("change", fastRebuild);
|
|
1671
1677
|
return void 0;
|
|
@@ -1673,15 +1679,15 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1673
1679
|
|
|
1674
1680
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1675
1681
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1676
|
-
|
|
1677
|
-
if (!_optionalChain([context2, 'access',
|
|
1682
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1683
|
+
if (!_optionalChain([context2, 'access', _81 => _81.projectsConfigurations, 'optionalAccess', _82 => _82.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _83 => _83.projectsConfigurations, 'access', _84 => _84.projects, 'access', _85 => _85[context2.projectName], 'optionalAccess', _86 => _86.root])) {
|
|
1678
1684
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1679
1685
|
}
|
|
1680
1686
|
await build3({
|
|
1681
1687
|
...options,
|
|
1682
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1688
|
+
projectRoot: _optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'access', _88 => _88.projects, 'optionalAccess', _89 => _89[context2.projectName], 'access', _90 => _90.root]),
|
|
1683
1689
|
projectName: context2.projectName,
|
|
1684
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1690
|
+
sourceRoot: _optionalChain([context2, 'access', _91 => _91.projectsConfigurations, 'access', _92 => _92.projects, 'optionalAccess', _93 => _93[context2.projectName], 'optionalAccess', _94 => _94.sourceRoot]),
|
|
1685
1691
|
format: options.format,
|
|
1686
1692
|
platform: options.format
|
|
1687
1693
|
});
|
|
@@ -1724,18 +1730,18 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1724
1730
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1725
1731
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1726
1732
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1727
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1733
|
+
if (!_optionalChain([context2, 'optionalAccess', _95 => _95.projectName]) || !_optionalChain([context2, 'access', _96 => _96.projectsConfigurations, 'optionalAccess', _97 => _97.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1728
1734
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1729
1735
|
}
|
|
1730
|
-
|
|
1736
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1731
1737
|
_sizelimit2.default.call(void 0, [
|
|
1732
1738
|
_file2.default,
|
|
1733
1739
|
_esbuild3.default,
|
|
1734
1740
|
_esbuildwhy2.default
|
|
1735
1741
|
], {
|
|
1736
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1742
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _98 => _98.projectsConfigurations, 'access', _99 => _99.projects, 'access', _100 => _100[context2.projectName], 'optionalAccess', _101 => _101.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'access', _104 => _104[context2.projectName], 'optionalAccess', _105 => _105.root]), () => ( "./")), "src")))
|
|
1737
1743
|
}).then((result) => {
|
|
1738
|
-
|
|
1744
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1739
1745
|
});
|
|
1740
1746
|
return {
|
|
1741
1747
|
success: true
|
|
@@ -1751,291 +1757,16 @@ var executor_default7 = withRunExecutor("Size-Limit Performance Test Executor",
|
|
|
1751
1757
|
}
|
|
1752
1758
|
});
|
|
1753
1759
|
|
|
1754
|
-
// ../tsdown/src/build.ts
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
var _tsdown = require('tsdown');
|
|
1761
|
-
|
|
1762
|
-
// ../tsdown/src/clean.ts
|
|
1763
|
-
|
|
1764
|
-
async function cleanDirectories2(name = "TSDown", directory, config) {
|
|
1765
|
-
await _promises.rm.call(void 0, directory, {
|
|
1766
|
-
recursive: true,
|
|
1767
|
-
force: true
|
|
1768
|
-
});
|
|
1769
|
-
}
|
|
1770
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanDirectories2, "cleanDirectories");
|
|
1771
|
-
|
|
1772
|
-
// ../tsdown/src/config.ts
|
|
1773
|
-
var DEFAULT_BUILD_OPTIONS2 = {
|
|
1774
|
-
platform: "node",
|
|
1775
|
-
target: "node22",
|
|
1776
|
-
format: [
|
|
1777
|
-
"esm",
|
|
1778
|
-
"cjs"
|
|
1779
|
-
],
|
|
1780
|
-
tsconfig: "tsconfig.json",
|
|
1781
|
-
envName: "production",
|
|
1782
|
-
globalName: "globalThis",
|
|
1783
|
-
unused: {
|
|
1784
|
-
level: "error"
|
|
1785
|
-
},
|
|
1786
|
-
injectShims: true,
|
|
1787
|
-
watch: false,
|
|
1788
|
-
bundle: true,
|
|
1789
|
-
treeshake: true,
|
|
1790
|
-
clean: true,
|
|
1791
|
-
debug: false
|
|
1792
|
-
};
|
|
1793
|
-
|
|
1794
|
-
// ../tsdown/src/build.ts
|
|
1795
|
-
var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (userOptions) => {
|
|
1796
|
-
const projectRoot = userOptions.projectRoot;
|
|
1797
|
-
const workspaceRoot3 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
1798
|
-
if (!workspaceRoot3) {
|
|
1799
|
-
throw new Error("Cannot find Nx workspace root");
|
|
1800
|
-
}
|
|
1801
|
-
const config = await _chunkKLCTLDIHjs.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1802
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1803
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1804
|
-
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1805
|
-
exitOnError: true
|
|
1806
|
-
});
|
|
1807
|
-
const projectJsonPath = _chunkHZON5W3Gjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1808
|
-
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1809
|
-
throw new Error("Cannot find project.json configuration");
|
|
1810
|
-
}
|
|
1811
|
-
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
1812
|
-
const projectJson = JSON.parse(projectJsonFile);
|
|
1813
|
-
const projectName = projectJson.name;
|
|
1814
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1815
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _97 => _97.projects, 'optionalAccess', _98 => _98[projectName]])) {
|
|
1816
|
-
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
1817
|
-
}
|
|
1818
|
-
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
1819
|
-
options.name ??= `${projectName}-${options.format}`;
|
|
1820
|
-
options.target ??= DEFAULT_TARGET;
|
|
1821
|
-
const packageJsonPath = _chunkHZON5W3Gjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1822
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1823
|
-
throw new Error("Cannot find package.json configuration");
|
|
1824
|
-
}
|
|
1825
|
-
const env = getEnv("tsdown", options);
|
|
1826
|
-
const result = {
|
|
1827
|
-
...options,
|
|
1828
|
-
config,
|
|
1829
|
-
...userOptions,
|
|
1830
|
-
tsconfig: _chunkHZON5W3Gjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1831
|
-
format: options.format || "cjs",
|
|
1832
|
-
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1833
|
-
"./src/index.ts"
|
|
1834
|
-
], userOptions.emitOnAll),
|
|
1835
|
-
outdir: userOptions.outputPath || _chunkHZON5W3Gjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1836
|
-
plugins: [],
|
|
1837
|
-
name: userOptions.name || projectName,
|
|
1838
|
-
projectConfigurations,
|
|
1839
|
-
projectName,
|
|
1840
|
-
projectGraph,
|
|
1841
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkHZON5W3Gjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1842
|
-
minify: userOptions.minify || !userOptions.debug,
|
|
1843
|
-
verbose: userOptions.verbose || _chunkHZON5W3Gjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1844
|
-
includeSrc: userOptions.includeSrc === true,
|
|
1845
|
-
metafile: userOptions.metafile !== false,
|
|
1846
|
-
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1847
|
-
clean: userOptions.clean !== false,
|
|
1848
|
-
emitOnAll: userOptions.emitOnAll === true,
|
|
1849
|
-
dts: userOptions.emitTypes === true ? {
|
|
1850
|
-
transformer: "oxc"
|
|
1851
|
-
} : userOptions.emitTypes,
|
|
1852
|
-
bundleDts: userOptions.emitTypes,
|
|
1853
|
-
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1854
|
-
shims: userOptions.injectShims !== true,
|
|
1855
|
-
bundle: userOptions.bundle !== false,
|
|
1856
|
-
watch: userOptions.watch === true,
|
|
1857
|
-
define: {
|
|
1858
|
-
STORM_FORMAT: JSON.stringify(options.format || "cjs"),
|
|
1859
|
-
...options.format === "cjs" && options.injectShims ? {
|
|
1860
|
-
"import.meta.url": "importMetaUrl"
|
|
1861
|
-
} : {},
|
|
1862
|
-
...Object.keys(env || {}).reduce((res, key) => {
|
|
1863
|
-
const value = JSON.stringify(env[key]);
|
|
1864
|
-
return {
|
|
1865
|
-
...res,
|
|
1866
|
-
[`process.env.${key}`]: value,
|
|
1867
|
-
[`import.meta.env.${key}`]: value
|
|
1868
|
-
};
|
|
1869
|
-
}, {}),
|
|
1870
|
-
...options.define
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
|
-
stopwatch();
|
|
1874
|
-
return result;
|
|
1875
|
-
}, "resolveOptions");
|
|
1876
|
-
async function generatePackageJson2(options) {
|
|
1877
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkHZON5W3Gjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
1878
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
1879
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1880
|
-
const packageJsonPath = _chunkHZON5W3Gjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
1881
|
-
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1882
|
-
throw new Error("Cannot find package.json configuration");
|
|
1883
|
-
}
|
|
1884
|
-
const packageJsonFile = await _promises2.default.readFile(_chunkHZON5W3Gjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
1885
|
-
if (!packageJsonFile) {
|
|
1886
|
-
throw new Error("Cannot find package.json configuration file");
|
|
1887
|
-
}
|
|
1888
|
-
let packageJson = JSON.parse(packageJsonFile);
|
|
1889
|
-
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
1890
|
-
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
1891
|
-
packageJson.exports ??= {};
|
|
1892
|
-
packageJson.exports["./package.json"] ??= "./package.json";
|
|
1893
|
-
packageJson.exports["."] ??= addPackageJsonExport("index", packageJson.type, options.sourceRoot);
|
|
1894
|
-
let entryPoints = [
|
|
1895
|
-
{
|
|
1896
|
-
in: "./src/index.ts",
|
|
1897
|
-
out: "./src/index.ts"
|
|
1898
|
-
}
|
|
1899
|
-
];
|
|
1900
|
-
if (options.entryPoints) {
|
|
1901
|
-
if (Array.isArray(options.entryPoints)) {
|
|
1902
|
-
entryPoints = options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
|
|
1903
|
-
in: entryPoint,
|
|
1904
|
-
out: entryPoint
|
|
1905
|
-
} : entryPoint);
|
|
1906
|
-
}
|
|
1907
|
-
for (const entryPoint of entryPoints) {
|
|
1908
|
-
const split = entryPoint.out.split(".");
|
|
1909
|
-
split.pop();
|
|
1910
|
-
const entry = split.join(".").replaceAll("\\", "/");
|
|
1911
|
-
packageJson.exports[`./${entry}`] ??= addPackageJsonExport(entry, packageJson.type, options.sourceRoot);
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
1915
|
-
packageJson.module = packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
|
|
1916
|
-
packageJson.types = "./dist/index.d.ts";
|
|
1917
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
1918
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1919
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
1920
|
-
}
|
|
1921
|
-
return ret;
|
|
1922
|
-
}, packageJson.exports);
|
|
1923
|
-
await _devkit.writeJsonFile.call(void 0, _chunkHZON5W3Gjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
1924
|
-
stopwatch();
|
|
1925
|
-
}
|
|
1926
|
-
return options;
|
|
1927
|
-
}
|
|
1928
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson2, "generatePackageJson");
|
|
1929
|
-
async function executeTSDown(options) {
|
|
1930
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1931
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
1932
|
-
await _tsdown.build.call(void 0, {
|
|
1933
|
-
...options,
|
|
1934
|
-
entry: options.entryPoints,
|
|
1935
|
-
outDir: options.outdir,
|
|
1936
|
-
config: false
|
|
1937
|
-
});
|
|
1938
|
-
stopwatch();
|
|
1939
|
-
return options;
|
|
1940
|
-
}
|
|
1941
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
1942
|
-
async function copyBuildAssets2(options) {
|
|
1943
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
1944
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
1945
|
-
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
|
|
1946
|
-
stopwatch();
|
|
1947
|
-
return options;
|
|
1948
|
-
}
|
|
1949
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets2, "copyBuildAssets");
|
|
1950
|
-
async function reportResults2(options) {
|
|
1951
|
-
_chunkHZON5W3Gjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
1952
|
-
}
|
|
1953
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults2, "reportResults");
|
|
1954
|
-
async function cleanOutputPath2(options) {
|
|
1955
|
-
if (options.clean !== false && options.outdir) {
|
|
1956
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
|
|
1957
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
1958
|
-
await cleanDirectories2(options.name, options.outdir, options.config);
|
|
1959
|
-
stopwatch();
|
|
1960
|
-
}
|
|
1961
|
-
return options;
|
|
1962
|
-
}
|
|
1963
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath2, "cleanOutputPath");
|
|
1964
|
-
async function build4(options) {
|
|
1965
|
-
_chunkHZON5W3Gjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1966
|
-
const stopwatch = _chunkHZON5W3Gjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
1967
|
-
try {
|
|
1968
|
-
const opts = Array.isArray(options) ? options : [
|
|
1969
|
-
options
|
|
1970
|
-
];
|
|
1971
|
-
if (opts.length === 0) {
|
|
1972
|
-
throw new Error("No build options were provided");
|
|
1973
|
-
}
|
|
1974
|
-
const resolved = await Promise.all(opts.map(async (opt) => await resolveOptions2(opt)));
|
|
1975
|
-
if (resolved.length > 0) {
|
|
1976
|
-
await cleanOutputPath2(resolved[0]);
|
|
1977
|
-
await generatePackageJson2(resolved[0]);
|
|
1978
|
-
await Promise.all(resolved.map(async (opt) => {
|
|
1979
|
-
await executeTSDown(opt);
|
|
1980
|
-
await copyBuildAssets2(opt);
|
|
1981
|
-
await reportResults2(opt);
|
|
1982
|
-
}));
|
|
1983
|
-
} else {
|
|
1984
|
-
_chunkHZON5W3Gjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1985
|
-
}
|
|
1986
|
-
_chunkHZON5W3Gjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1987
|
-
} catch (error) {
|
|
1988
|
-
_chunkHZON5W3Gjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1989
|
-
throw error;
|
|
1990
|
-
} finally {
|
|
1991
|
-
stopwatch();
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
1995
|
-
|
|
1996
|
-
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
1997
|
-
async function tsdownExecutorFn(options, context2, config) {
|
|
1998
|
-
_chunkHZON5W3Gjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
1999
|
-
if (!_optionalChain([context2, 'access', _99 => _99.projectsConfigurations, 'optionalAccess', _100 => _100.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _101 => _101.projectsConfigurations, 'access', _102 => _102.projects, 'access', _103 => _103[context2.projectName], 'optionalAccess', _104 => _104.root])) {
|
|
2000
|
-
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2001
|
-
}
|
|
2002
|
-
await build4({
|
|
2003
|
-
...options,
|
|
2004
|
-
projectRoot: _optionalChain([context2, 'access', _105 => _105.projectsConfigurations, 'access', _106 => _106.projects, 'optionalAccess', _107 => _107[context2.projectName], 'access', _108 => _108.root]),
|
|
2005
|
-
projectName: context2.projectName,
|
|
2006
|
-
sourceRoot: _optionalChain([context2, 'access', _109 => _109.projectsConfigurations, 'access', _110 => _110.projects, 'optionalAccess', _111 => _111[context2.projectName], 'optionalAccess', _112 => _112.sourceRoot]),
|
|
2007
|
-
format: options.format,
|
|
2008
|
-
platform: options.platform
|
|
2009
|
-
});
|
|
2010
|
-
return {
|
|
2011
|
-
success: true
|
|
2012
|
-
};
|
|
2013
|
-
}
|
|
2014
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, tsdownExecutorFn, "tsdownExecutorFn");
|
|
2015
|
-
var executor_default8 = withRunExecutor("Storm TSDown build executor", tsdownExecutorFn, {
|
|
2016
|
-
skipReadingConfig: false,
|
|
2017
|
-
hooks: {
|
|
2018
|
-
applyDefaultOptions: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, config) => {
|
|
2019
|
-
options.entry ??= [
|
|
2020
|
-
"src/index.ts"
|
|
2021
|
-
];
|
|
2022
|
-
options.outputPath ??= "dist/{projectRoot}";
|
|
2023
|
-
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
2024
|
-
return options;
|
|
2025
|
-
}, "applyDefaultOptions")
|
|
2026
|
-
}
|
|
2027
|
-
});
|
|
2028
|
-
|
|
2029
1760
|
// ../workspace-tools/src/executors/typia/executor.ts
|
|
2030
1761
|
var _fsextra = require('fs-extra');
|
|
2031
1762
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
2032
1763
|
async function typiaExecutorFn(options, _, config) {
|
|
2033
1764
|
if (options.clean !== false) {
|
|
2034
|
-
|
|
1765
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
2035
1766
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
2036
1767
|
}
|
|
2037
1768
|
await Promise.all(options.entry.map((entry) => {
|
|
2038
|
-
|
|
1769
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
2039
1770
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
2040
1771
|
input: entry,
|
|
2041
1772
|
output: options.outputPath,
|
|
@@ -2047,7 +1778,7 @@ async function typiaExecutorFn(options, _, config) {
|
|
|
2047
1778
|
};
|
|
2048
1779
|
}
|
|
2049
1780
|
_chunkJ5SB6L2Ljs.__name.call(void 0, typiaExecutorFn, "typiaExecutorFn");
|
|
2050
|
-
var
|
|
1781
|
+
var executor_default8 = withRunExecutor("Typia runtime validation generator", typiaExecutorFn, {
|
|
2051
1782
|
skipReadingConfig: false,
|
|
2052
1783
|
hooks: {
|
|
2053
1784
|
applyDefaultOptions: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options) => {
|
|
@@ -2066,8 +1797,8 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2066
1797
|
|
|
2067
1798
|
var _jiti = require('jiti');
|
|
2068
1799
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2069
|
-
|
|
2070
|
-
if (!_optionalChain([context2, 'access',
|
|
1800
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1801
|
+
if (!_optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'optionalAccess', _107 => _107.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
2071
1802
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
2072
1803
|
}
|
|
2073
1804
|
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
@@ -2077,7 +1808,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2077
1808
|
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2078
1809
|
}
|
|
2079
1810
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2080
|
-
fsCache: config.skipCache ? false :
|
|
1811
|
+
fsCache: config.skipCache ? false : _chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2081
1812
|
interopDefault: true
|
|
2082
1813
|
});
|
|
2083
1814
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -2090,7 +1821,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2090
1821
|
}, {
|
|
2091
1822
|
stubOptions: {
|
|
2092
1823
|
jiti: {
|
|
2093
|
-
fsCache: config.skipCache ? false :
|
|
1824
|
+
fsCache: config.skipCache ? false : _chunkFK6PN2T3js.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
2094
1825
|
}
|
|
2095
1826
|
},
|
|
2096
1827
|
rollup: {
|
|
@@ -2114,7 +1845,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2114
1845
|
};
|
|
2115
1846
|
}
|
|
2116
1847
|
_chunkJ5SB6L2Ljs.__name.call(void 0, unbuildExecutorFn, "unbuildExecutorFn");
|
|
2117
|
-
var
|
|
1848
|
+
var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecutorFn, {
|
|
2118
1849
|
skipReadingConfig: false,
|
|
2119
1850
|
hooks: {
|
|
2120
1851
|
applyDefaultOptions: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, config) => {
|
|
@@ -2137,58 +1868,58 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2137
1868
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
2138
1869
|
skipReadingConfig: false
|
|
2139
1870
|
}) => async (tree, _options) => {
|
|
2140
|
-
const stopwatch =
|
|
1871
|
+
const stopwatch = _chunkFK6PN2T3js.getStopwatch.call(void 0, name);
|
|
2141
1872
|
let options = _options;
|
|
2142
1873
|
let config;
|
|
2143
1874
|
try {
|
|
2144
|
-
|
|
1875
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
2145
1876
|
|
|
2146
1877
|
`, config);
|
|
2147
|
-
const workspaceRoot3 =
|
|
1878
|
+
const workspaceRoot3 = _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, );
|
|
2148
1879
|
if (!generatorOptions.skipReadingConfig) {
|
|
2149
|
-
|
|
1880
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2150
1881
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2151
|
-
config = await
|
|
1882
|
+
config = await _chunkH2ML72QFjs.getConfig.call(void 0, workspaceRoot3);
|
|
2152
1883
|
}
|
|
2153
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2154
|
-
|
|
1884
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _108 => _108.hooks, 'optionalAccess', _109 => _109.applyDefaultOptions])) {
|
|
1885
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2155
1886
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2156
|
-
|
|
1887
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
2157
1888
|
}
|
|
2158
|
-
|
|
1889
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
2159
1890
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
2160
1891
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
2161
1892
|
workspaceRoot: tree.root,
|
|
2162
1893
|
config
|
|
2163
1894
|
}, applyWorkspaceBaseTokens);
|
|
2164
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2165
|
-
|
|
1895
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _110 => _110.hooks, 'optionalAccess', _111 => _111.preProcess])) {
|
|
1896
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2166
1897
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2167
|
-
|
|
1898
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2168
1899
|
}
|
|
2169
1900
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2170
1901
|
if (result) {
|
|
2171
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1902
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _112 => _112.error, 'optionalAccess', _113 => _113.message]) && typeof _optionalChain([result, 'optionalAccess', _114 => _114.error, 'optionalAccess', _115 => _115.message]) === "string" && _optionalChain([result, 'optionalAccess', _116 => _116.error, 'optionalAccess', _117 => _117.name]) && typeof _optionalChain([result, 'optionalAccess', _118 => _118.error, 'optionalAccess', _119 => _119.name]) === "string") {
|
|
2172
1903
|
throw new Error(`The ${name} generator failed to run`, {
|
|
2173
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1904
|
+
cause: _optionalChain([result, 'optionalAccess', _120 => _120.error])
|
|
2174
1905
|
});
|
|
2175
1906
|
} else if (result.success && result.data) {
|
|
2176
1907
|
return result;
|
|
2177
1908
|
}
|
|
2178
1909
|
}
|
|
2179
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2180
|
-
|
|
1910
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _121 => _121.hooks, 'optionalAccess', _122 => _122.postProcess])) {
|
|
1911
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2181
1912
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2182
|
-
|
|
1913
|
+
_chunkFK6PN2T3js.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
2183
1914
|
}
|
|
2184
1915
|
return () => {
|
|
2185
|
-
|
|
1916
|
+
_chunkFK6PN2T3js.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
2186
1917
|
`, config);
|
|
2187
1918
|
};
|
|
2188
1919
|
} catch (error) {
|
|
2189
1920
|
return () => {
|
|
2190
|
-
|
|
2191
|
-
|
|
1921
|
+
_chunkFK6PN2T3js.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1922
|
+
_chunkFK6PN2T3js.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
2192
1923
|
- Details: ${error.message}
|
|
2193
1924
|
- Stacktrace: ${error.stack}`, config);
|
|
2194
1925
|
};
|
|
@@ -2234,7 +1965,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2234
1965
|
const projectConfig = {
|
|
2235
1966
|
root: normalized.directory,
|
|
2236
1967
|
projectType: "library",
|
|
2237
|
-
sourceRoot:
|
|
1968
|
+
sourceRoot: _chunkFK6PN2T3js.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
2238
1969
|
targets: {
|
|
2239
1970
|
build: {
|
|
2240
1971
|
executor: options.buildExecutor,
|
|
@@ -2243,11 +1974,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2243
1974
|
],
|
|
2244
1975
|
options: {
|
|
2245
1976
|
entry: [
|
|
2246
|
-
|
|
1977
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
2247
1978
|
],
|
|
2248
1979
|
outputPath: getOutputPath(normalized),
|
|
2249
|
-
tsconfig:
|
|
2250
|
-
project:
|
|
1980
|
+
tsconfig: _chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1981
|
+
project: _chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
2251
1982
|
defaultConfiguration: "production",
|
|
2252
1983
|
platform: "neutral",
|
|
2253
1984
|
assets: [
|
|
@@ -2286,22 +2017,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2286
2017
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2287
2018
|
let repository = {
|
|
2288
2019
|
type: "github",
|
|
2289
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2020
|
+
url: _optionalChain([config, 'optionalAccess', _123 => _123.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _124 => _124.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _125 => _125.namespace]) || _optionalChain([config, 'optionalAccess', _126 => _126.name]) || "repository"}.git`
|
|
2290
2021
|
};
|
|
2291
2022
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2292
2023
|
if (tree.exists("package.json")) {
|
|
2293
2024
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2294
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2025
|
+
if (_optionalChain([packageJson, 'optionalAccess', _127 => _127.repository])) {
|
|
2295
2026
|
repository = packageJson.repository;
|
|
2296
2027
|
}
|
|
2297
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2028
|
+
if (_optionalChain([packageJson, 'optionalAccess', _128 => _128.description])) {
|
|
2298
2029
|
description = packageJson.description;
|
|
2299
2030
|
}
|
|
2300
2031
|
}
|
|
2301
2032
|
if (!normalized.importPath) {
|
|
2302
2033
|
normalized.importPath = normalized.name;
|
|
2303
2034
|
}
|
|
2304
|
-
const packageJsonPath =
|
|
2035
|
+
const packageJsonPath = _chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2305
2036
|
if (tree.exists(packageJsonPath)) {
|
|
2306
2037
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2307
2038
|
if (!normalized.importPath) {
|
|
@@ -2349,30 +2080,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2349
2080
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2350
2081
|
...json,
|
|
2351
2082
|
pnpm: {
|
|
2352
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2083
|
+
..._optionalChain([json, 'optionalAccess', _129 => _129.pnpm]),
|
|
2353
2084
|
overrides: {
|
|
2354
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2085
|
+
..._optionalChain([json, 'optionalAccess', _130 => _130.pnpm, 'optionalAccess', _131 => _131.overrides]),
|
|
2355
2086
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2356
2087
|
}
|
|
2357
2088
|
}
|
|
2358
2089
|
}));
|
|
2359
2090
|
}
|
|
2360
2091
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2361
|
-
|
|
2092
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2362
2093
|
]);
|
|
2363
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2364
|
-
|
|
2094
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkFK6PN2T3js.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2095
|
+
_chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2365
2096
|
]);
|
|
2366
2097
|
if (tree.exists("package.json")) {
|
|
2367
2098
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2368
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2099
|
+
if (_optionalChain([packageJson, 'optionalAccess', _132 => _132.repository])) {
|
|
2369
2100
|
repository = packageJson.repository;
|
|
2370
2101
|
}
|
|
2371
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2102
|
+
if (_optionalChain([packageJson, 'optionalAccess', _133 => _133.description])) {
|
|
2372
2103
|
description = packageJson.description;
|
|
2373
2104
|
}
|
|
2374
2105
|
}
|
|
2375
|
-
const tsconfigPath =
|
|
2106
|
+
const tsconfigPath = _chunkFK6PN2T3js.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2376
2107
|
if (tree.exists(tsconfigPath)) {
|
|
2377
2108
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2378
2109
|
json.composite ??= true;
|
|
@@ -2410,42 +2141,42 @@ function getOutputPath(options) {
|
|
|
2410
2141
|
} else {
|
|
2411
2142
|
parts.push(options.projectRoot);
|
|
2412
2143
|
}
|
|
2413
|
-
return
|
|
2144
|
+
return _chunkFK6PN2T3js.joinPaths.call(void 0, ...parts);
|
|
2414
2145
|
}
|
|
2415
2146
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2416
2147
|
function createProjectTsConfigJson(tree, options) {
|
|
2417
2148
|
const tsconfig = {
|
|
2418
2149
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2419
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2150
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _134 => _134.tsconfigOptions]), () => ( {})),
|
|
2420
2151
|
compilerOptions: {
|
|
2421
2152
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2422
|
-
outDir:
|
|
2153
|
+
outDir: _chunkFK6PN2T3js.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2423
2154
|
noEmit: true,
|
|
2424
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2155
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _135 => _135.tsconfigOptions, 'optionalAccess', _136 => _136.compilerOptions]), () => ( {}))
|
|
2425
2156
|
},
|
|
2426
2157
|
files: [
|
|
2427
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2158
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _137 => _137.tsconfigOptions, 'optionalAccess', _138 => _138.files]), () => ( []))
|
|
2428
2159
|
],
|
|
2429
2160
|
include: [
|
|
2430
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2161
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.tsconfigOptions, 'optionalAccess', _140 => _140.include]), () => ( [])),
|
|
2431
2162
|
"src/**/*.ts",
|
|
2432
2163
|
"src/**/*.js",
|
|
2433
2164
|
"bin/**/*"
|
|
2434
2165
|
],
|
|
2435
2166
|
exclude: [
|
|
2436
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2167
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _141 => _141.tsconfigOptions, 'optionalAccess', _142 => _142.exclude]), () => ( [])),
|
|
2437
2168
|
"jest.config.ts",
|
|
2438
2169
|
"src/**/*.spec.ts",
|
|
2439
2170
|
"src/**/*.test.ts"
|
|
2440
2171
|
]
|
|
2441
2172
|
};
|
|
2442
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2173
|
+
_devkit.writeJson.call(void 0, tree, _chunkFK6PN2T3js.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2443
2174
|
}
|
|
2444
2175
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2445
2176
|
async function normalizeOptions(tree, options, config) {
|
|
2446
2177
|
let importPath = options.importPath;
|
|
2447
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2448
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
2178
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _143 => _143.namespace])) {
|
|
2179
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _144 => _144.namespace])}/${options.name}`;
|
|
2449
2180
|
}
|
|
2450
2181
|
if (options.publishable) {
|
|
2451
2182
|
if (!importPath) {
|
|
@@ -2499,7 +2230,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2499
2230
|
|
|
2500
2231
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2501
2232
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2502
|
-
const filesDir =
|
|
2233
|
+
const filesDir = _chunkFK6PN2T3js.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2503
2234
|
const tsLibraryGeneratorOptions = {
|
|
2504
2235
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2505
2236
|
platform: "browser",
|
|
@@ -2571,19 +2302,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2571
2302
|
|
|
2572
2303
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2573
2304
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2305
|
+
_chunkFK6PN2T3js.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2306
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2307
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkFK6PN2T3js.StormConfigSchema, {
|
|
2577
2308
|
name: "StormWorkspaceConfiguration"
|
|
2578
2309
|
});
|
|
2579
|
-
|
|
2580
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2581
|
-
|
|
2310
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, jsonSchema, config);
|
|
2311
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _145 => _145.workspaceRoot]), () => ( _chunkFK6PN2T3js.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _146 => _146.outputFile, 'optionalAccess', _147 => _147.startsWith, 'call', _148 => _148("./")]) ? "" : "./");
|
|
2312
|
+
_chunkFK6PN2T3js.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2582
2313
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2583
2314
|
spaces: 2
|
|
2584
2315
|
});
|
|
2585
2316
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2586
|
-
|
|
2317
|
+
_chunkFK6PN2T3js.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2587
2318
|
return {
|
|
2588
2319
|
success: true
|
|
2589
2320
|
};
|
|
@@ -2604,7 +2335,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
|
|
|
2604
2335
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2605
2336
|
|
|
2606
2337
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2607
|
-
const filesDir =
|
|
2338
|
+
const filesDir = _chunkFK6PN2T3js.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2608
2339
|
const tsLibraryGeneratorOptions = {
|
|
2609
2340
|
...schema,
|
|
2610
2341
|
platform: "neutral",
|
|
@@ -2647,7 +2378,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2647
2378
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2648
2379
|
|
|
2649
2380
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2650
|
-
const filesDir =
|
|
2381
|
+
const filesDir = _chunkFK6PN2T3js.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2651
2382
|
const tsLibraryGeneratorOptions = {
|
|
2652
2383
|
platform: "node",
|
|
2653
2384
|
devDependencies: {
|
|
@@ -2723,9 +2454,6 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2723
2454
|
"storm",
|
|
2724
2455
|
"storm-stack",
|
|
2725
2456
|
"storm-ops",
|
|
2726
|
-
"acidic",
|
|
2727
|
-
"acidic-engine",
|
|
2728
|
-
"cyclone-ui",
|
|
2729
2457
|
"rust",
|
|
2730
2458
|
"nx",
|
|
2731
2459
|
"graphql",
|
|
@@ -2766,10 +2494,10 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2766
2494
|
type: "github",
|
|
2767
2495
|
url: `${options.repositoryUrl}.git`
|
|
2768
2496
|
};
|
|
2769
|
-
json.packageManager ??= "pnpm@
|
|
2497
|
+
json.packageManager ??= "pnpm@10.3.0";
|
|
2770
2498
|
json.engines ??= {
|
|
2771
2499
|
node: ">=20.11.0",
|
|
2772
|
-
pnpm: ">=
|
|
2500
|
+
pnpm: ">=10.3.0"
|
|
2773
2501
|
};
|
|
2774
2502
|
json.prettier = "@storm-software/prettier/config.json";
|
|
2775
2503
|
json.nx ??= {
|
|
@@ -2922,6 +2650,199 @@ var _resolvelocalpackagedependencies = require('@nx/js/src/generators/release-ve
|
|
|
2922
2650
|
var _updatelockfile = require('@nx/js/src/generators/release-version/utils/update-lock-file');
|
|
2923
2651
|
|
|
2924
2652
|
// ../git-tools/src/types.ts
|
|
2653
|
+
var DEFAULT_COMMIT_TYPES = {
|
|
2654
|
+
/* --- Bumps version when selected --- */
|
|
2655
|
+
chore: {
|
|
2656
|
+
description: "Other changes that don't modify src or test files",
|
|
2657
|
+
title: "Chore",
|
|
2658
|
+
emoji: "\u2699\uFE0F ",
|
|
2659
|
+
semverBump: "patch",
|
|
2660
|
+
changelog: {
|
|
2661
|
+
title: "Miscellaneous",
|
|
2662
|
+
hidden: false
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2665
|
+
fix: {
|
|
2666
|
+
description: "A change that resolves an issue previously identified with the package",
|
|
2667
|
+
title: "Bug Fix",
|
|
2668
|
+
emoji: "\u{1FAB2} ",
|
|
2669
|
+
semverBump: "patch",
|
|
2670
|
+
changelog: {
|
|
2671
|
+
title: "Bug Fixes",
|
|
2672
|
+
hidden: false
|
|
2673
|
+
}
|
|
2674
|
+
},
|
|
2675
|
+
feat: {
|
|
2676
|
+
description: "A change that adds a new feature to the package",
|
|
2677
|
+
title: "Feature",
|
|
2678
|
+
emoji: "\u{1F511} ",
|
|
2679
|
+
semverBump: "minor",
|
|
2680
|
+
changelog: {
|
|
2681
|
+
title: "Features",
|
|
2682
|
+
hidden: false
|
|
2683
|
+
}
|
|
2684
|
+
},
|
|
2685
|
+
ci: {
|
|
2686
|
+
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
|
|
2687
|
+
title: "Continuous Integration",
|
|
2688
|
+
emoji: "\u{1F9F0} ",
|
|
2689
|
+
semverBump: "patch",
|
|
2690
|
+
changelog: {
|
|
2691
|
+
title: "Continuous Integration",
|
|
2692
|
+
hidden: false
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
refactor: {
|
|
2696
|
+
description: "A code change that neither fixes a bug nor adds a feature",
|
|
2697
|
+
title: "Code Refactoring",
|
|
2698
|
+
emoji: "\u{1F9EA} ",
|
|
2699
|
+
semverBump: "patch",
|
|
2700
|
+
changelog: {
|
|
2701
|
+
title: "Source Code Improvements",
|
|
2702
|
+
hidden: false
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2705
|
+
style: {
|
|
2706
|
+
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
|
|
2707
|
+
title: "Style Improvements",
|
|
2708
|
+
emoji: "\u{1F48E} ",
|
|
2709
|
+
semverBump: "patch",
|
|
2710
|
+
changelog: {
|
|
2711
|
+
title: "Style Improvements",
|
|
2712
|
+
hidden: false
|
|
2713
|
+
}
|
|
2714
|
+
},
|
|
2715
|
+
perf: {
|
|
2716
|
+
description: "A code change that improves performance",
|
|
2717
|
+
title: "Performance Improvement",
|
|
2718
|
+
emoji: "\u23F1\uFE0F ",
|
|
2719
|
+
semverBump: "patch",
|
|
2720
|
+
changelog: {
|
|
2721
|
+
title: "Performance Improvements",
|
|
2722
|
+
hidden: false
|
|
2723
|
+
}
|
|
2724
|
+
},
|
|
2725
|
+
/* --- Does not bump version when selected --- */
|
|
2726
|
+
docs: {
|
|
2727
|
+
description: "A change that only includes documentation updates",
|
|
2728
|
+
title: "Documentation",
|
|
2729
|
+
emoji: "\u{1F4DC} ",
|
|
2730
|
+
semverBump: "none",
|
|
2731
|
+
changelog: {
|
|
2732
|
+
title: "Documentation",
|
|
2733
|
+
hidden: false
|
|
2734
|
+
}
|
|
2735
|
+
},
|
|
2736
|
+
test: {
|
|
2737
|
+
description: "Adding missing tests or correcting existing tests",
|
|
2738
|
+
title: "Testing",
|
|
2739
|
+
emoji: "\u{1F6A8} ",
|
|
2740
|
+
semverBump: "none",
|
|
2741
|
+
changelog: {
|
|
2742
|
+
title: "Testing",
|
|
2743
|
+
hidden: true
|
|
2744
|
+
}
|
|
2745
|
+
},
|
|
2746
|
+
/* --- Not included in commitlint but included in changelog --- */
|
|
2747
|
+
deps: {
|
|
2748
|
+
description: "Changes that add, update, or remove dependencies. This includes devDependencies and peerDependencies",
|
|
2749
|
+
title: "Dependencies",
|
|
2750
|
+
emoji: "\u{1F4E6} ",
|
|
2751
|
+
hidden: true,
|
|
2752
|
+
semverBump: "patch",
|
|
2753
|
+
changelog: {
|
|
2754
|
+
title: "Dependency Upgrades",
|
|
2755
|
+
hidden: false
|
|
2756
|
+
}
|
|
2757
|
+
},
|
|
2758
|
+
/* --- Not included in commitlint or changelog --- */
|
|
2759
|
+
build: {
|
|
2760
|
+
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
|
|
2761
|
+
title: "Build",
|
|
2762
|
+
emoji: "\u{1F6E0} ",
|
|
2763
|
+
hidden: true,
|
|
2764
|
+
semverBump: "none",
|
|
2765
|
+
changelog: {
|
|
2766
|
+
title: "Build",
|
|
2767
|
+
hidden: true
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
release: {
|
|
2771
|
+
description: "Publishing a commit containing a newly released version",
|
|
2772
|
+
title: "Publish Release",
|
|
2773
|
+
emoji: "\u{1F680} ",
|
|
2774
|
+
hidden: true,
|
|
2775
|
+
semverBump: "none",
|
|
2776
|
+
changelog: {
|
|
2777
|
+
title: "Publish Release",
|
|
2778
|
+
hidden: true
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
var DEFAULT_COMMIT_QUESTIONS = {
|
|
2783
|
+
type: {
|
|
2784
|
+
type: "select",
|
|
2785
|
+
title: "Commit Type",
|
|
2786
|
+
description: "Select the commit type that best describes your changes",
|
|
2787
|
+
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter((type) => DEFAULT_COMMIT_TYPES[type].hidden !== true).reduce((ret, type) => {
|
|
2788
|
+
ret[type] = DEFAULT_COMMIT_TYPES[type];
|
|
2789
|
+
return ret;
|
|
2790
|
+
}, {}),
|
|
2791
|
+
defaultValue: "chore",
|
|
2792
|
+
maxLength: 20,
|
|
2793
|
+
minLength: 3
|
|
2794
|
+
},
|
|
2795
|
+
scope: {
|
|
2796
|
+
type: "select",
|
|
2797
|
+
title: "Commit Scope",
|
|
2798
|
+
description: "Select the monorepo project that is primarily impacted by this change",
|
|
2799
|
+
enum: {},
|
|
2800
|
+
defaultValue: "monorepo",
|
|
2801
|
+
maxLength: 50,
|
|
2802
|
+
minLength: 1
|
|
2803
|
+
},
|
|
2804
|
+
subject: {
|
|
2805
|
+
type: "input",
|
|
2806
|
+
title: "Commit Subject",
|
|
2807
|
+
description: "Write a short, imperative tense description of the change",
|
|
2808
|
+
maxLength: 150,
|
|
2809
|
+
minLength: 3
|
|
2810
|
+
},
|
|
2811
|
+
body: {
|
|
2812
|
+
type: "input",
|
|
2813
|
+
title: "Commit Body",
|
|
2814
|
+
description: "Provide a longer description of the change",
|
|
2815
|
+
maxLength: 600
|
|
2816
|
+
},
|
|
2817
|
+
isBreaking: {
|
|
2818
|
+
type: "confirm",
|
|
2819
|
+
title: "Breaking Changes",
|
|
2820
|
+
description: "Are there any breaking changes as a result of this commit?",
|
|
2821
|
+
defaultValue: false
|
|
2822
|
+
},
|
|
2823
|
+
breakingBody: {
|
|
2824
|
+
type: "input",
|
|
2825
|
+
title: "Breaking Changes (Details)",
|
|
2826
|
+
description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
|
|
2827
|
+
when: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (answers) => answers.isBreaking === true, "when"),
|
|
2828
|
+
maxLength: 600,
|
|
2829
|
+
minLength: 3
|
|
2830
|
+
},
|
|
2831
|
+
isIssueAffected: {
|
|
2832
|
+
type: "confirm",
|
|
2833
|
+
title: "Open Issue Affected",
|
|
2834
|
+
description: "Does this change impact any open issues?",
|
|
2835
|
+
defaultValue: false
|
|
2836
|
+
},
|
|
2837
|
+
issuesBody: {
|
|
2838
|
+
type: "input",
|
|
2839
|
+
title: "Open Issue Affected (Details)",
|
|
2840
|
+
description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
|
|
2841
|
+
when: /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (answers) => answers.isIssueAffected === true, "when"),
|
|
2842
|
+
maxLength: 600,
|
|
2843
|
+
minLength: 3
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2925
2846
|
var RuleConfigSeverity;
|
|
2926
2847
|
(function(RuleConfigSeverity2) {
|
|
2927
2848
|
RuleConfigSeverity2[RuleConfigSeverity2["Disabled"] = 0] = "Disabled";
|
|
@@ -2929,9 +2850,6 @@ var RuleConfigSeverity;
|
|
|
2929
2850
|
RuleConfigSeverity2[RuleConfigSeverity2["Error"] = 2] = "Error";
|
|
2930
2851
|
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
2931
2852
|
|
|
2932
|
-
// ../git-tools/src/release/changelog-renderer.ts
|
|
2933
|
-
var _index = require('nx/release/changelog-renderer/index'); var _index2 = _interopRequireDefault(_index);
|
|
2934
|
-
|
|
2935
2853
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2936
2854
|
|
|
2937
2855
|
|