@storm-software/cloudflare-tools 0.55.43 → 0.55.45
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 +15 -0
- package/README.md +1 -1
- package/dist/{chunk-MESLYSHV.mjs → chunk-2P5TGL2R.mjs} +18 -10
- package/dist/{chunk-MCQ4YOON.js → chunk-4P4IIN6G.js} +16 -16
- package/dist/{chunk-E22S7JBO.mjs → chunk-BDADKXEW.mjs} +17 -13
- package/dist/{chunk-6D3NUIUL.js → chunk-DZPVDJXE.js} +186 -182
- package/dist/{chunk-PW324BYD.js → chunk-P7YORNEH.js} +1 -1
- package/dist/{chunk-LEXIFHU6.mjs → chunk-PHH7TIFK.mjs} +1 -1
- package/dist/{chunk-S3S7EN37.mjs → chunk-QGY5FTZR.mjs} +3 -3
- package/dist/{chunk-FK6PN2T3.js → chunk-QQQD2SIN.js} +11 -3
- package/dist/{chunk-HF5FM2V2.js → chunk-S5NUDAJR.js} +3 -3
- package/dist/{chunk-Q67NQSCF.mjs → chunk-WGEGIRE6.mjs} +1 -1
- package/dist/{chunk-M4FHQYTZ.mjs → chunk-YBYGEO5L.mjs} +11 -3
- package/dist/{chunk-H2ML72QF.js → chunk-Z5XL2UL5.js} +56 -48
- package/dist/{chunk-247N3JYF.js → chunk-ZGZLK5XZ.js} +12 -12
- package/dist/{chunk-5QU7G4BP.mjs → chunk-ZTEXBI4T.mjs} +3 -3
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.d.mts +41 -7
- package/dist/src/executors/serve/executor.d.ts +41 -7
- 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 _chunkZ5XL2UL5js = require('./chunk-Z5XL2UL5.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 _chunkQQQD2SINjs = require('./chunk-QQQD2SIN.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]))), () => ( _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
117
117
|
if (!executorOptions.skipReadingConfig) {
|
|
118
|
-
|
|
118
|
+
_chunkQQQD2SINjs.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 _chunkZ5XL2UL5js.getConfig.call(void 0, workspaceRoot3);
|
|
125
125
|
}
|
|
126
126
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
127
|
-
|
|
127
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
128
128
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
129
|
-
|
|
129
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
${
|
|
131
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
132
|
+
${_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
142
|
+
${_chunkQQQD2SINjs.formatLogMessage.call(void 0, tokenized)}
|
|
143
143
|
`, config);
|
|
144
144
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
145
|
-
|
|
145
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
146
146
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
147
|
-
|
|
147
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
158
|
+
${_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
166
166
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
167
|
-
|
|
167
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
176
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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} -> ${_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkQQQD2SINjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
490
490
|
const files = await _glob.glob.call(void 0, [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
492
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
493
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
494
|
+
_chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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, _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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 : _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, );
|
|
568
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkQQQD2SINjs.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 ??= `${_chunkQQQD2SINjs.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 : _chunkQQQD2SINjs.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 || _chunkQQQD2SINjs.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(_chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.correctPaths.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkQQQD2SINjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkQQQD2SINjs.correctPaths.call(void 0, projectRoot), ""));
|
|
640
640
|
if (result) {
|
|
641
|
-
|
|
641
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkQQQD2SINjs.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,10 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
646
646
|
return ret;
|
|
647
647
|
}, []));
|
|
648
648
|
} else {
|
|
649
|
-
|
|
649
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `Trying to add entry point ${entryPoint}"`, config);
|
|
650
|
+
if (!paths.includes(entryPoint)) {
|
|
651
|
+
paths.push(entryPoint);
|
|
652
|
+
}
|
|
650
653
|
}
|
|
651
654
|
return paths;
|
|
652
655
|
}));
|
|
@@ -758,15 +761,15 @@ var RendererEngine = class {
|
|
|
758
761
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
759
762
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
760
763
|
}
|
|
761
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
764
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _52 => _52.outputs, 'access', _53 => _53[relativePath]]);
|
|
762
765
|
return {
|
|
763
766
|
type: "chunk",
|
|
764
767
|
path: file.path,
|
|
765
768
|
code: file.text,
|
|
766
|
-
map: _optionalChain([outputFiles, 'access',
|
|
767
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
768
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
769
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
769
|
+
map: _optionalChain([outputFiles, 'access', _54 => _54.find, 'call', _55 => _55((f) => f.path === `${file.path}.map`), 'optionalAccess', _56 => _56.text]),
|
|
770
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _57 => _57.entryPoint]),
|
|
771
|
+
exports: _optionalChain([meta, 'optionalAccess', _58 => _58.exports]),
|
|
772
|
+
imports: _optionalChain([meta, 'optionalAccess', _59 => _59.imports])
|
|
770
773
|
};
|
|
771
774
|
} else {
|
|
772
775
|
return {
|
|
@@ -849,7 +852,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
849
852
|
name: "storm:esm-split-code-to-cjs",
|
|
850
853
|
setup(build4) {
|
|
851
854
|
build4.onEnd(async (result) => {
|
|
852
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
855
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _60 => _60.metafile, 'optionalAccess', _61 => _61.outputs]), () => ( {})));
|
|
853
856
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
854
857
|
await esbuild.build({
|
|
855
858
|
outdir: resolvedOptions.outdir,
|
|
@@ -958,7 +961,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option
|
|
|
958
961
|
setup(build4) {
|
|
959
962
|
build4.onEnd((result) => {
|
|
960
963
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
961
|
-
|
|
964
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
962
965
|
${result.errors.map((error) => error.text).join("\n")}
|
|
963
966
|
|
|
964
967
|
`, resolvedOptions.config);
|
|
@@ -971,7 +974,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
971
974
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
972
975
|
|
|
973
976
|
function resolvePathsConfig(options, cwd) {
|
|
974
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
977
|
+
if (_optionalChain([options, 'optionalAccess', _62 => _62.compilerOptions, 'optionalAccess', _63 => _63.paths])) {
|
|
975
978
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
976
979
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
977
980
|
return [
|
|
@@ -993,13 +996,13 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
993
996
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
994
997
|
name: "storm:resolve-paths",
|
|
995
998
|
setup(build4) {
|
|
996
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
999
|
+
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
997
1000
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
998
1001
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
999
1002
|
build4.onResolve({
|
|
1000
1003
|
filter: packagesRegex
|
|
1001
1004
|
}, (args) => {
|
|
1002
|
-
if (_optionalChain([build4, 'access',
|
|
1005
|
+
if (_optionalChain([build4, 'access', _64 => _64.initialOptions, 'access', _65 => _65.external, 'optionalAccess', _66 => _66.includes, 'call', _67 => _67(args.path)])) {
|
|
1003
1006
|
return {
|
|
1004
1007
|
path: args.path,
|
|
1005
1008
|
external: true
|
|
@@ -1017,7 +1020,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
1017
1020
|
|
|
1018
1021
|
|
|
1019
1022
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1020
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1023
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1021
1024
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1022
1025
|
p,
|
|
1023
1026
|
getTypeDependencyPackageName(p)
|
|
@@ -1053,13 +1056,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1053
1056
|
},
|
|
1054
1057
|
dtsRollup: {
|
|
1055
1058
|
enabled: true,
|
|
1056
|
-
untrimmedFilePath:
|
|
1059
|
+
untrimmedFilePath: _chunkQQQD2SINjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1057
1060
|
},
|
|
1058
1061
|
tsdocMetadata: {
|
|
1059
1062
|
enabled: false
|
|
1060
1063
|
}
|
|
1061
1064
|
},
|
|
1062
|
-
packageJsonFullPath:
|
|
1065
|
+
packageJsonFullPath: _chunkQQQD2SINjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1063
1066
|
configObjectFullPath: void 0
|
|
1064
1067
|
});
|
|
1065
1068
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1067,7 +1070,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1067
1070
|
localBuild: true
|
|
1068
1071
|
});
|
|
1069
1072
|
if (extractorResult.succeeded === false) {
|
|
1070
|
-
|
|
1073
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1071
1074
|
throw new Error("API Extractor completed with errors");
|
|
1072
1075
|
}
|
|
1073
1076
|
}
|
|
@@ -1086,12 +1089,12 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1086
1089
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1087
1090
|
const typeOutDir = resolvedOptions.outdir;
|
|
1088
1091
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1089
|
-
const bundlePath =
|
|
1092
|
+
const bundlePath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1090
1093
|
let dtsPath;
|
|
1091
|
-
if (_fs.existsSync.call(void 0,
|
|
1092
|
-
dtsPath =
|
|
1093
|
-
} else if (_fs.existsSync.call(void 0,
|
|
1094
|
-
dtsPath =
|
|
1094
|
+
if (_fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1095
|
+
dtsPath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1096
|
+
} else if (_fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1097
|
+
dtsPath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1095
1098
|
}
|
|
1096
1099
|
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1097
1100
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1108,7 +1111,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1108
1111
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1109
1112
|
if (npmPackage.startsWith("@")) {
|
|
1110
1113
|
const [scope, name] = npmPackage.split("/");
|
|
1111
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1114
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _68 => _68.slice, 'call', _69 => _69(1)])}__${name}`;
|
|
1112
1115
|
}
|
|
1113
1116
|
return `@types/${npmPackage}`;
|
|
1114
1117
|
}
|
|
@@ -1255,8 +1258,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1255
1258
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1256
1259
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1257
1260
|
});
|
|
1258
|
-
|
|
1259
|
-
|
|
1261
|
+
_chunkQQQD2SINjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1262
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1260
1263
|
if (filteredMissingDeps.length > 0) {
|
|
1261
1264
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1262
1265
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1324,7 +1327,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1324
1327
|
return (...args) => {
|
|
1325
1328
|
let result = fn(...args);
|
|
1326
1329
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1327
|
-
result = _optionalChain([fns, 'access',
|
|
1330
|
+
result = _optionalChain([fns, 'access', _70 => _70[i], 'optionalCall', _71 => _71(result)]);
|
|
1328
1331
|
}
|
|
1329
1332
|
return result;
|
|
1330
1333
|
};
|
|
@@ -1334,7 +1337,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1334
1337
|
return async (...args) => {
|
|
1335
1338
|
let result = await fn(...args);
|
|
1336
1339
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1337
|
-
result = await _optionalChain([fns, 'access',
|
|
1340
|
+
result = await _optionalChain([fns, 'access', _72 => _72[i], 'optionalCall', _73 => _73(result)]);
|
|
1338
1341
|
}
|
|
1339
1342
|
return result;
|
|
1340
1343
|
};
|
|
@@ -1350,13 +1353,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1350
1353
|
if (!workspaceRoot3) {
|
|
1351
1354
|
throw new Error("Cannot find Nx workspace root");
|
|
1352
1355
|
}
|
|
1353
|
-
const config = await
|
|
1354
|
-
|
|
1355
|
-
const stopwatch =
|
|
1356
|
+
const config = await _chunkZ5XL2UL5js.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1357
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1358
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1356
1359
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1357
1360
|
exitOnError: true
|
|
1358
1361
|
});
|
|
1359
|
-
const projectJsonPath =
|
|
1362
|
+
const projectJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1360
1363
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1361
1364
|
throw new Error("Cannot find project.json configuration");
|
|
1362
1365
|
}
|
|
@@ -1364,13 +1367,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1364
1367
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1365
1368
|
const projectName = projectJson.name;
|
|
1366
1369
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1367
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1370
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _74 => _74.projects, 'optionalAccess', _75 => _75[projectName]])) {
|
|
1368
1371
|
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
1372
|
}
|
|
1370
1373
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1371
1374
|
options.name ??= `${projectName}-${options.format}`;
|
|
1372
1375
|
options.target ??= DEFAULT_TARGET;
|
|
1373
|
-
const packageJsonPath =
|
|
1376
|
+
const packageJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1374
1377
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1375
1378
|
throw new Error("Cannot find package.json configuration");
|
|
1376
1379
|
}
|
|
@@ -1387,24 +1390,23 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1387
1390
|
"main"
|
|
1388
1391
|
],
|
|
1389
1392
|
...userOptions,
|
|
1390
|
-
tsconfig:
|
|
1393
|
+
tsconfig: _chunkQQQD2SINjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1391
1394
|
format: options.format || "cjs",
|
|
1392
|
-
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")),
|
|
1393
|
-
outdir: userOptions.outputPath ||
|
|
1395
|
+
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), false),
|
|
1396
|
+
outdir: userOptions.outputPath || _chunkQQQD2SINjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1394
1397
|
distDir: userOptions.distDir || "dist",
|
|
1395
1398
|
plugins: [],
|
|
1396
1399
|
name: userOptions.name || projectName,
|
|
1397
1400
|
projectConfigurations,
|
|
1398
1401
|
projectName,
|
|
1399
1402
|
projectGraph,
|
|
1400
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1403
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkQQQD2SINjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1401
1404
|
minify: userOptions.minify || !userOptions.debug,
|
|
1402
|
-
verbose: userOptions.verbose ||
|
|
1405
|
+
verbose: userOptions.verbose || _chunkQQQD2SINjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1403
1406
|
includeSrc: userOptions.includeSrc === true,
|
|
1404
1407
|
metafile: userOptions.metafile !== false,
|
|
1405
1408
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1406
1409
|
clean: userOptions.clean !== false,
|
|
1407
|
-
emitOnAll: userOptions.emitOnAll === true,
|
|
1408
1410
|
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1409
1411
|
injectShims: userOptions.injectShims !== true,
|
|
1410
1412
|
bundle: userOptions.bundle !== false,
|
|
@@ -1435,8 +1437,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1435
1437
|
}, {})
|
|
1436
1438
|
},
|
|
1437
1439
|
inject: [
|
|
1438
|
-
options.format === "cjs" && options.injectShims ?
|
|
1439
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1440
|
+
options.format === "cjs" && options.injectShims ? _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1441
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1440
1442
|
].filter(Boolean)
|
|
1441
1443
|
};
|
|
1442
1444
|
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
@@ -1454,14 +1456,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1454
1456
|
return result;
|
|
1455
1457
|
}, "resolveOptions");
|
|
1456
1458
|
async function generatePackageJson(context2) {
|
|
1457
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1458
|
-
|
|
1459
|
-
const stopwatch =
|
|
1460
|
-
const packageJsonPath =
|
|
1459
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1460
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1461
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1462
|
+
const packageJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1461
1463
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1462
1464
|
throw new Error("Cannot find package.json configuration");
|
|
1463
1465
|
}
|
|
1464
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1466
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1465
1467
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1466
1468
|
if (!packageJson) {
|
|
1467
1469
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1481,7 +1483,7 @@ async function generatePackageJson(context2) {
|
|
|
1481
1483
|
if (Array.isArray(context2.options.entryPoints)) {
|
|
1482
1484
|
entryPoints = context2.options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
|
|
1483
1485
|
in: entryPoint,
|
|
1484
|
-
out: entryPoint
|
|
1486
|
+
out: _chunkQQQD2SINjs.correctPaths.call(void 0, entryPoint.replaceAll(_chunkQQQD2SINjs.correctPaths.call(void 0, context2.options.config.workspaceRoot), "").replaceAll(_chunkQQQD2SINjs.correctPaths.call(void 0, context2.options.projectRoot), ""))
|
|
1485
1487
|
} : entryPoint);
|
|
1486
1488
|
}
|
|
1487
1489
|
for (const entryPoint of entryPoints) {
|
|
@@ -1503,7 +1505,7 @@ async function generatePackageJson(context2) {
|
|
|
1503
1505
|
}
|
|
1504
1506
|
return ret;
|
|
1505
1507
|
}, packageJson.exports);
|
|
1506
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1508
|
+
await _devkit.writeJsonFile.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1507
1509
|
stopwatch();
|
|
1508
1510
|
}
|
|
1509
1511
|
return context2;
|
|
@@ -1529,8 +1531,8 @@ async function generateContext(getOptions) {
|
|
|
1529
1531
|
}
|
|
1530
1532
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1531
1533
|
async function executeEsBuild(context2) {
|
|
1532
|
-
|
|
1533
|
-
const stopwatch =
|
|
1534
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1535
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1534
1536
|
if (process.env.STORM_WATCH) {
|
|
1535
1537
|
const ctx = await esbuild2.context(context2.options);
|
|
1536
1538
|
watch(ctx, context2.options);
|
|
@@ -1538,7 +1540,7 @@ async function executeEsBuild(context2) {
|
|
|
1538
1540
|
const options = {
|
|
1539
1541
|
...context2.options
|
|
1540
1542
|
};
|
|
1541
|
-
options.outdir =
|
|
1543
|
+
options.outdir = _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1542
1544
|
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
1545
|
options.inject === {}) {
|
|
1544
1546
|
delete options.inject;
|
|
@@ -1552,7 +1554,6 @@ async function executeEsBuild(context2) {
|
|
|
1552
1554
|
delete options.clean;
|
|
1553
1555
|
delete options.debug;
|
|
1554
1556
|
delete options.generatePackageJson;
|
|
1555
|
-
delete options.emitOnAll;
|
|
1556
1557
|
delete options.distDir;
|
|
1557
1558
|
delete options.includeSrc;
|
|
1558
1559
|
delete options.verbose;
|
|
@@ -1564,8 +1565,11 @@ async function executeEsBuild(context2) {
|
|
|
1564
1565
|
delete options.config;
|
|
1565
1566
|
delete options.injectShims;
|
|
1566
1567
|
delete options.external;
|
|
1567
|
-
|
|
1568
|
-
${
|
|
1568
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1569
|
+
${_chunkQQQD2SINjs.formatLogMessage.call(void 0, {
|
|
1570
|
+
...options,
|
|
1571
|
+
define: "<Hidden>"
|
|
1572
|
+
})}`, 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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1586
|
+
const stopwatch = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1635
|
+
const stopwatch = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1644
|
+
const stopwatch = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1651
1655
|
} catch (error) {
|
|
1652
|
-
|
|
1656
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeError.call(void 0, rebuildResult.message);
|
|
1681
1685
|
}
|
|
1682
|
-
|
|
1686
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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 : _chunkQQQD2SINjs.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 : _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.getStopwatch.call(void 0, name);
|
|
1880
1884
|
let options = _options;
|
|
1881
1885
|
let config;
|
|
1882
1886
|
try {
|
|
1883
|
-
|
|
1887
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1884
1888
|
|
|
1885
1889
|
`, config);
|
|
1886
|
-
const workspaceRoot3 =
|
|
1890
|
+
const workspaceRoot3 = _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, );
|
|
1887
1891
|
if (!generatorOptions.skipReadingConfig) {
|
|
1888
|
-
|
|
1892
|
+
_chunkQQQD2SINjs.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 _chunkZ5XL2UL5js.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1894
1898
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
1895
|
-
|
|
1899
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1896
1900
|
}
|
|
1897
|
-
|
|
1901
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1905
1909
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
1906
|
-
|
|
1910
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1920
1924
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1921
|
-
|
|
1925
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1922
1926
|
}
|
|
1923
1927
|
return () => {
|
|
1924
|
-
|
|
1928
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1925
1929
|
`, config);
|
|
1926
1930
|
};
|
|
1927
1931
|
} catch (error) {
|
|
1928
1932
|
return () => {
|
|
1929
|
-
|
|
1930
|
-
|
|
1933
|
+
_chunkQQQD2SINjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1934
|
+
_chunkQQQD2SINjs.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: _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
1986
1990
|
],
|
|
1987
1991
|
outputPath: getOutputPath(normalized),
|
|
1988
|
-
tsconfig:
|
|
1989
|
-
project:
|
|
1992
|
+
tsconfig: _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1993
|
+
project: _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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, _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2107
|
+
_chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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 _chunkQQQD2SINjs.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: _chunkQQQD2SINjs.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, _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2318
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2319
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkQQQD2SINjs.stormWorkspaceConfigSchema, {
|
|
2316
2320
|
name: "StormWorkspaceConfiguration"
|
|
2317
2321
|
});
|
|
2318
|
-
|
|
2319
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2320
|
-
|
|
2322
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2323
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _146 => _146.workspaceRoot]), () => ( _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _147 => _147.outputFile, 'optionalAccess', _148 => _148.startsWith, 'call', _149 => _149("./")]) ? "" : "./");
|
|
2324
|
+
_chunkQQQD2SINjs.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
|
+
_chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.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 = _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2390
2394
|
const tsLibraryGeneratorOptions = {
|
|
2391
2395
|
platform: "node",
|
|
2392
2396
|
devDependencies: {
|