@storm-software/esbuild 0.34.2 → 0.34.3
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 +2 -1
- package/bin/esbuild.cjs +12143 -158
- package/dist/assets.cjs +9 -0
- package/dist/assets.d.cts +16 -0
- package/dist/assets.d.ts +16 -0
- package/dist/assets.js +9 -0
- package/dist/build.cjs +13 -17
- package/dist/build.d.cts +3 -13
- package/dist/build.d.ts +3 -13
- package/dist/build.js +14 -18
- package/dist/chunk-2CM3VAO5.cjs +119 -0
- package/dist/{chunk-Y7JBB452.js → chunk-4D6ICA75.js} +36 -3
- package/dist/{chunk-5RVOO3YF.js → chunk-ABRK5MYP.js} +3 -5
- package/dist/chunk-CVOQEYHW.cjs +117 -0
- package/dist/{chunk-3PF5YMWK.js → chunk-DNZNN5SK.js} +2 -2
- package/dist/chunk-EBTMX5WL.js +117 -0
- package/dist/chunk-ECCVVXNX.js +100 -0
- package/dist/chunk-EDLA3ZZN.js +26 -0
- package/dist/{chunk-GJHRTQAS.cjs → chunk-EVDNG72R.cjs} +35 -37
- package/dist/{chunk-TDBBRZTC.cjs → chunk-FQQYNAPT.cjs} +111 -189
- package/dist/{chunk-QKJ7KLDL.cjs → chunk-G66JI4BS.cjs} +5 -7
- package/dist/{chunk-SKJRUPDP.js → chunk-NJJBR57W.js} +24 -102
- package/dist/{chunk-STCE44IS.js → chunk-OCDIIBBZ.js} +2 -2
- package/dist/{chunk-M3AOQRGN.cjs → chunk-PTHYT3U2.cjs} +188 -582
- package/dist/chunk-QVMJLFU5.cjs +26 -0
- package/dist/{chunk-DPRINYB6.js → chunk-QWTKBUQW.js} +40 -434
- package/dist/chunk-R2KKGNQL.js +119 -0
- package/dist/{chunk-TH2QFJHI.cjs → chunk-RK34D7S5.cjs} +6 -6
- package/dist/chunk-SLSBBNRF.cjs +52 -0
- package/dist/{chunk-VQHKIS7J.js → chunk-TSQT5MWW.js} +2 -4
- package/dist/{chunk-BNPCRQK4.cjs → chunk-VTBMJYSM.cjs} +6 -6
- package/dist/chunk-WLJT52I3.cjs +100 -0
- package/dist/chunk-WXURMFT7.js +52 -0
- package/dist/{chunk-VPTKC3UK.cjs → chunk-YHMM6RY5.cjs} +42 -9
- package/dist/clean.cjs +4 -5
- package/dist/clean.d.cts +1 -2
- package/dist/clean.d.ts +1 -2
- package/dist/clean.js +3 -4
- package/dist/config.cjs +5 -14
- package/dist/config.d.cts +4 -6
- package/dist/config.d.ts +4 -6
- package/dist/config.js +6 -15
- package/dist/context.cjs +11 -0
- package/dist/context.d.cts +16 -0
- package/dist/context.d.ts +16 -0
- package/dist/context.js +11 -0
- package/dist/index.cjs +14 -52
- package/dist/index.d.cts +3 -216
- package/dist/index.d.ts +3 -216
- package/dist/index.js +15 -53
- package/dist/package-json.cjs +9 -0
- package/dist/package-json.d.cts +16 -0
- package/dist/package-json.d.ts +16 -0
- package/dist/package-json.js +9 -0
- package/dist/plugins/deps-check.cjs +4 -5
- package/dist/plugins/deps-check.js +3 -4
- package/dist/plugins/resolve-paths.cjs +3 -4
- package/dist/plugins/resolve-paths.d.cts +3 -4
- package/dist/plugins/resolve-paths.d.ts +3 -4
- package/dist/plugins/resolve-paths.js +2 -3
- package/dist/tsup.cjs +8 -0
- package/dist/tsup.d.cts +16 -0
- package/dist/tsup.d.ts +16 -0
- package/dist/tsup.js +8 -0
- package/dist/types.d.cts +1 -2
- package/dist/types.d.ts +1 -2
- package/dist/watch.cjs +111 -0
- package/dist/watch.d.cts +18 -0
- package/dist/watch.d.ts +18 -0
- package/dist/watch.js +111 -0
- package/package.json +59 -38
- package/dist/chunk-27VOV3G4.cjs +0 -23
- package/dist/chunk-2TG2H4XL.js +0 -29
- package/dist/chunk-2X5ZMEAN.js +0 -167
- package/dist/chunk-3QHFCKSI.js +0 -140
- package/dist/chunk-AZON722Q.js +0 -23
- package/dist/chunk-B4CUDMY2.cjs +0 -39
- package/dist/chunk-BOFHC4OE.cjs +0 -26
- package/dist/chunk-BWSIRV3D.js +0 -26
- package/dist/chunk-CCEWV2BR.js +0 -39
- package/dist/chunk-CGMLIVTB.cjs +0 -167
- package/dist/chunk-ILJQ4NCE.cjs +0 -29
- package/dist/chunk-N62ZR7UV.cjs +0 -140
- package/dist/chunk-RLQJRD62.cjs +0 -27
- package/dist/chunk-UYE6LM4C.js +0 -60
- package/dist/chunk-XLUZXKDY.js +0 -27
- package/dist/chunk-Y5SBBYX3.cjs +0 -60
- package/dist/plugins/esm-split-code-to-cjs.cjs +0 -7
- package/dist/plugins/esm-split-code-to-cjs.d.cts +0 -15
- package/dist/plugins/esm-split-code-to-cjs.d.ts +0 -15
- package/dist/plugins/esm-split-code-to-cjs.js +0 -7
- package/dist/plugins/fix-imports.cjs +0 -7
- package/dist/plugins/fix-imports.d.cts +0 -14
- package/dist/plugins/fix-imports.d.ts +0 -14
- package/dist/plugins/fix-imports.js +0 -7
- package/dist/plugins/native-node-module.cjs +0 -7
- package/dist/plugins/native-node-module.d.cts +0 -11
- package/dist/plugins/native-node-module.d.ts +0 -11
- package/dist/plugins/native-node-module.js +0 -7
- package/dist/plugins/node-protocol.cjs +0 -7
- package/dist/plugins/node-protocol.d.cts +0 -15
- package/dist/plugins/node-protocol.d.ts +0 -15
- package/dist/plugins/node-protocol.js +0 -7
- package/dist/plugins/on-error.cjs +0 -9
- package/dist/plugins/on-error.d.cts +0 -14
- package/dist/plugins/on-error.d.ts +0 -14
- package/dist/plugins/on-error.js +0 -9
- package/dist/plugins/tsc.cjs +0 -9
- package/dist/plugins/tsc.d.cts +0 -14
- package/dist/plugins/tsc.d.ts +0 -14
- package/dist/plugins/tsc.js +0 -9
- package/dist/tsc.cjs +0 -17
- package/dist/tsc.d.cts +0 -21
- package/dist/tsc.d.ts +0 -21
- package/dist/tsc.js +0 -17
- package/dist/types-B4jbZA4j.d.cts +0 -1286
- package/dist/types-B4jbZA4j.d.ts +0 -1286
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-B4CUDMY2.cjs');
|
|
3
|
+
var _chunkVTBMJYSMcjs = require('../chunk-VTBMJYSM.cjs');
|
|
4
|
+
require('../chunk-EVDNG72R.cjs');
|
|
5
|
+
require('../chunk-YHMM6RY5.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
exports.depsCheckPlugin =
|
|
8
|
+
exports.depsCheckPlugin = _chunkVTBMJYSMcjs.depsCheckPlugin;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
depsCheckPlugin
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-CCEWV2BR.js";
|
|
3
|
+
} from "../chunk-OCDIIBBZ.js";
|
|
4
|
+
import "../chunk-TSQT5MWW.js";
|
|
5
|
+
import "../chunk-4D6ICA75.js";
|
|
7
6
|
export {
|
|
8
7
|
depsCheckPlugin
|
|
9
8
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-B4CUDMY2.cjs');
|
|
3
|
+
var _chunkG66JI4BScjs = require('../chunk-G66JI4BS.cjs');
|
|
4
|
+
require('../chunk-YHMM6RY5.cjs');
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
exports.resolvePathsPlugin =
|
|
7
|
+
exports.resolvePathsPlugin = _chunkG66JI4BScjs.resolvePathsPlugin;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Plugin } from 'esbuild';
|
|
2
2
|
import { ESBuildContext } from '../types.cjs';
|
|
3
3
|
import '@nx/devkit';
|
|
4
4
|
import '@storm-software/build-tools';
|
|
5
|
-
import '
|
|
6
|
-
import 'zod';
|
|
5
|
+
import '@storm-software/config';
|
|
7
6
|
import 'tsup';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -12,6 +11,6 @@ import 'tsup';
|
|
|
12
11
|
* tree-shaking. Note: `esbuild` has some support for this, though it is limited
|
|
13
12
|
* in the amount of dependency nesting it supports.
|
|
14
13
|
*/
|
|
15
|
-
declare const resolvePathsPlugin: (context: ESBuildContext) =>
|
|
14
|
+
declare const resolvePathsPlugin: (context: ESBuildContext) => Plugin;
|
|
16
15
|
|
|
17
16
|
export { resolvePathsPlugin };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Plugin } from 'esbuild';
|
|
2
2
|
import { ESBuildContext } from '../types.js';
|
|
3
3
|
import '@nx/devkit';
|
|
4
4
|
import '@storm-software/build-tools';
|
|
5
|
-
import '
|
|
6
|
-
import 'zod';
|
|
5
|
+
import '@storm-software/config';
|
|
7
6
|
import 'tsup';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -12,6 +11,6 @@ import 'tsup';
|
|
|
12
11
|
* tree-shaking. Note: `esbuild` has some support for this, though it is limited
|
|
13
12
|
* in the amount of dependency nesting it supports.
|
|
14
13
|
*/
|
|
15
|
-
declare const resolvePathsPlugin: (context: ESBuildContext) =>
|
|
14
|
+
declare const resolvePathsPlugin: (context: ESBuildContext) => Plugin;
|
|
16
15
|
|
|
17
16
|
export { resolvePathsPlugin };
|
package/dist/tsup.cjs
ADDED
package/dist/tsup.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ESBuildContext } from './types.cjs';
|
|
2
|
+
import '@nx/devkit';
|
|
3
|
+
import '@storm-software/build-tools';
|
|
4
|
+
import '@storm-software/config';
|
|
5
|
+
import 'esbuild';
|
|
6
|
+
import 'tsup';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Execute tsup with all the configurations we pass
|
|
10
|
+
*
|
|
11
|
+
* @param context - The build context
|
|
12
|
+
* @returns The build context
|
|
13
|
+
*/
|
|
14
|
+
declare function executeTsup(context: ESBuildContext): Promise<ESBuildContext>;
|
|
15
|
+
|
|
16
|
+
export { executeTsup };
|
package/dist/tsup.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ESBuildContext } from './types.js';
|
|
2
|
+
import '@nx/devkit';
|
|
3
|
+
import '@storm-software/build-tools';
|
|
4
|
+
import '@storm-software/config';
|
|
5
|
+
import 'esbuild';
|
|
6
|
+
import 'tsup';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Execute tsup with all the configurations we pass
|
|
10
|
+
*
|
|
11
|
+
* @param context - The build context
|
|
12
|
+
* @returns The build context
|
|
13
|
+
*/
|
|
14
|
+
declare function executeTsup(context: ESBuildContext): Promise<ESBuildContext>;
|
|
15
|
+
|
|
16
|
+
export { executeTsup };
|
package/dist/tsup.js
ADDED
package/dist/types.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ProjectsConfigurations, ProjectGraph } from '@nx/devkit';
|
|
2
2
|
import { TypeScriptBuildOptions, AdditionalCLIOptions } from '@storm-software/build-tools';
|
|
3
|
-
import {
|
|
3
|
+
import { StormWorkspaceConfig } from '@storm-software/config';
|
|
4
4
|
import { TsconfigRaw, BuildResult } from 'esbuild';
|
|
5
5
|
import { Options } from 'tsup';
|
|
6
|
-
import 'zod';
|
|
7
6
|
|
|
8
7
|
type ESBuildOptions = Omit<Options, "outDir" | "entryPoints"> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & Pick<TypeScriptBuildOptions, "assets" | "sourceRoot" | "outputPath" | "generatePackageJson" | "includeSrc" | "mode"> & {
|
|
9
8
|
userOptions?: any;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ProjectsConfigurations, ProjectGraph } from '@nx/devkit';
|
|
2
2
|
import { TypeScriptBuildOptions, AdditionalCLIOptions } from '@storm-software/build-tools';
|
|
3
|
-
import {
|
|
3
|
+
import { StormWorkspaceConfig } from '@storm-software/config';
|
|
4
4
|
import { TsconfigRaw, BuildResult } from 'esbuild';
|
|
5
5
|
import { Options } from 'tsup';
|
|
6
|
-
import 'zod';
|
|
7
6
|
|
|
8
7
|
type ESBuildOptions = Omit<Options, "outDir" | "entryPoints"> & Required<Pick<TypeScriptBuildOptions, "projectRoot">> & Pick<TypeScriptBuildOptions, "assets" | "sourceRoot" | "outputPath" | "generatePackageJson" | "includeSrc" | "mode"> & {
|
|
9
8
|
userOptions?: any;
|
package/dist/watch.cjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkEVDNG72Rcjs = require('./chunk-EVDNG72R.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkYHMM6RY5cjs = require('./chunk-YHMM6RY5.cjs');
|
|
8
|
+
|
|
9
|
+
// src/watch.ts
|
|
10
|
+
var _chokidar = require('chokidar');
|
|
11
|
+
var _estoolkit = require('es-toolkit');
|
|
12
|
+
|
|
13
|
+
// src/utilities/helpers.ts
|
|
14
|
+
function handleSync(fn) {
|
|
15
|
+
try {
|
|
16
|
+
return fn();
|
|
17
|
+
} catch (error_) {
|
|
18
|
+
return error_;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, handleSync, "handleSync");
|
|
22
|
+
async function handleAsync(fn) {
|
|
23
|
+
try {
|
|
24
|
+
return await fn();
|
|
25
|
+
} catch (error_) {
|
|
26
|
+
return error_;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, handleAsync, "handleAsync");
|
|
30
|
+
var handle = handleSync;
|
|
31
|
+
handle.async = handleAsync;
|
|
32
|
+
var skip = Symbol("skip");
|
|
33
|
+
function transduceSync(list, transformer) {
|
|
34
|
+
const transduced = [];
|
|
35
|
+
for (const [i, element_] of list.entries()) {
|
|
36
|
+
const transformed = transformer(element_, i);
|
|
37
|
+
if (transformed !== skip) {
|
|
38
|
+
transduced[transduced.length] = transformed;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return transduced;
|
|
42
|
+
}
|
|
43
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, transduceSync, "transduceSync");
|
|
44
|
+
async function transduceAsync(list, transformer) {
|
|
45
|
+
const transduced = [];
|
|
46
|
+
await Promise.all(list.entries().map(async ([i, element_]) => {
|
|
47
|
+
const transformed = await transformer(element_, i);
|
|
48
|
+
if (transformed !== skip) {
|
|
49
|
+
transduced[transduced.length] = transformed;
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
return transduced;
|
|
53
|
+
}
|
|
54
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, transduceAsync, "transduceAsync");
|
|
55
|
+
var transduce = transduceSync;
|
|
56
|
+
transduce.async = transduceAsync;
|
|
57
|
+
function pipeSync(fn, ...fns) {
|
|
58
|
+
return (...args) => {
|
|
59
|
+
let result = fn(...args);
|
|
60
|
+
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
61
|
+
result = _optionalChain([fns, 'access', _ => _[i], 'optionalCall', _2 => _2(result)]);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, pipeSync, "pipeSync");
|
|
67
|
+
function pipeAsync(fn, ...fns) {
|
|
68
|
+
return async (...args) => {
|
|
69
|
+
let result = await fn(...args);
|
|
70
|
+
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
71
|
+
result = await _optionalChain([fns, 'access', _3 => _3[i], 'optionalCall', _4 => _4(result)]);
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
_chunkYHMM6RY5cjs.__name.call(void 0, pipeAsync, "pipeAsync");
|
|
77
|
+
var pipe = pipeSync;
|
|
78
|
+
pipe.async = pipeAsync;
|
|
79
|
+
|
|
80
|
+
// src/watch.ts
|
|
81
|
+
var watch = /* @__PURE__ */ _chunkYHMM6RY5cjs.__name.call(void 0, (context, options) => {
|
|
82
|
+
if (!options.watch) {
|
|
83
|
+
return context;
|
|
84
|
+
}
|
|
85
|
+
const config = {
|
|
86
|
+
ignoreInitial: true,
|
|
87
|
+
useFsEvents: true,
|
|
88
|
+
ignored: [
|
|
89
|
+
"./src/__tests__/**/*",
|
|
90
|
+
"./package.json"
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
const changeWatcher = _chokidar.watch.call(void 0, [
|
|
94
|
+
"./src/**/*"
|
|
95
|
+
], config);
|
|
96
|
+
const fastRebuild = _estoolkit.debounce.call(void 0, async () => {
|
|
97
|
+
const timeBefore = Date.now();
|
|
98
|
+
const rebuildResult = await handle.async(() => {
|
|
99
|
+
return context.rebuild();
|
|
100
|
+
});
|
|
101
|
+
if (rebuildResult instanceof Error) {
|
|
102
|
+
_chunkEVDNG72Rcjs.writeError.call(void 0, rebuildResult.message);
|
|
103
|
+
}
|
|
104
|
+
_chunkEVDNG72Rcjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
105
|
+
}, 10);
|
|
106
|
+
changeWatcher.on("change", fastRebuild);
|
|
107
|
+
return void 0;
|
|
108
|
+
}, "watch");
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
exports.watch = watch;
|
package/dist/watch.d.cts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
import { BuildContext } from 'esbuild';
|
|
3
|
+
import { ESBuildOptions } from './types.cjs';
|
|
4
|
+
import '@nx/devkit';
|
|
5
|
+
import '@storm-software/build-tools';
|
|
6
|
+
import '@storm-software/config';
|
|
7
|
+
import 'tsup';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Executes the build and rebuilds what is necessary
|
|
11
|
+
*
|
|
12
|
+
* @param context - the build context
|
|
13
|
+
* @param options - the build options
|
|
14
|
+
* @returns the build result
|
|
15
|
+
*/
|
|
16
|
+
declare const watch: (context: BuildContext, options: ESBuildOptions) => BuildContext<esbuild.BuildOptions> | undefined;
|
|
17
|
+
|
|
18
|
+
export { watch };
|
package/dist/watch.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
import { BuildContext } from 'esbuild';
|
|
3
|
+
import { ESBuildOptions } from './types.js';
|
|
4
|
+
import '@nx/devkit';
|
|
5
|
+
import '@storm-software/build-tools';
|
|
6
|
+
import '@storm-software/config';
|
|
7
|
+
import 'tsup';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Executes the build and rebuilds what is necessary
|
|
11
|
+
*
|
|
12
|
+
* @param context - the build context
|
|
13
|
+
* @param options - the build options
|
|
14
|
+
* @returns the build result
|
|
15
|
+
*/
|
|
16
|
+
declare const watch: (context: BuildContext, options: ESBuildOptions) => BuildContext<esbuild.BuildOptions> | undefined;
|
|
17
|
+
|
|
18
|
+
export { watch };
|
package/dist/watch.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
writeError,
|
|
3
|
+
writeTrace
|
|
4
|
+
} from "./chunk-TSQT5MWW.js";
|
|
5
|
+
import {
|
|
6
|
+
__name
|
|
7
|
+
} from "./chunk-4D6ICA75.js";
|
|
8
|
+
|
|
9
|
+
// src/watch.ts
|
|
10
|
+
import { watch as createWatcher } from "chokidar";
|
|
11
|
+
import { debounce } from "es-toolkit";
|
|
12
|
+
|
|
13
|
+
// src/utilities/helpers.ts
|
|
14
|
+
function handleSync(fn) {
|
|
15
|
+
try {
|
|
16
|
+
return fn();
|
|
17
|
+
} catch (error_) {
|
|
18
|
+
return error_;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__name(handleSync, "handleSync");
|
|
22
|
+
async function handleAsync(fn) {
|
|
23
|
+
try {
|
|
24
|
+
return await fn();
|
|
25
|
+
} catch (error_) {
|
|
26
|
+
return error_;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__name(handleAsync, "handleAsync");
|
|
30
|
+
var handle = handleSync;
|
|
31
|
+
handle.async = handleAsync;
|
|
32
|
+
var skip = Symbol("skip");
|
|
33
|
+
function transduceSync(list, transformer) {
|
|
34
|
+
const transduced = [];
|
|
35
|
+
for (const [i, element_] of list.entries()) {
|
|
36
|
+
const transformed = transformer(element_, i);
|
|
37
|
+
if (transformed !== skip) {
|
|
38
|
+
transduced[transduced.length] = transformed;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return transduced;
|
|
42
|
+
}
|
|
43
|
+
__name(transduceSync, "transduceSync");
|
|
44
|
+
async function transduceAsync(list, transformer) {
|
|
45
|
+
const transduced = [];
|
|
46
|
+
await Promise.all(list.entries().map(async ([i, element_]) => {
|
|
47
|
+
const transformed = await transformer(element_, i);
|
|
48
|
+
if (transformed !== skip) {
|
|
49
|
+
transduced[transduced.length] = transformed;
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
return transduced;
|
|
53
|
+
}
|
|
54
|
+
__name(transduceAsync, "transduceAsync");
|
|
55
|
+
var transduce = transduceSync;
|
|
56
|
+
transduce.async = transduceAsync;
|
|
57
|
+
function pipeSync(fn, ...fns) {
|
|
58
|
+
return (...args) => {
|
|
59
|
+
let result = fn(...args);
|
|
60
|
+
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
61
|
+
result = fns[i]?.(result);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
__name(pipeSync, "pipeSync");
|
|
67
|
+
function pipeAsync(fn, ...fns) {
|
|
68
|
+
return async (...args) => {
|
|
69
|
+
let result = await fn(...args);
|
|
70
|
+
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
71
|
+
result = await fns[i]?.(result);
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
__name(pipeAsync, "pipeAsync");
|
|
77
|
+
var pipe = pipeSync;
|
|
78
|
+
pipe.async = pipeAsync;
|
|
79
|
+
|
|
80
|
+
// src/watch.ts
|
|
81
|
+
var watch = /* @__PURE__ */ __name((context, options) => {
|
|
82
|
+
if (!options.watch) {
|
|
83
|
+
return context;
|
|
84
|
+
}
|
|
85
|
+
const config = {
|
|
86
|
+
ignoreInitial: true,
|
|
87
|
+
useFsEvents: true,
|
|
88
|
+
ignored: [
|
|
89
|
+
"./src/__tests__/**/*",
|
|
90
|
+
"./package.json"
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
const changeWatcher = createWatcher([
|
|
94
|
+
"./src/**/*"
|
|
95
|
+
], config);
|
|
96
|
+
const fastRebuild = debounce(async () => {
|
|
97
|
+
const timeBefore = Date.now();
|
|
98
|
+
const rebuildResult = await handle.async(() => {
|
|
99
|
+
return context.rebuild();
|
|
100
|
+
});
|
|
101
|
+
if (rebuildResult instanceof Error) {
|
|
102
|
+
writeError(rebuildResult.message);
|
|
103
|
+
}
|
|
104
|
+
writeTrace(`${Date.now() - timeBefore}ms [${options.name ?? ""}]`);
|
|
105
|
+
}, 10);
|
|
106
|
+
changeWatcher.on("change", fastRebuild);
|
|
107
|
+
return void 0;
|
|
108
|
+
}, "watch");
|
|
109
|
+
export {
|
|
110
|
+
watch
|
|
111
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/esbuild",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing `esbuild` utilities for building Storm Software libraries and applications",
|
|
6
6
|
"repository": {
|
|
@@ -96,19 +96,68 @@
|
|
|
96
96
|
"default": { "types": "./dist/clean.d.ts", "default": "./dist/clean.js" }
|
|
97
97
|
},
|
|
98
98
|
"./build": {
|
|
99
|
+
"import": { "types": "./dist/build.d.ts", "default": "./dist/build.js" },
|
|
100
|
+
"require": {
|
|
101
|
+
"types": "./dist/build.d.cts",
|
|
102
|
+
"default": "./dist/build.cjs"
|
|
103
|
+
},
|
|
104
|
+
"default": { "types": "./dist/build.d.ts", "default": "./dist/build.js" }
|
|
105
|
+
},
|
|
106
|
+
"./assets": {
|
|
107
|
+
"import": {
|
|
108
|
+
"types": "./dist/assets.d.ts",
|
|
109
|
+
"default": "./dist/assets.js"
|
|
110
|
+
},
|
|
111
|
+
"require": {
|
|
112
|
+
"types": "./dist/assets.d.cts",
|
|
113
|
+
"default": "./dist/assets.cjs"
|
|
114
|
+
},
|
|
115
|
+
"default": {
|
|
116
|
+
"types": "./dist/assets.d.ts",
|
|
117
|
+
"default": "./dist/assets.js"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"./context": {
|
|
121
|
+
"import": {
|
|
122
|
+
"types": "./dist/context.d.ts",
|
|
123
|
+
"default": "./dist/context.js"
|
|
124
|
+
},
|
|
125
|
+
"require": {
|
|
126
|
+
"types": "./dist/context.d.cts",
|
|
127
|
+
"default": "./dist/context.cjs"
|
|
128
|
+
},
|
|
129
|
+
"default": {
|
|
130
|
+
"types": "./dist/context.d.ts",
|
|
131
|
+
"default": "./dist/context.js"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"./package-json": {
|
|
99
135
|
"import": {
|
|
100
|
-
"types": "./dist/
|
|
101
|
-
"default": "./dist/
|
|
136
|
+
"types": "./dist/package-json.d.ts",
|
|
137
|
+
"default": "./dist/package-json.js"
|
|
102
138
|
},
|
|
103
139
|
"require": {
|
|
104
|
-
"types": "./dist/
|
|
105
|
-
"default": "./dist/
|
|
140
|
+
"types": "./dist/package-json.d.cts",
|
|
141
|
+
"default": "./dist/package-json.cjs"
|
|
106
142
|
},
|
|
107
143
|
"default": {
|
|
108
|
-
"types": "./dist/
|
|
109
|
-
"default": "./dist/
|
|
144
|
+
"types": "./dist/package-json.d.ts",
|
|
145
|
+
"default": "./dist/package-json.js"
|
|
110
146
|
}
|
|
111
147
|
},
|
|
148
|
+
"./tsup": {
|
|
149
|
+
"import": { "types": "./dist/tsup.d.ts", "default": "./dist/tsup.js" },
|
|
150
|
+
"require": { "types": "./dist/tsup.d.cts", "default": "./dist/tsup.cjs" },
|
|
151
|
+
"default": { "types": "./dist/tsup.d.ts", "default": "./dist/tsup.js" }
|
|
152
|
+
},
|
|
153
|
+
"./watch": {
|
|
154
|
+
"import": { "types": "./dist/watch.d.ts", "default": "./dist/watch.js" },
|
|
155
|
+
"require": {
|
|
156
|
+
"types": "./dist/watch.d.cts",
|
|
157
|
+
"default": "./dist/watch.cjs"
|
|
158
|
+
},
|
|
159
|
+
"default": { "types": "./dist/watch.d.ts", "default": "./dist/watch.js" }
|
|
160
|
+
},
|
|
112
161
|
"./plugins/*": {
|
|
113
162
|
"import": {
|
|
114
163
|
"types": "./dist/plugins/*.d.ts",
|
|
@@ -134,52 +183,24 @@
|
|
|
134
183
|
"storm-stack",
|
|
135
184
|
"sullivanpj"
|
|
136
185
|
],
|
|
137
|
-
"
|
|
138
|
-
"@microsoft/api-extractor": "^7.48.1",
|
|
186
|
+
"dependencies": {
|
|
139
187
|
"@nx/devkit": "20.8.0",
|
|
140
188
|
"@nx/js": "20.8.0",
|
|
141
189
|
"@storm-software/build-tools": "workspace:*",
|
|
190
|
+
"@storm-software/config": "workspace:*",
|
|
142
191
|
"@storm-software/config-tools": "workspace:*",
|
|
143
|
-
"esbuild": "^0.25.0",
|
|
144
|
-
"spdx-exceptions": "^2.5.0",
|
|
145
|
-
"spdx-license-ids": "^3.0.20"
|
|
146
|
-
},
|
|
147
|
-
"peerDependenciesMeta": {
|
|
148
|
-
"@microsoft/api-extractor": { "optional": true },
|
|
149
|
-
"@nx/devkit": { "optional": false },
|
|
150
|
-
"@nx/js": { "optional": false },
|
|
151
|
-
"@storm-software/build-tools": { "optional": false },
|
|
152
|
-
"@storm-software/config-tools": { "optional": false },
|
|
153
|
-
"esbuild": { "optional": false },
|
|
154
|
-
"spdx-exceptions": { "optional": true },
|
|
155
|
-
"spdx-license-ids": { "optional": true }
|
|
156
|
-
},
|
|
157
|
-
"dependencies": {
|
|
158
192
|
"chokidar": "^4.0.3",
|
|
159
193
|
"commander": "^12.1.0",
|
|
160
194
|
"defu": "6.1.4",
|
|
161
195
|
"es-toolkit": "^1.36.0",
|
|
162
196
|
"esbuild": "^0.25.0",
|
|
163
197
|
"globby": "^14.1.0",
|
|
164
|
-
"nx": "20.8.0",
|
|
165
198
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
166
199
|
"prettier-plugin-pkg": "^0.18.1",
|
|
167
200
|
"prettier-plugin-sh": "^0.15.0",
|
|
168
|
-
"source-map": "0.7.4",
|
|
169
201
|
"tsup": "8.4.0"
|
|
170
202
|
},
|
|
171
|
-
"devDependencies": {
|
|
172
|
-
"@microsoft/api-extractor": "^7.48.1",
|
|
173
|
-
"@nx/devkit": "20.8.0",
|
|
174
|
-
"@nx/js": "20.8.0",
|
|
175
|
-
"@storm-software/build-tools": "workspace:*",
|
|
176
|
-
"@storm-software/config": "workspace:*",
|
|
177
|
-
"@storm-software/config-tools": "workspace:*",
|
|
178
|
-
"@types/node": "^22.10.2",
|
|
179
|
-
"rollup": "^4.29.1",
|
|
180
|
-
"spdx-exceptions": "^2.5.0",
|
|
181
|
-
"spdx-license-ids": "^3.0.21"
|
|
182
|
-
},
|
|
203
|
+
"devDependencies": { "@types/node": "^22.10.2", "nx": "20.8.0" },
|
|
183
204
|
"publishConfig": { "access": "public" },
|
|
184
205
|
"sideEffects": false
|
|
185
206
|
}
|
package/dist/chunk-27VOV3G4.cjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkB4CUDMY2cjs = require('./chunk-B4CUDMY2.cjs');
|
|
4
|
-
|
|
5
|
-
// src/plugins/node-protocol.ts
|
|
6
|
-
var nodeProtocolPlugin = /* @__PURE__ */ _chunkB4CUDMY2cjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
7
|
-
const nodeProtocol = "node:";
|
|
8
|
-
return {
|
|
9
|
-
name: "node-protocol-plugin",
|
|
10
|
-
setup({ onResolve }) {
|
|
11
|
-
onResolve({
|
|
12
|
-
filter: /^node:/
|
|
13
|
-
}, ({ path }) => ({
|
|
14
|
-
path: path.slice(nodeProtocol.length),
|
|
15
|
-
external: true
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}, "nodeProtocolPlugin");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.nodeProtocolPlugin = nodeProtocolPlugin;
|
package/dist/chunk-2TG2H4XL.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name,
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-CCEWV2BR.js";
|
|
5
|
-
|
|
6
|
-
// src/plugins/fix-imports.ts
|
|
7
|
-
var fixImportsPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
8
|
-
name: "storm:fix-imports",
|
|
9
|
-
setup(build) {
|
|
10
|
-
build.onResolve({
|
|
11
|
-
filter: /^spdx-exceptions/
|
|
12
|
-
}, () => {
|
|
13
|
-
return {
|
|
14
|
-
path: __require.resolve("spdx-exceptions")
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
build.onResolve({
|
|
18
|
-
filter: /^spdx-license-ids/
|
|
19
|
-
}, () => {
|
|
20
|
-
return {
|
|
21
|
-
path: __require.resolve("spdx-license-ids")
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}), "fixImportsPlugin");
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
fixImportsPlugin
|
|
29
|
-
};
|