@storm-software/cloudflare-tools 0.55.43 → 0.55.44
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 +8 -0
- package/dist/{chunk-MESLYSHV.mjs → chunk-75BWJSFW.mjs} +9 -9
- package/dist/{chunk-HF5FM2V2.js → chunk-AXF5C7QR.js} +3 -3
- package/dist/{chunk-MCQ4YOON.js → chunk-CAC2PNUJ.js} +17 -17
- package/dist/{chunk-5QU7G4BP.mjs → chunk-FVMS7RMT.mjs} +5 -5
- package/dist/{chunk-FK6PN2T3.js → chunk-HWJBDRIG.js} +2 -2
- package/dist/{chunk-6D3NUIUL.js → chunk-ISO7UOVA.js} +182 -178
- package/dist/{chunk-247N3JYF.js → chunk-JUJW77CM.js} +12 -12
- package/dist/{chunk-E22S7JBO.mjs → chunk-LY3NUGLI.mjs} +12 -8
- package/dist/{chunk-Q67NQSCF.mjs → chunk-MIKH2FI5.mjs} +1 -1
- package/dist/{chunk-M4FHQYTZ.mjs → chunk-R2SQ6ZOK.mjs} +2 -2
- package/dist/{chunk-H2ML72QF.js → chunk-R32N7B24.js} +47 -47
- package/dist/{chunk-S3S7EN37.mjs → chunk-STUGKRS5.mjs} +6 -6
- package/dist/{chunk-PW324BYD.js → chunk-TDNPRL4Y.js} +1 -1
- package/dist/{chunk-LEXIFHU6.mjs → chunk-TTDB2VCO.mjs} +1 -1
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +12 -12
- package/dist/index.mjs +16 -16
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.d.mts +21 -5
- package/dist/src/executors/serve/executor.d.ts +21 -5
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkR32N7B24js = require('./chunk-R32N7B24.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ var _chunkH2ML72QFjs = require('./chunk-H2ML72QF.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkHWJBDRIGjs = require('./chunk-HWJBDRIG.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]))), () => ( _chunkHWJBDRIGjs.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 = _chunkHWJBDRIGjs.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 = _chunkHWJBDRIGjs.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
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
117
117
|
if (!executorOptions.skipReadingConfig) {
|
|
118
|
-
|
|
118
|
+
_chunkHWJBDRIGjs.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 _chunkR32N7B24js.getConfig.call(void 0, workspaceRoot3);
|
|
125
125
|
}
|
|
126
126
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
127
|
-
|
|
127
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
128
128
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
129
|
-
|
|
129
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
${
|
|
131
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
132
|
+
${_chunkHWJBDRIGjs.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 @@ ${_chunkFK6PN2T3js.formatLogMessage.call(void 0, options)}
|
|
|
138
138
|
projectName,
|
|
139
139
|
config
|
|
140
140
|
}, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
|
|
141
|
-
|
|
142
|
-
${
|
|
141
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
142
|
+
${_chunkHWJBDRIGjs.formatLogMessage.call(void 0, tokenized)}
|
|
143
143
|
`, config);
|
|
144
144
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
145
|
-
|
|
145
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
146
146
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
147
|
-
|
|
147
|
+
_chunkHWJBDRIGjs.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 @@ ${_chunkFK6PN2T3js.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
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
158
|
+
${_chunkHWJBDRIGjs.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
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
166
166
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
167
|
-
|
|
167
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
_chunkHWJBDRIGjs.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
|
+
_chunkHWJBDRIGjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
176
|
+
_chunkHWJBDRIGjs.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 {
|
|
@@ -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
|
+
_chunkHWJBDRIGjs.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} -> ${_chunkHWJBDRIGjs.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
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkHWJBDRIGjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
490
490
|
const files = await _glob.glob.call(void 0, [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
492
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
493
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
494
|
+
_chunkHWJBDRIGjs.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
|
|
|
@@ -514,7 +514,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
514
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 = _chunkHWJBDRIGjs.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,8 +525,8 @@ 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
|
+
_chunkHWJBDRIGjs.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, _chunkHWJBDRIGjs.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);
|
|
@@ -535,7 +535,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
535
535
|
}
|
|
536
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
537
|
if (_optionalChain([projectConfigurations, 'access', _42 => _42.projects, 'optionalAccess', _43 => _43[dep]])) {
|
|
538
|
-
const depPackageJsonPath =
|
|
538
|
+
const depPackageJsonPath = _chunkHWJBDRIGjs.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', _44 => _44.includes, 'call', _45 => _45(localPackage.name)])) {
|
|
551
|
-
ret[localPackage.name] =
|
|
550
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _44 => _44.includes, 'call', _45 => _45(localPackage.name)]) && _optionalChain([packageJson, 'access', _46 => _46.devDependencies, 'optionalAccess', _47 => _47[localPackage.name]]) === void 0) {
|
|
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', _48 => _48.includes, 'call', _49 => _49(localPackage.name)]) && _optionalChain([packageJson, 'access', _50 => _50.dependencies, 'optionalAccess', _51 => _51[localPackage.name]]) === void 0) {
|
|
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
|
+
_chunkHWJBDRIGjs.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 : _chunkHWJBDRIGjs.findWorkspaceRoot.call(void 0, );
|
|
568
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkHWJBDRIGjs.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 ??= `${_chunkHWJBDRIGjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
578
578
|
}
|
|
579
579
|
packageJson.files ??= [
|
|
580
580
|
"dist/**/*"
|
|
@@ -605,14 +605,14 @@ 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 : _chunkHWJBDRIGjs.joinPaths.call(void 0, "packages", projectName);
|
|
609
609
|
return packageJson;
|
|
610
610
|
}, "addWorkspacePackageJsonFields");
|
|
611
611
|
|
|
612
612
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
613
613
|
|
|
614
614
|
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
615
|
-
const workspaceRoot3 = config.workspaceRoot ||
|
|
615
|
+
const workspaceRoot3 = config.workspaceRoot || _chunkHWJBDRIGjs.findWorkspaceRoot.call(void 0, );
|
|
616
616
|
const entryPoints = [];
|
|
617
617
|
if (entry) {
|
|
618
618
|
if (typeof entry === "string") {
|
|
@@ -624,7 +624,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
if (emitOnAll) {
|
|
627
|
-
entryPoints.push(
|
|
627
|
+
entryPoints.push(_chunkHWJBDRIGjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
628
628
|
}
|
|
629
629
|
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
630
630
|
const paths = [];
|
|
@@ -636,9 +636,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
636
636
|
]
|
|
637
637
|
});
|
|
638
638
|
paths.push(...files.reduce((ret, filePath) => {
|
|
639
|
-
const result =
|
|
639
|
+
const result = _chunkHWJBDRIGjs.correctPaths.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkHWJBDRIGjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkHWJBDRIGjs.correctPaths.call(void 0, projectRoot), ""));
|
|
640
640
|
if (result) {
|
|
641
|
-
|
|
641
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkHWJBDRIGjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
642
642
|
if (!paths.includes(result)) {
|
|
643
643
|
paths.push(result);
|
|
644
644
|
}
|
|
@@ -646,7 +646,11 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
646
646
|
return ret;
|
|
647
647
|
}, []));
|
|
648
648
|
} else {
|
|
649
|
-
|
|
649
|
+
const result = _chunkHWJBDRIGjs.correctPaths.call(void 0, entryPoint.replaceAll(_chunkHWJBDRIGjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkHWJBDRIGjs.correctPaths.call(void 0, projectRoot), ""));
|
|
650
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, `Trying to add entry point ${result}"`, config);
|
|
651
|
+
if (!paths.includes(result)) {
|
|
652
|
+
paths.push(result);
|
|
653
|
+
}
|
|
650
654
|
}
|
|
651
655
|
return paths;
|
|
652
656
|
}));
|
|
@@ -758,15 +762,15 @@ var RendererEngine = class {
|
|
|
758
762
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
759
763
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
760
764
|
}
|
|
761
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
765
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _52 => _52.outputs, 'access', _53 => _53[relativePath]]);
|
|
762
766
|
return {
|
|
763
767
|
type: "chunk",
|
|
764
768
|
path: file.path,
|
|
765
769
|
code: file.text,
|
|
766
|
-
map: _optionalChain([outputFiles, 'access',
|
|
767
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
768
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
769
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
770
|
+
map: _optionalChain([outputFiles, 'access', _54 => _54.find, 'call', _55 => _55((f) => f.path === `${file.path}.map`), 'optionalAccess', _56 => _56.text]),
|
|
771
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _57 => _57.entryPoint]),
|
|
772
|
+
exports: _optionalChain([meta, 'optionalAccess', _58 => _58.exports]),
|
|
773
|
+
imports: _optionalChain([meta, 'optionalAccess', _59 => _59.imports])
|
|
770
774
|
};
|
|
771
775
|
} else {
|
|
772
776
|
return {
|
|
@@ -849,7 +853,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
849
853
|
name: "storm:esm-split-code-to-cjs",
|
|
850
854
|
setup(build4) {
|
|
851
855
|
build4.onEnd(async (result) => {
|
|
852
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
856
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _60 => _60.metafile, 'optionalAccess', _61 => _61.outputs]), () => ( {})));
|
|
853
857
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
854
858
|
await esbuild.build({
|
|
855
859
|
outdir: resolvedOptions.outdir,
|
|
@@ -958,7 +962,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option
|
|
|
958
962
|
setup(build4) {
|
|
959
963
|
build4.onEnd((result) => {
|
|
960
964
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
961
|
-
|
|
965
|
+
_chunkHWJBDRIGjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
962
966
|
${result.errors.map((error) => error.text).join("\n")}
|
|
963
967
|
|
|
964
968
|
`, resolvedOptions.config);
|
|
@@ -971,7 +975,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
971
975
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
972
976
|
|
|
973
977
|
function resolvePathsConfig(options, cwd) {
|
|
974
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
978
|
+
if (_optionalChain([options, 'optionalAccess', _62 => _62.compilerOptions, 'optionalAccess', _63 => _63.paths])) {
|
|
975
979
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
976
980
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
977
981
|
return [
|
|
@@ -993,13 +997,13 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
993
997
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
994
998
|
name: "storm:resolve-paths",
|
|
995
999
|
setup(build4) {
|
|
996
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1000
|
+
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
997
1001
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
998
1002
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
999
1003
|
build4.onResolve({
|
|
1000
1004
|
filter: packagesRegex
|
|
1001
1005
|
}, (args) => {
|
|
1002
|
-
if (_optionalChain([build4, 'access',
|
|
1006
|
+
if (_optionalChain([build4, 'access', _64 => _64.initialOptions, 'access', _65 => _65.external, 'optionalAccess', _66 => _66.includes, 'call', _67 => _67(args.path)])) {
|
|
1003
1007
|
return {
|
|
1004
1008
|
path: args.path,
|
|
1005
1009
|
external: true
|
|
@@ -1017,7 +1021,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
1017
1021
|
|
|
1018
1022
|
|
|
1019
1023
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1020
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1024
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1021
1025
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1022
1026
|
p,
|
|
1023
1027
|
getTypeDependencyPackageName(p)
|
|
@@ -1053,13 +1057,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1053
1057
|
},
|
|
1054
1058
|
dtsRollup: {
|
|
1055
1059
|
enabled: true,
|
|
1056
|
-
untrimmedFilePath:
|
|
1060
|
+
untrimmedFilePath: _chunkHWJBDRIGjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1057
1061
|
},
|
|
1058
1062
|
tsdocMetadata: {
|
|
1059
1063
|
enabled: false
|
|
1060
1064
|
}
|
|
1061
1065
|
},
|
|
1062
|
-
packageJsonFullPath:
|
|
1066
|
+
packageJsonFullPath: _chunkHWJBDRIGjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1063
1067
|
configObjectFullPath: void 0
|
|
1064
1068
|
});
|
|
1065
1069
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1067,7 +1071,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1067
1071
|
localBuild: true
|
|
1068
1072
|
});
|
|
1069
1073
|
if (extractorResult.succeeded === false) {
|
|
1070
|
-
|
|
1074
|
+
_chunkHWJBDRIGjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1071
1075
|
throw new Error("API Extractor completed with errors");
|
|
1072
1076
|
}
|
|
1073
1077
|
}
|
|
@@ -1086,12 +1090,12 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1086
1090
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1087
1091
|
const typeOutDir = resolvedOptions.outdir;
|
|
1088
1092
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1089
|
-
const bundlePath =
|
|
1093
|
+
const bundlePath = _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1090
1094
|
let dtsPath;
|
|
1091
|
-
if (_fs.existsSync.call(void 0,
|
|
1092
|
-
dtsPath =
|
|
1093
|
-
} else if (_fs.existsSync.call(void 0,
|
|
1094
|
-
dtsPath =
|
|
1095
|
+
if (_fs.existsSync.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1096
|
+
dtsPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1097
|
+
} else if (_fs.existsSync.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1098
|
+
dtsPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1095
1099
|
}
|
|
1096
1100
|
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1097
1101
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1108,7 +1112,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1108
1112
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1109
1113
|
if (npmPackage.startsWith("@")) {
|
|
1110
1114
|
const [scope, name] = npmPackage.split("/");
|
|
1111
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1115
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _68 => _68.slice, 'call', _69 => _69(1)])}__${name}`;
|
|
1112
1116
|
}
|
|
1113
1117
|
return `@types/${npmPackage}`;
|
|
1114
1118
|
}
|
|
@@ -1255,8 +1259,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1255
1259
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1256
1260
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1257
1261
|
});
|
|
1258
|
-
|
|
1259
|
-
|
|
1262
|
+
_chunkHWJBDRIGjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1263
|
+
_chunkHWJBDRIGjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1260
1264
|
if (filteredMissingDeps.length > 0) {
|
|
1261
1265
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1262
1266
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1324,7 +1328,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1324
1328
|
return (...args) => {
|
|
1325
1329
|
let result = fn(...args);
|
|
1326
1330
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1327
|
-
result = _optionalChain([fns, 'access',
|
|
1331
|
+
result = _optionalChain([fns, 'access', _70 => _70[i], 'optionalCall', _71 => _71(result)]);
|
|
1328
1332
|
}
|
|
1329
1333
|
return result;
|
|
1330
1334
|
};
|
|
@@ -1334,7 +1338,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1334
1338
|
return async (...args) => {
|
|
1335
1339
|
let result = await fn(...args);
|
|
1336
1340
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1337
|
-
result = await _optionalChain([fns, 'access',
|
|
1341
|
+
result = await _optionalChain([fns, 'access', _72 => _72[i], 'optionalCall', _73 => _73(result)]);
|
|
1338
1342
|
}
|
|
1339
1343
|
return result;
|
|
1340
1344
|
};
|
|
@@ -1350,13 +1354,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1350
1354
|
if (!workspaceRoot3) {
|
|
1351
1355
|
throw new Error("Cannot find Nx workspace root");
|
|
1352
1356
|
}
|
|
1353
|
-
const config = await
|
|
1354
|
-
|
|
1355
|
-
const stopwatch =
|
|
1357
|
+
const config = await _chunkR32N7B24js.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1358
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1359
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1356
1360
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1357
1361
|
exitOnError: true
|
|
1358
1362
|
});
|
|
1359
|
-
const projectJsonPath =
|
|
1363
|
+
const projectJsonPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1360
1364
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1361
1365
|
throw new Error("Cannot find project.json configuration");
|
|
1362
1366
|
}
|
|
@@ -1364,13 +1368,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1364
1368
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1365
1369
|
const projectName = projectJson.name;
|
|
1366
1370
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1367
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1371
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _74 => _74.projects, 'optionalAccess', _75 => _75[projectName]])) {
|
|
1368
1372
|
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.");
|
|
1369
1373
|
}
|
|
1370
1374
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1371
1375
|
options.name ??= `${projectName}-${options.format}`;
|
|
1372
1376
|
options.target ??= DEFAULT_TARGET;
|
|
1373
|
-
const packageJsonPath =
|
|
1377
|
+
const packageJsonPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1374
1378
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1375
1379
|
throw new Error("Cannot find package.json configuration");
|
|
1376
1380
|
}
|
|
@@ -1387,19 +1391,19 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1387
1391
|
"main"
|
|
1388
1392
|
],
|
|
1389
1393
|
...userOptions,
|
|
1390
|
-
tsconfig:
|
|
1394
|
+
tsconfig: _chunkHWJBDRIGjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1391
1395
|
format: options.format || "cjs",
|
|
1392
1396
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), userOptions.emitOnAll === true),
|
|
1393
|
-
outdir: userOptions.outputPath ||
|
|
1397
|
+
outdir: userOptions.outputPath || _chunkHWJBDRIGjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1394
1398
|
distDir: userOptions.distDir || "dist",
|
|
1395
1399
|
plugins: [],
|
|
1396
1400
|
name: userOptions.name || projectName,
|
|
1397
1401
|
projectConfigurations,
|
|
1398
1402
|
projectName,
|
|
1399
1403
|
projectGraph,
|
|
1400
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1404
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkHWJBDRIGjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1401
1405
|
minify: userOptions.minify || !userOptions.debug,
|
|
1402
|
-
verbose: userOptions.verbose ||
|
|
1406
|
+
verbose: userOptions.verbose || _chunkHWJBDRIGjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1403
1407
|
includeSrc: userOptions.includeSrc === true,
|
|
1404
1408
|
metafile: userOptions.metafile !== false,
|
|
1405
1409
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1435,8 +1439,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1435
1439
|
}, {})
|
|
1436
1440
|
},
|
|
1437
1441
|
inject: [
|
|
1438
|
-
options.format === "cjs" && options.injectShims ?
|
|
1439
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1442
|
+
options.format === "cjs" && options.injectShims ? _chunkHWJBDRIGjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1443
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkHWJBDRIGjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1440
1444
|
].filter(Boolean)
|
|
1441
1445
|
};
|
|
1442
1446
|
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
@@ -1454,14 +1458,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1454
1458
|
return result;
|
|
1455
1459
|
}, "resolveOptions");
|
|
1456
1460
|
async function generatePackageJson(context2) {
|
|
1457
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1458
|
-
|
|
1459
|
-
const stopwatch =
|
|
1460
|
-
const packageJsonPath =
|
|
1461
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1462
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1463
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1464
|
+
const packageJsonPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1461
1465
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1462
1466
|
throw new Error("Cannot find package.json configuration");
|
|
1463
1467
|
}
|
|
1464
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1468
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkHWJBDRIGjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1465
1469
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1466
1470
|
if (!packageJson) {
|
|
1467
1471
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1503,7 +1507,7 @@ async function generatePackageJson(context2) {
|
|
|
1503
1507
|
}
|
|
1504
1508
|
return ret;
|
|
1505
1509
|
}, packageJson.exports);
|
|
1506
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1510
|
+
await _devkit.writeJsonFile.call(void 0, _chunkHWJBDRIGjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1507
1511
|
stopwatch();
|
|
1508
1512
|
}
|
|
1509
1513
|
return context2;
|
|
@@ -1529,8 +1533,8 @@ async function generateContext(getOptions) {
|
|
|
1529
1533
|
}
|
|
1530
1534
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1531
1535
|
async function executeEsBuild(context2) {
|
|
1532
|
-
|
|
1533
|
-
const stopwatch =
|
|
1536
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1537
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1534
1538
|
if (process.env.STORM_WATCH) {
|
|
1535
1539
|
const ctx = await esbuild2.context(context2.options);
|
|
1536
1540
|
watch(ctx, context2.options);
|
|
@@ -1538,7 +1542,7 @@ async function executeEsBuild(context2) {
|
|
|
1538
1542
|
const options = {
|
|
1539
1543
|
...context2.options
|
|
1540
1544
|
};
|
|
1541
|
-
options.outdir =
|
|
1545
|
+
options.outdir = _chunkHWJBDRIGjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1542
1546
|
if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
|
|
1543
1547
|
options.inject === {}) {
|
|
1544
1548
|
delete options.inject;
|
|
@@ -1564,8 +1568,8 @@ async function executeEsBuild(context2) {
|
|
|
1564
1568
|
delete options.config;
|
|
1565
1569
|
delete options.injectShims;
|
|
1566
1570
|
delete options.external;
|
|
1567
|
-
|
|
1568
|
-
${
|
|
1571
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1572
|
+
${_chunkHWJBDRIGjs.formatLogMessage.call(void 0, options)}`, context2.options.config);
|
|
1569
1573
|
const result = await esbuild2.build(options);
|
|
1570
1574
|
await esbuild2.stop();
|
|
1571
1575
|
if (result.metafile) {
|
|
@@ -1577,9 +1581,9 @@ ${_chunkFK6PN2T3js.formatLogMessage.call(void 0, options)}`, context2.options.co
|
|
|
1577
1581
|
}
|
|
1578
1582
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1579
1583
|
async function copyBuildAssets(context2) {
|
|
1580
|
-
if (_optionalChain([context2, 'access',
|
|
1581
|
-
|
|
1582
|
-
const stopwatch =
|
|
1584
|
+
if (_optionalChain([context2, 'access', _76 => _76.result, 'optionalAccess', _77 => _77.errors, 'access', _78 => _78.length]) === 0) {
|
|
1585
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1586
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1583
1587
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1584
1588
|
stopwatch();
|
|
1585
1589
|
}
|
|
@@ -1587,11 +1591,11 @@ async function copyBuildAssets(context2) {
|
|
|
1587
1591
|
}
|
|
1588
1592
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1589
1593
|
async function reportResults(context2) {
|
|
1590
|
-
if (_optionalChain([context2, 'access',
|
|
1594
|
+
if (_optionalChain([context2, 'access', _79 => _79.result, 'optionalAccess', _80 => _80.errors, 'access', _81 => _81.length]) === 0) {
|
|
1591
1595
|
if (context2.result.warnings.length > 0) {
|
|
1592
|
-
|
|
1596
|
+
_chunkHWJBDRIGjs.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);
|
|
1593
1597
|
}
|
|
1594
|
-
|
|
1598
|
+
_chunkHWJBDRIGjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1595
1599
|
}
|
|
1596
1600
|
}
|
|
1597
1601
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1627,8 +1631,8 @@ async function dependencyCheck(options) {
|
|
|
1627
1631
|
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1628
1632
|
async function cleanOutputPath(context2) {
|
|
1629
1633
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
1630
|
-
|
|
1631
|
-
const stopwatch =
|
|
1634
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1635
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
|
|
1632
1636
|
await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
|
|
1633
1637
|
stopwatch();
|
|
1634
1638
|
}
|
|
@@ -1636,8 +1640,8 @@ async function cleanOutputPath(context2) {
|
|
|
1636
1640
|
}
|
|
1637
1641
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1638
1642
|
async function build3(options) {
|
|
1639
|
-
|
|
1640
|
-
const stopwatch =
|
|
1643
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1644
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1641
1645
|
try {
|
|
1642
1646
|
const opts = Array.isArray(options) ? options : [
|
|
1643
1647
|
options
|
|
@@ -1647,9 +1651,9 @@ async function build3(options) {
|
|
|
1647
1651
|
}
|
|
1648
1652
|
void transduce.async(opts, dependencyCheck);
|
|
1649
1653
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1650
|
-
|
|
1654
|
+
_chunkHWJBDRIGjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1651
1655
|
} catch (error) {
|
|
1652
|
-
|
|
1656
|
+
_chunkHWJBDRIGjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1653
1657
|
throw error;
|
|
1654
1658
|
} finally {
|
|
1655
1659
|
stopwatch();
|
|
@@ -1677,9 +1681,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1677
1681
|
return context2.rebuild();
|
|
1678
1682
|
});
|
|
1679
1683
|
if (rebuildResult instanceof Error) {
|
|
1680
|
-
|
|
1684
|
+
_chunkHWJBDRIGjs.writeError.call(void 0, rebuildResult.message);
|
|
1681
1685
|
}
|
|
1682
|
-
|
|
1686
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1683
1687
|
}, 10);
|
|
1684
1688
|
changeWatcher.on("change", fastRebuild);
|
|
1685
1689
|
return void 0;
|
|
@@ -1687,15 +1691,15 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1687
1691
|
|
|
1688
1692
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1689
1693
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1690
|
-
|
|
1691
|
-
if (!_optionalChain([context2, 'access',
|
|
1694
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1695
|
+
if (!_optionalChain([context2, 'access', _82 => _82.projectsConfigurations, 'optionalAccess', _83 => _83.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _84 => _84.projectsConfigurations, 'access', _85 => _85.projects, 'access', _86 => _86[context2.projectName], 'optionalAccess', _87 => _87.root])) {
|
|
1692
1696
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1693
1697
|
}
|
|
1694
1698
|
await build3({
|
|
1695
1699
|
...options,
|
|
1696
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1700
|
+
projectRoot: _optionalChain([context2, 'access', _88 => _88.projectsConfigurations, 'access', _89 => _89.projects, 'optionalAccess', _90 => _90[context2.projectName], 'access', _91 => _91.root]),
|
|
1697
1701
|
projectName: context2.projectName,
|
|
1698
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1702
|
+
sourceRoot: _optionalChain([context2, 'access', _92 => _92.projectsConfigurations, 'access', _93 => _93.projects, 'optionalAccess', _94 => _94[context2.projectName], 'optionalAccess', _95 => _95.sourceRoot]),
|
|
1699
1703
|
format: options.format,
|
|
1700
1704
|
platform: options.format
|
|
1701
1705
|
});
|
|
@@ -1738,18 +1742,18 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1738
1742
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1739
1743
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1740
1744
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1741
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1745
|
+
if (!_optionalChain([context2, 'optionalAccess', _96 => _96.projectName]) || !_optionalChain([context2, 'access', _97 => _97.projectsConfigurations, 'optionalAccess', _98 => _98.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1742
1746
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1743
1747
|
}
|
|
1744
|
-
|
|
1748
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1745
1749
|
_sizelimit2.default.call(void 0, [
|
|
1746
1750
|
_file2.default,
|
|
1747
1751
|
_esbuild3.default,
|
|
1748
1752
|
_esbuildwhy2.default
|
|
1749
1753
|
], {
|
|
1750
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1754
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _99 => _99.projectsConfigurations, 'access', _100 => _100.projects, 'access', _101 => _101[context2.projectName], 'optionalAccess', _102 => _102.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _103 => _103.projectsConfigurations, 'access', _104 => _104.projects, 'access', _105 => _105[context2.projectName], 'optionalAccess', _106 => _106.root]), () => ( "./")), "src")))
|
|
1751
1755
|
}).then((result) => {
|
|
1752
|
-
|
|
1756
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1753
1757
|
});
|
|
1754
1758
|
return {
|
|
1755
1759
|
success: true
|
|
@@ -1770,11 +1774,11 @@ var _fsextra = require('fs-extra');
|
|
|
1770
1774
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1771
1775
|
async function typiaExecutorFn(options, _, config) {
|
|
1772
1776
|
if (options.clean !== false) {
|
|
1773
|
-
|
|
1777
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1774
1778
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1775
1779
|
}
|
|
1776
1780
|
await Promise.all(options.entry.map((entry) => {
|
|
1777
|
-
|
|
1781
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1778
1782
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1779
1783
|
input: entry,
|
|
1780
1784
|
output: options.outputPath,
|
|
@@ -1805,8 +1809,8 @@ var executor_default8 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
1805
1809
|
|
|
1806
1810
|
var _jiti = require('jiti');
|
|
1807
1811
|
async function unbuildExecutorFn(options, context2, config) {
|
|
1808
|
-
|
|
1809
|
-
if (!_optionalChain([context2, 'access',
|
|
1812
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1813
|
+
if (!_optionalChain([context2, 'access', _107 => _107.projectsConfigurations, 'optionalAccess', _108 => _108.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1810
1814
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
1811
1815
|
}
|
|
1812
1816
|
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
@@ -1816,7 +1820,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1816
1820
|
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.");
|
|
1817
1821
|
}
|
|
1818
1822
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
1819
|
-
fsCache: config.skipCache ? false :
|
|
1823
|
+
fsCache: config.skipCache ? false : _chunkHWJBDRIGjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
1820
1824
|
interopDefault: true
|
|
1821
1825
|
});
|
|
1822
1826
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -1829,7 +1833,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1829
1833
|
}, {
|
|
1830
1834
|
stubOptions: {
|
|
1831
1835
|
jiti: {
|
|
1832
|
-
fsCache: config.skipCache ? false :
|
|
1836
|
+
fsCache: config.skipCache ? false : _chunkHWJBDRIGjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
1833
1837
|
}
|
|
1834
1838
|
},
|
|
1835
1839
|
rollup: {
|
|
@@ -1876,58 +1880,58 @@ var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecu
|
|
|
1876
1880
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
1877
1881
|
skipReadingConfig: false
|
|
1878
1882
|
}) => async (tree, _options) => {
|
|
1879
|
-
const stopwatch =
|
|
1883
|
+
const stopwatch = _chunkHWJBDRIGjs.getStopwatch.call(void 0, name);
|
|
1880
1884
|
let options = _options;
|
|
1881
1885
|
let config;
|
|
1882
1886
|
try {
|
|
1883
|
-
|
|
1887
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1884
1888
|
|
|
1885
1889
|
`, config);
|
|
1886
|
-
const workspaceRoot3 =
|
|
1890
|
+
const workspaceRoot3 = _chunkHWJBDRIGjs.findWorkspaceRoot.call(void 0, );
|
|
1887
1891
|
if (!generatorOptions.skipReadingConfig) {
|
|
1888
|
-
|
|
1892
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
1889
1893
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
1890
|
-
config = await
|
|
1894
|
+
config = await _chunkR32N7B24js.getConfig.call(void 0, workspaceRoot3);
|
|
1891
1895
|
}
|
|
1892
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1893
|
-
|
|
1896
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _109 => _109.hooks, 'optionalAccess', _110 => _110.applyDefaultOptions])) {
|
|
1897
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1894
1898
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
1895
|
-
|
|
1899
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1896
1900
|
}
|
|
1897
|
-
|
|
1901
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
1898
1902
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
1899
1903
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
1900
1904
|
workspaceRoot: tree.root,
|
|
1901
1905
|
config
|
|
1902
1906
|
}, applyWorkspaceBaseTokens);
|
|
1903
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1904
|
-
|
|
1907
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _111 => _111.hooks, 'optionalAccess', _112 => _112.preProcess])) {
|
|
1908
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1905
1909
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
1906
|
-
|
|
1910
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
1907
1911
|
}
|
|
1908
1912
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
1909
1913
|
if (result) {
|
|
1910
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1914
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _113 => _113.error, 'optionalAccess', _114 => _114.message]) && typeof _optionalChain([result, 'optionalAccess', _115 => _115.error, 'optionalAccess', _116 => _116.message]) === "string" && _optionalChain([result, 'optionalAccess', _117 => _117.error, 'optionalAccess', _118 => _118.name]) && typeof _optionalChain([result, 'optionalAccess', _119 => _119.error, 'optionalAccess', _120 => _120.name]) === "string") {
|
|
1911
1915
|
throw new Error(`The ${name} generator failed to run`, {
|
|
1912
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1916
|
+
cause: _optionalChain([result, 'optionalAccess', _121 => _121.error])
|
|
1913
1917
|
});
|
|
1914
1918
|
} else if (result.success && result.data) {
|
|
1915
1919
|
return result;
|
|
1916
1920
|
}
|
|
1917
1921
|
}
|
|
1918
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1919
|
-
|
|
1922
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _122 => _122.hooks, 'optionalAccess', _123 => _123.postProcess])) {
|
|
1923
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1920
1924
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1921
|
-
|
|
1925
|
+
_chunkHWJBDRIGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1922
1926
|
}
|
|
1923
1927
|
return () => {
|
|
1924
|
-
|
|
1928
|
+
_chunkHWJBDRIGjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1925
1929
|
`, config);
|
|
1926
1930
|
};
|
|
1927
1931
|
} catch (error) {
|
|
1928
1932
|
return () => {
|
|
1929
|
-
|
|
1930
|
-
|
|
1933
|
+
_chunkHWJBDRIGjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1934
|
+
_chunkHWJBDRIGjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
1931
1935
|
- Details: ${error.message}
|
|
1932
1936
|
- Stacktrace: ${error.stack}`, config);
|
|
1933
1937
|
};
|
|
@@ -1973,7 +1977,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1973
1977
|
const projectConfig = {
|
|
1974
1978
|
root: normalized.directory,
|
|
1975
1979
|
projectType: "library",
|
|
1976
|
-
sourceRoot:
|
|
1980
|
+
sourceRoot: _chunkHWJBDRIGjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
1977
1981
|
targets: {
|
|
1978
1982
|
build: {
|
|
1979
1983
|
executor: options.buildExecutor,
|
|
@@ -1982,11 +1986,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1982
1986
|
],
|
|
1983
1987
|
options: {
|
|
1984
1988
|
entry: [
|
|
1985
|
-
|
|
1989
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
1986
1990
|
],
|
|
1987
1991
|
outputPath: getOutputPath(normalized),
|
|
1988
|
-
tsconfig:
|
|
1989
|
-
project:
|
|
1992
|
+
tsconfig: _chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1993
|
+
project: _chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
1990
1994
|
defaultConfiguration: "production",
|
|
1991
1995
|
platform: "neutral",
|
|
1992
1996
|
assets: [
|
|
@@ -2025,22 +2029,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2025
2029
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2026
2030
|
let repository = {
|
|
2027
2031
|
type: "github",
|
|
2028
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2032
|
+
url: _optionalChain([config, 'optionalAccess', _124 => _124.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _125 => _125.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _126 => _126.namespace]) || _optionalChain([config, 'optionalAccess', _127 => _127.name]) || "repository"}.git`
|
|
2029
2033
|
};
|
|
2030
2034
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2031
2035
|
if (tree.exists("package.json")) {
|
|
2032
2036
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2033
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2037
|
+
if (_optionalChain([packageJson, 'optionalAccess', _128 => _128.repository])) {
|
|
2034
2038
|
repository = packageJson.repository;
|
|
2035
2039
|
}
|
|
2036
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2040
|
+
if (_optionalChain([packageJson, 'optionalAccess', _129 => _129.description])) {
|
|
2037
2041
|
description = packageJson.description;
|
|
2038
2042
|
}
|
|
2039
2043
|
}
|
|
2040
2044
|
if (!normalized.importPath) {
|
|
2041
2045
|
normalized.importPath = normalized.name;
|
|
2042
2046
|
}
|
|
2043
|
-
const packageJsonPath =
|
|
2047
|
+
const packageJsonPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2044
2048
|
if (tree.exists(packageJsonPath)) {
|
|
2045
2049
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2046
2050
|
if (!normalized.importPath) {
|
|
@@ -2088,30 +2092,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2088
2092
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2089
2093
|
...json,
|
|
2090
2094
|
pnpm: {
|
|
2091
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2095
|
+
..._optionalChain([json, 'optionalAccess', _130 => _130.pnpm]),
|
|
2092
2096
|
overrides: {
|
|
2093
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2097
|
+
..._optionalChain([json, 'optionalAccess', _131 => _131.pnpm, 'optionalAccess', _132 => _132.overrides]),
|
|
2094
2098
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2095
2099
|
}
|
|
2096
2100
|
}
|
|
2097
2101
|
}));
|
|
2098
2102
|
}
|
|
2099
2103
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2100
|
-
|
|
2104
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2101
2105
|
]);
|
|
2102
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2103
|
-
|
|
2106
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2107
|
+
_chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2104
2108
|
]);
|
|
2105
2109
|
if (tree.exists("package.json")) {
|
|
2106
2110
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2107
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2111
|
+
if (_optionalChain([packageJson, 'optionalAccess', _133 => _133.repository])) {
|
|
2108
2112
|
repository = packageJson.repository;
|
|
2109
2113
|
}
|
|
2110
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2114
|
+
if (_optionalChain([packageJson, 'optionalAccess', _134 => _134.description])) {
|
|
2111
2115
|
description = packageJson.description;
|
|
2112
2116
|
}
|
|
2113
2117
|
}
|
|
2114
|
-
const tsconfigPath =
|
|
2118
|
+
const tsconfigPath = _chunkHWJBDRIGjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2115
2119
|
if (tree.exists(tsconfigPath)) {
|
|
2116
2120
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2117
2121
|
json.composite ??= true;
|
|
@@ -2149,42 +2153,42 @@ function getOutputPath(options) {
|
|
|
2149
2153
|
} else {
|
|
2150
2154
|
parts.push(options.projectRoot);
|
|
2151
2155
|
}
|
|
2152
|
-
return
|
|
2156
|
+
return _chunkHWJBDRIGjs.joinPaths.call(void 0, ...parts);
|
|
2153
2157
|
}
|
|
2154
2158
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2155
2159
|
function createProjectTsConfigJson(tree, options) {
|
|
2156
2160
|
const tsconfig = {
|
|
2157
2161
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2158
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2162
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _135 => _135.tsconfigOptions]), () => ( {})),
|
|
2159
2163
|
compilerOptions: {
|
|
2160
2164
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2161
|
-
outDir:
|
|
2165
|
+
outDir: _chunkHWJBDRIGjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2162
2166
|
noEmit: true,
|
|
2163
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2167
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _136 => _136.tsconfigOptions, 'optionalAccess', _137 => _137.compilerOptions]), () => ( {}))
|
|
2164
2168
|
},
|
|
2165
2169
|
files: [
|
|
2166
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2170
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _138 => _138.tsconfigOptions, 'optionalAccess', _139 => _139.files]), () => ( []))
|
|
2167
2171
|
],
|
|
2168
2172
|
include: [
|
|
2169
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2173
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _140 => _140.tsconfigOptions, 'optionalAccess', _141 => _141.include]), () => ( [])),
|
|
2170
2174
|
"src/**/*.ts",
|
|
2171
2175
|
"src/**/*.js",
|
|
2172
2176
|
"bin/**/*"
|
|
2173
2177
|
],
|
|
2174
2178
|
exclude: [
|
|
2175
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2179
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _142 => _142.tsconfigOptions, 'optionalAccess', _143 => _143.exclude]), () => ( [])),
|
|
2176
2180
|
"jest.config.ts",
|
|
2177
2181
|
"src/**/*.spec.ts",
|
|
2178
2182
|
"src/**/*.test.ts"
|
|
2179
2183
|
]
|
|
2180
2184
|
};
|
|
2181
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2185
|
+
_devkit.writeJson.call(void 0, tree, _chunkHWJBDRIGjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2182
2186
|
}
|
|
2183
2187
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2184
2188
|
async function normalizeOptions(tree, options, config) {
|
|
2185
2189
|
let importPath = options.importPath;
|
|
2186
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2187
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
2190
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _144 => _144.namespace])) {
|
|
2191
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _145 => _145.namespace])}/${options.name}`;
|
|
2188
2192
|
}
|
|
2189
2193
|
if (options.publishable) {
|
|
2190
2194
|
if (!importPath) {
|
|
@@ -2238,7 +2242,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2238
2242
|
|
|
2239
2243
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2240
2244
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2241
|
-
const filesDir =
|
|
2245
|
+
const filesDir = _chunkHWJBDRIGjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2242
2246
|
const tsLibraryGeneratorOptions = {
|
|
2243
2247
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2244
2248
|
platform: "browser",
|
|
@@ -2310,19 +2314,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2310
2314
|
|
|
2311
2315
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2312
2316
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2317
|
+
_chunkHWJBDRIGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2318
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2319
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkHWJBDRIGjs.stormWorkspaceConfigSchema, {
|
|
2316
2320
|
name: "StormWorkspaceConfiguration"
|
|
2317
2321
|
});
|
|
2318
|
-
|
|
2319
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2320
|
-
|
|
2322
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2323
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _146 => _146.workspaceRoot]), () => ( _chunkHWJBDRIGjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _147 => _147.outputFile, 'optionalAccess', _148 => _148.startsWith, 'call', _149 => _149("./")]) ? "" : "./");
|
|
2324
|
+
_chunkHWJBDRIGjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2321
2325
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2322
2326
|
spaces: 2
|
|
2323
2327
|
});
|
|
2324
2328
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2325
|
-
|
|
2329
|
+
_chunkHWJBDRIGjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2326
2330
|
return {
|
|
2327
2331
|
success: true
|
|
2328
2332
|
};
|
|
@@ -2343,7 +2347,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
|
|
|
2343
2347
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2344
2348
|
|
|
2345
2349
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2346
|
-
const filesDir =
|
|
2350
|
+
const filesDir = _chunkHWJBDRIGjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2347
2351
|
const tsLibraryGeneratorOptions = {
|
|
2348
2352
|
...schema,
|
|
2349
2353
|
platform: "neutral",
|
|
@@ -2386,7 +2390,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2386
2390
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2387
2391
|
|
|
2388
2392
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2389
|
-
const filesDir =
|
|
2393
|
+
const filesDir = _chunkHWJBDRIGjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2390
2394
|
const tsLibraryGeneratorOptions = {
|
|
2391
2395
|
platform: "node",
|
|
2392
2396
|
devDependencies: {
|