@storm-software/terraform-tools 0.54.64 → 0.54.65
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/README.md +1 -1
- package/dist/{chunk-ASFTANKT.mjs → chunk-4SYDCN3A.mjs} +1 -1
- package/dist/{chunk-3OHP5XR7.mjs → chunk-DYXYEK43.mjs} +1 -1
- package/dist/{chunk-EVACDYVV.js → chunk-ESAA5DIO.js} +2 -2
- package/dist/{chunk-DLJYMU67.js → chunk-FC5AL6FF.js} +8 -27
- package/dist/{chunk-6DHDE4R5.mjs → chunk-GUH7JMSX.mjs} +21 -3
- package/dist/{chunk-IQBE77EA.mjs → chunk-HIHHRCT4.mjs} +1 -1
- package/dist/{chunk-YRJ6SG2R.js → chunk-JPGERIM3.js} +2 -2
- package/dist/{chunk-JJLWDVUK.js → chunk-LXKO7ZLH.js} +2 -2
- package/dist/{chunk-VGSUCQ2S.mjs → chunk-N7GSKHH2.mjs} +1 -1
- package/dist/{chunk-YKYW2IDQ.js → chunk-RB36TVDB.js} +258 -1118
- package/dist/{chunk-5L6S5MSQ.mjs → chunk-RW373JXN.mjs} +9 -28
- package/dist/{chunk-MVJYL7QB.mjs → chunk-S53JCUPE.mjs} +1 -1
- package/dist/{chunk-6DOGULXV.mjs → chunk-UAT7XLGY.mjs} +180 -1040
- package/dist/{chunk-DHBOQ6QN.js → chunk-YBMM6DDX.js} +2 -2
- package/dist/{chunk-JYWO443U.js → chunk-ZAMME4JX.js} +23 -5
- package/dist/executors.js +6 -6
- package/dist/executors.mjs +7 -7
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +3 -3
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/dist/src/base/base-terraform-executor.untyped.mjs +1 -1
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +3 -3
- package/dist/src/base/terraform-executor.js +3 -3
- package/dist/src/base/terraform-executor.mjs +3 -3
- package/dist/src/executors/apply/executor.js +4 -4
- package/dist/src/executors/apply/executor.mjs +4 -4
- package/dist/src/executors/destroy/executor.js +4 -4
- package/dist/src/executors/destroy/executor.mjs +4 -4
- package/dist/src/executors/output/executor.js +4 -4
- package/dist/src/executors/output/executor.mjs +4 -4
- package/dist/src/executors/plan/executor.js +4 -4
- package/dist/src/executors/plan/executor.mjs +4 -4
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +3 -3
- package/dist/tsup.config.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -15,10 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunkDLJYMU67js = require('./chunk-DLJYMU67.js');
|
|
18
|
+
var _chunkFC5AL6FFjs = require('./chunk-FC5AL6FF.js');
|
|
22
19
|
|
|
23
20
|
|
|
24
21
|
|
|
@@ -30,7 +27,7 @@ var _devkit = require('@nx/devkit');
|
|
|
30
27
|
// ../workspace-tools/src/utils/cargo.ts
|
|
31
28
|
|
|
32
29
|
var _child_process = require('child_process');
|
|
33
|
-
var _path = require('path'); var
|
|
30
|
+
var _path = require('path'); var path3 = _interopRequireWildcard(_path);
|
|
34
31
|
var INVALID_CARGO_ARGS = [
|
|
35
32
|
"allFeatures",
|
|
36
33
|
"allTargets",
|
|
@@ -39,7 +36,7 @@ var INVALID_CARGO_ARGS = [
|
|
|
39
36
|
"package",
|
|
40
37
|
"tsConfig"
|
|
41
38
|
];
|
|
42
|
-
var buildCargoCommand = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (baseCommand, options,
|
|
39
|
+
var buildCargoCommand = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (baseCommand, options, context) => {
|
|
43
40
|
const args = [];
|
|
44
41
|
if (options.toolchain && options.toolchain !== "stable") {
|
|
45
42
|
args.push(`+${options.toolchain}`);
|
|
@@ -61,8 +58,8 @@ var buildCargoCommand = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (ba
|
|
|
61
58
|
args.push(`--${key}`, String(value));
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
|
-
if (
|
|
65
|
-
args.push("-p",
|
|
61
|
+
if (context.projectName) {
|
|
62
|
+
args.push("-p", context.projectName);
|
|
66
63
|
}
|
|
67
64
|
if (options.allFeatures && !args.includes("--all-features")) {
|
|
68
65
|
args.push("--all-features");
|
|
@@ -154,12 +151,12 @@ function runProcess(processCmd, ...args) {
|
|
|
154
151
|
_chunk3GQAWCBQjs.__name.call(void 0, runProcess, "runProcess");
|
|
155
152
|
|
|
156
153
|
// ../workspace-tools/src/executors/cargo-build/executor.ts
|
|
157
|
-
async function cargoBuildExecutor(options,
|
|
158
|
-
const command = buildCargoCommand("build", options,
|
|
154
|
+
async function cargoBuildExecutor(options, context) {
|
|
155
|
+
const command = buildCargoCommand("build", options, context);
|
|
159
156
|
return await cargoCommand(...command);
|
|
160
157
|
}
|
|
161
158
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoBuildExecutor, "cargoBuildExecutor");
|
|
162
|
-
var executor_default =
|
|
159
|
+
var executor_default = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Cargo Build", cargoBuildExecutor, {
|
|
163
160
|
skipReadingConfig: false,
|
|
164
161
|
hooks: {
|
|
165
162
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -171,12 +168,12 @@ var executor_default = _chunkDLJYMU67js.withRunExecutor.call(void 0, "Cargo Buil
|
|
|
171
168
|
});
|
|
172
169
|
|
|
173
170
|
// ../workspace-tools/src/executors/cargo-check/executor.ts
|
|
174
|
-
async function cargoCheckExecutor(options,
|
|
175
|
-
const command = buildCargoCommand("check", options,
|
|
171
|
+
async function cargoCheckExecutor(options, context) {
|
|
172
|
+
const command = buildCargoCommand("check", options, context);
|
|
176
173
|
return await cargoCommand(...command);
|
|
177
174
|
}
|
|
178
175
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoCheckExecutor, "cargoCheckExecutor");
|
|
179
|
-
var executor_default2 =
|
|
176
|
+
var executor_default2 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Cargo Check", cargoCheckExecutor, {
|
|
180
177
|
skipReadingConfig: false,
|
|
181
178
|
hooks: {
|
|
182
179
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -187,12 +184,12 @@ var executor_default2 = _chunkDLJYMU67js.withRunExecutor.call(void 0, "Cargo Che
|
|
|
187
184
|
});
|
|
188
185
|
|
|
189
186
|
// ../workspace-tools/src/executors/cargo-clippy/executor.ts
|
|
190
|
-
async function cargoClippyExecutor(options,
|
|
191
|
-
const command = buildCargoCommand("clippy", options,
|
|
187
|
+
async function cargoClippyExecutor(options, context) {
|
|
188
|
+
const command = buildCargoCommand("clippy", options, context);
|
|
192
189
|
return await cargoCommand(...command);
|
|
193
190
|
}
|
|
194
191
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoClippyExecutor, "cargoClippyExecutor");
|
|
195
|
-
var executor_default3 =
|
|
192
|
+
var executor_default3 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Cargo Clippy", cargoClippyExecutor, {
|
|
196
193
|
skipReadingConfig: false,
|
|
197
194
|
hooks: {
|
|
198
195
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -204,17 +201,17 @@ var executor_default3 = _chunkDLJYMU67js.withRunExecutor.call(void 0, "Cargo Cli
|
|
|
204
201
|
});
|
|
205
202
|
|
|
206
203
|
// ../workspace-tools/src/executors/cargo-doc/executor.ts
|
|
207
|
-
async function cargoDocExecutor(options,
|
|
204
|
+
async function cargoDocExecutor(options, context) {
|
|
208
205
|
const opts = {
|
|
209
206
|
...options
|
|
210
207
|
};
|
|
211
208
|
opts["no-deps"] = opts.noDeps;
|
|
212
209
|
delete opts.noDeps;
|
|
213
|
-
const command = buildCargoCommand("doc", options,
|
|
210
|
+
const command = buildCargoCommand("doc", options, context);
|
|
214
211
|
return await cargoCommand(...command);
|
|
215
212
|
}
|
|
216
213
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoDocExecutor, "cargoDocExecutor");
|
|
217
|
-
var executor_default4 =
|
|
214
|
+
var executor_default4 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Cargo Doc", cargoDocExecutor, {
|
|
218
215
|
skipReadingConfig: false,
|
|
219
216
|
hooks: {
|
|
220
217
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -232,12 +229,12 @@ var executor_default4 = _chunkDLJYMU67js.withRunExecutor.call(void 0, "Cargo Doc
|
|
|
232
229
|
});
|
|
233
230
|
|
|
234
231
|
// ../workspace-tools/src/executors/cargo-format/executor.ts
|
|
235
|
-
async function cargoFormatExecutor(options,
|
|
236
|
-
const command = buildCargoCommand("fmt", options,
|
|
232
|
+
async function cargoFormatExecutor(options, context) {
|
|
233
|
+
const command = buildCargoCommand("fmt", options, context);
|
|
237
234
|
return await cargoCommand(...command);
|
|
238
235
|
}
|
|
239
236
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoFormatExecutor, "cargoFormatExecutor");
|
|
240
|
-
var executor_default5 =
|
|
237
|
+
var executor_default5 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Cargo Format", cargoFormatExecutor, {
|
|
241
238
|
skipReadingConfig: false,
|
|
242
239
|
hooks: {
|
|
243
240
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -318,8 +315,8 @@ var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (con
|
|
|
318
315
|
output: "src/"
|
|
319
316
|
});
|
|
320
317
|
}
|
|
321
|
-
|
|
322
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
318
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
319
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkFC5AL6FFjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
323
320
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
324
321
|
projectDir: projectRoot,
|
|
325
322
|
rootDir: config.workspaceRoot,
|
|
@@ -328,12 +325,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
328
325
|
});
|
|
329
326
|
await assetHandler.processAllAssetsOnce();
|
|
330
327
|
if (includeSrc === true) {
|
|
331
|
-
|
|
328
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkFC5AL6FFjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
332
329
|
const files = await _glob.glob.call(void 0, [
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
330
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
331
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
332
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
333
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
337
334
|
]);
|
|
338
335
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
339
336
|
|
|
@@ -356,7 +353,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
356
353
|
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
354
|
const projectNode = project.node;
|
|
358
355
|
if (projectNode.data.root) {
|
|
359
|
-
const projectPackageJsonPath =
|
|
356
|
+
const projectPackageJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
360
357
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
361
358
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
362
359
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -367,8 +364,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
367
364
|
}
|
|
368
365
|
}
|
|
369
366
|
if (localPackages.length > 0) {
|
|
370
|
-
|
|
371
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
367
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
368
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkFC5AL6FFjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
372
369
|
const projectJson = JSON.parse(projectJsonFile);
|
|
373
370
|
const projectName2 = projectJson.name;
|
|
374
371
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
@@ -377,7 +374,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
377
374
|
}
|
|
378
375
|
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
376
|
if (_optionalChain([projectConfigurations, 'access', _18 => _18.projects, 'optionalAccess', _19 => _19[dep]])) {
|
|
380
|
-
const depPackageJsonPath =
|
|
377
|
+
const depPackageJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
|
|
381
378
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
382
379
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
383
380
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -401,13 +398,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
401
398
|
return ret;
|
|
402
399
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
403
400
|
} else {
|
|
404
|
-
|
|
401
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
405
402
|
}
|
|
406
403
|
return packageJson;
|
|
407
404
|
}, "addPackageDependencies");
|
|
408
|
-
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (
|
|
409
|
-
const workspaceRoot3 =
|
|
410
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
405
|
+
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
406
|
+
const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkFC5AL6FFjs.findWorkspaceRoot.call(void 0, );
|
|
407
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
411
408
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
412
409
|
packageJson.type ??= "module";
|
|
413
410
|
packageJson.sideEffects ??= false;
|
|
@@ -416,7 +413,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
416
413
|
if (distSrc.startsWith("/")) {
|
|
417
414
|
distSrc = distSrc.substring(1);
|
|
418
415
|
}
|
|
419
|
-
packageJson.source ??= `${
|
|
416
|
+
packageJson.source ??= `${_chunkFC5AL6FFjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
420
417
|
}
|
|
421
418
|
packageJson.files ??= [
|
|
422
419
|
"dist/**/*"
|
|
@@ -447,7 +444,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
447
444
|
];
|
|
448
445
|
}
|
|
449
446
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
450
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
447
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkFC5AL6FFjs.joinPaths.call(void 0, "packages", projectName);
|
|
451
448
|
return packageJson;
|
|
452
449
|
}, "addWorkspacePackageJsonFields");
|
|
453
450
|
|
|
@@ -479,157 +476,16 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
|
479
476
|
var _chokidar = require('chokidar');
|
|
480
477
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
481
478
|
var _estoolkit = require('es-toolkit');
|
|
482
|
-
var
|
|
483
|
-
var _esbuild = require('esbuild'); var esbuild2 = _interopRequireWildcard(_esbuild); var esbuild = _interopRequireWildcard(_esbuild);
|
|
479
|
+
var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
|
|
484
480
|
var _globby = require('globby');
|
|
485
481
|
|
|
486
482
|
|
|
487
483
|
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
488
|
-
|
|
489
|
-
// ../esbuild/src/base/renderer-engine.ts
|
|
490
|
-
|
|
491
|
-
var _sourcemap = require('source-map');
|
|
492
|
-
|
|
493
|
-
// ../esbuild/src/utilities/output-file.ts
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
var outputFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (filepath, data, options) => {
|
|
497
|
-
await _fs2.default.promises.mkdir(path6.default.dirname(filepath), {
|
|
498
|
-
recursive: true
|
|
499
|
-
});
|
|
500
|
-
await _fs2.default.promises.writeFile(filepath, data, options);
|
|
501
|
-
}, "outputFile");
|
|
502
|
-
|
|
503
|
-
// ../esbuild/src/base/renderer-engine.ts
|
|
504
|
-
var parseSourceMap = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (map2) => {
|
|
505
|
-
return typeof map2 === "string" ? JSON.parse(map2) : map2;
|
|
506
|
-
}, "parseSourceMap");
|
|
507
|
-
var isJS = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (path7) => /\.(js|mjs|cjs)$/.test(path7), "isJS");
|
|
508
|
-
var isCSS = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (path7) => /\.css$/.test(path7), "isCSS");
|
|
509
|
-
var getSourcemapComment = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (inline, map2, filepath, isCssFile) => {
|
|
510
|
-
if (!map2) return "";
|
|
511
|
-
const prefix = isCssFile ? "/*" : "//";
|
|
512
|
-
const suffix = isCssFile ? " */" : "";
|
|
513
|
-
const url = inline ? `data:application/json;base64,${Buffer.from(typeof map2 === "string" ? map2 : JSON.stringify(map2)).toString("base64")}` : `${path6.default.basename(filepath)}.map`;
|
|
514
|
-
return `${prefix}# sourceMappingURL=${url}${suffix}`;
|
|
515
|
-
}, "getSourcemapComment");
|
|
516
|
-
var RendererEngine = class {
|
|
517
|
-
static {
|
|
518
|
-
_chunk3GQAWCBQjs.__name.call(void 0, this, "RendererEngine");
|
|
519
|
-
}
|
|
520
|
-
#renderers;
|
|
521
|
-
#options;
|
|
522
|
-
constructor(renderers) {
|
|
523
|
-
this.#renderers = renderers;
|
|
524
|
-
}
|
|
525
|
-
setOptions(options) {
|
|
526
|
-
this.#options = options;
|
|
527
|
-
}
|
|
528
|
-
getOptions() {
|
|
529
|
-
if (!this.#options) {
|
|
530
|
-
throw new Error(`Renderer options is not set`);
|
|
531
|
-
}
|
|
532
|
-
return this.#options;
|
|
533
|
-
}
|
|
534
|
-
modifyEsbuildOptions(options) {
|
|
535
|
-
for (const renderer of this.#renderers) {
|
|
536
|
-
if (renderer.esbuildOptions) {
|
|
537
|
-
renderer.esbuildOptions.call(this.getOptions(), options);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
async buildStarted() {
|
|
542
|
-
for (const renderer of this.#renderers) {
|
|
543
|
-
if (renderer.buildStart) {
|
|
544
|
-
await renderer.buildStart.call(this.getOptions());
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
async buildFinished({ outputFiles, metafile }) {
|
|
549
|
-
const files = outputFiles.filter((file) => !file.path.endsWith(".map")).map((file) => {
|
|
550
|
-
if (isJS(file.path) || isCSS(file.path)) {
|
|
551
|
-
let relativePath = path6.default.relative(this.getOptions().config.workspaceRoot, file.path);
|
|
552
|
-
if (!relativePath.startsWith("\\\\?\\")) {
|
|
553
|
-
relativePath = relativePath.replace(/\\/g, "/");
|
|
554
|
-
}
|
|
555
|
-
const meta = _optionalChain([metafile, 'optionalAccess', _28 => _28.outputs, 'access', _29 => _29[relativePath]]);
|
|
556
|
-
return {
|
|
557
|
-
type: "chunk",
|
|
558
|
-
path: file.path,
|
|
559
|
-
code: file.text,
|
|
560
|
-
map: _optionalChain([outputFiles, 'access', _30 => _30.find, 'call', _31 => _31((f) => f.path === `${file.path}.map`), 'optionalAccess', _32 => _32.text]),
|
|
561
|
-
entryPoint: _optionalChain([meta, 'optionalAccess', _33 => _33.entryPoint]),
|
|
562
|
-
exports: _optionalChain([meta, 'optionalAccess', _34 => _34.exports]),
|
|
563
|
-
imports: _optionalChain([meta, 'optionalAccess', _35 => _35.imports])
|
|
564
|
-
};
|
|
565
|
-
} else {
|
|
566
|
-
return {
|
|
567
|
-
type: "asset",
|
|
568
|
-
path: file.path,
|
|
569
|
-
contents: file.contents
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
const writtenFiles = [];
|
|
574
|
-
await Promise.all(files.map(async (info) => {
|
|
575
|
-
for (const renderer of this.#renderers) {
|
|
576
|
-
if (info.type === "chunk" && renderer.renderChunk) {
|
|
577
|
-
const result = await renderer.renderChunk.call(this.getOptions(), info.code, info);
|
|
578
|
-
if (result) {
|
|
579
|
-
info.code = result.code;
|
|
580
|
-
if (result.map) {
|
|
581
|
-
const originalConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(info.map));
|
|
582
|
-
const newConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(result.map));
|
|
583
|
-
const generator = _sourcemap.SourceMapGenerator.fromSourceMap(newConsumer);
|
|
584
|
-
generator.applySourceMap(originalConsumer, info.path);
|
|
585
|
-
info.map = generator.toJSON();
|
|
586
|
-
originalConsumer.destroy();
|
|
587
|
-
newConsumer.destroy();
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
const inlineSourceMap = this.#options.sourcemap === "inline";
|
|
593
|
-
const contents = info.type === "chunk" ? info.code + getSourcemapComment(inlineSourceMap, info.map, info.path, isCSS(info.path)) : info.contents;
|
|
594
|
-
await outputFile(info.path, contents, {
|
|
595
|
-
mode: info.type === "chunk" ? info.mode : void 0
|
|
596
|
-
});
|
|
597
|
-
writtenFiles.push({
|
|
598
|
-
get name() {
|
|
599
|
-
return path6.default.relative(process.cwd(), info.path);
|
|
600
|
-
},
|
|
601
|
-
get size() {
|
|
602
|
-
return contents.length;
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
if (info.type === "chunk" && info.map && !inlineSourceMap) {
|
|
606
|
-
const map2 = typeof info.map === "string" ? JSON.parse(info.map) : info.map;
|
|
607
|
-
const outPath = `${info.path}.map`;
|
|
608
|
-
const contents2 = JSON.stringify(map2);
|
|
609
|
-
await outputFile(outPath, contents2);
|
|
610
|
-
writtenFiles.push({
|
|
611
|
-
get name() {
|
|
612
|
-
return path6.default.relative(process.cwd(), outPath);
|
|
613
|
-
},
|
|
614
|
-
get size() {
|
|
615
|
-
return contents2.length;
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
}));
|
|
620
|
-
for (const renderer of this.#renderers) {
|
|
621
|
-
if (renderer.buildEnd) {
|
|
622
|
-
await renderer.buildEnd.call(this.getOptions(), {
|
|
623
|
-
writtenFiles
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
};
|
|
484
|
+
var _tsup = require('tsup');
|
|
629
485
|
|
|
630
486
|
// ../esbuild/src/clean.ts
|
|
631
487
|
|
|
632
|
-
async function cleanDirectories(
|
|
488
|
+
async function cleanDirectories(directory) {
|
|
633
489
|
await _promises.rm.call(void 0, directory, {
|
|
634
490
|
recursive: true,
|
|
635
491
|
force: true
|
|
@@ -637,315 +493,24 @@ async function cleanDirectories(name = "ESBuild", directory, config) {
|
|
|
637
493
|
}
|
|
638
494
|
_chunk3GQAWCBQjs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
639
495
|
|
|
640
|
-
// ../esbuild/src/plugins/esm-split-code-to-cjs.ts
|
|
641
|
-
|
|
642
|
-
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
643
|
-
name: "storm:esm-split-code-to-cjs",
|
|
644
|
-
setup(build4) {
|
|
645
|
-
build4.onEnd(async (result) => {
|
|
646
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _36 => _36.metafile, 'optionalAccess', _37 => _37.outputs]), () => ( {})));
|
|
647
|
-
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
648
|
-
await esbuild.build({
|
|
649
|
-
outdir: resolvedOptions.outdir,
|
|
650
|
-
entryPoints: jsFiles,
|
|
651
|
-
allowOverwrite: true,
|
|
652
|
-
format: "cjs",
|
|
653
|
-
logLevel: "error",
|
|
654
|
-
packages: "external"
|
|
655
|
-
});
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
}), "esmSplitCodeToCjsPlugin");
|
|
659
|
-
|
|
660
|
-
// ../esbuild/src/plugins/fix-imports.ts
|
|
661
|
-
var fixImportsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
662
|
-
name: "storm:fix-imports",
|
|
663
|
-
setup(build4) {
|
|
664
|
-
build4.onResolve({
|
|
665
|
-
filter: /^spdx-exceptions/
|
|
666
|
-
}, () => {
|
|
667
|
-
return {
|
|
668
|
-
path: _chunk3GQAWCBQjs.__require.resolve("spdx-exceptions")
|
|
669
|
-
};
|
|
670
|
-
});
|
|
671
|
-
build4.onResolve({
|
|
672
|
-
filter: /^spdx-license-ids/
|
|
673
|
-
}, () => {
|
|
674
|
-
return {
|
|
675
|
-
path: _chunk3GQAWCBQjs.__require.resolve("spdx-license-ids")
|
|
676
|
-
};
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
}), "fixImportsPlugin");
|
|
680
|
-
|
|
681
|
-
// ../esbuild/src/plugins/native-node-module.ts
|
|
682
|
-
|
|
683
|
-
var nativeNodeModulesPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
684
|
-
return {
|
|
685
|
-
name: "native-node-modules",
|
|
686
|
-
setup(build4) {
|
|
687
|
-
build4.onResolve({
|
|
688
|
-
filter: /\.node$/,
|
|
689
|
-
namespace: "file"
|
|
690
|
-
}, (args) => {
|
|
691
|
-
const resolvedId = _chunk3GQAWCBQjs.__require.resolve(args.path, {
|
|
692
|
-
paths: [
|
|
693
|
-
args.resolveDir
|
|
694
|
-
]
|
|
695
|
-
});
|
|
696
|
-
if (resolvedId.endsWith(".node")) {
|
|
697
|
-
return {
|
|
698
|
-
path: resolvedId,
|
|
699
|
-
namespace: "node-file"
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
path: resolvedId
|
|
704
|
-
};
|
|
705
|
-
});
|
|
706
|
-
build4.onLoad({
|
|
707
|
-
filter: /.*/,
|
|
708
|
-
namespace: "node-file"
|
|
709
|
-
}, (args) => {
|
|
710
|
-
return {
|
|
711
|
-
contents: `
|
|
712
|
-
import path from ${JSON.stringify(args.path)}
|
|
713
|
-
try { module.exports = require(path) }
|
|
714
|
-
catch {}
|
|
715
|
-
`,
|
|
716
|
-
resolveDir: _path.dirname.call(void 0, args.path)
|
|
717
|
-
};
|
|
718
|
-
});
|
|
719
|
-
build4.onResolve({
|
|
720
|
-
filter: /\.node$/,
|
|
721
|
-
namespace: "node-file"
|
|
722
|
-
}, (args) => ({
|
|
723
|
-
path: args.path,
|
|
724
|
-
namespace: "file"
|
|
725
|
-
}));
|
|
726
|
-
const opts = build4.initialOptions;
|
|
727
|
-
opts.loader = opts.loader || {};
|
|
728
|
-
opts.loader[".node"] = "file";
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
}, "nativeNodeModulesPlugin");
|
|
732
|
-
|
|
733
|
-
// ../esbuild/src/plugins/node-protocol.ts
|
|
734
|
-
var nodeProtocolPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
735
|
-
const nodeProtocol = "node:";
|
|
736
|
-
return {
|
|
737
|
-
name: "node-protocol-plugin",
|
|
738
|
-
setup({ onResolve }) {
|
|
739
|
-
onResolve({
|
|
740
|
-
filter: /^node:/
|
|
741
|
-
}, ({ path: path7 }) => ({
|
|
742
|
-
path: path7.slice(nodeProtocol.length),
|
|
743
|
-
external: true
|
|
744
|
-
}));
|
|
745
|
-
}
|
|
746
|
-
};
|
|
747
|
-
}, "nodeProtocolPlugin");
|
|
748
|
-
|
|
749
|
-
// ../esbuild/src/plugins/on-error.ts
|
|
750
|
-
var onErrorPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
751
|
-
name: "storm:on-error",
|
|
752
|
-
setup(build4) {
|
|
753
|
-
build4.onEnd((result) => {
|
|
754
|
-
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
755
|
-
_chunkDLJYMU67js.writeError.call(void 0, `The following errors occurred during the build:
|
|
756
|
-
${result.errors.map((error) => error.text).join("\n")}
|
|
757
|
-
|
|
758
|
-
`, resolvedOptions.config);
|
|
759
|
-
throw new Error("Storm esbuild process failed with errors.");
|
|
760
|
-
}
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
}), "onErrorPlugin");
|
|
764
|
-
|
|
765
|
-
// ../esbuild/src/plugins/resolve-paths.ts
|
|
766
|
-
|
|
767
|
-
function resolvePathsConfig(options, cwd) {
|
|
768
|
-
if (_optionalChain([options, 'optionalAccess', _38 => _38.compilerOptions, 'optionalAccess', _39 => _39.paths])) {
|
|
769
|
-
const paths = Object.entries(options.compilerOptions.paths);
|
|
770
|
-
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
771
|
-
return [
|
|
772
|
-
key,
|
|
773
|
-
paths2.map((v) => path6.default.resolve(cwd, v))
|
|
774
|
-
];
|
|
775
|
-
});
|
|
776
|
-
return Object.fromEntries(resolvedPaths);
|
|
777
|
-
}
|
|
778
|
-
if (options.extends) {
|
|
779
|
-
const extendsPath = path6.default.resolve(cwd, options.extends);
|
|
780
|
-
const extendsDir = path6.default.dirname(extendsPath);
|
|
781
|
-
const extendsConfig = _chunk3GQAWCBQjs.__require.call(void 0, extendsPath);
|
|
782
|
-
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
783
|
-
}
|
|
784
|
-
return [];
|
|
785
|
-
}
|
|
786
|
-
_chunk3GQAWCBQjs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
787
|
-
var resolvePathsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
788
|
-
name: "storm:resolve-paths",
|
|
789
|
-
setup(build4) {
|
|
790
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunk3GQAWCBQjs.__require.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunk3GQAWCBQjs.__require.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
791
|
-
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
792
|
-
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
793
|
-
build4.onResolve({
|
|
794
|
-
filter: packagesRegex
|
|
795
|
-
}, (args) => {
|
|
796
|
-
if (_optionalChain([build4, 'access', _40 => _40.initialOptions, 'access', _41 => _41.external, 'optionalAccess', _42 => _42.includes, 'call', _43 => _43(args.path)])) {
|
|
797
|
-
return {
|
|
798
|
-
path: args.path,
|
|
799
|
-
external: true
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
return {
|
|
803
|
-
path: `${resolvedTsPaths[args.path][0]}/index.ts`
|
|
804
|
-
};
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
}), "resolvePathsPlugin");
|
|
808
|
-
|
|
809
|
-
// ../esbuild/src/plugins/tsc.ts
|
|
810
|
-
var _apiextractor = require('@microsoft/api-extractor');
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
814
|
-
const { dependencies, peerDependencies, devDependencies } = _chunk3GQAWCBQjs.__require.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
815
|
-
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
816
|
-
p,
|
|
817
|
-
getTypeDependencyPackageName(p)
|
|
818
|
-
]);
|
|
819
|
-
const peerDependenciesKeys = Object.keys(_nullishCoalesce(peerDependencies, () => ( {}))).flatMap((p) => [
|
|
820
|
-
p,
|
|
821
|
-
getTypeDependencyPackageName(p)
|
|
822
|
-
]);
|
|
823
|
-
const devDependenciesKeys = Object.keys(_nullishCoalesce(devDependencies, () => ( {}))).flatMap((p) => [
|
|
824
|
-
p,
|
|
825
|
-
getTypeDependencyPackageName(p)
|
|
826
|
-
]);
|
|
827
|
-
const includeDeps = devDependenciesKeys;
|
|
828
|
-
const excludeDeps = /* @__PURE__ */ new Set([
|
|
829
|
-
...dependenciesKeys,
|
|
830
|
-
...peerDependenciesKeys,
|
|
831
|
-
...externals
|
|
832
|
-
]);
|
|
833
|
-
const bundledPackages = includeDeps.filter((dep) => !excludeDeps.has(dep));
|
|
834
|
-
const extractorConfig = _apiextractor.ExtractorConfig.prepare({
|
|
835
|
-
configObject: {
|
|
836
|
-
projectFolder: options.projectRoot,
|
|
837
|
-
mainEntryPointFilePath: filename,
|
|
838
|
-
bundledPackages,
|
|
839
|
-
compiler: {
|
|
840
|
-
tsconfigFilePath: options.tsconfig,
|
|
841
|
-
overrideTsconfig: {
|
|
842
|
-
compilerOptions: {
|
|
843
|
-
paths: {}
|
|
844
|
-
// bug with api extract + paths
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
dtsRollup: {
|
|
849
|
-
enabled: true,
|
|
850
|
-
untrimmedFilePath: _chunkDLJYMU67js.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
851
|
-
},
|
|
852
|
-
tsdocMetadata: {
|
|
853
|
-
enabled: false
|
|
854
|
-
}
|
|
855
|
-
},
|
|
856
|
-
packageJsonFullPath: _chunkDLJYMU67js.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
857
|
-
configObjectFullPath: void 0
|
|
858
|
-
});
|
|
859
|
-
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
860
|
-
showVerboseMessages: true,
|
|
861
|
-
localBuild: true
|
|
862
|
-
});
|
|
863
|
-
if (extractorResult.succeeded === false) {
|
|
864
|
-
_chunkDLJYMU67js.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
865
|
-
throw new Error("API Extractor completed with errors");
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
_chunk3GQAWCBQjs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
869
|
-
var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
870
|
-
name: "storm:tsc",
|
|
871
|
-
setup(build4) {
|
|
872
|
-
if (options.dts === false) {
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
build4.onStart(async () => {
|
|
876
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
877
|
-
await _chunkDLJYMU67js.run.call(void 0, resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
878
|
-
}
|
|
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")) {
|
|
880
|
-
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
881
|
-
const typeOutDir = resolvedOptions.outdir;
|
|
882
|
-
const entryPoint = resolvedOptions.entryPoints[0].in.replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
883
|
-
const bundlePath = _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
884
|
-
let dtsPath;
|
|
885
|
-
if (_fs.existsSync.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
886
|
-
dtsPath = _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
887
|
-
} else if (_fs.existsSync.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
888
|
-
dtsPath = _chunkDLJYMU67js.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
889
|
-
}
|
|
890
|
-
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
891
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
892
|
-
bundleTypeDefinitions(dtsPath, bundlePath, _nullishCoalesce(resolvedOptions.external, () => ( [])), resolvedOptions);
|
|
893
|
-
const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
|
|
894
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, dtsContents);
|
|
895
|
-
} else {
|
|
896
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
}), "tscPlugin");
|
|
902
|
-
function getTypeDependencyPackageName(npmPackage) {
|
|
903
|
-
if (npmPackage.startsWith("@")) {
|
|
904
|
-
const [scope, name] = npmPackage.split("/");
|
|
905
|
-
return `@types/${_optionalChain([scope, 'optionalAccess', _47 => _47.slice, 'call', _48 => _48(1)])}__${name}`;
|
|
906
|
-
}
|
|
907
|
-
return `@types/${npmPackage}`;
|
|
908
|
-
}
|
|
909
|
-
_chunk3GQAWCBQjs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDependencyPackageName");
|
|
910
|
-
|
|
911
496
|
// ../esbuild/src/config.ts
|
|
912
|
-
var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => [
|
|
913
|
-
nodeProtocolPlugin(options, resolvedOptions),
|
|
914
|
-
resolvePathsPlugin(options, resolvedOptions),
|
|
915
|
-
fixImportsPlugin(options, resolvedOptions),
|
|
916
|
-
nativeNodeModulesPlugin(options, resolvedOptions),
|
|
917
|
-
esmSplitCodeToCjsPlugin(options, resolvedOptions),
|
|
918
|
-
tscPlugin(options, resolvedOptions),
|
|
919
|
-
onErrorPlugin(options, resolvedOptions)
|
|
920
|
-
], "getDefaultBuildPlugins");
|
|
921
497
|
var DEFAULT_BUILD_OPTIONS = {
|
|
498
|
+
assets: [],
|
|
922
499
|
platform: "node",
|
|
923
|
-
target:
|
|
500
|
+
target: [
|
|
501
|
+
"esnext"
|
|
502
|
+
],
|
|
924
503
|
format: "esm",
|
|
925
|
-
external: [],
|
|
926
|
-
logLevel: "error",
|
|
927
504
|
tsconfig: "tsconfig.json",
|
|
928
505
|
mode: "production",
|
|
506
|
+
generatePackageJson: true,
|
|
507
|
+
includeSrc: false,
|
|
929
508
|
keepNames: true,
|
|
930
|
-
metafile:
|
|
931
|
-
|
|
932
|
-
|
|
509
|
+
metafile: false,
|
|
510
|
+
treeshake: true,
|
|
511
|
+
shims: false,
|
|
933
512
|
watch: false,
|
|
934
513
|
bundle: true,
|
|
935
|
-
clean: true,
|
|
936
|
-
debug: false,
|
|
937
|
-
resolveExtensions: [
|
|
938
|
-
".tsx",
|
|
939
|
-
".ts",
|
|
940
|
-
".cts",
|
|
941
|
-
".mts",
|
|
942
|
-
".jsx",
|
|
943
|
-
".js",
|
|
944
|
-
".cjs",
|
|
945
|
-
".mjs",
|
|
946
|
-
".css",
|
|
947
|
-
".json"
|
|
948
|
-
],
|
|
949
514
|
loader: {
|
|
950
515
|
".aac": "file",
|
|
951
516
|
".css": "file",
|
|
@@ -967,7 +532,10 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
967
532
|
".woff": "file",
|
|
968
533
|
".woff2": "file"
|
|
969
534
|
},
|
|
970
|
-
banner:
|
|
535
|
+
banner: {
|
|
536
|
+
js: DEFAULT_COMPILED_BANNER,
|
|
537
|
+
css: DEFAULT_COMPILED_BANNER
|
|
538
|
+
}
|
|
971
539
|
};
|
|
972
540
|
|
|
973
541
|
// ../esbuild/src/plugins/deps-check.ts
|
|
@@ -1004,8 +572,8 @@ var missingIgnore = [
|
|
|
1004
572
|
];
|
|
1005
573
|
var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bundle) => ({
|
|
1006
574
|
name: "storm:deps-check",
|
|
1007
|
-
setup(
|
|
1008
|
-
const pkgJsonPath =
|
|
575
|
+
setup(build3) {
|
|
576
|
+
const pkgJsonPath = path3.default.join(process.cwd(), "package.json");
|
|
1009
577
|
const pkgContents = _chunk3GQAWCBQjs.__require.call(void 0, pkgJsonPath);
|
|
1010
578
|
const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
|
|
1011
579
|
const devDependencies = Object.keys(_nullishCoalesce(pkgContents["devDependencies"], () => ( {})));
|
|
@@ -1016,7 +584,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bund
|
|
|
1016
584
|
];
|
|
1017
585
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
1018
586
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
1019
|
-
|
|
587
|
+
build3.onResolve({
|
|
1020
588
|
filter: onlyPackages
|
|
1021
589
|
}, (args) => {
|
|
1022
590
|
if (args.importer.includes(process.cwd())) {
|
|
@@ -1032,7 +600,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bund
|
|
|
1032
600
|
external: true
|
|
1033
601
|
};
|
|
1034
602
|
});
|
|
1035
|
-
|
|
603
|
+
build3.onEnd(() => {
|
|
1036
604
|
const unusedDependencies = [
|
|
1037
605
|
...dependencies
|
|
1038
606
|
].filter((dep) => {
|
|
@@ -1049,8 +617,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bund
|
|
|
1049
617
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1050
618
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1051
619
|
});
|
|
1052
|
-
|
|
1053
|
-
|
|
620
|
+
_chunkFC5AL6FFjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
621
|
+
_chunkFC5AL6FFjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1054
622
|
if (filteredMissingDeps.length > 0) {
|
|
1055
623
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1056
624
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1060,391 +628,53 @@ ${JSON.stringify(filteredMissingDeps)}
|
|
|
1060
628
|
}
|
|
1061
629
|
}), "depsCheckPlugin");
|
|
1062
630
|
|
|
1063
|
-
// ../esbuild/src/renderers/shebang.ts
|
|
1064
|
-
var shebangRenderer = {
|
|
1065
|
-
name: "shebang",
|
|
1066
|
-
renderChunk(_, __, info) {
|
|
1067
|
-
if (info.type === "chunk" && /\.(cjs|js|mjs)$/.test(info.path) && info.code.startsWith("#!")) {
|
|
1068
|
-
info.mode = 493;
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
};
|
|
1072
|
-
|
|
1073
|
-
// ../esbuild/src/tsc.ts
|
|
1074
|
-
var _bundlerequire = require('bundle-require');
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
|
|
1079
|
-
function ensureTempDeclarationDir(workspaceConfig) {
|
|
1080
|
-
const root = workspaceConfig.directories.temp || _path.join.call(void 0, workspaceConfig.workspaceRoot, "tmp");
|
|
1081
|
-
const dirPath = _path.join.call(void 0, root, ".tsc", "declaration");
|
|
1082
|
-
if (_fs.existsSync.call(void 0, dirPath)) {
|
|
1083
|
-
return dirPath;
|
|
1084
|
-
}
|
|
1085
|
-
_fs.mkdirSync.call(void 0, dirPath, {
|
|
1086
|
-
recursive: true
|
|
1087
|
-
});
|
|
1088
|
-
const gitIgnorePath = _path.join.call(void 0, root, ".tsc", ".gitignore");
|
|
1089
|
-
_fs.writeFileSync.call(void 0, gitIgnorePath, "**/*\n");
|
|
1090
|
-
return dirPath;
|
|
1091
|
-
}
|
|
1092
|
-
_chunk3GQAWCBQjs.__name.call(void 0, ensureTempDeclarationDir, "ensureTempDeclarationDir");
|
|
1093
|
-
function slash(path7) {
|
|
1094
|
-
const isExtendedLengthPath = path7.startsWith("\\\\?\\");
|
|
1095
|
-
if (isExtendedLengthPath) {
|
|
1096
|
-
return path7;
|
|
1097
|
-
}
|
|
1098
|
-
return path7.replace(/\\/g, "/");
|
|
1099
|
-
}
|
|
1100
|
-
_chunk3GQAWCBQjs.__name.call(void 0, slash, "slash");
|
|
1101
|
-
function toAbsolutePath(workspaceConfig, p, cwd) {
|
|
1102
|
-
if (_path.isAbsolute.call(void 0, p)) {
|
|
1103
|
-
return p;
|
|
1104
|
-
}
|
|
1105
|
-
return slash(_path.normalize.call(void 0, _path.join.call(void 0, cwd || workspaceConfig.workspaceRoot, p)));
|
|
1106
|
-
}
|
|
1107
|
-
_chunk3GQAWCBQjs.__name.call(void 0, toAbsolutePath, "toAbsolutePath");
|
|
1108
|
-
var AliasPool = (_class = class AliasPool2 {constructor() { _class.prototype.__init.call(this); }
|
|
1109
|
-
static {
|
|
1110
|
-
_chunk3GQAWCBQjs.__name.call(void 0, this, "AliasPool");
|
|
1111
|
-
}
|
|
1112
|
-
__init() {this.seen = /* @__PURE__ */ new Set()}
|
|
1113
|
-
assign(name) {
|
|
1114
|
-
let suffix = 0;
|
|
1115
|
-
let alias = name === "default" ? "default_alias" : name;
|
|
1116
|
-
while (this.seen.has(alias)) {
|
|
1117
|
-
alias = `${name}_alias_${++suffix}`;
|
|
1118
|
-
if (suffix >= 1e3) {
|
|
1119
|
-
throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
this.seen.add(alias);
|
|
1123
|
-
return alias;
|
|
1124
|
-
}
|
|
1125
|
-
}, _class);
|
|
1126
|
-
function getExports(workspaceConfig, program, fileMapping) {
|
|
1127
|
-
const checker = program.getTypeChecker();
|
|
1128
|
-
const aliasPool = new AliasPool();
|
|
1129
|
-
const assignAlias = aliasPool.assign.bind(aliasPool);
|
|
1130
|
-
function extractExports(sourceFileName) {
|
|
1131
|
-
const cwd = program.getCurrentDirectory();
|
|
1132
|
-
sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
|
|
1133
|
-
const sourceFile = program.getSourceFile(sourceFileName);
|
|
1134
|
-
if (!sourceFile) {
|
|
1135
|
-
return [];
|
|
1136
|
-
}
|
|
1137
|
-
const destFileName = fileMapping.get(sourceFileName);
|
|
1138
|
-
if (!destFileName) {
|
|
1139
|
-
return [];
|
|
1140
|
-
}
|
|
1141
|
-
const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
|
|
1142
|
-
if (!moduleSymbol) {
|
|
1143
|
-
return [];
|
|
1144
|
-
}
|
|
1145
|
-
const exports = [];
|
|
1146
|
-
const exportSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
1147
|
-
exportSymbols.forEach((symbol) => {
|
|
1148
|
-
const name = symbol.getName();
|
|
1149
|
-
exports.push({
|
|
1150
|
-
kind: "named",
|
|
1151
|
-
sourceFileName,
|
|
1152
|
-
destFileName,
|
|
1153
|
-
name,
|
|
1154
|
-
alias: assignAlias(name),
|
|
1155
|
-
isTypeOnly: false
|
|
1156
|
-
});
|
|
1157
|
-
});
|
|
1158
|
-
return exports;
|
|
1159
|
-
}
|
|
1160
|
-
_chunk3GQAWCBQjs.__name.call(void 0, extractExports, "extractExports");
|
|
1161
|
-
return program.getRootFileNames().flatMap(extractExports);
|
|
1162
|
-
}
|
|
1163
|
-
_chunk3GQAWCBQjs.__name.call(void 0, getExports, "getExports");
|
|
1164
|
-
function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
|
|
1165
|
-
const fileMapping = /* @__PURE__ */ new Map();
|
|
1166
|
-
const writeFile3 = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
1167
|
-
const sourceFile = _optionalChain([sourceFiles, 'optionalAccess', _49 => _49[0]]);
|
|
1168
|
-
const sourceFileName = _optionalChain([sourceFile, 'optionalAccess', _50 => _50.fileName]);
|
|
1169
|
-
if (sourceFileName && !fileName.endsWith(".map")) {
|
|
1170
|
-
const cwd = program.getCurrentDirectory();
|
|
1171
|
-
fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
|
|
1172
|
-
}
|
|
1173
|
-
return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
1174
|
-
}, "writeFile");
|
|
1175
|
-
const emitResult = program.emit(void 0, writeFile3, void 0, emitOnlyDtsFiles, customTransformers);
|
|
1176
|
-
const diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
1177
|
-
const diagnosticMessages = [];
|
|
1178
|
-
diagnostics.forEach((diagnostic) => {
|
|
1179
|
-
if (diagnostic.file) {
|
|
1180
|
-
const { line, character } = _typescript2.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
1181
|
-
const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
1182
|
-
diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
1183
|
-
} else {
|
|
1184
|
-
const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
1185
|
-
diagnosticMessages.push(message);
|
|
1186
|
-
}
|
|
1187
|
-
});
|
|
1188
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
1189
|
-
if (diagnosticMessage) {
|
|
1190
|
-
_chunkDLJYMU67js.writeError.call(void 0, `Failed to emit declaration files.
|
|
1191
|
-
|
|
1192
|
-
${diagnosticMessage}`, workspaceConfig);
|
|
1193
|
-
throw new Error("TypeScript compilation failed");
|
|
1194
|
-
}
|
|
1195
|
-
return fileMapping;
|
|
1196
|
-
}
|
|
1197
|
-
_chunk3GQAWCBQjs.__name.call(void 0, emitDtsFiles, "emitDtsFiles");
|
|
1198
|
-
function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
|
|
1199
|
-
const rawTsconfig = _bundlerequire.loadTsConfig.call(void 0, workspaceConfig.workspaceRoot, tsconfig);
|
|
1200
|
-
if (!rawTsconfig) {
|
|
1201
|
-
throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
|
|
1202
|
-
}
|
|
1203
|
-
const declarationDir = ensureTempDeclarationDir(workspaceConfig);
|
|
1204
|
-
const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(_defu2.default.call(void 0, {
|
|
1205
|
-
compilerOptions: {
|
|
1206
|
-
// Enable declaration emit and disable javascript emit
|
|
1207
|
-
noEmit: false,
|
|
1208
|
-
declaration: true,
|
|
1209
|
-
declarationMap: true,
|
|
1210
|
-
declarationDir,
|
|
1211
|
-
emitDeclarationOnly: true
|
|
1212
|
-
}
|
|
1213
|
-
}, _nullishCoalesce(_optionalChain([tsconfigRaw, 'optionalAccess', _51 => _51.compilerOptions]), () => ( {})), _nullishCoalesce(rawTsconfig.data, () => ( {}))), _typescript2.default.sys, tsconfig ? _path.dirname.call(void 0, tsconfig) : "./");
|
|
1214
|
-
const options = parsedTsconfig.options;
|
|
1215
|
-
const host = _typescript2.default.createCompilerHost(options);
|
|
1216
|
-
const program = _typescript2.default.createProgram(parsedTsconfig.fileNames, options, host);
|
|
1217
|
-
const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
|
|
1218
|
-
return getExports(workspaceConfig, program, fileMapping);
|
|
1219
|
-
}
|
|
1220
|
-
_chunk3GQAWCBQjs.__name.call(void 0, emitDts, "emitDts");
|
|
1221
|
-
|
|
1222
|
-
// ../esbuild/src/utilities/get-entry-points.ts
|
|
1223
|
-
|
|
1224
|
-
var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
1225
|
-
const workspaceRoot3 = config.workspaceRoot || _chunkDLJYMU67js.findWorkspaceRoot.call(void 0, );
|
|
1226
|
-
const entryPoints = [];
|
|
1227
|
-
if (entry) {
|
|
1228
|
-
if (typeof entry === "string") {
|
|
1229
|
-
entryPoints.push({
|
|
1230
|
-
in: entry,
|
|
1231
|
-
out: entry
|
|
1232
|
-
});
|
|
1233
|
-
} else if (Array.isArray(entry)) {
|
|
1234
|
-
entryPoints.push(...entry.map((entry2) => ({
|
|
1235
|
-
in: entry2,
|
|
1236
|
-
out: entry2
|
|
1237
|
-
})));
|
|
1238
|
-
} else {
|
|
1239
|
-
entryPoints.push(...Object.entries(entry).map(([key, value]) => {
|
|
1240
|
-
if (typeof value === "string") {
|
|
1241
|
-
return {
|
|
1242
|
-
in: value,
|
|
1243
|
-
out: key
|
|
1244
|
-
};
|
|
1245
|
-
} else {
|
|
1246
|
-
return {
|
|
1247
|
-
in: key,
|
|
1248
|
-
out: key
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
}));
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
if (emitOnAll) {
|
|
1255
|
-
entryPoints.push({
|
|
1256
|
-
in: _chunkDLJYMU67js.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"),
|
|
1257
|
-
out: _chunkDLJYMU67js.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}")
|
|
1258
|
-
});
|
|
1259
|
-
}
|
|
1260
|
-
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
1261
|
-
const paths = [];
|
|
1262
|
-
if (entryPoint.in.includes("*")) {
|
|
1263
|
-
const files = await _glob.glob.call(void 0, entryPoint.in, {
|
|
1264
|
-
withFileTypes: true,
|
|
1265
|
-
ignore: [
|
|
1266
|
-
"**/node_modules/**"
|
|
1267
|
-
]
|
|
1268
|
-
});
|
|
1269
|
-
paths.push(...files.reduce((ret, filePath) => {
|
|
1270
|
-
const result = _chunkDLJYMU67js.correctPaths.call(void 0, _chunkDLJYMU67js.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkDLJYMU67js.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkDLJYMU67js.correctPaths.call(void 0, projectRoot), ""));
|
|
1271
|
-
if (result) {
|
|
1272
|
-
_chunkDLJYMU67js.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkDLJYMU67js.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
1273
|
-
if (!paths.some((p) => p.in === result)) {
|
|
1274
|
-
paths.push({
|
|
1275
|
-
in: result,
|
|
1276
|
-
out: entryPoint.out.replace(entryPoint.in, result)
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
return ret;
|
|
1281
|
-
}, []));
|
|
1282
|
-
} else {
|
|
1283
|
-
_chunkDLJYMU67js.writeDebug.call(void 0, `Adding ESBuild entry point
|
|
1284
|
-
- Input: ${entryPoint.in}
|
|
1285
|
-
- Output: ${entryPoint.out}`, config);
|
|
1286
|
-
if (!paths.some((p) => p.out === entryPoint.out)) {
|
|
1287
|
-
paths.push(entryPoint);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
return paths;
|
|
1291
|
-
}));
|
|
1292
|
-
return results.filter(Boolean).reduce((ret, result) => {
|
|
1293
|
-
result.forEach((res) => {
|
|
1294
|
-
if (res && !ret.some((p) => p.in === res.in)) {
|
|
1295
|
-
ret.push(res);
|
|
1296
|
-
}
|
|
1297
|
-
});
|
|
1298
|
-
return ret;
|
|
1299
|
-
}, []);
|
|
1300
|
-
}, "getEntryPoints");
|
|
1301
|
-
|
|
1302
|
-
// ../esbuild/src/utilities/helpers.ts
|
|
1303
|
-
function handleSync(fn) {
|
|
1304
|
-
try {
|
|
1305
|
-
return fn();
|
|
1306
|
-
} catch (error_) {
|
|
1307
|
-
return error_;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
_chunk3GQAWCBQjs.__name.call(void 0, handleSync, "handleSync");
|
|
1311
|
-
async function handleAsync(fn) {
|
|
1312
|
-
try {
|
|
1313
|
-
return await fn();
|
|
1314
|
-
} catch (error_) {
|
|
1315
|
-
return error_;
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
_chunk3GQAWCBQjs.__name.call(void 0, handleAsync, "handleAsync");
|
|
1319
|
-
var handle = handleSync;
|
|
1320
|
-
handle.async = handleAsync;
|
|
1321
|
-
var skip = Symbol("skip");
|
|
1322
|
-
function transduceSync(list, transformer) {
|
|
1323
|
-
const transduced = [];
|
|
1324
|
-
for (const [i, element_] of list.entries()) {
|
|
1325
|
-
const transformed = transformer(element_, i);
|
|
1326
|
-
if (transformed !== skip) {
|
|
1327
|
-
transduced[transduced.length] = transformed;
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
return transduced;
|
|
1331
|
-
}
|
|
1332
|
-
_chunk3GQAWCBQjs.__name.call(void 0, transduceSync, "transduceSync");
|
|
1333
|
-
async function transduceAsync(list, transformer) {
|
|
1334
|
-
const transduced = [];
|
|
1335
|
-
await Promise.all(list.entries().map(async ([i, element_]) => {
|
|
1336
|
-
const transformed = await transformer(element_, i);
|
|
1337
|
-
if (transformed !== skip) {
|
|
1338
|
-
transduced[transduced.length] = transformed;
|
|
1339
|
-
}
|
|
1340
|
-
}));
|
|
1341
|
-
return transduced;
|
|
1342
|
-
}
|
|
1343
|
-
_chunk3GQAWCBQjs.__name.call(void 0, transduceAsync, "transduceAsync");
|
|
1344
|
-
var transduce = transduceSync;
|
|
1345
|
-
transduce.async = transduceAsync;
|
|
1346
|
-
function pipeSync(fn, ...fns) {
|
|
1347
|
-
return (...args) => {
|
|
1348
|
-
let result = fn(...args);
|
|
1349
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1350
|
-
result = _optionalChain([fns, 'access', _52 => _52[i], 'optionalCall', _53 => _53(result)]);
|
|
1351
|
-
}
|
|
1352
|
-
return result;
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
_chunk3GQAWCBQjs.__name.call(void 0, pipeSync, "pipeSync");
|
|
1356
|
-
function pipeAsync(fn, ...fns) {
|
|
1357
|
-
return async (...args) => {
|
|
1358
|
-
let result = await fn(...args);
|
|
1359
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1360
|
-
result = await _optionalChain([fns, 'access', _54 => _54[i], 'optionalCall', _55 => _55(result)]);
|
|
1361
|
-
}
|
|
1362
|
-
return result;
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
_chunk3GQAWCBQjs.__name.call(void 0, pipeAsync, "pipeAsync");
|
|
1366
|
-
var pipe = pipeSync;
|
|
1367
|
-
pipe.async = pipeAsync;
|
|
1368
|
-
|
|
1369
631
|
// ../esbuild/src/build.ts
|
|
1370
|
-
|
|
632
|
+
async function resolveContext(userOptions) {
|
|
1371
633
|
const projectRoot = userOptions.projectRoot;
|
|
1372
634
|
const workspaceRoot3 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
1373
635
|
if (!workspaceRoot3) {
|
|
1374
636
|
throw new Error("Cannot find Nx workspace root");
|
|
1375
637
|
}
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
|
|
638
|
+
const workspaceConfig = await _chunkFC5AL6FFjs.getWorkspaceConfig.call(void 0, true, {
|
|
639
|
+
workspaceRoot: workspaceRoot3.dir
|
|
640
|
+
});
|
|
641
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
642
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1379
643
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1380
644
|
exitOnError: true
|
|
1381
645
|
});
|
|
1382
|
-
const projectJsonPath =
|
|
646
|
+
const projectJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1383
647
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1384
648
|
throw new Error("Cannot find project.json configuration");
|
|
1385
649
|
}
|
|
1386
650
|
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
1387
651
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1388
|
-
const projectName = projectJson.name;
|
|
652
|
+
const projectName = projectJson.name || userOptions.name;
|
|
1389
653
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1390
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
654
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _28 => _28.projects, 'optionalAccess', _29 => _29[projectName]])) {
|
|
1391
655
|
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.");
|
|
1392
656
|
}
|
|
1393
657
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1394
658
|
options.name ??= `${projectName}-${options.format}`;
|
|
1395
659
|
options.target ??= DEFAULT_TARGET;
|
|
1396
|
-
const packageJsonPath =
|
|
660
|
+
const packageJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1397
661
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1398
662
|
throw new Error("Cannot find package.json configuration");
|
|
1399
663
|
}
|
|
1400
664
|
const env = getEnv("esbuild", options);
|
|
1401
|
-
const
|
|
665
|
+
const resolvedOptions = {
|
|
1402
666
|
...options,
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
] : [
|
|
1408
|
-
"browser",
|
|
1409
|
-
"module",
|
|
1410
|
-
"main"
|
|
1411
|
-
],
|
|
667
|
+
tsconfig: _chunkFC5AL6FFjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
668
|
+
distDir: "dist",
|
|
669
|
+
name: projectName,
|
|
670
|
+
metafile: userOptions.mode === "development",
|
|
1412
671
|
...userOptions,
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
outdir: userOptions.outputPath || _chunkDLJYMU67js.joinPaths.call(void 0, "dist", projectRoot),
|
|
1417
|
-
distDir: userOptions.distDir || "dist",
|
|
1418
|
-
plugins: [],
|
|
1419
|
-
name: userOptions.name || projectName,
|
|
1420
|
-
projectConfigurations,
|
|
1421
|
-
projectName,
|
|
1422
|
-
projectGraph,
|
|
1423
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkDLJYMU67js.joinPaths.call(void 0, projectRoot, "src"),
|
|
1424
|
-
minify: userOptions.minify || !userOptions.debug,
|
|
1425
|
-
verbose: userOptions.verbose || _chunkDLJYMU67js.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1426
|
-
includeSrc: userOptions.includeSrc === true,
|
|
1427
|
-
metafile: userOptions.metafile !== false,
|
|
1428
|
-
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1429
|
-
clean: userOptions.clean !== false,
|
|
1430
|
-
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1431
|
-
injectShims: userOptions.injectShims !== true,
|
|
1432
|
-
bundle: userOptions.bundle !== false,
|
|
1433
|
-
keepNames: true,
|
|
1434
|
-
watch: userOptions.watch === true,
|
|
1435
|
-
footer: userOptions.footer,
|
|
1436
|
-
banner: {
|
|
1437
|
-
js: options.banner || DEFAULT_COMPILED_BANNER,
|
|
1438
|
-
css: options.banner || DEFAULT_COMPILED_BANNER
|
|
1439
|
-
},
|
|
1440
|
-
splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
|
|
1441
|
-
treeShaking: options.format === "esm",
|
|
672
|
+
clean: false,
|
|
673
|
+
target: userOptions.target || options.target,
|
|
674
|
+
splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
|
|
1442
675
|
env,
|
|
1443
676
|
define: {
|
|
1444
|
-
STORM_FORMAT: JSON.stringify(options.format
|
|
1445
|
-
...options.format === "cjs" && options.injectShims ? {
|
|
1446
|
-
"import.meta.url": "importMetaUrl"
|
|
1447
|
-
} : {},
|
|
677
|
+
STORM_FORMAT: JSON.stringify(options.format),
|
|
1448
678
|
...options.define,
|
|
1449
679
|
...Object.keys(env || {}).reduce((res, key) => {
|
|
1450
680
|
const value = JSON.stringify(env[key]);
|
|
@@ -1455,167 +685,98 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
1455
685
|
[`import.meta.env.${safeKey}`]: value
|
|
1456
686
|
};
|
|
1457
687
|
}, {})
|
|
1458
|
-
}
|
|
1459
|
-
inject: [
|
|
1460
|
-
options.format === "cjs" && options.injectShims ? _chunkDLJYMU67js.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1461
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkDLJYMU67js.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1462
|
-
].filter(Boolean)
|
|
688
|
+
}
|
|
1463
689
|
};
|
|
1464
|
-
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
1465
|
-
if (options.inject && Array.isArray(options.inject) && options.inject.length > 0) {
|
|
1466
|
-
result.inject = options.inject.reduce((ret, inj) => {
|
|
1467
|
-
if (inj && typeof inj === "string" && ret.includes(inj)) {
|
|
1468
|
-
ret.push(inj);
|
|
1469
|
-
}
|
|
1470
|
-
return ret;
|
|
1471
|
-
}, result.inject);
|
|
1472
|
-
}
|
|
1473
|
-
delete result.entry;
|
|
1474
|
-
delete result.outputPath;
|
|
1475
690
|
stopwatch();
|
|
1476
|
-
return
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
691
|
+
return {
|
|
692
|
+
options: resolvedOptions,
|
|
693
|
+
clean: userOptions.clean !== false,
|
|
694
|
+
workspaceConfig,
|
|
695
|
+
projectConfigurations,
|
|
696
|
+
projectName,
|
|
697
|
+
projectGraph,
|
|
698
|
+
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || _chunkFC5AL6FFjs.joinPaths.call(void 0, resolvedOptions.projectRoot, "src"),
|
|
699
|
+
outputPath: resolvedOptions.outputPath || _chunkFC5AL6FFjs.joinPaths.call(void 0, workspaceConfig.workspaceRoot, "dist", resolvedOptions.projectRoot),
|
|
700
|
+
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
_chunk3GQAWCBQjs.__name.call(void 0, resolveContext, "resolveContext");
|
|
704
|
+
async function generatePackageJson(context) {
|
|
705
|
+
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkFC5AL6FFjs.joinPaths.call(void 0, context.options.projectRoot, "package.json"))) {
|
|
706
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
707
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, "Write package.json file");
|
|
708
|
+
const packageJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, context.options.projectRoot, "project.json");
|
|
1483
709
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1484
710
|
throw new Error("Cannot find package.json configuration");
|
|
1485
711
|
}
|
|
1486
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
712
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkFC5AL6FFjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, context.options.projectRoot, "package.json"), "utf8");
|
|
1487
713
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1488
714
|
if (!packageJson) {
|
|
1489
715
|
throw new Error("Cannot find package.json configuration file");
|
|
1490
716
|
}
|
|
1491
|
-
packageJson = await addPackageDependencies(
|
|
1492
|
-
packageJson = await addWorkspacePackageJsonFields(
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
717
|
+
packageJson = await addPackageDependencies(context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
|
|
718
|
+
packageJson = await addWorkspacePackageJsonFields(context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
|
|
719
|
+
if (context.options.entry) {
|
|
720
|
+
packageJson.exports ??= {};
|
|
721
|
+
packageJson.exports["./package.json"] ??= "./package.json";
|
|
722
|
+
packageJson.exports["."] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js`;
|
|
723
|
+
const entryPoints = Array.isArray(context.options.entry) ? context.options.entry : Object.keys(context.options.entry);
|
|
724
|
+
for (const entryPoint of entryPoints) {
|
|
725
|
+
if (context.options.entry[entryPoint]) {
|
|
726
|
+
const entry = context.options.entry[entryPoint].replaceAll("\\", "/").replaceAll(/^(\.\/)*/g, "").replace(/\.([cm])?[jt]s(x)?$/g, "");
|
|
727
|
+
packageJson.exports[`./${entry}`] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/${entry}.js`;
|
|
728
|
+
}
|
|
1500
729
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
packageJson.main = packageJson.type === "commonjs" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.cjs`;
|
|
1506
|
-
}
|
|
1507
|
-
packageJson.types = `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.d.ts`;
|
|
1508
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
1509
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1510
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
730
|
+
if (context.options.format === "esm") {
|
|
731
|
+
packageJson.module = packageJson.type === "module" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.mjs`;
|
|
732
|
+
} else {
|
|
733
|
+
packageJson.main = packageJson.type === "commonjs" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.cjs`;
|
|
1511
734
|
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
735
|
+
packageJson.types = `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.d.ts`;
|
|
736
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
737
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
738
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
739
|
+
}
|
|
740
|
+
return ret;
|
|
741
|
+
}, packageJson.exports);
|
|
742
|
+
}
|
|
743
|
+
await _devkit.writeJsonFile.call(void 0, _chunkFC5AL6FFjs.joinPaths.call(void 0, context.outputPath, "package.json"), packageJson);
|
|
1515
744
|
stopwatch();
|
|
1516
745
|
}
|
|
1517
|
-
return
|
|
746
|
+
return context;
|
|
1518
747
|
}
|
|
1519
748
|
_chunk3GQAWCBQjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
1520
|
-
async function
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
const options = await getOptions();
|
|
1529
|
-
const rendererEngine = new RendererEngine([
|
|
1530
|
-
shebangRenderer,
|
|
1531
|
-
...options.renderers || []
|
|
1532
|
-
]);
|
|
1533
|
-
return {
|
|
1534
|
-
options,
|
|
1535
|
-
rendererEngine
|
|
1536
|
-
};
|
|
1537
|
-
}
|
|
1538
|
-
_chunk3GQAWCBQjs.__name.call(void 0, generateContext, "generateContext");
|
|
1539
|
-
async function executeEsBuild(context2) {
|
|
1540
|
-
_chunkDLJYMU67js.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1541
|
-
const stopwatch = _chunkDLJYMU67js.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1542
|
-
if (process.env.STORM_WATCH) {
|
|
1543
|
-
const ctx = await esbuild2.context(context2.options);
|
|
1544
|
-
watch(ctx, context2.options);
|
|
1545
|
-
}
|
|
1546
|
-
const options = {
|
|
1547
|
-
...context2.options
|
|
1548
|
-
};
|
|
1549
|
-
options.outdir = _chunkDLJYMU67js.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1550
|
-
if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
|
|
1551
|
-
options.inject === {}) {
|
|
1552
|
-
delete options.inject;
|
|
1553
|
-
}
|
|
1554
|
-
delete options.dts;
|
|
1555
|
-
delete options.env;
|
|
1556
|
-
delete options.name;
|
|
1557
|
-
delete options.assets;
|
|
1558
|
-
delete options.mode;
|
|
1559
|
-
delete options.orgName;
|
|
1560
|
-
delete options.watch;
|
|
1561
|
-
delete options.clean;
|
|
1562
|
-
delete options.debug;
|
|
1563
|
-
delete options.generatePackageJson;
|
|
1564
|
-
delete options.distDir;
|
|
1565
|
-
delete options.includeSrc;
|
|
1566
|
-
delete options.verbose;
|
|
1567
|
-
delete options.projectRoot;
|
|
1568
|
-
delete options.projectName;
|
|
1569
|
-
delete options.projectGraph;
|
|
1570
|
-
delete options.projectConfigurations;
|
|
1571
|
-
delete options.renderers;
|
|
1572
|
-
delete options.config;
|
|
1573
|
-
delete options.injectShims;
|
|
1574
|
-
delete options.external;
|
|
1575
|
-
_chunkDLJYMU67js.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1576
|
-
${_chunkDLJYMU67js.formatLogMessage.call(void 0, {
|
|
1577
|
-
...options,
|
|
1578
|
-
define: "<Hidden>"
|
|
1579
|
-
})}`, context2.options.config);
|
|
1580
|
-
const result = await esbuild2.build(options);
|
|
1581
|
-
await esbuild2.stop();
|
|
1582
|
-
if (result.metafile) {
|
|
1583
|
-
const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
|
|
1584
|
-
await _promises2.default.writeFile(metafilePath, JSON.stringify(result.metafile));
|
|
1585
|
-
}
|
|
749
|
+
async function executeTsup(context) {
|
|
750
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, ` \u{1F680} Running ${context.options.name} build`, context.workspaceConfig);
|
|
751
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, `${context.options.name} build`);
|
|
752
|
+
await _tsup.build.call(void 0, {
|
|
753
|
+
...context.options,
|
|
754
|
+
outDir: context.outputPath,
|
|
755
|
+
workspaceConfig: context.workspaceConfig
|
|
756
|
+
});
|
|
1586
757
|
stopwatch();
|
|
1587
|
-
return
|
|
758
|
+
return context;
|
|
1588
759
|
}
|
|
1589
|
-
_chunk3GQAWCBQjs.__name.call(void 0,
|
|
1590
|
-
async function
|
|
1591
|
-
if (_optionalChain([
|
|
1592
|
-
|
|
1593
|
-
const stopwatch =
|
|
1594
|
-
await
|
|
760
|
+
_chunk3GQAWCBQjs.__name.call(void 0, executeTsup, "executeTsup");
|
|
761
|
+
async function copyBuildAssets(context) {
|
|
762
|
+
if (_optionalChain([context, 'access', _30 => _30.result, 'optionalAccess', _31 => _31.errors, 'access', _32 => _32.length]) === 0) {
|
|
763
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
|
|
764
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
|
|
765
|
+
await copyAssets(context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
|
|
1595
766
|
stopwatch();
|
|
1596
767
|
}
|
|
1597
|
-
return
|
|
1598
|
-
}
|
|
1599
|
-
_chunk3GQAWCBQjs.__name.call(void 0, executeTypescript, "executeTypescript");
|
|
1600
|
-
async function copyBuildAssets(context2) {
|
|
1601
|
-
if (_optionalChain([context2, 'access', _61 => _61.result, 'optionalAccess', _62 => _62.errors, 'access', _63 => _63.length]) === 0) {
|
|
1602
|
-
_chunkDLJYMU67js.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1603
|
-
const stopwatch = _chunkDLJYMU67js.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1604
|
-
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1605
|
-
stopwatch();
|
|
1606
|
-
}
|
|
1607
|
-
return context2;
|
|
768
|
+
return context;
|
|
1608
769
|
}
|
|
1609
770
|
_chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1610
|
-
async function reportResults(
|
|
1611
|
-
if (_optionalChain([
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
771
|
+
async function reportResults(context) {
|
|
772
|
+
if (_optionalChain([context, 'access', _33 => _33.result, 'optionalAccess', _34 => _34.errors, 'access', _35 => _35.length]) === 0) {
|
|
773
|
+
if (context.result.warnings.length > 0) {
|
|
774
|
+
_chunkFC5AL6FFjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`, context.workspaceConfig);
|
|
1614
775
|
}
|
|
1615
|
-
|
|
1616
|
-
} else if (_optionalChain([
|
|
1617
|
-
|
|
1618
|
-
throw new Error(`The ${
|
|
776
|
+
_chunkFC5AL6FFjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context.options.name} build completed successfully`, context.workspaceConfig);
|
|
777
|
+
} else if (_optionalChain([context, 'access', _36 => _36.result, 'optionalAccess', _37 => _37.errors]) && _optionalChain([context, 'access', _38 => _38.result, 'optionalAccess', _39 => _39.errors, 'access', _40 => _40.length]) > 0) {
|
|
778
|
+
_chunkFC5AL6FFjs.writeError.call(void 0, ` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`, context.workspaceConfig);
|
|
779
|
+
throw new Error(`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`);
|
|
1619
780
|
}
|
|
1620
781
|
}
|
|
1621
782
|
_chunk3GQAWCBQjs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1626,7 +787,7 @@ async function dependencyCheck(options) {
|
|
|
1626
787
|
if (process.env.CI && !process.env.BUILDKITE) {
|
|
1627
788
|
return void 0;
|
|
1628
789
|
}
|
|
1629
|
-
const buildPromise =
|
|
790
|
+
const buildPromise = esbuild.build({
|
|
1630
791
|
entryPoints: _globby.globbySync.call(void 0, "**/*.{j,t}s", {
|
|
1631
792
|
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
1632
793
|
ignore: [
|
|
@@ -1649,19 +810,19 @@ async function dependencyCheck(options) {
|
|
|
1649
810
|
return void 0;
|
|
1650
811
|
}
|
|
1651
812
|
_chunk3GQAWCBQjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1652
|
-
async function cleanOutputPath(
|
|
1653
|
-
if (
|
|
1654
|
-
|
|
1655
|
-
const stopwatch =
|
|
1656
|
-
await cleanDirectories(
|
|
813
|
+
async function cleanOutputPath(context) {
|
|
814
|
+
if (context.clean !== false && context.outputPath) {
|
|
815
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`, context.workspaceConfig);
|
|
816
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, `${context.options.name} output clean`);
|
|
817
|
+
await cleanDirectories(context.outputPath);
|
|
1657
818
|
stopwatch();
|
|
1658
819
|
}
|
|
1659
|
-
return
|
|
820
|
+
return context;
|
|
1660
821
|
}
|
|
1661
822
|
_chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1662
|
-
async function
|
|
1663
|
-
|
|
1664
|
-
const stopwatch =
|
|
823
|
+
async function build2(options) {
|
|
824
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
825
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1665
826
|
try {
|
|
1666
827
|
const opts = Array.isArray(options) ? options : [
|
|
1667
828
|
options
|
|
@@ -1669,57 +830,36 @@ async function build3(options) {
|
|
|
1669
830
|
if (opts.length === 0) {
|
|
1670
831
|
throw new Error("No build options were provided");
|
|
1671
832
|
}
|
|
1672
|
-
|
|
1673
|
-
await
|
|
1674
|
-
|
|
833
|
+
const context = await resolveContext(options);
|
|
834
|
+
await cleanOutputPath(context);
|
|
835
|
+
await Promise.all([
|
|
836
|
+
dependencyCheck(context.options),
|
|
837
|
+
generatePackageJson(context),
|
|
838
|
+
copyBuildAssets(context),
|
|
839
|
+
executeTsup(context)
|
|
840
|
+
]);
|
|
841
|
+
await reportResults(context);
|
|
842
|
+
_chunkFC5AL6FFjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1675
843
|
} catch (error) {
|
|
1676
|
-
|
|
844
|
+
_chunkFC5AL6FFjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1677
845
|
throw error;
|
|
1678
846
|
} finally {
|
|
1679
847
|
stopwatch();
|
|
1680
848
|
}
|
|
1681
849
|
}
|
|
1682
|
-
_chunk3GQAWCBQjs.__name.call(void 0,
|
|
1683
|
-
var watch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (context2, options) => {
|
|
1684
|
-
if (!options.watch) {
|
|
1685
|
-
return context2;
|
|
1686
|
-
}
|
|
1687
|
-
const config = {
|
|
1688
|
-
ignoreInitial: true,
|
|
1689
|
-
useFsEvents: true,
|
|
1690
|
-
ignored: [
|
|
1691
|
-
"./src/__tests__/**/*",
|
|
1692
|
-
"./package.json"
|
|
1693
|
-
]
|
|
1694
|
-
};
|
|
1695
|
-
const changeWatcher = _chokidar.watch.call(void 0, [
|
|
1696
|
-
"./src/**/*"
|
|
1697
|
-
], config);
|
|
1698
|
-
const fastRebuild = _estoolkit.debounce.call(void 0, async () => {
|
|
1699
|
-
const timeBefore = Date.now();
|
|
1700
|
-
const rebuildResult = await handle.async(() => {
|
|
1701
|
-
return context2.rebuild();
|
|
1702
|
-
});
|
|
1703
|
-
if (rebuildResult instanceof Error) {
|
|
1704
|
-
_chunkDLJYMU67js.writeError.call(void 0, rebuildResult.message);
|
|
1705
|
-
}
|
|
1706
|
-
_chunkDLJYMU67js.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1707
|
-
}, 10);
|
|
1708
|
-
changeWatcher.on("change", fastRebuild);
|
|
1709
|
-
return void 0;
|
|
1710
|
-
}, "watch");
|
|
850
|
+
_chunk3GQAWCBQjs.__name.call(void 0, build2, "build");
|
|
1711
851
|
|
|
1712
852
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1713
|
-
async function esbuildExecutorFn(options,
|
|
1714
|
-
|
|
1715
|
-
if (!_optionalChain([
|
|
853
|
+
async function esbuildExecutorFn(options, context, config) {
|
|
854
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
855
|
+
if (!_optionalChain([context, 'access', _41 => _41.projectsConfigurations, 'optionalAccess', _42 => _42.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _43 => _43.projectsConfigurations, 'access', _44 => _44.projects, 'access', _45 => _45[context.projectName], 'optionalAccess', _46 => _46.root])) {
|
|
1716
856
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1717
857
|
}
|
|
1718
|
-
await
|
|
858
|
+
await build2({
|
|
1719
859
|
...options,
|
|
1720
|
-
projectRoot: _optionalChain([
|
|
1721
|
-
|
|
1722
|
-
sourceRoot: _optionalChain([
|
|
860
|
+
projectRoot: _optionalChain([context, 'access', _47 => _47.projectsConfigurations, 'access', _48 => _48.projects, 'optionalAccess', _49 => _49[context.projectName], 'access', _50 => _50.root]),
|
|
861
|
+
name: context.projectName,
|
|
862
|
+
sourceRoot: _optionalChain([context, 'access', _51 => _51.projectsConfigurations, 'access', _52 => _52.projects, 'optionalAccess', _53 => _53[context.projectName], 'optionalAccess', _54 => _54.sourceRoot]),
|
|
1723
863
|
format: options.format,
|
|
1724
864
|
platform: options.format
|
|
1725
865
|
});
|
|
@@ -1728,7 +868,7 @@ async function esbuildExecutorFn(options, context2, config) {
|
|
|
1728
868
|
};
|
|
1729
869
|
}
|
|
1730
870
|
_chunk3GQAWCBQjs.__name.call(void 0, esbuildExecutorFn, "esbuildExecutorFn");
|
|
1731
|
-
var executor_default6 =
|
|
871
|
+
var executor_default6 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Storm ESBuild build", esbuildExecutorFn, {
|
|
1732
872
|
skipReadingConfig: false,
|
|
1733
873
|
hooks: {
|
|
1734
874
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
|
|
@@ -1761,26 +901,26 @@ var _esbuild2 = require('@size-limit/esbuild'); var _esbuild3 = _interopRequireD
|
|
|
1761
901
|
var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _interopRequireDefault(_esbuildwhy);
|
|
1762
902
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1763
903
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1764
|
-
async function sizeLimitExecutorFn(options,
|
|
1765
|
-
if (!_optionalChain([
|
|
904
|
+
async function sizeLimitExecutorFn(options, context, config) {
|
|
905
|
+
if (!_optionalChain([context, 'optionalAccess', _55 => _55.projectName]) || !_optionalChain([context, 'access', _56 => _56.projectsConfigurations, 'optionalAccess', _57 => _57.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1766
906
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1767
907
|
}
|
|
1768
|
-
|
|
908
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
1769
909
|
_sizelimit2.default.call(void 0, [
|
|
1770
910
|
_file2.default,
|
|
1771
911
|
_esbuild3.default,
|
|
1772
912
|
_esbuildwhy2.default
|
|
1773
913
|
], {
|
|
1774
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([
|
|
914
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _58 => _58.projectsConfigurations, 'access', _59 => _59.projects, 'access', _60 => _60[context.projectName], 'optionalAccess', _61 => _61.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context, 'access', _62 => _62.projectsConfigurations, 'access', _63 => _63.projects, 'access', _64 => _64[context.projectName], 'optionalAccess', _65 => _65.root]), () => ( "./")), "src")))
|
|
1775
915
|
}).then((result) => {
|
|
1776
|
-
|
|
916
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1777
917
|
});
|
|
1778
918
|
return {
|
|
1779
919
|
success: true
|
|
1780
920
|
};
|
|
1781
921
|
}
|
|
1782
922
|
_chunk3GQAWCBQjs.__name.call(void 0, sizeLimitExecutorFn, "sizeLimitExecutorFn");
|
|
1783
|
-
var executor_default7 =
|
|
923
|
+
var executor_default7 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Size-Limit Performance Test Executor", sizeLimitExecutorFn, {
|
|
1784
924
|
skipReadingConfig: false,
|
|
1785
925
|
hooks: {
|
|
1786
926
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -1794,11 +934,11 @@ var _fsextra = require('fs-extra');
|
|
|
1794
934
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1795
935
|
async function typiaExecutorFn(options, _, config) {
|
|
1796
936
|
if (options.clean !== false) {
|
|
1797
|
-
|
|
937
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1798
938
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1799
939
|
}
|
|
1800
940
|
await Promise.all(options.entry.map((entry) => {
|
|
1801
|
-
|
|
941
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1802
942
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1803
943
|
input: entry,
|
|
1804
944
|
output: options.outputPath,
|
|
@@ -1810,7 +950,7 @@ async function typiaExecutorFn(options, _, config) {
|
|
|
1810
950
|
};
|
|
1811
951
|
}
|
|
1812
952
|
_chunk3GQAWCBQjs.__name.call(void 0, typiaExecutorFn, "typiaExecutorFn");
|
|
1813
|
-
var executor_default8 =
|
|
953
|
+
var executor_default8 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "Typia runtime validation generator", typiaExecutorFn, {
|
|
1814
954
|
skipReadingConfig: false,
|
|
1815
955
|
hooks: {
|
|
1816
956
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -1828,32 +968,32 @@ var executor_default8 = _chunkDLJYMU67js.withRunExecutor.call(void 0, "Typia run
|
|
|
1828
968
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
1829
969
|
|
|
1830
970
|
var _jiti = require('jiti');
|
|
1831
|
-
async function unbuildExecutorFn(options,
|
|
1832
|
-
|
|
1833
|
-
if (!_optionalChain([
|
|
971
|
+
async function unbuildExecutorFn(options, context, config) {
|
|
972
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
973
|
+
if (!_optionalChain([context, 'access', _66 => _66.projectsConfigurations, 'optionalAccess', _67 => _67.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1834
974
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
1835
975
|
}
|
|
1836
|
-
if (!
|
|
976
|
+
if (!context.projectsConfigurations.projects[context.projectName].root) {
|
|
1837
977
|
throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
|
|
1838
978
|
}
|
|
1839
|
-
if (!
|
|
979
|
+
if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
|
|
1840
980
|
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.");
|
|
1841
981
|
}
|
|
1842
982
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
1843
|
-
fsCache: config.skipCache ? false :
|
|
983
|
+
fsCache: config.skipCache ? false : _chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
1844
984
|
interopDefault: true
|
|
1845
985
|
});
|
|
1846
986
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
1847
987
|
await stormUnbuild.build(_defu.defu.call(void 0, {
|
|
1848
988
|
...options,
|
|
1849
|
-
projectRoot:
|
|
1850
|
-
projectName:
|
|
1851
|
-
sourceRoot:
|
|
989
|
+
projectRoot: context.projectsConfigurations.projects[context.projectName].root,
|
|
990
|
+
projectName: context.projectName,
|
|
991
|
+
sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
|
|
1852
992
|
platform: options.platform
|
|
1853
993
|
}, {
|
|
1854
994
|
stubOptions: {
|
|
1855
995
|
jiti: {
|
|
1856
|
-
fsCache: config.skipCache ? false :
|
|
996
|
+
fsCache: config.skipCache ? false : _chunkFC5AL6FFjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
1857
997
|
}
|
|
1858
998
|
},
|
|
1859
999
|
rollup: {
|
|
@@ -1877,7 +1017,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
1877
1017
|
};
|
|
1878
1018
|
}
|
|
1879
1019
|
_chunk3GQAWCBQjs.__name.call(void 0, unbuildExecutorFn, "unbuildExecutorFn");
|
|
1880
|
-
var executor_default9 =
|
|
1020
|
+
var executor_default9 = _chunkFC5AL6FFjs.withRunExecutor.call(void 0, "TypeScript Unbuild build", unbuildExecutorFn, {
|
|
1881
1021
|
skipReadingConfig: false,
|
|
1882
1022
|
hooks: {
|
|
1883
1023
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
|
|
@@ -1901,58 +1041,58 @@ var executor_default9 = _chunkDLJYMU67js.withRunExecutor.call(void 0, "TypeScrip
|
|
|
1901
1041
|
var withRunGenerator = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
1902
1042
|
skipReadingConfig: false
|
|
1903
1043
|
}) => async (tree, _options) => {
|
|
1904
|
-
const stopwatch =
|
|
1044
|
+
const stopwatch = _chunkFC5AL6FFjs.getStopwatch.call(void 0, name);
|
|
1905
1045
|
let options = _options;
|
|
1906
1046
|
let config;
|
|
1907
1047
|
try {
|
|
1908
|
-
|
|
1048
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1909
1049
|
|
|
1910
1050
|
`, config);
|
|
1911
|
-
const workspaceRoot3 =
|
|
1051
|
+
const workspaceRoot3 = _chunkFC5AL6FFjs.findWorkspaceRoot.call(void 0, );
|
|
1912
1052
|
if (!generatorOptions.skipReadingConfig) {
|
|
1913
|
-
|
|
1053
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
1914
1054
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
1915
|
-
config = await
|
|
1055
|
+
config = await _chunkFC5AL6FFjs.getConfig.call(void 0, workspaceRoot3);
|
|
1916
1056
|
}
|
|
1917
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1918
|
-
|
|
1057
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _68 => _68.hooks, 'optionalAccess', _69 => _69.applyDefaultOptions])) {
|
|
1058
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1919
1059
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
1920
|
-
|
|
1060
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1921
1061
|
}
|
|
1922
|
-
|
|
1062
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
1923
1063
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
1924
|
-
const tokenized = await
|
|
1064
|
+
const tokenized = await _chunkFC5AL6FFjs.applyWorkspaceTokens.call(void 0, options, {
|
|
1925
1065
|
workspaceRoot: tree.root,
|
|
1926
1066
|
config
|
|
1927
|
-
},
|
|
1928
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1929
|
-
|
|
1067
|
+
}, _chunkFC5AL6FFjs.applyWorkspaceBaseTokens);
|
|
1068
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _70 => _70.hooks, 'optionalAccess', _71 => _71.preProcess])) {
|
|
1069
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1930
1070
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
1931
|
-
|
|
1071
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
1932
1072
|
}
|
|
1933
1073
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
1934
1074
|
if (result) {
|
|
1935
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1075
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _72 => _72.error, 'optionalAccess', _73 => _73.message]) && typeof _optionalChain([result, 'optionalAccess', _74 => _74.error, 'optionalAccess', _75 => _75.message]) === "string" && _optionalChain([result, 'optionalAccess', _76 => _76.error, 'optionalAccess', _77 => _77.name]) && typeof _optionalChain([result, 'optionalAccess', _78 => _78.error, 'optionalAccess', _79 => _79.name]) === "string") {
|
|
1936
1076
|
throw new Error(`The ${name} generator failed to run`, {
|
|
1937
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1077
|
+
cause: _optionalChain([result, 'optionalAccess', _80 => _80.error])
|
|
1938
1078
|
});
|
|
1939
1079
|
} else if (result.success && result.data) {
|
|
1940
1080
|
return result;
|
|
1941
1081
|
}
|
|
1942
1082
|
}
|
|
1943
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
1944
|
-
|
|
1083
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _81 => _81.hooks, 'optionalAccess', _82 => _82.postProcess])) {
|
|
1084
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1945
1085
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1946
|
-
|
|
1086
|
+
_chunkFC5AL6FFjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1947
1087
|
}
|
|
1948
1088
|
return () => {
|
|
1949
|
-
|
|
1089
|
+
_chunkFC5AL6FFjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1950
1090
|
`, config);
|
|
1951
1091
|
};
|
|
1952
1092
|
} catch (error) {
|
|
1953
1093
|
return () => {
|
|
1954
|
-
|
|
1955
|
-
|
|
1094
|
+
_chunkFC5AL6FFjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1095
|
+
_chunkFC5AL6FFjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
1956
1096
|
- Details: ${error.message}
|
|
1957
1097
|
- Stacktrace: ${error.stack}`, config);
|
|
1958
1098
|
};
|
|
@@ -2054,7 +1194,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2054
1194
|
const projectConfig = {
|
|
2055
1195
|
root: normalized.directory,
|
|
2056
1196
|
projectType: "library",
|
|
2057
|
-
sourceRoot:
|
|
1197
|
+
sourceRoot: _chunkFC5AL6FFjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
2058
1198
|
targets: {
|
|
2059
1199
|
build: {
|
|
2060
1200
|
executor: options.buildExecutor,
|
|
@@ -2063,11 +1203,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2063
1203
|
],
|
|
2064
1204
|
options: {
|
|
2065
1205
|
entry: [
|
|
2066
|
-
|
|
1206
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
2067
1207
|
],
|
|
2068
1208
|
outputPath: getOutputPath(normalized),
|
|
2069
|
-
tsconfig:
|
|
2070
|
-
project:
|
|
1209
|
+
tsconfig: _chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1210
|
+
project: _chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
2071
1211
|
defaultConfiguration: "production",
|
|
2072
1212
|
platform: "neutral",
|
|
2073
1213
|
assets: [
|
|
@@ -2106,22 +1246,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2106
1246
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2107
1247
|
let repository = {
|
|
2108
1248
|
type: "github",
|
|
2109
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
1249
|
+
url: _optionalChain([config, 'optionalAccess', _83 => _83.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _84 => _84.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _85 => _85.namespace]) || _optionalChain([config, 'optionalAccess', _86 => _86.name]) || "repository"}.git`
|
|
2110
1250
|
};
|
|
2111
1251
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2112
1252
|
if (tree.exists("package.json")) {
|
|
2113
1253
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2114
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1254
|
+
if (_optionalChain([packageJson, 'optionalAccess', _87 => _87.repository])) {
|
|
2115
1255
|
repository = packageJson.repository;
|
|
2116
1256
|
}
|
|
2117
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1257
|
+
if (_optionalChain([packageJson, 'optionalAccess', _88 => _88.description])) {
|
|
2118
1258
|
description = packageJson.description;
|
|
2119
1259
|
}
|
|
2120
1260
|
}
|
|
2121
1261
|
if (!normalized.importPath) {
|
|
2122
1262
|
normalized.importPath = normalized.name;
|
|
2123
1263
|
}
|
|
2124
|
-
const packageJsonPath =
|
|
1264
|
+
const packageJsonPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2125
1265
|
if (tree.exists(packageJsonPath)) {
|
|
2126
1266
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2127
1267
|
if (!normalized.importPath) {
|
|
@@ -2169,30 +1309,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2169
1309
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2170
1310
|
...json,
|
|
2171
1311
|
pnpm: {
|
|
2172
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1312
|
+
..._optionalChain([json, 'optionalAccess', _89 => _89.pnpm]),
|
|
2173
1313
|
overrides: {
|
|
2174
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1314
|
+
..._optionalChain([json, 'optionalAccess', _90 => _90.pnpm, 'optionalAccess', _91 => _91.overrides]),
|
|
2175
1315
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2176
1316
|
}
|
|
2177
1317
|
}
|
|
2178
1318
|
}));
|
|
2179
1319
|
}
|
|
2180
1320
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2181
|
-
|
|
1321
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2182
1322
|
]);
|
|
2183
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2184
|
-
|
|
1323
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
1324
|
+
_chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2185
1325
|
]);
|
|
2186
1326
|
if (tree.exists("package.json")) {
|
|
2187
1327
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2188
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1328
|
+
if (_optionalChain([packageJson, 'optionalAccess', _92 => _92.repository])) {
|
|
2189
1329
|
repository = packageJson.repository;
|
|
2190
1330
|
}
|
|
2191
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1331
|
+
if (_optionalChain([packageJson, 'optionalAccess', _93 => _93.description])) {
|
|
2192
1332
|
description = packageJson.description;
|
|
2193
1333
|
}
|
|
2194
1334
|
}
|
|
2195
|
-
const tsconfigPath =
|
|
1335
|
+
const tsconfigPath = _chunkFC5AL6FFjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2196
1336
|
if (tree.exists(tsconfigPath)) {
|
|
2197
1337
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2198
1338
|
json.composite ??= true;
|
|
@@ -2230,42 +1370,42 @@ function getOutputPath(options) {
|
|
|
2230
1370
|
} else {
|
|
2231
1371
|
parts.push(options.projectRoot);
|
|
2232
1372
|
}
|
|
2233
|
-
return
|
|
1373
|
+
return _chunkFC5AL6FFjs.joinPaths.call(void 0, ...parts);
|
|
2234
1374
|
}
|
|
2235
1375
|
_chunk3GQAWCBQjs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2236
1376
|
function createProjectTsConfigJson(tree, options) {
|
|
2237
1377
|
const tsconfig = {
|
|
2238
1378
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2239
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1379
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _94 => _94.tsconfigOptions]), () => ( {})),
|
|
2240
1380
|
compilerOptions: {
|
|
2241
1381
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2242
|
-
outDir:
|
|
1382
|
+
outDir: _chunkFC5AL6FFjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2243
1383
|
noEmit: true,
|
|
2244
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1384
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _95 => _95.tsconfigOptions, 'optionalAccess', _96 => _96.compilerOptions]), () => ( {}))
|
|
2245
1385
|
},
|
|
2246
1386
|
files: [
|
|
2247
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1387
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _97 => _97.tsconfigOptions, 'optionalAccess', _98 => _98.files]), () => ( []))
|
|
2248
1388
|
],
|
|
2249
1389
|
include: [
|
|
2250
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1390
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _99 => _99.tsconfigOptions, 'optionalAccess', _100 => _100.include]), () => ( [])),
|
|
2251
1391
|
"src/**/*.ts",
|
|
2252
1392
|
"src/**/*.js",
|
|
2253
1393
|
"bin/**/*"
|
|
2254
1394
|
],
|
|
2255
1395
|
exclude: [
|
|
2256
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1396
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _101 => _101.tsconfigOptions, 'optionalAccess', _102 => _102.exclude]), () => ( [])),
|
|
2257
1397
|
"jest.config.ts",
|
|
2258
1398
|
"src/**/*.spec.ts",
|
|
2259
1399
|
"src/**/*.test.ts"
|
|
2260
1400
|
]
|
|
2261
1401
|
};
|
|
2262
|
-
_devkit.writeJson.call(void 0, tree,
|
|
1402
|
+
_devkit.writeJson.call(void 0, tree, _chunkFC5AL6FFjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2263
1403
|
}
|
|
2264
1404
|
_chunk3GQAWCBQjs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2265
1405
|
async function normalizeOptions(tree, options, config) {
|
|
2266
1406
|
let importPath = options.importPath;
|
|
2267
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2268
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
1407
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _103 => _103.namespace])) {
|
|
1408
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _104 => _104.namespace])}/${options.name}`;
|
|
2269
1409
|
}
|
|
2270
1410
|
if (options.publishable) {
|
|
2271
1411
|
if (!importPath) {
|
|
@@ -2319,7 +1459,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2319
1459
|
|
|
2320
1460
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2321
1461
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2322
|
-
const filesDir =
|
|
1462
|
+
const filesDir = _chunkFC5AL6FFjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2323
1463
|
const tsLibraryGeneratorOptions = {
|
|
2324
1464
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2325
1465
|
platform: "browser",
|
|
@@ -2391,19 +1531,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2391
1531
|
|
|
2392
1532
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2393
1533
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
1534
|
+
_chunkFC5AL6FFjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
1535
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
1536
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkFC5AL6FFjs.stormWorkspaceConfigSchema, {
|
|
2397
1537
|
name: "StormWorkspaceConfiguration"
|
|
2398
1538
|
});
|
|
2399
|
-
|
|
2400
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2401
|
-
|
|
1539
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, jsonSchema, config);
|
|
1540
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _105 => _105.workspaceRoot]), () => ( _chunkFC5AL6FFjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _106 => _106.outputFile, 'optionalAccess', _107 => _107.startsWith, 'call', _108 => _108("./")]) ? "" : "./");
|
|
1541
|
+
_chunkFC5AL6FFjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2402
1542
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2403
1543
|
spaces: 2
|
|
2404
1544
|
});
|
|
2405
1545
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2406
|
-
|
|
1546
|
+
_chunkFC5AL6FFjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2407
1547
|
return {
|
|
2408
1548
|
success: true
|
|
2409
1549
|
};
|
|
@@ -2442,7 +1582,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, initGenerator, "initGenerator");
|
|
|
2442
1582
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2443
1583
|
|
|
2444
1584
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2445
|
-
const filesDir =
|
|
1585
|
+
const filesDir = _chunkFC5AL6FFjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2446
1586
|
const tsLibraryGeneratorOptions = {
|
|
2447
1587
|
...schema,
|
|
2448
1588
|
platform: "neutral",
|
|
@@ -2485,7 +1625,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2485
1625
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2486
1626
|
|
|
2487
1627
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2488
|
-
const filesDir =
|
|
1628
|
+
const filesDir = _chunkFC5AL6FFjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2489
1629
|
const tsLibraryGeneratorOptions = {
|
|
2490
1630
|
platform: "node",
|
|
2491
1631
|
devDependencies: {
|
|
@@ -2679,7 +1819,7 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2679
1819
|
};
|
|
2680
1820
|
return json;
|
|
2681
1821
|
});
|
|
2682
|
-
_devkit.generateFiles.call(void 0, tree,
|
|
1822
|
+
_devkit.generateFiles.call(void 0, tree, path3.join(__dirname, "files"), projectRoot, {
|
|
2683
1823
|
...options,
|
|
2684
1824
|
pnpmVersion,
|
|
2685
1825
|
nodeVersion
|