@storm-software/esbuild 0.21.7 → 0.21.8
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 +10 -10
- package/dist/build.js +9 -9
- package/dist/{chunk-KJJEF47Z.js → chunk-4Q76YH6E.js} +1 -1
- package/dist/{chunk-3MVHCPXF.js → chunk-57U4XU5O.js} +5 -5
- package/dist/{chunk-W5YHMJLR.js → chunk-5A3PLYYB.js} +1 -1
- package/dist/{chunk-RMB62XEL.cjs → chunk-5UODOOQA.cjs} +2 -2
- package/dist/{chunk-CD57N3DC.js → chunk-7N4NGXDE.js} +5 -5
- package/dist/{chunk-GQTYEGCT.cjs → chunk-AP5TC7E5.cjs} +2 -2
- package/dist/{chunk-JXPYSVZW.js → chunk-B2PY326H.js} +1 -1
- package/dist/{chunk-NWSAHFK5.cjs → chunk-CJ3YJPNC.cjs} +66 -66
- package/dist/{chunk-GD4U35FZ.cjs → chunk-CNHHELK6.cjs} +3 -3
- package/dist/{chunk-LVWQSCJM.cjs → chunk-GHWCUMOG.cjs} +11 -5
- package/dist/{chunk-ZKT6GJKV.cjs → chunk-MPZUORUA.cjs} +4 -4
- package/dist/{chunk-TBU55QYV.cjs → chunk-MSCC7MGM.cjs} +49 -49
- package/dist/chunk-P4V2LVOO.js +32 -0
- package/dist/{chunk-GZKDEX4I.cjs → chunk-UEYUN2J6.cjs} +3 -3
- package/dist/{chunk-KE7NROKH.js → chunk-V7HJ2CJT.js} +1 -1
- package/dist/{chunk-42FF63OO.cjs → chunk-W6IC5BU4.cjs} +11 -11
- package/dist/{chunk-7QV3QQUC.js → chunk-XCY6RUA6.js} +2 -2
- package/dist/{chunk-DAGDNKO5.js → chunk-XOY3T2ZQ.js} +1 -1
- package/dist/clean.cjs +4 -4
- package/dist/clean.d.cts +10 -10
- package/dist/clean.d.ts +10 -10
- package/dist/clean.js +3 -3
- package/dist/config.cjs +7 -7
- package/dist/config.js +6 -6
- package/dist/index.cjs +10 -10
- package/dist/index.js +9 -9
- package/dist/plugins/deps-check.cjs +4 -4
- package/dist/plugins/deps-check.js +3 -3
- package/dist/plugins/on-error.cjs +4 -4
- package/dist/plugins/on-error.js +3 -3
- package/dist/plugins/resolve-paths.cjs +3 -3
- package/dist/plugins/resolve-paths.js +2 -2
- package/dist/plugins/tsc.cjs +4 -4
- package/dist/plugins/tsc.js +3 -3
- package/package.json +4 -4
- package/dist/chunk-7MDMXJ5V.js +0 -26
|
@@ -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(); } } 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
|
-
var
|
|
4
|
+
var _chunkGHWCUMOGcjs = require('./chunk-GHWCUMOG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -317,9 +317,9 @@ var rootFiles = [
|
|
|
317
317
|
];
|
|
318
318
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
319
319
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
320
|
-
return
|
|
320
|
+
return _chunkGHWCUMOGcjs.correctPaths.call(void 0, _nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
321
321
|
}
|
|
322
|
-
return
|
|
322
|
+
return _chunkGHWCUMOGcjs.correctPaths.call(void 0, findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
323
323
|
}
|
|
324
324
|
_chunkBGYQAVKQcjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
325
325
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -370,7 +370,7 @@ var getDefaultConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, asy
|
|
|
370
370
|
let repository = void 0;
|
|
371
371
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
372
372
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
373
|
-
const file = await _promises.readFile.call(void 0,
|
|
373
|
+
const file = await _promises.readFile.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
374
374
|
if (file) {
|
|
375
375
|
const packageJson = JSON.parse(file);
|
|
376
376
|
if (packageJson.name) {
|
|
@@ -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 _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -14,10 +14,10 @@ var _chunkGZKDEX4Icjs = require('./chunk-GZKDEX4I.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkCJ3YJPNCcjs = require('./chunk-CJ3YJPNC.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkCNHHELK6cjs = require('./chunk-CNHHELK6.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -27,10 +27,10 @@ var _chunkGD4U35FZcjs = require('./chunk-GD4U35FZ.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkMPZUORUAcjs = require('./chunk-MPZUORUA.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkGHWCUMOGcjs = require('./chunk-GHWCUMOG.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -277,13 +277,13 @@ 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 _chunkCJ3YJPNCcjs.getConfig.call(void 0, workspaceRoot.dir);
|
|
281
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
282
|
+
const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, "Build options resolution");
|
|
283
283
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
284
284
|
exitOnError: true
|
|
285
285
|
});
|
|
286
|
-
const projectJsonPath =
|
|
286
|
+
const projectJsonPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
287
287
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
288
288
|
throw new Error("Cannot find project.json configuration");
|
|
289
289
|
}
|
|
@@ -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, _chunkCJ3YJPNCcjs.DEFAULT_BUILD_OPTIONS);
|
|
297
297
|
options.name ??= `${projectName}-${options.format}`;
|
|
298
|
-
options.target ??=
|
|
299
|
-
const packageJsonPath =
|
|
298
|
+
options.target ??= _chunkCJ3YJPNCcjs.DEFAULT_TARGET;
|
|
299
|
+
const packageJsonPath = _chunkGHWCUMOGcjs.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 = _chunkCJ3YJPNCcjs.getOutputExtensionMap.call(void 0, options, packageJson.type);
|
|
305
|
+
const env = _chunkCJ3YJPNCcjs.getEnv.call(void 0, "esbuild", options);
|
|
306
306
|
const result = {
|
|
307
307
|
...options,
|
|
308
308
|
config,
|
|
@@ -320,20 +320,20 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
320
320
|
".node"
|
|
321
321
|
],
|
|
322
322
|
...userOptions,
|
|
323
|
-
tsconfig:
|
|
323
|
+
tsconfig: _chunkGHWCUMOGcjs.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 _chunkCJ3YJPNCcjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
326
326
|
"./src/index.ts"
|
|
327
327
|
], userOptions.emitOnAll),
|
|
328
|
-
outdir: userOptions.outputPath ||
|
|
328
|
+
outdir: userOptions.outputPath || _chunkGHWCUMOGcjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
329
329
|
plugins: [],
|
|
330
330
|
name: userOptions.name || projectName,
|
|
331
331
|
projectConfigurations,
|
|
332
332
|
projectName,
|
|
333
333
|
projectGraph,
|
|
334
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
334
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkGHWCUMOGcjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
335
335
|
minify: userOptions.minify || !userOptions.debug,
|
|
336
|
-
verbose: userOptions.verbose ||
|
|
336
|
+
verbose: userOptions.verbose || _chunkMPZUORUAcjs.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 || _chunkCJ3YJPNCcjs.DEFAULT_COMPILED_BANNER,
|
|
351
|
+
css: options.banner || _chunkCJ3YJPNCcjs.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",
|
|
@@ -369,32 +369,32 @@ var resolveOptions = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
|
|
|
369
369
|
}, {})
|
|
370
370
|
},
|
|
371
371
|
inject: [
|
|
372
|
-
options.format === "cjs" && options.injectShims ?
|
|
373
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
372
|
+
options.format === "cjs" && options.injectShims ? _chunkGHWCUMOGcjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
373
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkGHWCUMOGcjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : "",
|
|
374
374
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
375
375
|
].filter(Boolean)
|
|
376
376
|
};
|
|
377
|
-
result.plugins = _nullishCoalesce(userOptions.plugins, () => (
|
|
377
|
+
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( _chunkCJ3YJPNCcjs.getDefaultBuildPlugins.call(void 0, userOptions, result)));
|
|
378
378
|
stopwatch();
|
|
379
379
|
return result;
|
|
380
380
|
}, "resolveOptions");
|
|
381
381
|
async function generatePackageJson(context2) {
|
|
382
|
-
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
383
|
-
|
|
384
|
-
const stopwatch =
|
|
385
|
-
const packageJsonPath =
|
|
382
|
+
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
383
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
384
|
+
const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, "Write package.json file");
|
|
385
|
+
const packageJsonPath = _chunkGHWCUMOGcjs.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");
|
|
388
388
|
}
|
|
389
|
-
let packageJson = await _node.hfs.json(
|
|
389
|
+
let packageJson = await _node.hfs.json(_chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
|
|
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 _chunkCJ3YJPNCcjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
|
|
394
|
+
packageJson = await _chunkCJ3YJPNCcjs.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["."] ??= _chunkCJ3YJPNCcjs.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}`] ??= _chunkCJ3YJPNCcjs.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";
|
|
@@ -424,7 +424,7 @@ async function generatePackageJson(context2) {
|
|
|
424
424
|
}
|
|
425
425
|
return ret;
|
|
426
426
|
}, packageJson.exports);
|
|
427
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
427
|
+
await _devkit.writeJsonFile.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
428
428
|
stopwatch();
|
|
429
429
|
}
|
|
430
430
|
return context2;
|
|
@@ -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
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
454
|
+
const stopwatch = _chunkMPZUORUAcjs.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
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
471
|
+
const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
472
|
+
await _chunkCJ3YJPNCcjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, 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
|
+
_chunkMPZUORUAcjs.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
|
+
_chunkMPZUORUAcjs.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
|
+
_chunkCNHHELK6cjs.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 _chunkUEYUN2J6cjs.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
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
526
|
+
const stopwatch = _chunkMPZUORUAcjs.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
|
+
_chunkMPZUORUAcjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
537
537
|
} catch (error) {
|
|
538
|
-
|
|
538
|
+
_chunkMPZUORUAcjs.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
|
+
_chunkMPZUORUAcjs.writeError.call(void 0, rebuildResult.message);
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
_chunkMPZUORUAcjs.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;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-3GQAWCBQ.js";
|
|
4
|
+
|
|
5
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
|
|
8
|
+
return osSpecificPath.replace(/^[A-Z]:/, "");
|
|
9
|
+
}, "removeWindowsDriveLetter");
|
|
10
|
+
var correctPaths = /* @__PURE__ */ __name((path) => {
|
|
11
|
+
if (!path) {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
if (path.includes("\\")) {
|
|
15
|
+
if (!path.toUpperCase().startsWith("C:")) {
|
|
16
|
+
path = `C:${path}`;
|
|
17
|
+
}
|
|
18
|
+
return path.replaceAll("/", "\\");
|
|
19
|
+
}
|
|
20
|
+
return removeWindowsDriveLetter(path).split("\\").join("/");
|
|
21
|
+
}, "correctPaths");
|
|
22
|
+
var joinPaths = /* @__PURE__ */ __name((...paths) => {
|
|
23
|
+
if (!paths || paths.length === 0) {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
return correctPaths(join(...paths));
|
|
27
|
+
}, "joinPaths");
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
correctPaths,
|
|
31
|
+
joinPaths
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkMPZUORUAcjs = require('./chunk-MPZUORUA.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
|
+
_chunkMPZUORUAcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
13
|
+
const stopwatch = _chunkMPZUORUAcjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
14
14
|
await _node.hfs.deleteAll(directory);
|
|
15
15
|
stopwatch();
|
|
16
16
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _chunkMPZUORUAcjs = require('./chunk-MPZUORUA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkGHWCUMOGcjs = require('./chunk-GHWCUMOG.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -34,7 +34,7 @@ var run = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config, command
|
|
|
34
34
|
|
|
35
35
|
// src/plugins/tsc.ts
|
|
36
36
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
37
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkBGYQAVKQcjs.__require.call(void 0,
|
|
37
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkBGYQAVKQcjs.__require.call(void 0, _chunkGHWCUMOGcjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
38
38
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
39
39
|
p,
|
|
40
40
|
getTypeDependencyPackageName(p)
|
|
@@ -70,13 +70,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
70
70
|
},
|
|
71
71
|
dtsRollup: {
|
|
72
72
|
enabled: true,
|
|
73
|
-
untrimmedFilePath:
|
|
73
|
+
untrimmedFilePath: _chunkGHWCUMOGcjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
74
74
|
},
|
|
75
75
|
tsdocMetadata: {
|
|
76
76
|
enabled: false
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
packageJsonFullPath:
|
|
79
|
+
packageJsonFullPath: _chunkGHWCUMOGcjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
80
80
|
configObjectFullPath: void 0
|
|
81
81
|
});
|
|
82
82
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -84,7 +84,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
84
84
|
localBuild: true
|
|
85
85
|
});
|
|
86
86
|
if (extractorResult.succeeded === false) {
|
|
87
|
-
|
|
87
|
+
_chunkMPZUORUAcjs.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
|
}
|
|
@@ -103,12 +103,12 @@ var tscPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (options,
|
|
|
103
103
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
104
104
|
const typeOutDir = resolvedOptions.outdir;
|
|
105
105
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
106
|
-
const bundlePath =
|
|
106
|
+
const bundlePath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
107
107
|
let dtsPath;
|
|
108
|
-
if (await _node.hfs.isFile(
|
|
109
|
-
dtsPath =
|
|
110
|
-
} else if (await _node.hfs.isFile(
|
|
111
|
-
dtsPath =
|
|
108
|
+
if (await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
109
|
+
dtsPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
110
|
+
} else if (await _node.hfs.isFile(_chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
111
|
+
dtsPath = _chunkGHWCUMOGcjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
112
112
|
}
|
|
113
113
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
114
114
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
package/dist/clean.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkUEYUN2J6cjs = require('./chunk-UEYUN2J6.cjs');
|
|
4
|
+
require('./chunk-MPZUORUA.cjs');
|
|
5
|
+
require('./chunk-GHWCUMOG.cjs');
|
|
6
6
|
require('./chunk-BGYQAVKQ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.clean =
|
|
9
|
+
exports.clean = _chunkUEYUN2J6cjs.clean;
|
package/dist/clean.d.cts
CHANGED
|
@@ -40,15 +40,15 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
40
40
|
build: z.ZodDefault<z.ZodString>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
build: string;
|
|
43
|
-
config?: string | undefined;
|
|
44
43
|
cache?: string | undefined;
|
|
45
44
|
data?: string | undefined;
|
|
45
|
+
config?: string | undefined;
|
|
46
46
|
temp?: string | undefined;
|
|
47
47
|
log?: string | undefined;
|
|
48
48
|
}, {
|
|
49
|
-
config?: string | undefined;
|
|
50
49
|
cache?: string | undefined;
|
|
51
50
|
data?: string | undefined;
|
|
51
|
+
config?: string | undefined;
|
|
52
52
|
temp?: string | undefined;
|
|
53
53
|
log?: string | undefined;
|
|
54
54
|
build?: string | undefined;
|
|
@@ -794,8 +794,6 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
794
794
|
}>]>>]>]>;
|
|
795
795
|
extensions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
logLevel: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all";
|
|
798
|
-
env: "development" | "staging" | "production";
|
|
799
797
|
organization: string;
|
|
800
798
|
license: string;
|
|
801
799
|
homepage: string;
|
|
@@ -807,20 +805,22 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
807
805
|
name: string;
|
|
808
806
|
email: string;
|
|
809
807
|
};
|
|
808
|
+
env: "development" | "staging" | "production";
|
|
810
809
|
workspaceRoot: string;
|
|
811
810
|
externalPackagePatterns: string[];
|
|
812
811
|
skipCache: boolean;
|
|
813
812
|
directories: {
|
|
814
813
|
build: string;
|
|
815
|
-
config?: string | undefined;
|
|
816
814
|
cache?: string | undefined;
|
|
817
815
|
data?: string | undefined;
|
|
816
|
+
config?: string | undefined;
|
|
818
817
|
temp?: string | undefined;
|
|
819
818
|
log?: string | undefined;
|
|
820
819
|
};
|
|
821
820
|
packageManager: "npm" | "yarn" | "pnpm" | "bun";
|
|
822
821
|
timezone: string;
|
|
823
822
|
locale: string;
|
|
823
|
+
logLevel: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all";
|
|
824
824
|
registry: {
|
|
825
825
|
npm?: string | undefined;
|
|
826
826
|
github?: string | undefined;
|
|
@@ -977,9 +977,9 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
977
977
|
};
|
|
978
978
|
}>;
|
|
979
979
|
extensions: Record<string, any>;
|
|
980
|
-
name?: string | undefined;
|
|
981
980
|
$schema?: string | null | undefined;
|
|
982
981
|
extends?: string | string[] | undefined;
|
|
982
|
+
name?: string | undefined;
|
|
983
983
|
namespace?: string | undefined;
|
|
984
984
|
repository?: string | undefined;
|
|
985
985
|
preid?: string | undefined;
|
|
@@ -989,9 +989,9 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
989
989
|
email?: string | undefined;
|
|
990
990
|
};
|
|
991
991
|
directories: {
|
|
992
|
-
config?: string | undefined;
|
|
993
992
|
cache?: string | undefined;
|
|
994
993
|
data?: string | undefined;
|
|
994
|
+
config?: string | undefined;
|
|
995
995
|
temp?: string | undefined;
|
|
996
996
|
log?: string | undefined;
|
|
997
997
|
build?: string | undefined;
|
|
@@ -1143,11 +1143,9 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
1143
1143
|
background?: string | undefined;
|
|
1144
1144
|
};
|
|
1145
1145
|
}>;
|
|
1146
|
-
logLevel?: "debug" | "silent" | "fatal" | "error" | "warn" | "success" | "info" | "trace" | "all" | undefined;
|
|
1147
|
-
name?: string | undefined;
|
|
1148
|
-
env?: "development" | "staging" | "production" | undefined;
|
|
1149
1146
|
$schema?: string | null | undefined;
|
|
1150
1147
|
extends?: string | string[] | undefined;
|
|
1148
|
+
name?: string | undefined;
|
|
1151
1149
|
namespace?: string | undefined;
|
|
1152
1150
|
organization?: string | undefined;
|
|
1153
1151
|
repository?: string | undefined;
|
|
@@ -1158,12 +1156,14 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
1158
1156
|
branch?: string | undefined;
|
|
1159
1157
|
preid?: string | undefined;
|
|
1160
1158
|
owner?: string | undefined;
|
|
1159
|
+
env?: "development" | "staging" | "production" | undefined;
|
|
1161
1160
|
workspaceRoot?: string | undefined;
|
|
1162
1161
|
externalPackagePatterns?: string[] | undefined;
|
|
1163
1162
|
skipCache?: boolean | undefined;
|
|
1164
1163
|
packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
|
|
1165
1164
|
timezone?: string | undefined;
|
|
1166
1165
|
locale?: string | undefined;
|
|
1166
|
+
logLevel?: "silent" | "fatal" | "error" | "warn" | "success" | "info" | "debug" | "trace" | "all" | undefined;
|
|
1167
1167
|
registry?: {
|
|
1168
1168
|
npm?: string | undefined;
|
|
1169
1169
|
github?: string | undefined;
|