@storm-software/terraform-tools 0.54.44 → 0.54.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 +16 -0
- package/README.md +1 -1
- package/dist/{chunk-TMSXVOPT.js → chunk-AWKDJF6S.js} +3 -3
- package/dist/{chunk-IASMSKFD.js → chunk-DJCYC7JQ.js} +2 -2
- package/dist/{chunk-KXU4RONH.mjs → chunk-JXHQ3VKS.mjs} +1 -1
- package/dist/{chunk-SD5RUDOC.js → chunk-N54F7ABF.js} +2 -2
- package/dist/{chunk-TC6M3XSY.js → chunk-O3P3PRAI.js} +237 -216
- package/dist/{chunk-HLKD7LH2.js → chunk-OFLYCEQV.js} +18 -2
- package/dist/{chunk-I7YJV2HQ.mjs → chunk-PX46VTHM.mjs} +1 -1
- package/dist/{chunk-7DKBJQFC.js → chunk-QLX5ZXZW.js} +2 -2
- package/dist/{chunk-2YQ45BL6.mjs → chunk-QVS5QXGT.mjs} +18 -2
- package/dist/{chunk-HNQXOQIK.js → chunk-SHSQW7WA.js} +2 -2
- package/dist/{chunk-END6WC65.mjs → chunk-UFNO4VYA.mjs} +1 -1
- package/dist/{chunk-DQSC56MV.mjs → chunk-WQRXF2IK.mjs} +1 -1
- package/dist/{chunk-2KL7TQCA.mjs → chunk-XXGHGWME.mjs} +87 -66
- package/dist/{chunk-JXBAKJPX.mjs → chunk-ZAEMRHF3.mjs} +1 -1
- package/dist/executors.d.mts +1 -1
- package/dist/executors.d.ts +1 -1
- package/dist/executors.js +6 -6
- package/dist/executors.mjs +6 -6
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/base/index.d.mts +1 -1
- package/dist/src/base/index.d.ts +1 -1
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +2 -2
- package/dist/src/base/terraform-executor.d.mts +1 -1276
- package/dist/src/base/terraform-executor.d.ts +1 -1276
- package/dist/src/base/terraform-executor.js +3 -3
- package/dist/src/base/terraform-executor.mjs +2 -2
- package/dist/src/executors/apply/executor.d.mts +1 -1
- package/dist/src/executors/apply/executor.d.ts +1 -1
- package/dist/src/executors/apply/executor.js +4 -4
- package/dist/src/executors/apply/executor.mjs +3 -3
- package/dist/src/executors/destroy/executor.d.mts +1 -1
- package/dist/src/executors/destroy/executor.d.ts +1 -1
- package/dist/src/executors/destroy/executor.js +4 -4
- package/dist/src/executors/destroy/executor.mjs +3 -3
- package/dist/src/executors/output/executor.js +4 -4
- package/dist/src/executors/output/executor.mjs +3 -3
- package/dist/src/executors/plan/executor.d.mts +1 -1
- package/dist/src/executors/plan/executor.d.ts +1 -1
- package/dist/src/executors/plan/executor.js +4 -4
- package/dist/src/executors/plan/executor.mjs +3 -3
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +2 -2
- package/package.json +7 -9
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkOFLYCEQVjs = require('./chunk-OFLYCEQV.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -159,7 +159,7 @@ async function cargoBuildExecutor(options, context2) {
|
|
|
159
159
|
return await cargoCommand(...command);
|
|
160
160
|
}
|
|
161
161
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoBuildExecutor, "cargoBuildExecutor");
|
|
162
|
-
var executor_default =
|
|
162
|
+
var executor_default = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Cargo Build", cargoBuildExecutor, {
|
|
163
163
|
skipReadingConfig: false,
|
|
164
164
|
hooks: {
|
|
165
165
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -176,7 +176,7 @@ async function cargoCheckExecutor(options, context2) {
|
|
|
176
176
|
return await cargoCommand(...command);
|
|
177
177
|
}
|
|
178
178
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoCheckExecutor, "cargoCheckExecutor");
|
|
179
|
-
var executor_default2 =
|
|
179
|
+
var executor_default2 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Cargo Check", cargoCheckExecutor, {
|
|
180
180
|
skipReadingConfig: false,
|
|
181
181
|
hooks: {
|
|
182
182
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -192,7 +192,7 @@ async function cargoClippyExecutor(options, context2) {
|
|
|
192
192
|
return await cargoCommand(...command);
|
|
193
193
|
}
|
|
194
194
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoClippyExecutor, "cargoClippyExecutor");
|
|
195
|
-
var executor_default3 =
|
|
195
|
+
var executor_default3 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Cargo Clippy", cargoClippyExecutor, {
|
|
196
196
|
skipReadingConfig: false,
|
|
197
197
|
hooks: {
|
|
198
198
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -214,7 +214,7 @@ async function cargoDocExecutor(options, context2) {
|
|
|
214
214
|
return await cargoCommand(...command);
|
|
215
215
|
}
|
|
216
216
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoDocExecutor, "cargoDocExecutor");
|
|
217
|
-
var executor_default4 =
|
|
217
|
+
var executor_default4 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Cargo Doc", cargoDocExecutor, {
|
|
218
218
|
skipReadingConfig: false,
|
|
219
219
|
hooks: {
|
|
220
220
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -237,7 +237,7 @@ async function cargoFormatExecutor(options, context2) {
|
|
|
237
237
|
return await cargoCommand(...command);
|
|
238
238
|
}
|
|
239
239
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoFormatExecutor, "cargoFormatExecutor");
|
|
240
|
-
var executor_default5 =
|
|
240
|
+
var executor_default5 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Cargo Format", cargoFormatExecutor, {
|
|
241
241
|
skipReadingConfig: false,
|
|
242
242
|
hooks: {
|
|
243
243
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -318,8 +318,8 @@ var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (con
|
|
|
318
318
|
output: "src/"
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
321
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
322
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkOFLYCEQVjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
323
323
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
324
324
|
projectDir: projectRoot,
|
|
325
325
|
rootDir: config.workspaceRoot,
|
|
@@ -328,12 +328,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
328
328
|
});
|
|
329
329
|
await assetHandler.processAllAssetsOnce();
|
|
330
330
|
if (includeSrc === true) {
|
|
331
|
-
|
|
331
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkOFLYCEQVjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
332
332
|
const files = await _glob.glob.call(void 0, [
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
333
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
334
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
335
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
336
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
337
337
|
]);
|
|
338
338
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
339
339
|
|
|
@@ -356,7 +356,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
356
356
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _5 => _5.node, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.root]) !== projectRoot && _optionalChain([dep, 'access', _8 => _8.node, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.root]) !== workspaceRoot3)) {
|
|
357
357
|
const projectNode = project.node;
|
|
358
358
|
if (projectNode.data.root) {
|
|
359
|
-
const projectPackageJsonPath =
|
|
359
|
+
const projectPackageJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
360
360
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
361
361
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
362
362
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -367,8 +367,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
if (localPackages.length > 0) {
|
|
370
|
-
|
|
371
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
370
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
371
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
372
372
|
const projectJson = JSON.parse(projectJsonFile);
|
|
373
373
|
const projectName2 = projectJson.name;
|
|
374
374
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
@@ -377,7 +377,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
377
377
|
}
|
|
378
378
|
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _13 => _13.projects, 'optionalAccess', _14 => _14[projectName2], 'access', _15 => _15.implicitDependencies, 'optionalAccess', _16 => _16.reduce, 'call', _17 => _17((ret, dep) => {
|
|
379
379
|
if (_optionalChain([projectConfigurations, 'access', _18 => _18.projects, 'optionalAccess', _19 => _19[dep]])) {
|
|
380
|
-
const depPackageJsonPath =
|
|
380
|
+
const depPackageJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
|
|
381
381
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
382
382
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
383
383
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -401,13 +401,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
401
401
|
return ret;
|
|
402
402
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
403
403
|
} else {
|
|
404
|
-
|
|
404
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
405
405
|
}
|
|
406
406
|
return packageJson;
|
|
407
407
|
}, "addPackageDependencies");
|
|
408
408
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
409
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
410
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
409
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkOFLYCEQVjs.findWorkspaceRoot.call(void 0, );
|
|
410
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
411
411
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
412
412
|
packageJson.type ??= "module";
|
|
413
413
|
packageJson.sideEffects ??= false;
|
|
@@ -416,7 +416,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
416
416
|
if (distSrc.startsWith("/")) {
|
|
417
417
|
distSrc = distSrc.substring(1);
|
|
418
418
|
}
|
|
419
|
-
packageJson.source ??= `${
|
|
419
|
+
packageJson.source ??= `${_chunkOFLYCEQVjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
420
420
|
}
|
|
421
421
|
packageJson.files ??= [
|
|
422
422
|
"dist/**/*"
|
|
@@ -447,64 +447,12 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
447
447
|
];
|
|
448
448
|
}
|
|
449
449
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
450
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
450
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkOFLYCEQVjs.joinPaths.call(void 0, "packages", projectName);
|
|
451
451
|
return packageJson;
|
|
452
452
|
}, "addWorkspacePackageJsonFields");
|
|
453
453
|
|
|
454
454
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
455
455
|
|
|
456
|
-
var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
457
|
-
const workspaceRoot3 = config.workspaceRoot || _chunkHLKD7LH2js.findWorkspaceRoot.call(void 0, );
|
|
458
|
-
const entryPoints = [];
|
|
459
|
-
if (entry) {
|
|
460
|
-
if (typeof entry === "string") {
|
|
461
|
-
entryPoints.push(entry);
|
|
462
|
-
} else if (Array.isArray(entry)) {
|
|
463
|
-
entryPoints.push(...entry);
|
|
464
|
-
} else {
|
|
465
|
-
entryPoints.push(...Object.values(entry));
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
if (emitOnAll) {
|
|
469
|
-
entryPoints.push(_chunkHLKD7LH2js.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
470
|
-
}
|
|
471
|
-
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
472
|
-
const paths = [];
|
|
473
|
-
if (entryPoint.includes("*")) {
|
|
474
|
-
const files = await _glob.glob.call(void 0, entryPoint, {
|
|
475
|
-
withFileTypes: true,
|
|
476
|
-
ignore: [
|
|
477
|
-
"**/node_modules/**"
|
|
478
|
-
]
|
|
479
|
-
});
|
|
480
|
-
paths.push(...files.reduce((ret, filePath) => {
|
|
481
|
-
const result = _chunkHLKD7LH2js.correctPaths.call(void 0, _chunkHLKD7LH2js.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkHLKD7LH2js.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkHLKD7LH2js.correctPaths.call(void 0, projectRoot), ""));
|
|
482
|
-
if (result) {
|
|
483
|
-
_chunkHLKD7LH2js.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkHLKD7LH2js.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
484
|
-
if (!paths.includes(result)) {
|
|
485
|
-
paths.push(result);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
return ret;
|
|
489
|
-
}, []));
|
|
490
|
-
} else {
|
|
491
|
-
const result = _chunkHLKD7LH2js.correctPaths.call(void 0, entryPoint.replaceAll(_chunkHLKD7LH2js.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkHLKD7LH2js.correctPaths.call(void 0, projectRoot), ""));
|
|
492
|
-
_chunkHLKD7LH2js.writeDebug.call(void 0, `Trying to add entry point ${result}"`, config);
|
|
493
|
-
if (!paths.includes(result)) {
|
|
494
|
-
paths.push(result);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
return paths;
|
|
498
|
-
}));
|
|
499
|
-
return results.filter(Boolean).reduce((ret, result) => {
|
|
500
|
-
result.forEach((res) => {
|
|
501
|
-
if (res && !ret.includes(res)) {
|
|
502
|
-
ret.push(res);
|
|
503
|
-
}
|
|
504
|
-
});
|
|
505
|
-
return ret;
|
|
506
|
-
}, []);
|
|
507
|
-
}, "getEntryPoints");
|
|
508
456
|
|
|
509
457
|
// ../build-tools/src/utilities/get-env.ts
|
|
510
458
|
var getEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (builder, options) => {
|
|
@@ -804,7 +752,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (option
|
|
|
804
752
|
setup(build4) {
|
|
805
753
|
build4.onEnd((result) => {
|
|
806
754
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
807
|
-
|
|
755
|
+
_chunkOFLYCEQVjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
808
756
|
${result.errors.map((error) => error.text).join("\n")}
|
|
809
757
|
|
|
810
758
|
`, resolvedOptions.config);
|
|
@@ -839,7 +787,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
839
787
|
var resolvePathsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
840
788
|
name: "storm:resolve-paths",
|
|
841
789
|
setup(build4) {
|
|
842
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunk3GQAWCBQjs.__require.call(void 0,
|
|
790
|
+
const parentTsConfig = build4.initialOptions.tsconfig ? _chunk3GQAWCBQjs.__require.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunk3GQAWCBQjs.__require.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
843
791
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
844
792
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
845
793
|
build4.onResolve({
|
|
@@ -863,7 +811,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
863
811
|
|
|
864
812
|
|
|
865
813
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
866
|
-
const { dependencies, peerDependencies, devDependencies } = _chunk3GQAWCBQjs.__require.call(void 0,
|
|
814
|
+
const { dependencies, peerDependencies, devDependencies } = _chunk3GQAWCBQjs.__require.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
867
815
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
868
816
|
p,
|
|
869
817
|
getTypeDependencyPackageName(p)
|
|
@@ -899,13 +847,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
899
847
|
},
|
|
900
848
|
dtsRollup: {
|
|
901
849
|
enabled: true,
|
|
902
|
-
untrimmedFilePath:
|
|
850
|
+
untrimmedFilePath: _chunkOFLYCEQVjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
903
851
|
},
|
|
904
852
|
tsdocMetadata: {
|
|
905
853
|
enabled: false
|
|
906
854
|
}
|
|
907
855
|
},
|
|
908
|
-
packageJsonFullPath:
|
|
856
|
+
packageJsonFullPath: _chunkOFLYCEQVjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
909
857
|
configObjectFullPath: void 0
|
|
910
858
|
});
|
|
911
859
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -913,7 +861,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
913
861
|
localBuild: true
|
|
914
862
|
});
|
|
915
863
|
if (extractorResult.succeeded === false) {
|
|
916
|
-
|
|
864
|
+
_chunkOFLYCEQVjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
917
865
|
throw new Error("API Extractor completed with errors");
|
|
918
866
|
}
|
|
919
867
|
}
|
|
@@ -926,18 +874,18 @@ var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, r
|
|
|
926
874
|
}
|
|
927
875
|
build4.onStart(async () => {
|
|
928
876
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
929
|
-
await
|
|
877
|
+
await _chunkOFLYCEQVjs.run.call(void 0, resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
930
878
|
}
|
|
931
|
-
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && resolvedOptions.entryPoints[0] && resolvedOptions.entryPoints[0].endsWith(".ts")) {
|
|
879
|
+
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && _optionalChain([resolvedOptions, 'access', _44 => _44.entryPoints, 'access', _45 => _45[0], 'optionalAccess', _46 => _46.in]) && resolvedOptions.entryPoints[0].in.endsWith(".ts")) {
|
|
932
880
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
933
881
|
const typeOutDir = resolvedOptions.outdir;
|
|
934
|
-
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
935
|
-
const bundlePath =
|
|
882
|
+
const entryPoint = resolvedOptions.entryPoints[0].in.replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
883
|
+
const bundlePath = _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
936
884
|
let dtsPath;
|
|
937
|
-
if (_fs.existsSync.call(void 0,
|
|
938
|
-
dtsPath =
|
|
939
|
-
} else if (_fs.existsSync.call(void 0,
|
|
940
|
-
dtsPath =
|
|
885
|
+
if (_fs.existsSync.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
886
|
+
dtsPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
887
|
+
} else if (_fs.existsSync.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
888
|
+
dtsPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
941
889
|
}
|
|
942
890
|
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
943
891
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -954,7 +902,7 @@ var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, r
|
|
|
954
902
|
function getTypeDependencyPackageName(npmPackage) {
|
|
955
903
|
if (npmPackage.startsWith("@")) {
|
|
956
904
|
const [scope, name] = npmPackage.split("/");
|
|
957
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
905
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _47 => _47.slice, 'call', _48 => _48(1)])}__${name}`;
|
|
958
906
|
}
|
|
959
907
|
return `@types/${npmPackage}`;
|
|
960
908
|
}
|
|
@@ -1101,8 +1049,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bund
|
|
|
1101
1049
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1102
1050
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1103
1051
|
});
|
|
1104
|
-
|
|
1105
|
-
|
|
1052
|
+
_chunkOFLYCEQVjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1053
|
+
_chunkOFLYCEQVjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1106
1054
|
if (filteredMissingDeps.length > 0) {
|
|
1107
1055
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1108
1056
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1122,6 +1070,84 @@ var shebangRenderer = {
|
|
|
1122
1070
|
}
|
|
1123
1071
|
};
|
|
1124
1072
|
|
|
1073
|
+
// ../esbuild/src/utilities/get-entry-points.ts
|
|
1074
|
+
|
|
1075
|
+
var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
1076
|
+
const workspaceRoot3 = config.workspaceRoot || _chunkOFLYCEQVjs.findWorkspaceRoot.call(void 0, );
|
|
1077
|
+
const entryPoints = [];
|
|
1078
|
+
if (entry) {
|
|
1079
|
+
if (typeof entry === "string") {
|
|
1080
|
+
entryPoints.push({
|
|
1081
|
+
in: entry,
|
|
1082
|
+
out: entry
|
|
1083
|
+
});
|
|
1084
|
+
} else if (Array.isArray(entry)) {
|
|
1085
|
+
entryPoints.push(...entry.map((entry2) => ({
|
|
1086
|
+
in: entry2,
|
|
1087
|
+
out: entry2
|
|
1088
|
+
})));
|
|
1089
|
+
} else {
|
|
1090
|
+
entryPoints.push(...Object.entries(entry).map(([key, value]) => {
|
|
1091
|
+
if (typeof value === "string") {
|
|
1092
|
+
return {
|
|
1093
|
+
in: key,
|
|
1094
|
+
out: value
|
|
1095
|
+
};
|
|
1096
|
+
} else {
|
|
1097
|
+
return {
|
|
1098
|
+
in: key,
|
|
1099
|
+
out: key
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
}));
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (emitOnAll) {
|
|
1106
|
+
entryPoints.push({
|
|
1107
|
+
in: _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"),
|
|
1108
|
+
out: _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}")
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
1112
|
+
const paths = [];
|
|
1113
|
+
if (entryPoint.in.includes("*")) {
|
|
1114
|
+
const files = await _glob.glob.call(void 0, entryPoint.in, {
|
|
1115
|
+
withFileTypes: true,
|
|
1116
|
+
ignore: [
|
|
1117
|
+
"**/node_modules/**"
|
|
1118
|
+
]
|
|
1119
|
+
});
|
|
1120
|
+
paths.push(...files.reduce((ret, filePath) => {
|
|
1121
|
+
const result = _chunkOFLYCEQVjs.correctPaths.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkOFLYCEQVjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkOFLYCEQVjs.correctPaths.call(void 0, projectRoot), ""));
|
|
1122
|
+
if (result) {
|
|
1123
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkOFLYCEQVjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
1124
|
+
if (!paths.some((p) => p.in === result)) {
|
|
1125
|
+
paths.push({
|
|
1126
|
+
in: result,
|
|
1127
|
+
out: entryPoint.out.replace(entryPoint.in, result)
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
return ret;
|
|
1132
|
+
}, []));
|
|
1133
|
+
} else {
|
|
1134
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, `Trying to add entry point ${entryPoint}"`, config);
|
|
1135
|
+
if (!paths.some((p) => p.in === entryPoint.in)) {
|
|
1136
|
+
paths.push(entryPoint);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
return paths;
|
|
1140
|
+
}));
|
|
1141
|
+
return results.filter(Boolean).reduce((ret, result) => {
|
|
1142
|
+
result.forEach((res) => {
|
|
1143
|
+
if (res && !ret.some((p) => p.in === res.in)) {
|
|
1144
|
+
ret.push(res);
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
return ret;
|
|
1148
|
+
}, []);
|
|
1149
|
+
}, "getEntryPoints");
|
|
1150
|
+
|
|
1125
1151
|
// ../esbuild/src/utilities/helpers.ts
|
|
1126
1152
|
function handleSync(fn) {
|
|
1127
1153
|
try {
|
|
@@ -1170,7 +1196,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1170
1196
|
return (...args) => {
|
|
1171
1197
|
let result = fn(...args);
|
|
1172
1198
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1173
|
-
result = _optionalChain([fns, 'access',
|
|
1199
|
+
result = _optionalChain([fns, 'access', _49 => _49[i], 'optionalCall', _50 => _50(result)]);
|
|
1174
1200
|
}
|
|
1175
1201
|
return result;
|
|
1176
1202
|
};
|
|
@@ -1180,7 +1206,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1180
1206
|
return async (...args) => {
|
|
1181
1207
|
let result = await fn(...args);
|
|
1182
1208
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1183
|
-
result = await _optionalChain([fns, 'access',
|
|
1209
|
+
result = await _optionalChain([fns, 'access', _51 => _51[i], 'optionalCall', _52 => _52(result)]);
|
|
1184
1210
|
}
|
|
1185
1211
|
return result;
|
|
1186
1212
|
};
|
|
@@ -1196,13 +1222,13 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1196
1222
|
if (!workspaceRoot3) {
|
|
1197
1223
|
throw new Error("Cannot find Nx workspace root");
|
|
1198
1224
|
}
|
|
1199
|
-
const config = await
|
|
1200
|
-
|
|
1201
|
-
const stopwatch =
|
|
1225
|
+
const config = await _chunkOFLYCEQVjs.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1226
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1227
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1202
1228
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1203
1229
|
exitOnError: true
|
|
1204
1230
|
});
|
|
1205
|
-
const projectJsonPath =
|
|
1231
|
+
const projectJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1206
1232
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1207
1233
|
throw new Error("Cannot find project.json configuration");
|
|
1208
1234
|
}
|
|
@@ -1210,13 +1236,13 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1210
1236
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1211
1237
|
const projectName = projectJson.name;
|
|
1212
1238
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1213
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1239
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _53 => _53.projects, 'optionalAccess', _54 => _54[projectName]])) {
|
|
1214
1240
|
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.");
|
|
1215
1241
|
}
|
|
1216
1242
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1217
1243
|
options.name ??= `${projectName}-${options.format}`;
|
|
1218
1244
|
options.target ??= DEFAULT_TARGET;
|
|
1219
|
-
const packageJsonPath =
|
|
1245
|
+
const packageJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1220
1246
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1221
1247
|
throw new Error("Cannot find package.json configuration");
|
|
1222
1248
|
}
|
|
@@ -1233,24 +1259,23 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1233
1259
|
"main"
|
|
1234
1260
|
],
|
|
1235
1261
|
...userOptions,
|
|
1236
|
-
tsconfig:
|
|
1262
|
+
tsconfig: _chunkOFLYCEQVjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1237
1263
|
format: options.format || "cjs",
|
|
1238
|
-
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")),
|
|
1239
|
-
outdir: userOptions.outputPath ||
|
|
1264
|
+
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), false),
|
|
1265
|
+
outdir: userOptions.outputPath || _chunkOFLYCEQVjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1240
1266
|
distDir: userOptions.distDir || "dist",
|
|
1241
1267
|
plugins: [],
|
|
1242
1268
|
name: userOptions.name || projectName,
|
|
1243
1269
|
projectConfigurations,
|
|
1244
1270
|
projectName,
|
|
1245
1271
|
projectGraph,
|
|
1246
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1272
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkOFLYCEQVjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1247
1273
|
minify: userOptions.minify || !userOptions.debug,
|
|
1248
|
-
verbose: userOptions.verbose ||
|
|
1274
|
+
verbose: userOptions.verbose || _chunkOFLYCEQVjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1249
1275
|
includeSrc: userOptions.includeSrc === true,
|
|
1250
1276
|
metafile: userOptions.metafile !== false,
|
|
1251
1277
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1252
1278
|
clean: userOptions.clean !== false,
|
|
1253
|
-
emitOnAll: userOptions.emitOnAll === true,
|
|
1254
1279
|
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1255
1280
|
injectShims: userOptions.injectShims !== true,
|
|
1256
1281
|
bundle: userOptions.bundle !== false,
|
|
@@ -1281,8 +1306,8 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1281
1306
|
}, {})
|
|
1282
1307
|
},
|
|
1283
1308
|
inject: [
|
|
1284
|
-
options.format === "cjs" && options.injectShims ?
|
|
1285
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1309
|
+
options.format === "cjs" && options.injectShims ? _chunkOFLYCEQVjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1310
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkOFLYCEQVjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1286
1311
|
].filter(Boolean)
|
|
1287
1312
|
};
|
|
1288
1313
|
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
@@ -1300,14 +1325,14 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1300
1325
|
return result;
|
|
1301
1326
|
}, "resolveOptions");
|
|
1302
1327
|
async function generatePackageJson(context2) {
|
|
1303
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1304
|
-
|
|
1305
|
-
const stopwatch =
|
|
1306
|
-
const packageJsonPath =
|
|
1328
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1329
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1330
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1331
|
+
const packageJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1307
1332
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1308
1333
|
throw new Error("Cannot find package.json configuration");
|
|
1309
1334
|
}
|
|
1310
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1335
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkOFLYCEQVjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1311
1336
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1312
1337
|
if (!packageJson) {
|
|
1313
1338
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1317,19 +1342,13 @@ async function generatePackageJson(context2) {
|
|
|
1317
1342
|
packageJson.exports ??= {};
|
|
1318
1343
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
1319
1344
|
packageJson.exports["."] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js`;
|
|
1320
|
-
|
|
1345
|
+
const entryPoints = [
|
|
1321
1346
|
{
|
|
1322
1347
|
in: "./src/index.ts",
|
|
1323
1348
|
out: "./src/index.ts"
|
|
1324
1349
|
}
|
|
1325
1350
|
];
|
|
1326
1351
|
if (context2.options.entryPoints) {
|
|
1327
|
-
if (Array.isArray(context2.options.entryPoints)) {
|
|
1328
|
-
entryPoints = context2.options.entryPoints.map((entryPoint) => typeof entryPoint === "string" ? {
|
|
1329
|
-
in: entryPoint,
|
|
1330
|
-
out: entryPoint
|
|
1331
|
-
} : entryPoint);
|
|
1332
|
-
}
|
|
1333
1352
|
for (const entryPoint of entryPoints) {
|
|
1334
1353
|
const split = entryPoint.out.split(".");
|
|
1335
1354
|
split.pop();
|
|
@@ -1349,7 +1368,7 @@ async function generatePackageJson(context2) {
|
|
|
1349
1368
|
}
|
|
1350
1369
|
return ret;
|
|
1351
1370
|
}, packageJson.exports);
|
|
1352
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1371
|
+
await _devkit.writeJsonFile.call(void 0, _chunkOFLYCEQVjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1353
1372
|
stopwatch();
|
|
1354
1373
|
}
|
|
1355
1374
|
return context2;
|
|
@@ -1375,8 +1394,8 @@ async function generateContext(getOptions) {
|
|
|
1375
1394
|
}
|
|
1376
1395
|
_chunk3GQAWCBQjs.__name.call(void 0, generateContext, "generateContext");
|
|
1377
1396
|
async function executeEsBuild(context2) {
|
|
1378
|
-
|
|
1379
|
-
const stopwatch =
|
|
1397
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1398
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1380
1399
|
if (process.env.STORM_WATCH) {
|
|
1381
1400
|
const ctx = await esbuild2.context(context2.options);
|
|
1382
1401
|
watch(ctx, context2.options);
|
|
@@ -1384,7 +1403,7 @@ async function executeEsBuild(context2) {
|
|
|
1384
1403
|
const options = {
|
|
1385
1404
|
...context2.options
|
|
1386
1405
|
};
|
|
1387
|
-
options.outdir =
|
|
1406
|
+
options.outdir = _chunkOFLYCEQVjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1388
1407
|
if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
|
|
1389
1408
|
options.inject === {}) {
|
|
1390
1409
|
delete options.inject;
|
|
@@ -1398,7 +1417,6 @@ async function executeEsBuild(context2) {
|
|
|
1398
1417
|
delete options.clean;
|
|
1399
1418
|
delete options.debug;
|
|
1400
1419
|
delete options.generatePackageJson;
|
|
1401
|
-
delete options.emitOnAll;
|
|
1402
1420
|
delete options.distDir;
|
|
1403
1421
|
delete options.includeSrc;
|
|
1404
1422
|
delete options.verbose;
|
|
@@ -1410,8 +1428,11 @@ async function executeEsBuild(context2) {
|
|
|
1410
1428
|
delete options.config;
|
|
1411
1429
|
delete options.injectShims;
|
|
1412
1430
|
delete options.external;
|
|
1413
|
-
|
|
1414
|
-
${
|
|
1431
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1432
|
+
${_chunkOFLYCEQVjs.formatLogMessage.call(void 0, {
|
|
1433
|
+
...options,
|
|
1434
|
+
define: "<Hidden>"
|
|
1435
|
+
})}`, context2.options.config);
|
|
1415
1436
|
const result = await esbuild2.build(options);
|
|
1416
1437
|
await esbuild2.stop();
|
|
1417
1438
|
if (result.metafile) {
|
|
@@ -1423,9 +1444,9 @@ ${_chunkHLKD7LH2js.formatLogMessage.call(void 0, options)}`, context2.options.co
|
|
|
1423
1444
|
}
|
|
1424
1445
|
_chunk3GQAWCBQjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1425
1446
|
async function copyBuildAssets(context2) {
|
|
1426
|
-
if (_optionalChain([context2, 'access',
|
|
1427
|
-
|
|
1428
|
-
const stopwatch =
|
|
1447
|
+
if (_optionalChain([context2, 'access', _55 => _55.result, 'optionalAccess', _56 => _56.errors, 'access', _57 => _57.length]) === 0) {
|
|
1448
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1449
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1429
1450
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1430
1451
|
stopwatch();
|
|
1431
1452
|
}
|
|
@@ -1433,11 +1454,11 @@ async function copyBuildAssets(context2) {
|
|
|
1433
1454
|
}
|
|
1434
1455
|
_chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1435
1456
|
async function reportResults(context2) {
|
|
1436
|
-
if (_optionalChain([context2, 'access',
|
|
1457
|
+
if (_optionalChain([context2, 'access', _58 => _58.result, 'optionalAccess', _59 => _59.errors, 'access', _60 => _60.length]) === 0) {
|
|
1437
1458
|
if (context2.result.warnings.length > 0) {
|
|
1438
|
-
|
|
1459
|
+
_chunkOFLYCEQVjs.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);
|
|
1439
1460
|
}
|
|
1440
|
-
|
|
1461
|
+
_chunkOFLYCEQVjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1441
1462
|
}
|
|
1442
1463
|
}
|
|
1443
1464
|
_chunk3GQAWCBQjs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1473,8 +1494,8 @@ async function dependencyCheck(options) {
|
|
|
1473
1494
|
_chunk3GQAWCBQjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1474
1495
|
async function cleanOutputPath(context2) {
|
|
1475
1496
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
1476
|
-
|
|
1477
|
-
const stopwatch =
|
|
1497
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1498
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
|
|
1478
1499
|
await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
|
|
1479
1500
|
stopwatch();
|
|
1480
1501
|
}
|
|
@@ -1482,8 +1503,8 @@ async function cleanOutputPath(context2) {
|
|
|
1482
1503
|
}
|
|
1483
1504
|
_chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1484
1505
|
async function build3(options) {
|
|
1485
|
-
|
|
1486
|
-
const stopwatch =
|
|
1506
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1507
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1487
1508
|
try {
|
|
1488
1509
|
const opts = Array.isArray(options) ? options : [
|
|
1489
1510
|
options
|
|
@@ -1493,9 +1514,9 @@ async function build3(options) {
|
|
|
1493
1514
|
}
|
|
1494
1515
|
void transduce.async(opts, dependencyCheck);
|
|
1495
1516
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1496
|
-
|
|
1517
|
+
_chunkOFLYCEQVjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1497
1518
|
} catch (error) {
|
|
1498
|
-
|
|
1519
|
+
_chunkOFLYCEQVjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1499
1520
|
throw error;
|
|
1500
1521
|
} finally {
|
|
1501
1522
|
stopwatch();
|
|
@@ -1523,9 +1544,9 @@ var watch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (context2, opti
|
|
|
1523
1544
|
return context2.rebuild();
|
|
1524
1545
|
});
|
|
1525
1546
|
if (rebuildResult instanceof Error) {
|
|
1526
|
-
|
|
1547
|
+
_chunkOFLYCEQVjs.writeError.call(void 0, rebuildResult.message);
|
|
1527
1548
|
}
|
|
1528
|
-
|
|
1549
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1529
1550
|
}, 10);
|
|
1530
1551
|
changeWatcher.on("change", fastRebuild);
|
|
1531
1552
|
return void 0;
|
|
@@ -1533,15 +1554,15 @@ var watch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (context2, opti
|
|
|
1533
1554
|
|
|
1534
1555
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1535
1556
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1536
|
-
|
|
1537
|
-
if (!_optionalChain([context2, 'access',
|
|
1557
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1558
|
+
if (!_optionalChain([context2, 'access', _61 => _61.projectsConfigurations, 'optionalAccess', _62 => _62.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _63 => _63.projectsConfigurations, 'access', _64 => _64.projects, 'access', _65 => _65[context2.projectName], 'optionalAccess', _66 => _66.root])) {
|
|
1538
1559
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1539
1560
|
}
|
|
1540
1561
|
await build3({
|
|
1541
1562
|
...options,
|
|
1542
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1563
|
+
projectRoot: _optionalChain([context2, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'optionalAccess', _69 => _69[context2.projectName], 'access', _70 => _70.root]),
|
|
1543
1564
|
projectName: context2.projectName,
|
|
1544
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1565
|
+
sourceRoot: _optionalChain([context2, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'optionalAccess', _73 => _73[context2.projectName], 'optionalAccess', _74 => _74.sourceRoot]),
|
|
1545
1566
|
format: options.format,
|
|
1546
1567
|
platform: options.format
|
|
1547
1568
|
});
|
|
@@ -1550,7 +1571,7 @@ async function esbuildExecutorFn(options, context2, config) {
|
|
|
1550
1571
|
};
|
|
1551
1572
|
}
|
|
1552
1573
|
_chunk3GQAWCBQjs.__name.call(void 0, esbuildExecutorFn, "esbuildExecutorFn");
|
|
1553
|
-
var executor_default6 =
|
|
1574
|
+
var executor_default6 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Storm ESBuild build", esbuildExecutorFn, {
|
|
1554
1575
|
skipReadingConfig: false,
|
|
1555
1576
|
hooks: {
|
|
1556
1577
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
|
|
@@ -1584,25 +1605,25 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1584
1605
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1585
1606
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1586
1607
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1587
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1608
|
+
if (!_optionalChain([context2, 'optionalAccess', _75 => _75.projectName]) || !_optionalChain([context2, 'access', _76 => _76.projectsConfigurations, 'optionalAccess', _77 => _77.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1588
1609
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1589
1610
|
}
|
|
1590
|
-
|
|
1611
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1591
1612
|
_sizelimit2.default.call(void 0, [
|
|
1592
1613
|
_file2.default,
|
|
1593
1614
|
_esbuild3.default,
|
|
1594
1615
|
_esbuildwhy2.default
|
|
1595
1616
|
], {
|
|
1596
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1617
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _78 => _78.projectsConfigurations, 'access', _79 => _79.projects, 'access', _80 => _80[context2.projectName], 'optionalAccess', _81 => _81.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _82 => _82.projectsConfigurations, 'access', _83 => _83.projects, 'access', _84 => _84[context2.projectName], 'optionalAccess', _85 => _85.root]), () => ( "./")), "src")))
|
|
1597
1618
|
}).then((result) => {
|
|
1598
|
-
|
|
1619
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1599
1620
|
});
|
|
1600
1621
|
return {
|
|
1601
1622
|
success: true
|
|
1602
1623
|
};
|
|
1603
1624
|
}
|
|
1604
1625
|
_chunk3GQAWCBQjs.__name.call(void 0, sizeLimitExecutorFn, "sizeLimitExecutorFn");
|
|
1605
|
-
var executor_default7 =
|
|
1626
|
+
var executor_default7 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Size-Limit Performance Test Executor", sizeLimitExecutorFn, {
|
|
1606
1627
|
skipReadingConfig: false,
|
|
1607
1628
|
hooks: {
|
|
1608
1629
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -1616,11 +1637,11 @@ var _fsextra = require('fs-extra');
|
|
|
1616
1637
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1617
1638
|
async function typiaExecutorFn(options, _, config) {
|
|
1618
1639
|
if (options.clean !== false) {
|
|
1619
|
-
|
|
1640
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1620
1641
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1621
1642
|
}
|
|
1622
1643
|
await Promise.all(options.entry.map((entry) => {
|
|
1623
|
-
|
|
1644
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1624
1645
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1625
1646
|
input: entry,
|
|
1626
1647
|
output: options.outputPath,
|
|
@@ -1632,7 +1653,7 @@ async function typiaExecutorFn(options, _, config) {
|
|
|
1632
1653
|
};
|
|
1633
1654
|
}
|
|
1634
1655
|
_chunk3GQAWCBQjs.__name.call(void 0, typiaExecutorFn, "typiaExecutorFn");
|
|
1635
|
-
var executor_default8 =
|
|
1656
|
+
var executor_default8 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "Typia runtime validation generator", typiaExecutorFn, {
|
|
1636
1657
|
skipReadingConfig: false,
|
|
1637
1658
|
hooks: {
|
|
1638
1659
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -1651,8 +1672,8 @@ var executor_default8 = _chunkHLKD7LH2js.withRunExecutor.call(void 0, "Typia run
|
|
|
1651
1672
|
|
|
1652
1673
|
var _jiti = require('jiti');
|
|
1653
1674
|
async function unbuildExecutorFn(options, context2, config) {
|
|
1654
|
-
|
|
1655
|
-
if (!_optionalChain([context2, 'access',
|
|
1675
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1676
|
+
if (!_optionalChain([context2, 'access', _86 => _86.projectsConfigurations, 'optionalAccess', _87 => _87.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1656
1677
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
1657
1678
|
}
|
|
1658
1679
|
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
@@ -1662,7 +1683,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1662
1683
|
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.");
|
|
1663
1684
|
}
|
|
1664
1685
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
1665
|
-
fsCache: config.skipCache ? false :
|
|
1686
|
+
fsCache: config.skipCache ? false : _chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
1666
1687
|
interopDefault: true
|
|
1667
1688
|
});
|
|
1668
1689
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -1675,7 +1696,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1675
1696
|
}, {
|
|
1676
1697
|
stubOptions: {
|
|
1677
1698
|
jiti: {
|
|
1678
|
-
fsCache: config.skipCache ? false :
|
|
1699
|
+
fsCache: config.skipCache ? false : _chunkOFLYCEQVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
1679
1700
|
}
|
|
1680
1701
|
},
|
|
1681
1702
|
rollup: {
|
|
@@ -1699,7 +1720,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1699
1720
|
};
|
|
1700
1721
|
}
|
|
1701
1722
|
_chunk3GQAWCBQjs.__name.call(void 0, unbuildExecutorFn, "unbuildExecutorFn");
|
|
1702
|
-
var executor_default9 =
|
|
1723
|
+
var executor_default9 = _chunkOFLYCEQVjs.withRunExecutor.call(void 0, "TypeScript Unbuild build", unbuildExecutorFn, {
|
|
1703
1724
|
skipReadingConfig: false,
|
|
1704
1725
|
hooks: {
|
|
1705
1726
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
|
|
@@ -1722,58 +1743,58 @@ var executor_default9 = _chunkHLKD7LH2js.withRunExecutor.call(void 0, "TypeScrip
|
|
|
1722
1743
|
var withRunGenerator = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
1723
1744
|
skipReadingConfig: false
|
|
1724
1745
|
}) => async (tree, _options) => {
|
|
1725
|
-
const stopwatch =
|
|
1746
|
+
const stopwatch = _chunkOFLYCEQVjs.getStopwatch.call(void 0, name);
|
|
1726
1747
|
let options = _options;
|
|
1727
1748
|
let config;
|
|
1728
1749
|
try {
|
|
1729
|
-
|
|
1750
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1730
1751
|
|
|
1731
1752
|
`, config);
|
|
1732
|
-
const workspaceRoot3 =
|
|
1753
|
+
const workspaceRoot3 = _chunkOFLYCEQVjs.findWorkspaceRoot.call(void 0, );
|
|
1733
1754
|
if (!generatorOptions.skipReadingConfig) {
|
|
1734
|
-
|
|
1755
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
1735
1756
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
1736
|
-
config = await
|
|
1757
|
+
config = await _chunkOFLYCEQVjs.getConfig.call(void 0, workspaceRoot3);
|
|
1737
1758
|
}
|
|
1738
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1739
|
-
|
|
1759
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _88 => _88.hooks, 'optionalAccess', _89 => _89.applyDefaultOptions])) {
|
|
1760
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1740
1761
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
1741
|
-
|
|
1762
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1742
1763
|
}
|
|
1743
|
-
|
|
1764
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
1744
1765
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
1745
|
-
const tokenized = await
|
|
1766
|
+
const tokenized = await _chunkOFLYCEQVjs.applyWorkspaceTokens.call(void 0, options, {
|
|
1746
1767
|
workspaceRoot: tree.root,
|
|
1747
1768
|
config
|
|
1748
|
-
},
|
|
1749
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1750
|
-
|
|
1769
|
+
}, _chunkOFLYCEQVjs.applyWorkspaceBaseTokens);
|
|
1770
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _90 => _90.hooks, 'optionalAccess', _91 => _91.preProcess])) {
|
|
1771
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1751
1772
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
1752
|
-
|
|
1773
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
1753
1774
|
}
|
|
1754
1775
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
1755
1776
|
if (result) {
|
|
1756
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1777
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _92 => _92.error, 'optionalAccess', _93 => _93.message]) && typeof _optionalChain([result, 'optionalAccess', _94 => _94.error, 'optionalAccess', _95 => _95.message]) === "string" && _optionalChain([result, 'optionalAccess', _96 => _96.error, 'optionalAccess', _97 => _97.name]) && typeof _optionalChain([result, 'optionalAccess', _98 => _98.error, 'optionalAccess', _99 => _99.name]) === "string") {
|
|
1757
1778
|
throw new Error(`The ${name} generator failed to run`, {
|
|
1758
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1779
|
+
cause: _optionalChain([result, 'optionalAccess', _100 => _100.error])
|
|
1759
1780
|
});
|
|
1760
1781
|
} else if (result.success && result.data) {
|
|
1761
1782
|
return result;
|
|
1762
1783
|
}
|
|
1763
1784
|
}
|
|
1764
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1765
|
-
|
|
1785
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _101 => _101.hooks, 'optionalAccess', _102 => _102.postProcess])) {
|
|
1786
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1766
1787
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1767
|
-
|
|
1788
|
+
_chunkOFLYCEQVjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1768
1789
|
}
|
|
1769
1790
|
return () => {
|
|
1770
|
-
|
|
1791
|
+
_chunkOFLYCEQVjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1771
1792
|
`, config);
|
|
1772
1793
|
};
|
|
1773
1794
|
} catch (error) {
|
|
1774
1795
|
return () => {
|
|
1775
|
-
|
|
1776
|
-
|
|
1796
|
+
_chunkOFLYCEQVjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1797
|
+
_chunkOFLYCEQVjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
1777
1798
|
- Details: ${error.message}
|
|
1778
1799
|
- Stacktrace: ${error.stack}`, config);
|
|
1779
1800
|
};
|
|
@@ -1875,7 +1896,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1875
1896
|
const projectConfig = {
|
|
1876
1897
|
root: normalized.directory,
|
|
1877
1898
|
projectType: "library",
|
|
1878
|
-
sourceRoot:
|
|
1899
|
+
sourceRoot: _chunkOFLYCEQVjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
1879
1900
|
targets: {
|
|
1880
1901
|
build: {
|
|
1881
1902
|
executor: options.buildExecutor,
|
|
@@ -1884,11 +1905,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1884
1905
|
],
|
|
1885
1906
|
options: {
|
|
1886
1907
|
entry: [
|
|
1887
|
-
|
|
1908
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
1888
1909
|
],
|
|
1889
1910
|
outputPath: getOutputPath(normalized),
|
|
1890
|
-
tsconfig:
|
|
1891
|
-
project:
|
|
1911
|
+
tsconfig: _chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1912
|
+
project: _chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
1892
1913
|
defaultConfiguration: "production",
|
|
1893
1914
|
platform: "neutral",
|
|
1894
1915
|
assets: [
|
|
@@ -1927,22 +1948,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1927
1948
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
1928
1949
|
let repository = {
|
|
1929
1950
|
type: "github",
|
|
1930
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
1951
|
+
url: _optionalChain([config, 'optionalAccess', _103 => _103.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _104 => _104.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _105 => _105.namespace]) || _optionalChain([config, 'optionalAccess', _106 => _106.name]) || "repository"}.git`
|
|
1931
1952
|
};
|
|
1932
1953
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
1933
1954
|
if (tree.exists("package.json")) {
|
|
1934
1955
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
1935
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1956
|
+
if (_optionalChain([packageJson, 'optionalAccess', _107 => _107.repository])) {
|
|
1936
1957
|
repository = packageJson.repository;
|
|
1937
1958
|
}
|
|
1938
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1959
|
+
if (_optionalChain([packageJson, 'optionalAccess', _108 => _108.description])) {
|
|
1939
1960
|
description = packageJson.description;
|
|
1940
1961
|
}
|
|
1941
1962
|
}
|
|
1942
1963
|
if (!normalized.importPath) {
|
|
1943
1964
|
normalized.importPath = normalized.name;
|
|
1944
1965
|
}
|
|
1945
|
-
const packageJsonPath =
|
|
1966
|
+
const packageJsonPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
1946
1967
|
if (tree.exists(packageJsonPath)) {
|
|
1947
1968
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
1948
1969
|
if (!normalized.importPath) {
|
|
@@ -1990,30 +2011,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1990
2011
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
1991
2012
|
...json,
|
|
1992
2013
|
pnpm: {
|
|
1993
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2014
|
+
..._optionalChain([json, 'optionalAccess', _109 => _109.pnpm]),
|
|
1994
2015
|
overrides: {
|
|
1995
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2016
|
+
..._optionalChain([json, 'optionalAccess', _110 => _110.pnpm, 'optionalAccess', _111 => _111.overrides]),
|
|
1996
2017
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
1997
2018
|
}
|
|
1998
2019
|
}
|
|
1999
2020
|
}));
|
|
2000
2021
|
}
|
|
2001
2022
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2002
|
-
|
|
2023
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2003
2024
|
]);
|
|
2004
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2005
|
-
|
|
2025
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2026
|
+
_chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2006
2027
|
]);
|
|
2007
2028
|
if (tree.exists("package.json")) {
|
|
2008
2029
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2009
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2030
|
+
if (_optionalChain([packageJson, 'optionalAccess', _112 => _112.repository])) {
|
|
2010
2031
|
repository = packageJson.repository;
|
|
2011
2032
|
}
|
|
2012
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2033
|
+
if (_optionalChain([packageJson, 'optionalAccess', _113 => _113.description])) {
|
|
2013
2034
|
description = packageJson.description;
|
|
2014
2035
|
}
|
|
2015
2036
|
}
|
|
2016
|
-
const tsconfigPath =
|
|
2037
|
+
const tsconfigPath = _chunkOFLYCEQVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2017
2038
|
if (tree.exists(tsconfigPath)) {
|
|
2018
2039
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2019
2040
|
json.composite ??= true;
|
|
@@ -2051,42 +2072,42 @@ function getOutputPath(options) {
|
|
|
2051
2072
|
} else {
|
|
2052
2073
|
parts.push(options.projectRoot);
|
|
2053
2074
|
}
|
|
2054
|
-
return
|
|
2075
|
+
return _chunkOFLYCEQVjs.joinPaths.call(void 0, ...parts);
|
|
2055
2076
|
}
|
|
2056
2077
|
_chunk3GQAWCBQjs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2057
2078
|
function createProjectTsConfigJson(tree, options) {
|
|
2058
2079
|
const tsconfig = {
|
|
2059
2080
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2060
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2081
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _114 => _114.tsconfigOptions]), () => ( {})),
|
|
2061
2082
|
compilerOptions: {
|
|
2062
2083
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2063
|
-
outDir:
|
|
2084
|
+
outDir: _chunkOFLYCEQVjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2064
2085
|
noEmit: true,
|
|
2065
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2086
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _115 => _115.tsconfigOptions, 'optionalAccess', _116 => _116.compilerOptions]), () => ( {}))
|
|
2066
2087
|
},
|
|
2067
2088
|
files: [
|
|
2068
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2089
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _117 => _117.tsconfigOptions, 'optionalAccess', _118 => _118.files]), () => ( []))
|
|
2069
2090
|
],
|
|
2070
2091
|
include: [
|
|
2071
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2092
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _119 => _119.tsconfigOptions, 'optionalAccess', _120 => _120.include]), () => ( [])),
|
|
2072
2093
|
"src/**/*.ts",
|
|
2073
2094
|
"src/**/*.js",
|
|
2074
2095
|
"bin/**/*"
|
|
2075
2096
|
],
|
|
2076
2097
|
exclude: [
|
|
2077
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2098
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _121 => _121.tsconfigOptions, 'optionalAccess', _122 => _122.exclude]), () => ( [])),
|
|
2078
2099
|
"jest.config.ts",
|
|
2079
2100
|
"src/**/*.spec.ts",
|
|
2080
2101
|
"src/**/*.test.ts"
|
|
2081
2102
|
]
|
|
2082
2103
|
};
|
|
2083
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2104
|
+
_devkit.writeJson.call(void 0, tree, _chunkOFLYCEQVjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2084
2105
|
}
|
|
2085
2106
|
_chunk3GQAWCBQjs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2086
2107
|
async function normalizeOptions(tree, options, config) {
|
|
2087
2108
|
let importPath = options.importPath;
|
|
2088
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2089
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
2109
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _123 => _123.namespace])) {
|
|
2110
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _124 => _124.namespace])}/${options.name}`;
|
|
2090
2111
|
}
|
|
2091
2112
|
if (options.publishable) {
|
|
2092
2113
|
if (!importPath) {
|
|
@@ -2140,7 +2161,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2140
2161
|
|
|
2141
2162
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2142
2163
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2143
|
-
const filesDir =
|
|
2164
|
+
const filesDir = _chunkOFLYCEQVjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2144
2165
|
const tsLibraryGeneratorOptions = {
|
|
2145
2166
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2146
2167
|
platform: "browser",
|
|
@@ -2212,19 +2233,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2212
2233
|
|
|
2213
2234
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2214
2235
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2236
|
+
_chunkOFLYCEQVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2237
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2238
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkOFLYCEQVjs.stormWorkspaceConfigSchema, {
|
|
2218
2239
|
name: "StormWorkspaceConfiguration"
|
|
2219
2240
|
});
|
|
2220
|
-
|
|
2221
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2222
|
-
|
|
2241
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2242
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _125 => _125.workspaceRoot]), () => ( _chunkOFLYCEQVjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _126 => _126.outputFile, 'optionalAccess', _127 => _127.startsWith, 'call', _128 => _128("./")]) ? "" : "./");
|
|
2243
|
+
_chunkOFLYCEQVjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2223
2244
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2224
2245
|
spaces: 2
|
|
2225
2246
|
});
|
|
2226
2247
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2227
|
-
|
|
2248
|
+
_chunkOFLYCEQVjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2228
2249
|
return {
|
|
2229
2250
|
success: true
|
|
2230
2251
|
};
|
|
@@ -2263,7 +2284,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, initGenerator, "initGenerator");
|
|
|
2263
2284
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2264
2285
|
|
|
2265
2286
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2266
|
-
const filesDir =
|
|
2287
|
+
const filesDir = _chunkOFLYCEQVjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2267
2288
|
const tsLibraryGeneratorOptions = {
|
|
2268
2289
|
...schema,
|
|
2269
2290
|
platform: "neutral",
|
|
@@ -2306,7 +2327,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2306
2327
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2307
2328
|
|
|
2308
2329
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2309
|
-
const filesDir =
|
|
2330
|
+
const filesDir = _chunkOFLYCEQVjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2310
2331
|
const tsLibraryGeneratorOptions = {
|
|
2311
2332
|
platform: "node",
|
|
2312
2333
|
devDependencies: {
|