@storm-software/esbuild 0.18.0 → 0.19.1
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/build.cjs +8 -8
- package/dist/build.js +7 -7
- package/dist/{chunk-2GDH4JSN.cjs → chunk-2COJNALQ.cjs} +2 -2
- package/dist/{chunk-O5KQUB74.cjs → chunk-2THAVAOF.cjs} +37 -37
- package/dist/{chunk-UY5T74KN.js → chunk-4U2FYKOQ.js} +1 -1
- package/dist/{chunk-B6XATEM4.js → chunk-5SXB2YMC.js} +1 -1
- package/dist/{chunk-C7RQ2QZM.js → chunk-6MOE3663.js} +27 -40
- package/dist/{chunk-UJM4BCSP.cjs → chunk-B3ZJI3HY.cjs} +3 -3
- package/dist/{chunk-QJCTL2UQ.cjs → chunk-BM5D6M6U.cjs} +3 -3
- package/dist/{chunk-IMZK22U3.js → chunk-CHCOA7BI.js} +9 -8
- package/dist/{chunk-2C3TGE3A.cjs → chunk-GQMUNAL6.cjs} +54 -67
- package/dist/{chunk-Y67WRXQG.js → chunk-I457R337.js} +1 -1
- package/dist/{chunk-MQBIMPCE.cjs → chunk-L5BDTYEA.cjs} +2 -2
- package/dist/{chunk-ZKJVN5D7.cjs → chunk-RRTBX24M.cjs} +9 -8
- package/dist/{chunk-6B4WCVK3.js → chunk-W5UUV5HR.js} +4 -4
- package/dist/{chunk-JETLWBVI.js → chunk-WBJTD7ZO.js} +1 -1
- package/dist/clean.cjs +3 -3
- package/dist/clean.js +2 -2
- package/dist/config.cjs +5 -5
- package/dist/config.js +4 -4
- package/dist/index.cjs +8 -8
- package/dist/index.js +7 -7
- package/package.json +187 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/dist/build.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk2THAVAOFcjs = require('./chunk-2THAVAOF.cjs');
|
|
4
|
+
require('./chunk-B3ZJI3HY.cjs');
|
|
5
|
+
require('./chunk-GQMUNAL6.cjs');
|
|
6
6
|
require('./chunk-S6M44SSZ.cjs');
|
|
7
7
|
require('./chunk-WRBUO7H6.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-L5BDTYEA.cjs');
|
|
9
9
|
require('./chunk-RMB62XEL.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-2COJNALQ.cjs');
|
|
11
|
+
require('./chunk-BM5D6M6U.cjs');
|
|
12
|
+
require('./chunk-RRTBX24M.cjs');
|
|
13
13
|
require('./chunk-LVWQSCJM.cjs');
|
|
14
14
|
require('./chunk-CGFDQ5AJ.cjs');
|
|
15
15
|
require('./chunk-EZGTDCYM.cjs');
|
|
16
16
|
require('./chunk-BGYQAVKQ.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
exports.build =
|
|
19
|
+
exports.build = _chunk2THAVAOFcjs.build;
|
package/dist/build.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-W5UUV5HR.js";
|
|
4
|
+
import "./chunk-WBJTD7ZO.js";
|
|
5
|
+
import "./chunk-6MOE3663.js";
|
|
6
6
|
import "./chunk-T5272PC2.js";
|
|
7
7
|
import "./chunk-LYDEMC26.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-I457R337.js";
|
|
9
9
|
import "./chunk-DAGDNKO5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-4U2FYKOQ.js";
|
|
11
|
+
import "./chunk-5SXB2YMC.js";
|
|
12
|
+
import "./chunk-CHCOA7BI.js";
|
|
13
13
|
import "./chunk-7MDMXJ5V.js";
|
|
14
14
|
import "./chunk-YNQ45EAM.js";
|
|
15
15
|
import "./chunk-GWG4HOQ6.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
-
var
|
|
3
|
+
var _chunkRRTBX24Mcjs = require('./chunk-RRTBX24M.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkLVWQSCJMcjs = require('./chunk-LVWQSCJM.cjs');
|
|
@@ -84,7 +84,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
84
84
|
localBuild: true
|
|
85
85
|
});
|
|
86
86
|
if (extractorResult.succeeded === false) {
|
|
87
|
-
|
|
87
|
+
_chunkRRTBX24Mcjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
88
88
|
throw new Error("API Extractor completed with errors");
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
var
|
|
3
|
+
var _chunkB3ZJI3HYcjs = require('./chunk-B3ZJI3HY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -14,10 +14,10 @@ var _chunkUJM4BCSPcjs = require('./chunk-UJM4BCSP.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkGQMUNAL6cjs = require('./chunk-GQMUNAL6.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkBM5D6M6Ucjs = require('./chunk-BM5D6M6U.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ var _chunkQJCTL2UQcjs = require('./chunk-QJCTL2UQ.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkRRTBX24Mcjs = require('./chunk-RRTBX24M.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkLVWQSCJMcjs = require('./chunk-LVWQSCJM.cjs');
|
|
@@ -277,9 +277,9 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
277
277
|
if (!workspaceRoot) {
|
|
278
278
|
throw new Error("Cannot find Nx workspace root");
|
|
279
279
|
}
|
|
280
|
-
const config = await
|
|
281
|
-
|
|
282
|
-
const stopwatch =
|
|
280
|
+
const config = await _chunkGQMUNAL6cjs.loadStormConfig.call(void 0, workspaceRoot.dir);
|
|
281
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
282
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, "Build options resolution");
|
|
283
283
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
284
284
|
exitOnError: true
|
|
285
285
|
});
|
|
@@ -293,16 +293,16 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
293
293
|
if (!_optionalChain([projectConfigurations, 'optionalAccess', _14 => _14.projects, 'optionalAccess', _15 => _15[projectName]])) {
|
|
294
294
|
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.");
|
|
295
295
|
}
|
|
296
|
-
const options = _defu2.default.call(void 0, userOptions,
|
|
296
|
+
const options = _defu2.default.call(void 0, userOptions, _chunkGQMUNAL6cjs.DEFAULT_BUILD_OPTIONS);
|
|
297
297
|
options.name ??= `${projectName}-${options.format}`;
|
|
298
|
-
options.target ??=
|
|
298
|
+
options.target ??= _chunkGQMUNAL6cjs.DEFAULT_TARGET;
|
|
299
299
|
const packageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
300
300
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
301
301
|
throw new Error("Cannot find package.json configuration");
|
|
302
302
|
}
|
|
303
303
|
const packageJson = await _node.hfs.json(packageJsonPath);
|
|
304
|
-
const outExtension =
|
|
305
|
-
const env =
|
|
304
|
+
const outExtension = _chunkGQMUNAL6cjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
|
|
305
|
+
const env = _chunkGQMUNAL6cjs.getEnv.call(void 0, "esbuild", options);
|
|
306
306
|
const result = {
|
|
307
307
|
...options,
|
|
308
308
|
config,
|
|
@@ -322,7 +322,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
322
322
|
...userOptions,
|
|
323
323
|
tsconfig: _chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
324
324
|
format: options.format || "cjs",
|
|
325
|
-
entryPoints: await
|
|
325
|
+
entryPoints: await _chunkGQMUNAL6cjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
326
326
|
"./src/index.ts"
|
|
327
327
|
], userOptions.emitOnAll),
|
|
328
328
|
outdir: userOptions.outputPath || _chunkLVWQSCJMcjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
@@ -333,7 +333,7 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
333
333
|
projectGraph,
|
|
334
334
|
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkLVWQSCJMcjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
335
335
|
minify: userOptions.minify || !userOptions.debug,
|
|
336
|
-
verbose: userOptions.verbose ||
|
|
336
|
+
verbose: userOptions.verbose || _chunkRRTBX24Mcjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
337
337
|
includeSrc: userOptions.includeSrc === true,
|
|
338
338
|
metafile: userOptions.metafile !== false,
|
|
339
339
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -347,8 +347,8 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
347
347
|
outExtension,
|
|
348
348
|
footer: userOptions.footer,
|
|
349
349
|
banner: {
|
|
350
|
-
js: options.banner ||
|
|
351
|
-
css: options.banner ||
|
|
350
|
+
js: options.banner || _chunkGQMUNAL6cjs.DEFAULT_COMPILED_BANNER,
|
|
351
|
+
css: options.banner || _chunkGQMUNAL6cjs.DEFAULT_COMPILED_BANNER
|
|
352
352
|
},
|
|
353
353
|
splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
|
|
354
354
|
treeShaking: options.format === "esm",
|
|
@@ -374,14 +374,14 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
374
374
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
375
375
|
].filter(Boolean)
|
|
376
376
|
};
|
|
377
|
-
result.plugins = _nullishCoalesce(userOptions.plugins, () => (
|
|
377
|
+
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkGQMUNAL6cjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
|
|
378
378
|
stopwatch();
|
|
379
379
|
return result;
|
|
380
380
|
}, "resolveOptions");
|
|
381
381
|
async function generatePackageJson(context2) {
|
|
382
382
|
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkLVWQSCJMcjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
383
|
-
|
|
384
|
-
const stopwatch =
|
|
383
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
384
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, "Write package.json file");
|
|
385
385
|
const packageJsonPath = _chunkLVWQSCJMcjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
386
386
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
387
387
|
throw new Error("Cannot find package.json configuration");
|
|
@@ -390,11 +390,11 @@ async function generatePackageJson(context2) {
|
|
|
390
390
|
if (!packageJson) {
|
|
391
391
|
throw new Error("Cannot find package.json configuration file");
|
|
392
392
|
}
|
|
393
|
-
packageJson = await
|
|
394
|
-
packageJson = await
|
|
393
|
+
packageJson = await _chunkGQMUNAL6cjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
|
|
394
|
+
packageJson = await _chunkGQMUNAL6cjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
|
|
395
395
|
packageJson.exports ??= {};
|
|
396
396
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
397
|
-
packageJson.exports["."] ??=
|
|
397
|
+
packageJson.exports["."] ??= _chunkGQMUNAL6cjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
|
|
398
398
|
let entryPoints = [
|
|
399
399
|
{
|
|
400
400
|
in: "./src/index.ts",
|
|
@@ -412,7 +412,7 @@ async function generatePackageJson(context2) {
|
|
|
412
412
|
const split = entryPoint.out.split(".");
|
|
413
413
|
split.pop();
|
|
414
414
|
const entry = split.join(".").replaceAll("\\", "/");
|
|
415
|
-
packageJson.exports[`./${entry}`] ??=
|
|
415
|
+
packageJson.exports[`./${entry}`] ??= _chunkGQMUNAL6cjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
@@ -450,8 +450,8 @@ async function generateContext(getOptions) {
|
|
|
450
450
|
}
|
|
451
451
|
_chunkBGYQAVKQcjs.__name.call(void 0, generateContext, "generateContext");
|
|
452
452
|
async function executeEsBuild(context2) {
|
|
453
|
-
|
|
454
|
-
const stopwatch =
|
|
453
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
454
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
455
455
|
if (process.env.WATCH === "true") {
|
|
456
456
|
const ctx = await esbuild.context(context2.options);
|
|
457
457
|
watch(ctx, context2.options);
|
|
@@ -467,9 +467,9 @@ async function executeEsBuild(context2) {
|
|
|
467
467
|
_chunkBGYQAVKQcjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
468
468
|
async function copyBuildAssets(context2) {
|
|
469
469
|
if (_optionalChain([context2, 'access', _16 => _16.result, 'optionalAccess', _17 => _17.errors, 'access', _18 => _18.length]) === 0) {
|
|
470
|
-
|
|
471
|
-
const stopwatch =
|
|
472
|
-
await
|
|
470
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
471
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
472
|
+
await _chunkGQMUNAL6cjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
|
|
473
473
|
stopwatch();
|
|
474
474
|
}
|
|
475
475
|
return context2;
|
|
@@ -478,9 +478,9 @@ _chunkBGYQAVKQcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
|
478
478
|
async function reportResults(context2) {
|
|
479
479
|
if (_optionalChain([context2, 'access', _19 => _19.result, 'optionalAccess', _20 => _20.errors, 'access', _21 => _21.length]) === 0) {
|
|
480
480
|
if (context2.result.warnings.length > 0) {
|
|
481
|
-
|
|
481
|
+
_chunkRRTBX24Mcjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
482
482
|
}
|
|
483
|
-
|
|
483
|
+
_chunkRRTBX24Mcjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
_chunkBGYQAVKQcjs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -506,7 +506,7 @@ async function dependencyCheck(options) {
|
|
|
506
506
|
write: false,
|
|
507
507
|
outdir: "out",
|
|
508
508
|
plugins: [
|
|
509
|
-
|
|
509
|
+
_chunkBM5D6M6Ucjs.depsCheckPlugin.call(void 0, options.bundle)
|
|
510
510
|
]
|
|
511
511
|
});
|
|
512
512
|
await buildPromise.catch(() => {
|
|
@@ -516,14 +516,14 @@ async function dependencyCheck(options) {
|
|
|
516
516
|
_chunkBGYQAVKQcjs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
517
517
|
async function cleanOutputPath(context2) {
|
|
518
518
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
519
|
-
await
|
|
519
|
+
await _chunkB3ZJI3HYcjs.clean.call(void 0, context2.options.name, context2.options.outdir, context2.options.config);
|
|
520
520
|
}
|
|
521
521
|
return context2;
|
|
522
522
|
}
|
|
523
523
|
_chunkBGYQAVKQcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
524
524
|
async function build2(options) {
|
|
525
|
-
|
|
526
|
-
const stopwatch =
|
|
525
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
526
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
527
527
|
try {
|
|
528
528
|
const opts = Array.isArray(options) ? options : [
|
|
529
529
|
options
|
|
@@ -533,9 +533,9 @@ async function build2(options) {
|
|
|
533
533
|
}
|
|
534
534
|
void transduce.async(opts, dependencyCheck);
|
|
535
535
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
536
|
-
|
|
536
|
+
_chunkRRTBX24Mcjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
537
537
|
} catch (error) {
|
|
538
|
-
|
|
538
|
+
_chunkRRTBX24Mcjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
539
539
|
throw error;
|
|
540
540
|
} finally {
|
|
541
541
|
stopwatch();
|
|
@@ -563,9 +563,9 @@ var watch = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (context2, opt
|
|
|
563
563
|
return context2.rebuild();
|
|
564
564
|
});
|
|
565
565
|
if (rebuildResult instanceof Error) {
|
|
566
|
-
|
|
566
|
+
_chunkRRTBX24Mcjs.writeError.call(void 0, rebuildResult.message);
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
_chunkRRTBX24Mcjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
569
569
|
}, 10);
|
|
570
570
|
changeWatcher.on("change", fastRebuild);
|
|
571
571
|
return void 0;
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-LYDEMC26.js";
|
|
7
7
|
import {
|
|
8
8
|
onErrorPlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I457R337.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePathsPlugin
|
|
12
12
|
} from "./chunk-DAGDNKO5.js";
|
|
13
13
|
import {
|
|
14
14
|
tscPlugin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4U2FYKOQ.js";
|
|
16
16
|
import {
|
|
17
17
|
COLOR_KEYS,
|
|
18
18
|
LogLevel,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
writeSystem,
|
|
30
30
|
writeTrace,
|
|
31
31
|
writeWarning
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CHCOA7BI.js";
|
|
33
33
|
import {
|
|
34
34
|
correctPaths,
|
|
35
35
|
joinPaths
|
|
@@ -69,39 +69,36 @@ import { stripIndents } from "@nx/devkit";
|
|
|
69
69
|
import { relative } from "path";
|
|
70
70
|
|
|
71
71
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
72
|
-
import {
|
|
73
|
-
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
72
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
74
73
|
import { copyAssets as copyAssetsBase } from "@nx/js";
|
|
75
74
|
import { glob } from "glob";
|
|
76
|
-
|
|
77
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
78
|
-
import { hfs } from "@humanfs/node";
|
|
75
|
+
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
79
76
|
|
|
80
77
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
81
78
|
import { loadConfig } from "c12";
|
|
82
79
|
import defu from "defu";
|
|
83
80
|
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
84
81
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
85
|
-
let config = loadConfig({
|
|
82
|
+
let config = await loadConfig({
|
|
86
83
|
cwd: workspacePath,
|
|
87
84
|
packageJson: true,
|
|
88
85
|
name: fileName,
|
|
89
86
|
envName: fileName?.toUpperCase(),
|
|
90
87
|
jitiOptions: {
|
|
91
88
|
debug: false,
|
|
92
|
-
|
|
89
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
93
90
|
},
|
|
94
91
|
...options
|
|
95
92
|
});
|
|
96
93
|
if (!config || Object.keys(config).length === 0) {
|
|
97
|
-
config = loadConfig({
|
|
94
|
+
config = await loadConfig({
|
|
98
95
|
cwd: workspacePath,
|
|
99
96
|
packageJson: true,
|
|
100
97
|
name: fileName,
|
|
101
98
|
envName: fileName?.toUpperCase(),
|
|
102
99
|
jitiOptions: {
|
|
103
100
|
debug: false,
|
|
104
|
-
|
|
101
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
105
102
|
},
|
|
106
103
|
configFile: fileName,
|
|
107
104
|
...options
|
|
@@ -555,6 +552,8 @@ ${formatLogMessage(config)}`, config);
|
|
|
555
552
|
}, "loadStormConfig");
|
|
556
553
|
|
|
557
554
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
555
|
+
import { existsSync } from "node:fs";
|
|
556
|
+
import { readFile } from "node:fs/promises";
|
|
558
557
|
var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
559
558
|
let rootDir = workspaceRoot;
|
|
560
559
|
if (!rootDir) {
|
|
@@ -562,10 +561,11 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
|
562
561
|
rootDir = config.workspaceRoot;
|
|
563
562
|
}
|
|
564
563
|
const nxJsonPath = joinPaths(rootDir, "nx.json");
|
|
565
|
-
if (!
|
|
564
|
+
if (!existsSync(nxJsonPath)) {
|
|
566
565
|
throw new Error("Cannot find project.json configuration");
|
|
567
566
|
}
|
|
568
|
-
|
|
567
|
+
const configContent = await readFile(nxJsonPath, "utf8");
|
|
568
|
+
return JSON.parse(configContent);
|
|
569
569
|
}, "readNxConfig");
|
|
570
570
|
|
|
571
571
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -600,14 +600,12 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
600
600
|
});
|
|
601
601
|
}
|
|
602
602
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
603
|
-
const projectGraph =
|
|
604
|
-
exitOnError: true
|
|
605
|
-
});
|
|
603
|
+
const projectGraph = readCachedProjectGraph();
|
|
606
604
|
const projectsConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
607
605
|
if (!projectsConfigurations?.projects?.[projectName]) {
|
|
608
606
|
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.");
|
|
609
607
|
}
|
|
610
|
-
const buildTarget = projectsConfigurations.projects[projectName]
|
|
608
|
+
const buildTarget = projectsConfigurations.projects[projectName].targets?.build;
|
|
611
609
|
if (!buildTarget) {
|
|
612
610
|
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${joinPaths(projectRoot, "project.json")}`);
|
|
613
611
|
}
|
|
@@ -637,42 +635,30 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
637
635
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
638
636
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
639
637
|
]);
|
|
640
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
638
|
+
await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
641
639
|
|
|
642
|
-
${await
|
|
640
|
+
${await readFile2(file, "utf8")}
|
|
643
641
|
|
|
644
642
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
645
643
|
}
|
|
646
644
|
}, "copyAssets");
|
|
647
645
|
|
|
648
646
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
649
|
-
import { hfs as hfs3 } from "@humanfs/node";
|
|
650
647
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
651
648
|
import { Glob } from "glob";
|
|
652
|
-
import {
|
|
649
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
650
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
651
|
+
import { readCachedProjectGraph as readCachedProjectGraph2 } from "nx/src/project-graph/project-graph";
|
|
653
652
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
654
|
-
const
|
|
655
|
-
exitOnError: true
|
|
656
|
-
});
|
|
657
|
-
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
658
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
659
|
-
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.");
|
|
660
|
-
}
|
|
661
|
-
const projectJsonPath = joinPaths(workspaceRoot, projectRoot, "project.json");
|
|
662
|
-
if (!await hfs3.isFile(projectJsonPath)) {
|
|
663
|
-
throw new Error("Cannot find project.json configuration");
|
|
664
|
-
}
|
|
665
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
666
|
-
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.");
|
|
667
|
-
}
|
|
668
|
-
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
653
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph2(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
669
654
|
const localPackages = [];
|
|
670
655
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
671
656
|
const projectNode = project.node;
|
|
672
657
|
if (projectNode.data.root) {
|
|
673
658
|
const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
659
|
+
if (existsSync2(projectPackageJsonPath)) {
|
|
660
|
+
const projectPackageJsonContent = await readFile3(projectPackageJsonPath, "utf8");
|
|
661
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
676
662
|
if (projectPackageJson.private !== false) {
|
|
677
663
|
localPackages.push(projectPackageJson);
|
|
678
664
|
}
|
|
@@ -708,7 +694,8 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
708
694
|
}, "addPackageDependencies");
|
|
709
695
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
710
696
|
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
|
|
711
|
-
const
|
|
697
|
+
const workspacePackageJsonContent = await readFile3(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
698
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
712
699
|
packageJson.type ??= "module";
|
|
713
700
|
packageJson.sideEffects ??= false;
|
|
714
701
|
if (includeSrc === true) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRRTBX24Mcjs = require('./chunk-RRTBX24M.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -9,8 +9,8 @@ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
|
9
9
|
// src/clean.ts
|
|
10
10
|
var _node = require('@humanfs/node');
|
|
11
11
|
async function clean(name = "ESBuild", directory, config) {
|
|
12
|
-
|
|
13
|
-
const stopwatch =
|
|
12
|
+
_chunkRRTBX24Mcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
13
|
+
const stopwatch = _chunkRRTBX24Mcjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
14
14
|
await _node.hfs.deleteAll(directory);
|
|
15
15
|
stopwatch();
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRRTBX24Mcjs = require('./chunk-RRTBX24M.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -86,8 +86,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (bun
|
|
|
86
86
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
87
87
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
88
88
|
});
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
_chunkRRTBX24Mcjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
90
|
+
_chunkRRTBX24Mcjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
91
91
|
if (filteredMissingDeps.length > 0) {
|
|
92
92
|
throw new Error(`Missing dependencies detected - please install them:
|
|
93
93
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -453,7 +453,8 @@ var CONSOLE_ICONS = {
|
|
|
453
453
|
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
454
454
|
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
455
455
|
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
456
|
-
[LogLevelLabel.TRACE]: useIcon("\
|
|
456
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
457
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
457
458
|
};
|
|
458
459
|
|
|
459
460
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
@@ -473,48 +474,48 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) =>
|
|
|
473
474
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
474
475
|
return (message) => {
|
|
475
476
|
console.error(`
|
|
476
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
477
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
477
478
|
`);
|
|
478
479
|
};
|
|
479
480
|
}
|
|
480
481
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
481
482
|
return (message) => {
|
|
482
483
|
console.error(`
|
|
483
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
484
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
484
485
|
`);
|
|
485
486
|
};
|
|
486
487
|
}
|
|
487
488
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
488
489
|
return (message) => {
|
|
489
490
|
console.warn(`
|
|
490
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
491
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
491
492
|
`);
|
|
492
493
|
};
|
|
493
494
|
}
|
|
494
495
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
495
496
|
return (message) => {
|
|
496
497
|
console.info(`
|
|
497
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
498
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
498
499
|
`);
|
|
499
500
|
};
|
|
500
501
|
}
|
|
501
502
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
502
503
|
return (message) => {
|
|
503
504
|
console.info(`
|
|
504
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
505
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
505
506
|
`);
|
|
506
507
|
};
|
|
507
508
|
}
|
|
508
509
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
509
510
|
return (message) => {
|
|
510
511
|
console.debug(`
|
|
511
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
512
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
512
513
|
`);
|
|
513
514
|
};
|
|
514
515
|
}
|
|
515
516
|
return (message) => {
|
|
516
517
|
console.log(`
|
|
517
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
518
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
518
519
|
`);
|
|
519
520
|
};
|
|
520
521
|
}, "getLogFn");
|