@storm-software/cloudflare-tools 0.55.44 → 0.55.46
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 +14 -0
- package/README.md +1 -1
- package/dist/{chunk-75BWJSFW.mjs → chunk-2P5TGL2R.mjs} +10 -2
- package/dist/{chunk-FVMS7RMT.mjs → chunk-37HC2CC6.mjs} +3 -3
- package/dist/{chunk-MIKH2FI5.mjs → chunk-7JTISIUD.mjs} +1 -1
- package/dist/{chunk-CAC2PNUJ.js → chunk-CWBI7ZQ2.js} +16 -16
- package/dist/{chunk-JUJW77CM.js → chunk-FUMCGABO.js} +12 -12
- package/dist/{chunk-ISO7UOVA.js → chunk-GZJSLTK4.js} +247 -226
- package/dist/{chunk-LY3NUGLI.mjs → chunk-HD246TI3.mjs} +88 -67
- package/dist/{chunk-TTDB2VCO.mjs → chunk-PHH7TIFK.mjs} +1 -1
- package/dist/{chunk-HWJBDRIG.js → chunk-QQQD2SIN.js} +9 -1
- package/dist/{chunk-AXF5C7QR.js → chunk-S5NUDAJR.js} +3 -3
- package/dist/{chunk-STUGKRS5.mjs → chunk-WTERMAUR.mjs} +3 -3
- package/dist/{chunk-R2SQ6ZOK.mjs → chunk-YBYGEO5L.mjs} +9 -1
- package/dist/{chunk-TDNPRL4Y.js → chunk-Z3WJNLJW.js} +1 -1
- package/dist/{chunk-R32N7B24.js → chunk-Z5XL2UL5.js} +50 -42
- 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 +20 -2
- package/dist/src/executors/serve/executor.d.ts +20 -2
- 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 _chunkR32N7B24js = require('./chunk-R32N7B24.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 @@ ${_chunkHWJBDRIGjs.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 @@ ${_chunkHWJBDRIGjs.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);
|
|
@@ -559,13 +559,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
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,64 +605,12 @@ 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
|
-
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
615
|
-
const workspaceRoot3 = config.workspaceRoot || _chunkHWJBDRIGjs.findWorkspaceRoot.call(void 0, );
|
|
616
|
-
const entryPoints = [];
|
|
617
|
-
if (entry) {
|
|
618
|
-
if (typeof entry === "string") {
|
|
619
|
-
entryPoints.push(entry);
|
|
620
|
-
} else if (Array.isArray(entry)) {
|
|
621
|
-
entryPoints.push(...entry);
|
|
622
|
-
} else {
|
|
623
|
-
entryPoints.push(...Object.values(entry));
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
if (emitOnAll) {
|
|
627
|
-
entryPoints.push(_chunkHWJBDRIGjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
628
|
-
}
|
|
629
|
-
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
630
|
-
const paths = [];
|
|
631
|
-
if (entryPoint.includes("*")) {
|
|
632
|
-
const files = await _glob.glob.call(void 0, entryPoint, {
|
|
633
|
-
withFileTypes: true,
|
|
634
|
-
ignore: [
|
|
635
|
-
"**/node_modules/**"
|
|
636
|
-
]
|
|
637
|
-
});
|
|
638
|
-
paths.push(...files.reduce((ret, filePath) => {
|
|
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
|
-
if (result) {
|
|
641
|
-
_chunkHWJBDRIGjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkHWJBDRIGjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
642
|
-
if (!paths.includes(result)) {
|
|
643
|
-
paths.push(result);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
return ret;
|
|
647
|
-
}, []));
|
|
648
|
-
} else {
|
|
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
|
-
}
|
|
654
|
-
}
|
|
655
|
-
return paths;
|
|
656
|
-
}));
|
|
657
|
-
return results.filter(Boolean).reduce((ret, result) => {
|
|
658
|
-
result.forEach((res) => {
|
|
659
|
-
if (res && !ret.includes(res)) {
|
|
660
|
-
ret.push(res);
|
|
661
|
-
}
|
|
662
|
-
});
|
|
663
|
-
return ret;
|
|
664
|
-
}, []);
|
|
665
|
-
}, "getEntryPoints");
|
|
666
614
|
|
|
667
615
|
// ../build-tools/src/utilities/get-env.ts
|
|
668
616
|
var getEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (builder, options) => {
|
|
@@ -962,7 +910,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option
|
|
|
962
910
|
setup(build4) {
|
|
963
911
|
build4.onEnd((result) => {
|
|
964
912
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
965
|
-
|
|
913
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
966
914
|
${result.errors.map((error) => error.text).join("\n")}
|
|
967
915
|
|
|
968
916
|
`, resolvedOptions.config);
|
|
@@ -997,7 +945,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
997
945
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
998
946
|
name: "storm:resolve-paths",
|
|
999
947
|
setup(build4) {
|
|
1000
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
948
|
+
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"));
|
|
1001
949
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
1002
950
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
1003
951
|
build4.onResolve({
|
|
@@ -1021,7 +969,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
1021
969
|
|
|
1022
970
|
|
|
1023
971
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1024
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
972
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1025
973
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1026
974
|
p,
|
|
1027
975
|
getTypeDependencyPackageName(p)
|
|
@@ -1057,13 +1005,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1057
1005
|
},
|
|
1058
1006
|
dtsRollup: {
|
|
1059
1007
|
enabled: true,
|
|
1060
|
-
untrimmedFilePath:
|
|
1008
|
+
untrimmedFilePath: _chunkQQQD2SINjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1061
1009
|
},
|
|
1062
1010
|
tsdocMetadata: {
|
|
1063
1011
|
enabled: false
|
|
1064
1012
|
}
|
|
1065
1013
|
},
|
|
1066
|
-
packageJsonFullPath:
|
|
1014
|
+
packageJsonFullPath: _chunkQQQD2SINjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1067
1015
|
configObjectFullPath: void 0
|
|
1068
1016
|
});
|
|
1069
1017
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1071,7 +1019,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1071
1019
|
localBuild: true
|
|
1072
1020
|
});
|
|
1073
1021
|
if (extractorResult.succeeded === false) {
|
|
1074
|
-
|
|
1022
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1075
1023
|
throw new Error("API Extractor completed with errors");
|
|
1076
1024
|
}
|
|
1077
1025
|
}
|
|
@@ -1086,16 +1034,16 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1086
1034
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1087
1035
|
await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
1088
1036
|
}
|
|
1089
|
-
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && resolvedOptions.entryPoints[0] && resolvedOptions.entryPoints[0].endsWith(".ts")) {
|
|
1037
|
+
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && _optionalChain([resolvedOptions, 'access', _68 => _68.entryPoints, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.in]) && resolvedOptions.entryPoints[0].in.endsWith(".ts")) {
|
|
1090
1038
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1091
1039
|
const typeOutDir = resolvedOptions.outdir;
|
|
1092
|
-
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1093
|
-
const bundlePath =
|
|
1040
|
+
const entryPoint = resolvedOptions.entryPoints[0].in.replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1041
|
+
const bundlePath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1094
1042
|
let dtsPath;
|
|
1095
|
-
if (_fs.existsSync.call(void 0,
|
|
1096
|
-
dtsPath =
|
|
1097
|
-
} else if (_fs.existsSync.call(void 0,
|
|
1098
|
-
dtsPath =
|
|
1043
|
+
if (_fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1044
|
+
dtsPath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1045
|
+
} else if (_fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1046
|
+
dtsPath = _chunkQQQD2SINjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1099
1047
|
}
|
|
1100
1048
|
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1101
1049
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1112,7 +1060,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1112
1060
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1113
1061
|
if (npmPackage.startsWith("@")) {
|
|
1114
1062
|
const [scope, name] = npmPackage.split("/");
|
|
1115
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1063
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _71 => _71.slice, 'call', _72 => _72(1)])}__${name}`;
|
|
1116
1064
|
}
|
|
1117
1065
|
return `@types/${npmPackage}`;
|
|
1118
1066
|
}
|
|
@@ -1259,8 +1207,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1259
1207
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1260
1208
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1261
1209
|
});
|
|
1262
|
-
|
|
1263
|
-
|
|
1210
|
+
_chunkQQQD2SINjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1211
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1264
1212
|
if (filteredMissingDeps.length > 0) {
|
|
1265
1213
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1266
1214
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1280,6 +1228,84 @@ var shebangRenderer = {
|
|
|
1280
1228
|
}
|
|
1281
1229
|
};
|
|
1282
1230
|
|
|
1231
|
+
// ../esbuild/src/utilities/get-entry-points.ts
|
|
1232
|
+
|
|
1233
|
+
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
1234
|
+
const workspaceRoot3 = config.workspaceRoot || _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, );
|
|
1235
|
+
const entryPoints = [];
|
|
1236
|
+
if (entry) {
|
|
1237
|
+
if (typeof entry === "string") {
|
|
1238
|
+
entryPoints.push({
|
|
1239
|
+
in: entry,
|
|
1240
|
+
out: entry
|
|
1241
|
+
});
|
|
1242
|
+
} else if (Array.isArray(entry)) {
|
|
1243
|
+
entryPoints.push(...entry.map((entry2) => ({
|
|
1244
|
+
in: entry2,
|
|
1245
|
+
out: entry2
|
|
1246
|
+
})));
|
|
1247
|
+
} else {
|
|
1248
|
+
entryPoints.push(...Object.entries(entry).map(([key, value]) => {
|
|
1249
|
+
if (typeof value === "string") {
|
|
1250
|
+
return {
|
|
1251
|
+
in: key,
|
|
1252
|
+
out: value
|
|
1253
|
+
};
|
|
1254
|
+
} else {
|
|
1255
|
+
return {
|
|
1256
|
+
in: key,
|
|
1257
|
+
out: key
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
}));
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
if (emitOnAll) {
|
|
1264
|
+
entryPoints.push({
|
|
1265
|
+
in: _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"),
|
|
1266
|
+
out: _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}")
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
1270
|
+
const paths = [];
|
|
1271
|
+
if (entryPoint.in.includes("*")) {
|
|
1272
|
+
const files = await _glob.glob.call(void 0, entryPoint.in, {
|
|
1273
|
+
withFileTypes: true,
|
|
1274
|
+
ignore: [
|
|
1275
|
+
"**/node_modules/**"
|
|
1276
|
+
]
|
|
1277
|
+
});
|
|
1278
|
+
paths.push(...files.reduce((ret, filePath) => {
|
|
1279
|
+
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), ""));
|
|
1280
|
+
if (result) {
|
|
1281
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkQQQD2SINjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
1282
|
+
if (!paths.some((p) => p.in === result)) {
|
|
1283
|
+
paths.push({
|
|
1284
|
+
in: result,
|
|
1285
|
+
out: entryPoint.out.replace(entryPoint.in, result)
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
return ret;
|
|
1290
|
+
}, []));
|
|
1291
|
+
} else {
|
|
1292
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `Trying to add entry point ${entryPoint}"`, config);
|
|
1293
|
+
if (!paths.some((p) => p.in === entryPoint.in)) {
|
|
1294
|
+
paths.push(entryPoint);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
return paths;
|
|
1298
|
+
}));
|
|
1299
|
+
return results.filter(Boolean).reduce((ret, result) => {
|
|
1300
|
+
result.forEach((res) => {
|
|
1301
|
+
if (res && !ret.some((p) => p.in === res.in)) {
|
|
1302
|
+
ret.push(res);
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
return ret;
|
|
1306
|
+
}, []);
|
|
1307
|
+
}, "getEntryPoints");
|
|
1308
|
+
|
|
1283
1309
|
// ../esbuild/src/utilities/helpers.ts
|
|
1284
1310
|
function handleSync(fn) {
|
|
1285
1311
|
try {
|
|
@@ -1328,7 +1354,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1328
1354
|
return (...args) => {
|
|
1329
1355
|
let result = fn(...args);
|
|
1330
1356
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1331
|
-
result = _optionalChain([fns, 'access',
|
|
1357
|
+
result = _optionalChain([fns, 'access', _73 => _73[i], 'optionalCall', _74 => _74(result)]);
|
|
1332
1358
|
}
|
|
1333
1359
|
return result;
|
|
1334
1360
|
};
|
|
@@ -1338,7 +1364,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1338
1364
|
return async (...args) => {
|
|
1339
1365
|
let result = await fn(...args);
|
|
1340
1366
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1341
|
-
result = await _optionalChain([fns, 'access',
|
|
1367
|
+
result = await _optionalChain([fns, 'access', _75 => _75[i], 'optionalCall', _76 => _76(result)]);
|
|
1342
1368
|
}
|
|
1343
1369
|
return result;
|
|
1344
1370
|
};
|
|
@@ -1354,13 +1380,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1354
1380
|
if (!workspaceRoot3) {
|
|
1355
1381
|
throw new Error("Cannot find Nx workspace root");
|
|
1356
1382
|
}
|
|
1357
|
-
const config = await
|
|
1358
|
-
|
|
1359
|
-
const stopwatch =
|
|
1383
|
+
const config = await _chunkZ5XL2UL5js.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1384
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1385
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1360
1386
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1361
1387
|
exitOnError: true
|
|
1362
1388
|
});
|
|
1363
|
-
const projectJsonPath =
|
|
1389
|
+
const projectJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1364
1390
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1365
1391
|
throw new Error("Cannot find project.json configuration");
|
|
1366
1392
|
}
|
|
@@ -1368,13 +1394,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1368
1394
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1369
1395
|
const projectName = projectJson.name;
|
|
1370
1396
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1371
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1397
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _77 => _77.projects, 'optionalAccess', _78 => _78[projectName]])) {
|
|
1372
1398
|
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.");
|
|
1373
1399
|
}
|
|
1374
1400
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1375
1401
|
options.name ??= `${projectName}-${options.format}`;
|
|
1376
1402
|
options.target ??= DEFAULT_TARGET;
|
|
1377
|
-
const packageJsonPath =
|
|
1403
|
+
const packageJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1378
1404
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1379
1405
|
throw new Error("Cannot find package.json configuration");
|
|
1380
1406
|
}
|
|
@@ -1391,24 +1417,23 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1391
1417
|
"main"
|
|
1392
1418
|
],
|
|
1393
1419
|
...userOptions,
|
|
1394
|
-
tsconfig:
|
|
1420
|
+
tsconfig: _chunkQQQD2SINjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1395
1421
|
format: options.format || "cjs",
|
|
1396
|
-
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")),
|
|
1397
|
-
outdir: userOptions.outputPath ||
|
|
1422
|
+
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), false),
|
|
1423
|
+
outdir: userOptions.outputPath || _chunkQQQD2SINjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1398
1424
|
distDir: userOptions.distDir || "dist",
|
|
1399
1425
|
plugins: [],
|
|
1400
1426
|
name: userOptions.name || projectName,
|
|
1401
1427
|
projectConfigurations,
|
|
1402
1428
|
projectName,
|
|
1403
1429
|
projectGraph,
|
|
1404
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1430
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkQQQD2SINjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1405
1431
|
minify: userOptions.minify || !userOptions.debug,
|
|
1406
|
-
verbose: userOptions.verbose ||
|
|
1432
|
+
verbose: userOptions.verbose || _chunkQQQD2SINjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1407
1433
|
includeSrc: userOptions.includeSrc === true,
|
|
1408
1434
|
metafile: userOptions.metafile !== false,
|
|
1409
1435
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1410
1436
|
clean: userOptions.clean !== false,
|
|
1411
|
-
emitOnAll: userOptions.emitOnAll === true,
|
|
1412
1437
|
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1413
1438
|
injectShims: userOptions.injectShims !== true,
|
|
1414
1439
|
bundle: userOptions.bundle !== false,
|
|
@@ -1439,8 +1464,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1439
1464
|
}, {})
|
|
1440
1465
|
},
|
|
1441
1466
|
inject: [
|
|
1442
|
-
options.format === "cjs" && options.injectShims ?
|
|
1443
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1467
|
+
options.format === "cjs" && options.injectShims ? _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1468
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1444
1469
|
].filter(Boolean)
|
|
1445
1470
|
};
|
|
1446
1471
|
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
@@ -1458,14 +1483,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1458
1483
|
return result;
|
|
1459
1484
|
}, "resolveOptions");
|
|
1460
1485
|
async function generatePackageJson(context2) {
|
|
1461
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1462
|
-
|
|
1463
|
-
const stopwatch =
|
|
1464
|
-
const packageJsonPath =
|
|
1486
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1487
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1488
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1489
|
+
const packageJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1465
1490
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1466
1491
|
throw new Error("Cannot find package.json configuration");
|
|
1467
1492
|
}
|
|
1468
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1493
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1469
1494
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1470
1495
|
if (!packageJson) {
|
|
1471
1496
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1475,19 +1500,13 @@ async function generatePackageJson(context2) {
|
|
|
1475
1500
|
packageJson.exports ??= {};
|
|
1476
1501
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
1477
1502
|
packageJson.exports["."] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js`;
|
|
1478
|
-
|
|
1503
|
+
const entryPoints = [
|
|
1479
1504
|
{
|
|
1480
1505
|
in: "./src/index.ts",
|
|
1481
1506
|
out: "./src/index.ts"
|
|
1482
1507
|
}
|
|
1483
1508
|
];
|
|
1484
1509
|
if (context2.options.entryPoints) {
|
|
1485
|
-
if (Array.isArray(context2.options.entryPoints)) {
|
|
1486
|
-
entryPoints = context2.options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
|
|
1487
|
-
in: entryPoint,
|
|
1488
|
-
out: entryPoint
|
|
1489
|
-
} : entryPoint);
|
|
1490
|
-
}
|
|
1491
1510
|
for (const entryPoint of entryPoints) {
|
|
1492
1511
|
const split = entryPoint.out.split(".");
|
|
1493
1512
|
split.pop();
|
|
@@ -1507,7 +1526,7 @@ async function generatePackageJson(context2) {
|
|
|
1507
1526
|
}
|
|
1508
1527
|
return ret;
|
|
1509
1528
|
}, packageJson.exports);
|
|
1510
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1529
|
+
await _devkit.writeJsonFile.call(void 0, _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1511
1530
|
stopwatch();
|
|
1512
1531
|
}
|
|
1513
1532
|
return context2;
|
|
@@ -1533,8 +1552,8 @@ async function generateContext(getOptions) {
|
|
|
1533
1552
|
}
|
|
1534
1553
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1535
1554
|
async function executeEsBuild(context2) {
|
|
1536
|
-
|
|
1537
|
-
const stopwatch =
|
|
1555
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1556
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1538
1557
|
if (process.env.STORM_WATCH) {
|
|
1539
1558
|
const ctx = await esbuild2.context(context2.options);
|
|
1540
1559
|
watch(ctx, context2.options);
|
|
@@ -1542,7 +1561,7 @@ async function executeEsBuild(context2) {
|
|
|
1542
1561
|
const options = {
|
|
1543
1562
|
...context2.options
|
|
1544
1563
|
};
|
|
1545
|
-
options.outdir =
|
|
1564
|
+
options.outdir = _chunkQQQD2SINjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1546
1565
|
if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
|
|
1547
1566
|
options.inject === {}) {
|
|
1548
1567
|
delete options.inject;
|
|
@@ -1556,7 +1575,6 @@ async function executeEsBuild(context2) {
|
|
|
1556
1575
|
delete options.clean;
|
|
1557
1576
|
delete options.debug;
|
|
1558
1577
|
delete options.generatePackageJson;
|
|
1559
|
-
delete options.emitOnAll;
|
|
1560
1578
|
delete options.distDir;
|
|
1561
1579
|
delete options.includeSrc;
|
|
1562
1580
|
delete options.verbose;
|
|
@@ -1568,8 +1586,11 @@ async function executeEsBuild(context2) {
|
|
|
1568
1586
|
delete options.config;
|
|
1569
1587
|
delete options.injectShims;
|
|
1570
1588
|
delete options.external;
|
|
1571
|
-
|
|
1572
|
-
${
|
|
1589
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1590
|
+
${_chunkQQQD2SINjs.formatLogMessage.call(void 0, {
|
|
1591
|
+
...options,
|
|
1592
|
+
define: "<Hidden>"
|
|
1593
|
+
})}`, context2.options.config);
|
|
1573
1594
|
const result = await esbuild2.build(options);
|
|
1574
1595
|
await esbuild2.stop();
|
|
1575
1596
|
if (result.metafile) {
|
|
@@ -1581,9 +1602,9 @@ ${_chunkHWJBDRIGjs.formatLogMessage.call(void 0, options)}`, context2.options.co
|
|
|
1581
1602
|
}
|
|
1582
1603
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1583
1604
|
async function copyBuildAssets(context2) {
|
|
1584
|
-
if (_optionalChain([context2, 'access',
|
|
1585
|
-
|
|
1586
|
-
const stopwatch =
|
|
1605
|
+
if (_optionalChain([context2, 'access', _79 => _79.result, 'optionalAccess', _80 => _80.errors, 'access', _81 => _81.length]) === 0) {
|
|
1606
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1607
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1587
1608
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1588
1609
|
stopwatch();
|
|
1589
1610
|
}
|
|
@@ -1591,11 +1612,11 @@ async function copyBuildAssets(context2) {
|
|
|
1591
1612
|
}
|
|
1592
1613
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1593
1614
|
async function reportResults(context2) {
|
|
1594
|
-
if (_optionalChain([context2, 'access',
|
|
1615
|
+
if (_optionalChain([context2, 'access', _82 => _82.result, 'optionalAccess', _83 => _83.errors, 'access', _84 => _84.length]) === 0) {
|
|
1595
1616
|
if (context2.result.warnings.length > 0) {
|
|
1596
|
-
|
|
1617
|
+
_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);
|
|
1597
1618
|
}
|
|
1598
|
-
|
|
1619
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1599
1620
|
}
|
|
1600
1621
|
}
|
|
1601
1622
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1631,8 +1652,8 @@ async function dependencyCheck(options) {
|
|
|
1631
1652
|
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1632
1653
|
async function cleanOutputPath(context2) {
|
|
1633
1654
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
1634
|
-
|
|
1635
|
-
const stopwatch =
|
|
1655
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1656
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
|
|
1636
1657
|
await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
|
|
1637
1658
|
stopwatch();
|
|
1638
1659
|
}
|
|
@@ -1640,8 +1661,8 @@ async function cleanOutputPath(context2) {
|
|
|
1640
1661
|
}
|
|
1641
1662
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1642
1663
|
async function build3(options) {
|
|
1643
|
-
|
|
1644
|
-
const stopwatch =
|
|
1664
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1665
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1645
1666
|
try {
|
|
1646
1667
|
const opts = Array.isArray(options) ? options : [
|
|
1647
1668
|
options
|
|
@@ -1651,9 +1672,9 @@ async function build3(options) {
|
|
|
1651
1672
|
}
|
|
1652
1673
|
void transduce.async(opts, dependencyCheck);
|
|
1653
1674
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1654
|
-
|
|
1675
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1655
1676
|
} catch (error) {
|
|
1656
|
-
|
|
1677
|
+
_chunkQQQD2SINjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1657
1678
|
throw error;
|
|
1658
1679
|
} finally {
|
|
1659
1680
|
stopwatch();
|
|
@@ -1681,9 +1702,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1681
1702
|
return context2.rebuild();
|
|
1682
1703
|
});
|
|
1683
1704
|
if (rebuildResult instanceof Error) {
|
|
1684
|
-
|
|
1705
|
+
_chunkQQQD2SINjs.writeError.call(void 0, rebuildResult.message);
|
|
1685
1706
|
}
|
|
1686
|
-
|
|
1707
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1687
1708
|
}, 10);
|
|
1688
1709
|
changeWatcher.on("change", fastRebuild);
|
|
1689
1710
|
return void 0;
|
|
@@ -1691,15 +1712,15 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1691
1712
|
|
|
1692
1713
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1693
1714
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1694
|
-
|
|
1695
|
-
if (!_optionalChain([context2, 'access',
|
|
1715
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1716
|
+
if (!_optionalChain([context2, 'access', _85 => _85.projectsConfigurations, 'optionalAccess', _86 => _86.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'access', _88 => _88.projects, 'access', _89 => _89[context2.projectName], 'optionalAccess', _90 => _90.root])) {
|
|
1696
1717
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1697
1718
|
}
|
|
1698
1719
|
await build3({
|
|
1699
1720
|
...options,
|
|
1700
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1721
|
+
projectRoot: _optionalChain([context2, 'access', _91 => _91.projectsConfigurations, 'access', _92 => _92.projects, 'optionalAccess', _93 => _93[context2.projectName], 'access', _94 => _94.root]),
|
|
1701
1722
|
projectName: context2.projectName,
|
|
1702
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1723
|
+
sourceRoot: _optionalChain([context2, 'access', _95 => _95.projectsConfigurations, 'access', _96 => _96.projects, 'optionalAccess', _97 => _97[context2.projectName], 'optionalAccess', _98 => _98.sourceRoot]),
|
|
1703
1724
|
format: options.format,
|
|
1704
1725
|
platform: options.format
|
|
1705
1726
|
});
|
|
@@ -1742,18 +1763,18 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1742
1763
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1743
1764
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1744
1765
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1745
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1766
|
+
if (!_optionalChain([context2, 'optionalAccess', _99 => _99.projectName]) || !_optionalChain([context2, 'access', _100 => _100.projectsConfigurations, 'optionalAccess', _101 => _101.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1746
1767
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1747
1768
|
}
|
|
1748
|
-
|
|
1769
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1749
1770
|
_sizelimit2.default.call(void 0, [
|
|
1750
1771
|
_file2.default,
|
|
1751
1772
|
_esbuild3.default,
|
|
1752
1773
|
_esbuildwhy2.default
|
|
1753
1774
|
], {
|
|
1754
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1775
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'access', _104 => _104[context2.projectName], 'optionalAccess', _105 => _105.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'access', _107 => _107.projects, 'access', _108 => _108[context2.projectName], 'optionalAccess', _109 => _109.root]), () => ( "./")), "src")))
|
|
1755
1776
|
}).then((result) => {
|
|
1756
|
-
|
|
1777
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1757
1778
|
});
|
|
1758
1779
|
return {
|
|
1759
1780
|
success: true
|
|
@@ -1774,11 +1795,11 @@ var _fsextra = require('fs-extra');
|
|
|
1774
1795
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1775
1796
|
async function typiaExecutorFn(options, _, config) {
|
|
1776
1797
|
if (options.clean !== false) {
|
|
1777
|
-
|
|
1798
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1778
1799
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1779
1800
|
}
|
|
1780
1801
|
await Promise.all(options.entry.map((entry) => {
|
|
1781
|
-
|
|
1802
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1782
1803
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1783
1804
|
input: entry,
|
|
1784
1805
|
output: options.outputPath,
|
|
@@ -1809,8 +1830,8 @@ var executor_default8 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
1809
1830
|
|
|
1810
1831
|
var _jiti = require('jiti');
|
|
1811
1832
|
async function unbuildExecutorFn(options, context2, config) {
|
|
1812
|
-
|
|
1813
|
-
if (!_optionalChain([context2, 'access',
|
|
1833
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1834
|
+
if (!_optionalChain([context2, 'access', _110 => _110.projectsConfigurations, 'optionalAccess', _111 => _111.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1814
1835
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
1815
1836
|
}
|
|
1816
1837
|
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
@@ -1820,7 +1841,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1820
1841
|
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.");
|
|
1821
1842
|
}
|
|
1822
1843
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
1823
|
-
fsCache: config.skipCache ? false :
|
|
1844
|
+
fsCache: config.skipCache ? false : _chunkQQQD2SINjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
1824
1845
|
interopDefault: true
|
|
1825
1846
|
});
|
|
1826
1847
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -1833,7 +1854,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1833
1854
|
}, {
|
|
1834
1855
|
stubOptions: {
|
|
1835
1856
|
jiti: {
|
|
1836
|
-
fsCache: config.skipCache ? false :
|
|
1857
|
+
fsCache: config.skipCache ? false : _chunkQQQD2SINjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
1837
1858
|
}
|
|
1838
1859
|
},
|
|
1839
1860
|
rollup: {
|
|
@@ -1880,58 +1901,58 @@ var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecu
|
|
|
1880
1901
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
1881
1902
|
skipReadingConfig: false
|
|
1882
1903
|
}) => async (tree, _options) => {
|
|
1883
|
-
const stopwatch =
|
|
1904
|
+
const stopwatch = _chunkQQQD2SINjs.getStopwatch.call(void 0, name);
|
|
1884
1905
|
let options = _options;
|
|
1885
1906
|
let config;
|
|
1886
1907
|
try {
|
|
1887
|
-
|
|
1908
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1888
1909
|
|
|
1889
1910
|
`, config);
|
|
1890
|
-
const workspaceRoot3 =
|
|
1911
|
+
const workspaceRoot3 = _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, );
|
|
1891
1912
|
if (!generatorOptions.skipReadingConfig) {
|
|
1892
|
-
|
|
1913
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
1893
1914
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
1894
|
-
config = await
|
|
1915
|
+
config = await _chunkZ5XL2UL5js.getConfig.call(void 0, workspaceRoot3);
|
|
1895
1916
|
}
|
|
1896
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1897
|
-
|
|
1917
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _112 => _112.hooks, 'optionalAccess', _113 => _113.applyDefaultOptions])) {
|
|
1918
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1898
1919
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
1899
|
-
|
|
1920
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1900
1921
|
}
|
|
1901
|
-
|
|
1922
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
1902
1923
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
1903
1924
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
1904
1925
|
workspaceRoot: tree.root,
|
|
1905
1926
|
config
|
|
1906
1927
|
}, applyWorkspaceBaseTokens);
|
|
1907
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1908
|
-
|
|
1928
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _114 => _114.hooks, 'optionalAccess', _115 => _115.preProcess])) {
|
|
1929
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1909
1930
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
1910
|
-
|
|
1931
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
1911
1932
|
}
|
|
1912
1933
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
1913
1934
|
if (result) {
|
|
1914
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1935
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _116 => _116.error, 'optionalAccess', _117 => _117.message]) && typeof _optionalChain([result, 'optionalAccess', _118 => _118.error, 'optionalAccess', _119 => _119.message]) === "string" && _optionalChain([result, 'optionalAccess', _120 => _120.error, 'optionalAccess', _121 => _121.name]) && typeof _optionalChain([result, 'optionalAccess', _122 => _122.error, 'optionalAccess', _123 => _123.name]) === "string") {
|
|
1915
1936
|
throw new Error(`The ${name} generator failed to run`, {
|
|
1916
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1937
|
+
cause: _optionalChain([result, 'optionalAccess', _124 => _124.error])
|
|
1917
1938
|
});
|
|
1918
1939
|
} else if (result.success && result.data) {
|
|
1919
1940
|
return result;
|
|
1920
1941
|
}
|
|
1921
1942
|
}
|
|
1922
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1923
|
-
|
|
1943
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _125 => _125.hooks, 'optionalAccess', _126 => _126.postProcess])) {
|
|
1944
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1924
1945
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1925
|
-
|
|
1946
|
+
_chunkQQQD2SINjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1926
1947
|
}
|
|
1927
1948
|
return () => {
|
|
1928
|
-
|
|
1949
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1929
1950
|
`, config);
|
|
1930
1951
|
};
|
|
1931
1952
|
} catch (error) {
|
|
1932
1953
|
return () => {
|
|
1933
|
-
|
|
1934
|
-
|
|
1954
|
+
_chunkQQQD2SINjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1955
|
+
_chunkQQQD2SINjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
1935
1956
|
- Details: ${error.message}
|
|
1936
1957
|
- Stacktrace: ${error.stack}`, config);
|
|
1937
1958
|
};
|
|
@@ -1977,7 +1998,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1977
1998
|
const projectConfig = {
|
|
1978
1999
|
root: normalized.directory,
|
|
1979
2000
|
projectType: "library",
|
|
1980
|
-
sourceRoot:
|
|
2001
|
+
sourceRoot: _chunkQQQD2SINjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
1981
2002
|
targets: {
|
|
1982
2003
|
build: {
|
|
1983
2004
|
executor: options.buildExecutor,
|
|
@@ -1986,11 +2007,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1986
2007
|
],
|
|
1987
2008
|
options: {
|
|
1988
2009
|
entry: [
|
|
1989
|
-
|
|
2010
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
1990
2011
|
],
|
|
1991
2012
|
outputPath: getOutputPath(normalized),
|
|
1992
|
-
tsconfig:
|
|
1993
|
-
project:
|
|
2013
|
+
tsconfig: _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
2014
|
+
project: _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
1994
2015
|
defaultConfiguration: "production",
|
|
1995
2016
|
platform: "neutral",
|
|
1996
2017
|
assets: [
|
|
@@ -2029,22 +2050,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2029
2050
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2030
2051
|
let repository = {
|
|
2031
2052
|
type: "github",
|
|
2032
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2053
|
+
url: _optionalChain([config, 'optionalAccess', _127 => _127.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _128 => _128.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _129 => _129.namespace]) || _optionalChain([config, 'optionalAccess', _130 => _130.name]) || "repository"}.git`
|
|
2033
2054
|
};
|
|
2034
2055
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2035
2056
|
if (tree.exists("package.json")) {
|
|
2036
2057
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2037
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2058
|
+
if (_optionalChain([packageJson, 'optionalAccess', _131 => _131.repository])) {
|
|
2038
2059
|
repository = packageJson.repository;
|
|
2039
2060
|
}
|
|
2040
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2061
|
+
if (_optionalChain([packageJson, 'optionalAccess', _132 => _132.description])) {
|
|
2041
2062
|
description = packageJson.description;
|
|
2042
2063
|
}
|
|
2043
2064
|
}
|
|
2044
2065
|
if (!normalized.importPath) {
|
|
2045
2066
|
normalized.importPath = normalized.name;
|
|
2046
2067
|
}
|
|
2047
|
-
const packageJsonPath =
|
|
2068
|
+
const packageJsonPath = _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2048
2069
|
if (tree.exists(packageJsonPath)) {
|
|
2049
2070
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2050
2071
|
if (!normalized.importPath) {
|
|
@@ -2092,30 +2113,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2092
2113
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2093
2114
|
...json,
|
|
2094
2115
|
pnpm: {
|
|
2095
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2116
|
+
..._optionalChain([json, 'optionalAccess', _133 => _133.pnpm]),
|
|
2096
2117
|
overrides: {
|
|
2097
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2118
|
+
..._optionalChain([json, 'optionalAccess', _134 => _134.pnpm, 'optionalAccess', _135 => _135.overrides]),
|
|
2098
2119
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2099
2120
|
}
|
|
2100
2121
|
}
|
|
2101
2122
|
}));
|
|
2102
2123
|
}
|
|
2103
2124
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2104
|
-
|
|
2125
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2105
2126
|
]);
|
|
2106
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2107
|
-
|
|
2127
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2128
|
+
_chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2108
2129
|
]);
|
|
2109
2130
|
if (tree.exists("package.json")) {
|
|
2110
2131
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2111
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2132
|
+
if (_optionalChain([packageJson, 'optionalAccess', _136 => _136.repository])) {
|
|
2112
2133
|
repository = packageJson.repository;
|
|
2113
2134
|
}
|
|
2114
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2135
|
+
if (_optionalChain([packageJson, 'optionalAccess', _137 => _137.description])) {
|
|
2115
2136
|
description = packageJson.description;
|
|
2116
2137
|
}
|
|
2117
2138
|
}
|
|
2118
|
-
const tsconfigPath =
|
|
2139
|
+
const tsconfigPath = _chunkQQQD2SINjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2119
2140
|
if (tree.exists(tsconfigPath)) {
|
|
2120
2141
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2121
2142
|
json.composite ??= true;
|
|
@@ -2153,42 +2174,42 @@ function getOutputPath(options) {
|
|
|
2153
2174
|
} else {
|
|
2154
2175
|
parts.push(options.projectRoot);
|
|
2155
2176
|
}
|
|
2156
|
-
return
|
|
2177
|
+
return _chunkQQQD2SINjs.joinPaths.call(void 0, ...parts);
|
|
2157
2178
|
}
|
|
2158
2179
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2159
2180
|
function createProjectTsConfigJson(tree, options) {
|
|
2160
2181
|
const tsconfig = {
|
|
2161
2182
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2162
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2183
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _138 => _138.tsconfigOptions]), () => ( {})),
|
|
2163
2184
|
compilerOptions: {
|
|
2164
2185
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2165
|
-
outDir:
|
|
2186
|
+
outDir: _chunkQQQD2SINjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2166
2187
|
noEmit: true,
|
|
2167
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2188
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.tsconfigOptions, 'optionalAccess', _140 => _140.compilerOptions]), () => ( {}))
|
|
2168
2189
|
},
|
|
2169
2190
|
files: [
|
|
2170
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2191
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _141 => _141.tsconfigOptions, 'optionalAccess', _142 => _142.files]), () => ( []))
|
|
2171
2192
|
],
|
|
2172
2193
|
include: [
|
|
2173
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2194
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _143 => _143.tsconfigOptions, 'optionalAccess', _144 => _144.include]), () => ( [])),
|
|
2174
2195
|
"src/**/*.ts",
|
|
2175
2196
|
"src/**/*.js",
|
|
2176
2197
|
"bin/**/*"
|
|
2177
2198
|
],
|
|
2178
2199
|
exclude: [
|
|
2179
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2200
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _145 => _145.tsconfigOptions, 'optionalAccess', _146 => _146.exclude]), () => ( [])),
|
|
2180
2201
|
"jest.config.ts",
|
|
2181
2202
|
"src/**/*.spec.ts",
|
|
2182
2203
|
"src/**/*.test.ts"
|
|
2183
2204
|
]
|
|
2184
2205
|
};
|
|
2185
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2206
|
+
_devkit.writeJson.call(void 0, tree, _chunkQQQD2SINjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2186
2207
|
}
|
|
2187
2208
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2188
2209
|
async function normalizeOptions(tree, options, config) {
|
|
2189
2210
|
let importPath = options.importPath;
|
|
2190
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2191
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
2211
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _147 => _147.namespace])) {
|
|
2212
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _148 => _148.namespace])}/${options.name}`;
|
|
2192
2213
|
}
|
|
2193
2214
|
if (options.publishable) {
|
|
2194
2215
|
if (!importPath) {
|
|
@@ -2242,7 +2263,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2242
2263
|
|
|
2243
2264
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2244
2265
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2245
|
-
const filesDir =
|
|
2266
|
+
const filesDir = _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2246
2267
|
const tsLibraryGeneratorOptions = {
|
|
2247
2268
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2248
2269
|
platform: "browser",
|
|
@@ -2314,19 +2335,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2314
2335
|
|
|
2315
2336
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2316
2337
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2338
|
+
_chunkQQQD2SINjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2339
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2340
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkQQQD2SINjs.stormWorkspaceConfigSchema, {
|
|
2320
2341
|
name: "StormWorkspaceConfiguration"
|
|
2321
2342
|
});
|
|
2322
|
-
|
|
2323
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2324
|
-
|
|
2343
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2344
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _149 => _149.workspaceRoot]), () => ( _chunkQQQD2SINjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _150 => _150.outputFile, 'optionalAccess', _151 => _151.startsWith, 'call', _152 => _152("./")]) ? "" : "./");
|
|
2345
|
+
_chunkQQQD2SINjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2325
2346
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2326
2347
|
spaces: 2
|
|
2327
2348
|
});
|
|
2328
2349
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2329
|
-
|
|
2350
|
+
_chunkQQQD2SINjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2330
2351
|
return {
|
|
2331
2352
|
success: true
|
|
2332
2353
|
};
|
|
@@ -2347,7 +2368,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
|
|
|
2347
2368
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2348
2369
|
|
|
2349
2370
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2350
|
-
const filesDir =
|
|
2371
|
+
const filesDir = _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2351
2372
|
const tsLibraryGeneratorOptions = {
|
|
2352
2373
|
...schema,
|
|
2353
2374
|
platform: "neutral",
|
|
@@ -2390,7 +2411,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2390
2411
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2391
2412
|
|
|
2392
2413
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2393
|
-
const filesDir =
|
|
2414
|
+
const filesDir = _chunkQQQD2SINjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2394
2415
|
const tsLibraryGeneratorOptions = {
|
|
2395
2416
|
platform: "node",
|
|
2396
2417
|
devDependencies: {
|