@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.
Files changed (117) hide show
  1. package/README.md +2 -1
  2. package/bin/esbuild.cjs +12143 -158
  3. package/dist/assets.cjs +9 -0
  4. package/dist/assets.d.cts +16 -0
  5. package/dist/assets.d.ts +16 -0
  6. package/dist/assets.js +9 -0
  7. package/dist/build.cjs +13 -17
  8. package/dist/build.d.cts +3 -13
  9. package/dist/build.d.ts +3 -13
  10. package/dist/build.js +14 -18
  11. package/dist/chunk-2CM3VAO5.cjs +119 -0
  12. package/dist/{chunk-Y7JBB452.js → chunk-4D6ICA75.js} +36 -3
  13. package/dist/{chunk-5RVOO3YF.js → chunk-ABRK5MYP.js} +3 -5
  14. package/dist/chunk-CVOQEYHW.cjs +117 -0
  15. package/dist/{chunk-3PF5YMWK.js → chunk-DNZNN5SK.js} +2 -2
  16. package/dist/chunk-EBTMX5WL.js +117 -0
  17. package/dist/chunk-ECCVVXNX.js +100 -0
  18. package/dist/chunk-EDLA3ZZN.js +26 -0
  19. package/dist/{chunk-GJHRTQAS.cjs → chunk-EVDNG72R.cjs} +35 -37
  20. package/dist/{chunk-TDBBRZTC.cjs → chunk-FQQYNAPT.cjs} +111 -189
  21. package/dist/{chunk-QKJ7KLDL.cjs → chunk-G66JI4BS.cjs} +5 -7
  22. package/dist/{chunk-SKJRUPDP.js → chunk-NJJBR57W.js} +24 -102
  23. package/dist/{chunk-STCE44IS.js → chunk-OCDIIBBZ.js} +2 -2
  24. package/dist/{chunk-M3AOQRGN.cjs → chunk-PTHYT3U2.cjs} +188 -582
  25. package/dist/chunk-QVMJLFU5.cjs +26 -0
  26. package/dist/{chunk-DPRINYB6.js → chunk-QWTKBUQW.js} +40 -434
  27. package/dist/chunk-R2KKGNQL.js +119 -0
  28. package/dist/{chunk-TH2QFJHI.cjs → chunk-RK34D7S5.cjs} +6 -6
  29. package/dist/chunk-SLSBBNRF.cjs +52 -0
  30. package/dist/{chunk-VQHKIS7J.js → chunk-TSQT5MWW.js} +2 -4
  31. package/dist/{chunk-BNPCRQK4.cjs → chunk-VTBMJYSM.cjs} +6 -6
  32. package/dist/chunk-WLJT52I3.cjs +100 -0
  33. package/dist/chunk-WXURMFT7.js +52 -0
  34. package/dist/{chunk-VPTKC3UK.cjs → chunk-YHMM6RY5.cjs} +42 -9
  35. package/dist/clean.cjs +4 -5
  36. package/dist/clean.d.cts +1 -2
  37. package/dist/clean.d.ts +1 -2
  38. package/dist/clean.js +3 -4
  39. package/dist/config.cjs +5 -14
  40. package/dist/config.d.cts +4 -6
  41. package/dist/config.d.ts +4 -6
  42. package/dist/config.js +6 -15
  43. package/dist/context.cjs +11 -0
  44. package/dist/context.d.cts +16 -0
  45. package/dist/context.d.ts +16 -0
  46. package/dist/context.js +11 -0
  47. package/dist/index.cjs +14 -52
  48. package/dist/index.d.cts +3 -216
  49. package/dist/index.d.ts +3 -216
  50. package/dist/index.js +15 -53
  51. package/dist/package-json.cjs +9 -0
  52. package/dist/package-json.d.cts +16 -0
  53. package/dist/package-json.d.ts +16 -0
  54. package/dist/package-json.js +9 -0
  55. package/dist/plugins/deps-check.cjs +4 -5
  56. package/dist/plugins/deps-check.js +3 -4
  57. package/dist/plugins/resolve-paths.cjs +3 -4
  58. package/dist/plugins/resolve-paths.d.cts +3 -4
  59. package/dist/plugins/resolve-paths.d.ts +3 -4
  60. package/dist/plugins/resolve-paths.js +2 -3
  61. package/dist/tsup.cjs +8 -0
  62. package/dist/tsup.d.cts +16 -0
  63. package/dist/tsup.d.ts +16 -0
  64. package/dist/tsup.js +8 -0
  65. package/dist/types.d.cts +1 -2
  66. package/dist/types.d.ts +1 -2
  67. package/dist/watch.cjs +111 -0
  68. package/dist/watch.d.cts +18 -0
  69. package/dist/watch.d.ts +18 -0
  70. package/dist/watch.js +111 -0
  71. package/package.json +59 -38
  72. package/dist/chunk-27VOV3G4.cjs +0 -23
  73. package/dist/chunk-2TG2H4XL.js +0 -29
  74. package/dist/chunk-2X5ZMEAN.js +0 -167
  75. package/dist/chunk-3QHFCKSI.js +0 -140
  76. package/dist/chunk-AZON722Q.js +0 -23
  77. package/dist/chunk-B4CUDMY2.cjs +0 -39
  78. package/dist/chunk-BOFHC4OE.cjs +0 -26
  79. package/dist/chunk-BWSIRV3D.js +0 -26
  80. package/dist/chunk-CCEWV2BR.js +0 -39
  81. package/dist/chunk-CGMLIVTB.cjs +0 -167
  82. package/dist/chunk-ILJQ4NCE.cjs +0 -29
  83. package/dist/chunk-N62ZR7UV.cjs +0 -140
  84. package/dist/chunk-RLQJRD62.cjs +0 -27
  85. package/dist/chunk-UYE6LM4C.js +0 -60
  86. package/dist/chunk-XLUZXKDY.js +0 -27
  87. package/dist/chunk-Y5SBBYX3.cjs +0 -60
  88. package/dist/plugins/esm-split-code-to-cjs.cjs +0 -7
  89. package/dist/plugins/esm-split-code-to-cjs.d.cts +0 -15
  90. package/dist/plugins/esm-split-code-to-cjs.d.ts +0 -15
  91. package/dist/plugins/esm-split-code-to-cjs.js +0 -7
  92. package/dist/plugins/fix-imports.cjs +0 -7
  93. package/dist/plugins/fix-imports.d.cts +0 -14
  94. package/dist/plugins/fix-imports.d.ts +0 -14
  95. package/dist/plugins/fix-imports.js +0 -7
  96. package/dist/plugins/native-node-module.cjs +0 -7
  97. package/dist/plugins/native-node-module.d.cts +0 -11
  98. package/dist/plugins/native-node-module.d.ts +0 -11
  99. package/dist/plugins/native-node-module.js +0 -7
  100. package/dist/plugins/node-protocol.cjs +0 -7
  101. package/dist/plugins/node-protocol.d.cts +0 -15
  102. package/dist/plugins/node-protocol.d.ts +0 -15
  103. package/dist/plugins/node-protocol.js +0 -7
  104. package/dist/plugins/on-error.cjs +0 -9
  105. package/dist/plugins/on-error.d.cts +0 -14
  106. package/dist/plugins/on-error.d.ts +0 -14
  107. package/dist/plugins/on-error.js +0 -9
  108. package/dist/plugins/tsc.cjs +0 -9
  109. package/dist/plugins/tsc.d.cts +0 -14
  110. package/dist/plugins/tsc.d.ts +0 -14
  111. package/dist/plugins/tsc.js +0 -9
  112. package/dist/tsc.cjs +0 -17
  113. package/dist/tsc.d.cts +0 -21
  114. package/dist/tsc.d.ts +0 -21
  115. package/dist/tsc.js +0 -17
  116. package/dist/types-B4jbZA4j.d.cts +0 -1286
  117. package/dist/types-B4jbZA4j.d.ts +0 -1286
@@ -0,0 +1,16 @@
1
+ import { ESBuildOptions, 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
+ * Apply defaults to the original build options
10
+ *
11
+ * @param userOptions - the original build options provided by the user
12
+ * @returns the build options with defaults applied
13
+ */
14
+ declare function resolveContext(userOptions: ESBuildOptions): Promise<ESBuildContext>;
15
+
16
+ export { resolveContext };
@@ -0,0 +1,11 @@
1
+ import {
2
+ resolveContext
3
+ } from "./chunk-ECCVVXNX.js";
4
+ import "./chunk-ABRK5MYP.js";
5
+ import "./chunk-WXURMFT7.js";
6
+ import "./chunk-NJJBR57W.js";
7
+ import "./chunk-TSQT5MWW.js";
8
+ import "./chunk-4D6ICA75.js";
9
+ export {
10
+ resolveContext
11
+ };
package/dist/index.cjs CHANGED
@@ -1,56 +1,18 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-SFZRYJZ2.cjs');
2
2
 
3
3
 
4
+ var _chunkCVOQEYHWcjs = require('./chunk-CVOQEYHW.cjs');
5
+ require('./chunk-VTBMJYSM.cjs');
6
+ require('./chunk-QVMJLFU5.cjs');
7
+ require('./chunk-RK34D7S5.cjs');
8
+ require('./chunk-WLJT52I3.cjs');
9
+ require('./chunk-G66JI4BS.cjs');
10
+ require('./chunk-SLSBBNRF.cjs');
11
+ require('./chunk-2CM3VAO5.cjs');
12
+ require('./chunk-FQQYNAPT.cjs');
13
+ require('./chunk-PTHYT3U2.cjs');
14
+ require('./chunk-EVDNG72R.cjs');
15
+ require('./chunk-YHMM6RY5.cjs');
4
16
 
5
17
 
6
-
7
-
8
-
9
-
10
- var _chunkM3AOQRGNcjs = require('./chunk-M3AOQRGN.cjs');
11
-
12
-
13
-
14
- var _chunkTH2QFJHIcjs = require('./chunk-TH2QFJHI.cjs');
15
-
16
-
17
-
18
- var _chunkTDBBRZTCcjs = require('./chunk-TDBBRZTC.cjs');
19
- require('./chunk-ILJQ4NCE.cjs');
20
- require('./chunk-Y5SBBYX3.cjs');
21
- require('./chunk-27VOV3G4.cjs');
22
- require('./chunk-BOFHC4OE.cjs');
23
- require('./chunk-QKJ7KLDL.cjs');
24
- require('./chunk-N62ZR7UV.cjs');
25
-
26
-
27
-
28
-
29
-
30
-
31
- var _chunkCGMLIVTBcjs = require('./chunk-CGMLIVTB.cjs');
32
- require('./chunk-SFZRYJZ2.cjs');
33
- require('./chunk-BNPCRQK4.cjs');
34
- require('./chunk-GJHRTQAS.cjs');
35
- require('./chunk-VPTKC3UK.cjs');
36
- require('./chunk-RLQJRD62.cjs');
37
- require('./chunk-B4CUDMY2.cjs');
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
- exports.DEFAULT_BUILD_OPTIONS = _chunkTDBBRZTCcjs.DEFAULT_BUILD_OPTIONS; exports.Filter = _chunkM3AOQRGNcjs.Filter; exports.Mapper = _chunkM3AOQRGNcjs.Mapper; exports.build = _chunkM3AOQRGNcjs.build; exports.clean = _chunkTH2QFJHIcjs.clean; exports.cleanDirectories = _chunkTH2QFJHIcjs.cleanDirectories; exports.emitDts = _chunkCGMLIVTBcjs.emitDts; exports.emitDtsFiles = _chunkCGMLIVTBcjs.emitDtsFiles; exports.ensureTempDeclarationDir = _chunkCGMLIVTBcjs.ensureTempDeclarationDir; exports.getDefaultBuildPlugins = _chunkTDBBRZTCcjs.getDefaultBuildPlugins; exports.handle = _chunkM3AOQRGNcjs.handle; exports.pipe = _chunkM3AOQRGNcjs.pipe; exports.skip = _chunkM3AOQRGNcjs.skip; exports.slash = _chunkCGMLIVTBcjs.slash; exports.toAbsolutePath = _chunkCGMLIVTBcjs.toAbsolutePath; exports.transduce = _chunkM3AOQRGNcjs.transduce; exports.watch = _chunkM3AOQRGNcjs.watch;
18
+ exports.build = _chunkCVOQEYHWcjs.build;
package/dist/index.d.cts CHANGED
@@ -1,220 +1,7 @@
1
- export { build, watch } from './build.cjs';
2
- export { clean, cleanDirectories } from './clean.cjs';
3
- export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins } from './config.cjs';
4
- export { emitDts, emitDtsFiles, ensureTempDeclarationDir, slash, toAbsolutePath } from './tsc.cjs';
1
+ export { build } from './build.cjs';
5
2
  export { ESBuildCLIOptions, ESBuildContext, ESBuildOptions, ESBuildResult, ExportDeclaration, MaybePromise } from './types.cjs';
6
- import 'esbuild';
7
- import './types-B4jbZA4j.cjs';
8
- import 'zod';
9
- import 'typescript';
10
3
  import '@nx/devkit';
11
4
  import '@storm-software/build-tools';
5
+ import '@storm-software/config';
6
+ import 'esbuild';
12
7
  import 'tsup';
13
-
14
- declare function handleSync<R, E = Error>(fn: () => R): R | E;
15
- declare function handleAsync<R, E = Error>(fn: () => Promise<R> | R): Promise<R | E>;
16
- /**
17
- * Executes a function, catches exceptions, and returns any outcome.
18
- * @param fn - to be executed
19
- */
20
- declare const handle: typeof handleSync & {
21
- async: typeof handleAsync;
22
- };
23
-
24
- declare const skip: unique symbol;
25
- type SyncTransformer<I, R> = (item: I, key: number) => R | typeof skip;
26
- type ASyncTransformer<I, R> = (item: I, key: number) => Promise<R | typeof skip>;
27
- declare function transduceSync<I, R>(list: Array<I>, transformer: SyncTransformer<I, R>): R[];
28
- declare function transduceAsync<I, R>(list: Array<I>, transformer: ASyncTransformer<I, R>): Promise<R[]>;
29
- declare const Filter: <I>(filter: (item: I) => boolean) => (item: I) => I;
30
- declare const Mapper: <I, R>(mapper: (item: I) => R) => (item: I) => R;
31
- /**
32
- * Transducers enable efficient data processing. They allow the composition of
33
- * mappers and filters to be applied on a list. And this is applied in a single
34
- * pass, that's the efficient pipeline processing.
35
- *
36
- * (does not reduce at the same time)
37
- *
38
- * @see https://medium.com/javascript-scene/7985330fe73d
39
- *
40
- * @param list - to transform
41
- * @param transformer - to apply
42
-
43
- * @example
44
- * ```ts
45
- * const filterEven = Filter(<U>(unit: U) =>
46
- * typeof unit === 'number' ? !(unit % 2) : true,
47
- * )
48
- * const mapTimes2 = Mapper(<U>(unit: U) =>
49
- * typeof unit === 'number' ? unit * 2 : unit,
50
- * )
51
- * const mapString = Mapper(<U>(unit: U) => `${unit}`)
52
- *
53
- * const test0 = transduce(
54
- * [1, 2, 3, 4, 5, 6, 7, 'a'],
55
- * pipe(filterEven, mapTimes2, mapTimes2, mapString, filterEven),
56
- * )
57
- * ```
58
- */
59
- declare const transduce: typeof transduceSync & {
60
- async: typeof transduceAsync;
61
- };
62
-
63
- type FunctionLike<P extends Array<any> = any, R = any> = (...args: P) => R;
64
- type Await<P> = P extends Promise<infer A> ? A : P;
65
- /**
66
- * Pipe the input and output of functions.
67
- *
68
- * @param fn - parameter-taking function
69
- * @param fns - subsequent piped functions
70
- * @returns
71
- */
72
- declare const pipe: PipeMultiSync & {
73
- async: PipeMultiAsync;
74
- };
75
- declare type PipeMultiSync = {
76
- <R0, P extends any[]>(...fns: [FunctionLike<P, R0>]): FunctionLike<P, R0>;
77
- <R0, R1, P extends any[]>(...fns: [FunctionLike<P, R0>, FunctionLike<[R0], R1>]): FunctionLike<P, R1>;
78
- <R0, R1, R2, P extends any[]>(...fns: [
79
- FunctionLike<P, R0>,
80
- FunctionLike<[R0], R1>,
81
- FunctionLike<[R1], R2>
82
- ]): FunctionLike<P, R2>;
83
- <R0, R1, R2, R3, P extends any[]>(...fns: [
84
- FunctionLike<P, R0>,
85
- FunctionLike<[R0], R1>,
86
- FunctionLike<[R1], R2>,
87
- FunctionLike<[R2], R3>
88
- ]): FunctionLike<P, R3>;
89
- <R0, R1, R2, R3, R4, P extends any[]>(...fns: [
90
- FunctionLike<P, R0>,
91
- FunctionLike<[R0], R1>,
92
- FunctionLike<[R1], R2>,
93
- FunctionLike<[R2], R3>,
94
- FunctionLike<[R3], R4>
95
- ]): FunctionLike<P, R4>;
96
- <R0, R1, R2, R3, R4, R5, P extends any[]>(...fns: [
97
- FunctionLike<P, R0>,
98
- FunctionLike<[R0], R1>,
99
- FunctionLike<[R1], R2>,
100
- FunctionLike<[R2], R3>,
101
- FunctionLike<[R3], R4>,
102
- FunctionLike<[R4], R5>
103
- ]): FunctionLike<P, R5>;
104
- <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(...fns: [
105
- FunctionLike<P, R0>,
106
- FunctionLike<[R0], R1>,
107
- FunctionLike<[R1], R2>,
108
- FunctionLike<[R2], R3>,
109
- FunctionLike<[R3], R4>,
110
- FunctionLike<[R4], R5>,
111
- FunctionLike<[R5], R6>
112
- ]): FunctionLike<P, R6>;
113
- <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(...fns: [
114
- FunctionLike<P, R0>,
115
- FunctionLike<[R0], R1>,
116
- FunctionLike<[R1], R2>,
117
- FunctionLike<[R2], R3>,
118
- FunctionLike<[R3], R4>,
119
- FunctionLike<[R4], R5>,
120
- FunctionLike<[R5], R6>,
121
- FunctionLike<[R6], R7>
122
- ]): FunctionLike<P, R7>;
123
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(...fns: [
124
- FunctionLike<P, R0>,
125
- FunctionLike<[R0], R1>,
126
- FunctionLike<[R1], R2>,
127
- FunctionLike<[R2], R3>,
128
- FunctionLike<[R3], R4>,
129
- FunctionLike<[R4], R5>,
130
- FunctionLike<[R5], R6>,
131
- FunctionLike<[R6], R7>,
132
- FunctionLike<[R7], R8>
133
- ]): FunctionLike<P, R8>;
134
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(...fns: [
135
- FunctionLike<P, R0>,
136
- FunctionLike<[R0], R1>,
137
- FunctionLike<[R1], R2>,
138
- FunctionLike<[R2], R3>,
139
- FunctionLike<[R3], R4>,
140
- FunctionLike<[R4], R5>,
141
- FunctionLike<[R5], R6>,
142
- FunctionLike<[R6], R7>,
143
- FunctionLike<[R7], R8>,
144
- FunctionLike<[R8], R9>
145
- ]): FunctionLike<P, R9>;
146
- };
147
- declare type PipeMultiAsync = {
148
- <R0, P extends any[]>(...fns: [FunctionLike<P, R0>]): FunctionLike<P, Promise<Await<R0>>>;
149
- <R0, R1, P extends any[]>(...fns: [FunctionLike<P, R0>, FunctionLike<[Await<R0>], R1>]): FunctionLike<P, Promise<Await<R1>>>;
150
- <R0, R1, R2, P extends any[]>(...fns: [
151
- FunctionLike<P, R0>,
152
- FunctionLike<[Await<R0>], R1>,
153
- FunctionLike<[Await<R1>], R2>
154
- ]): FunctionLike<P, Promise<Await<R2>>>;
155
- <R0, R1, R2, R3, P extends any[]>(...fns: [
156
- FunctionLike<P, R0>,
157
- FunctionLike<[Await<R0>], R1>,
158
- FunctionLike<[Await<R1>], R2>,
159
- FunctionLike<[Await<R2>], R3>
160
- ]): FunctionLike<P, Promise<Await<R3>>>;
161
- <R0, R1, R2, R3, R4, P extends any[]>(...fns: [
162
- FunctionLike<P, R0>,
163
- FunctionLike<[Await<R0>], R1>,
164
- FunctionLike<[Await<R1>], R2>,
165
- FunctionLike<[Await<R2>], R3>,
166
- FunctionLike<[Await<R3>], R4>
167
- ]): FunctionLike<P, Promise<Await<R4>>>;
168
- <R0, R1, R2, R3, R4, R5, P extends any[]>(...fns: [
169
- FunctionLike<P, R0>,
170
- FunctionLike<[Await<R0>], R1>,
171
- FunctionLike<[Await<R1>], R2>,
172
- FunctionLike<[Await<R2>], R3>,
173
- FunctionLike<[Await<R3>], R4>,
174
- FunctionLike<[Await<R4>], R5>
175
- ]): FunctionLike<P, Promise<Await<R5>>>;
176
- <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(...fns: [
177
- FunctionLike<P, R0>,
178
- FunctionLike<[Await<R0>], R1>,
179
- FunctionLike<[Await<R1>], R2>,
180
- FunctionLike<[Await<R2>], R3>,
181
- FunctionLike<[Await<R3>], R4>,
182
- FunctionLike<[Await<R4>], R5>,
183
- FunctionLike<[Await<R5>], R6>
184
- ]): FunctionLike<P, Promise<Await<R6>>>;
185
- <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(...fns: [
186
- FunctionLike<P, R0>,
187
- FunctionLike<[Await<R0>], R1>,
188
- FunctionLike<[Await<R1>], R2>,
189
- FunctionLike<[Await<R2>], R3>,
190
- FunctionLike<[Await<R3>], R4>,
191
- FunctionLike<[Await<R4>], R5>,
192
- FunctionLike<[Await<R5>], R6>,
193
- FunctionLike<[Await<R6>], R7>
194
- ]): FunctionLike<P, Promise<Await<R7>>>;
195
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(...fns: [
196
- FunctionLike<P, R0>,
197
- FunctionLike<[Await<R0>], R1>,
198
- FunctionLike<[Await<R1>], R2>,
199
- FunctionLike<[Await<R2>], R3>,
200
- FunctionLike<[Await<R3>], R4>,
201
- FunctionLike<[Await<R4>], R5>,
202
- FunctionLike<[Await<R5>], R6>,
203
- FunctionLike<[Await<R6>], R7>,
204
- FunctionLike<[Await<R7>], R8>
205
- ]): FunctionLike<P, Promise<Await<R8>>>;
206
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(...fns: [
207
- FunctionLike<P, R0>,
208
- FunctionLike<[Await<R0>], R1>,
209
- FunctionLike<[Await<R1>], R2>,
210
- FunctionLike<[Await<R2>], R3>,
211
- FunctionLike<[Await<R3>], R4>,
212
- FunctionLike<[Await<R4>], R5>,
213
- FunctionLike<[Await<R5>], R6>,
214
- FunctionLike<[Await<R6>], R7>,
215
- FunctionLike<[Await<R7>], R8>,
216
- FunctionLike<[Await<R8>], R9>
217
- ]): FunctionLike<P, Promise<Await<R9>>>;
218
- };
219
-
220
- export { Filter, Mapper, type PipeMultiAsync, type PipeMultiSync, handle, pipe, skip, transduce };
package/dist/index.d.ts CHANGED
@@ -1,220 +1,7 @@
1
- export { build, watch } from './build.js';
2
- export { clean, cleanDirectories } from './clean.js';
3
- export { DEFAULT_BUILD_OPTIONS, getDefaultBuildPlugins } from './config.js';
4
- export { emitDts, emitDtsFiles, ensureTempDeclarationDir, slash, toAbsolutePath } from './tsc.js';
1
+ export { build } from './build.js';
5
2
  export { ESBuildCLIOptions, ESBuildContext, ESBuildOptions, ESBuildResult, ExportDeclaration, MaybePromise } from './types.js';
6
- import 'esbuild';
7
- import './types-B4jbZA4j.js';
8
- import 'zod';
9
- import 'typescript';
10
3
  import '@nx/devkit';
11
4
  import '@storm-software/build-tools';
5
+ import '@storm-software/config';
6
+ import 'esbuild';
12
7
  import 'tsup';
13
-
14
- declare function handleSync<R, E = Error>(fn: () => R): R | E;
15
- declare function handleAsync<R, E = Error>(fn: () => Promise<R> | R): Promise<R | E>;
16
- /**
17
- * Executes a function, catches exceptions, and returns any outcome.
18
- * @param fn - to be executed
19
- */
20
- declare const handle: typeof handleSync & {
21
- async: typeof handleAsync;
22
- };
23
-
24
- declare const skip: unique symbol;
25
- type SyncTransformer<I, R> = (item: I, key: number) => R | typeof skip;
26
- type ASyncTransformer<I, R> = (item: I, key: number) => Promise<R | typeof skip>;
27
- declare function transduceSync<I, R>(list: Array<I>, transformer: SyncTransformer<I, R>): R[];
28
- declare function transduceAsync<I, R>(list: Array<I>, transformer: ASyncTransformer<I, R>): Promise<R[]>;
29
- declare const Filter: <I>(filter: (item: I) => boolean) => (item: I) => I;
30
- declare const Mapper: <I, R>(mapper: (item: I) => R) => (item: I) => R;
31
- /**
32
- * Transducers enable efficient data processing. They allow the composition of
33
- * mappers and filters to be applied on a list. And this is applied in a single
34
- * pass, that's the efficient pipeline processing.
35
- *
36
- * (does not reduce at the same time)
37
- *
38
- * @see https://medium.com/javascript-scene/7985330fe73d
39
- *
40
- * @param list - to transform
41
- * @param transformer - to apply
42
-
43
- * @example
44
- * ```ts
45
- * const filterEven = Filter(<U>(unit: U) =>
46
- * typeof unit === 'number' ? !(unit % 2) : true,
47
- * )
48
- * const mapTimes2 = Mapper(<U>(unit: U) =>
49
- * typeof unit === 'number' ? unit * 2 : unit,
50
- * )
51
- * const mapString = Mapper(<U>(unit: U) => `${unit}`)
52
- *
53
- * const test0 = transduce(
54
- * [1, 2, 3, 4, 5, 6, 7, 'a'],
55
- * pipe(filterEven, mapTimes2, mapTimes2, mapString, filterEven),
56
- * )
57
- * ```
58
- */
59
- declare const transduce: typeof transduceSync & {
60
- async: typeof transduceAsync;
61
- };
62
-
63
- type FunctionLike<P extends Array<any> = any, R = any> = (...args: P) => R;
64
- type Await<P> = P extends Promise<infer A> ? A : P;
65
- /**
66
- * Pipe the input and output of functions.
67
- *
68
- * @param fn - parameter-taking function
69
- * @param fns - subsequent piped functions
70
- * @returns
71
- */
72
- declare const pipe: PipeMultiSync & {
73
- async: PipeMultiAsync;
74
- };
75
- declare type PipeMultiSync = {
76
- <R0, P extends any[]>(...fns: [FunctionLike<P, R0>]): FunctionLike<P, R0>;
77
- <R0, R1, P extends any[]>(...fns: [FunctionLike<P, R0>, FunctionLike<[R0], R1>]): FunctionLike<P, R1>;
78
- <R0, R1, R2, P extends any[]>(...fns: [
79
- FunctionLike<P, R0>,
80
- FunctionLike<[R0], R1>,
81
- FunctionLike<[R1], R2>
82
- ]): FunctionLike<P, R2>;
83
- <R0, R1, R2, R3, P extends any[]>(...fns: [
84
- FunctionLike<P, R0>,
85
- FunctionLike<[R0], R1>,
86
- FunctionLike<[R1], R2>,
87
- FunctionLike<[R2], R3>
88
- ]): FunctionLike<P, R3>;
89
- <R0, R1, R2, R3, R4, P extends any[]>(...fns: [
90
- FunctionLike<P, R0>,
91
- FunctionLike<[R0], R1>,
92
- FunctionLike<[R1], R2>,
93
- FunctionLike<[R2], R3>,
94
- FunctionLike<[R3], R4>
95
- ]): FunctionLike<P, R4>;
96
- <R0, R1, R2, R3, R4, R5, P extends any[]>(...fns: [
97
- FunctionLike<P, R0>,
98
- FunctionLike<[R0], R1>,
99
- FunctionLike<[R1], R2>,
100
- FunctionLike<[R2], R3>,
101
- FunctionLike<[R3], R4>,
102
- FunctionLike<[R4], R5>
103
- ]): FunctionLike<P, R5>;
104
- <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(...fns: [
105
- FunctionLike<P, R0>,
106
- FunctionLike<[R0], R1>,
107
- FunctionLike<[R1], R2>,
108
- FunctionLike<[R2], R3>,
109
- FunctionLike<[R3], R4>,
110
- FunctionLike<[R4], R5>,
111
- FunctionLike<[R5], R6>
112
- ]): FunctionLike<P, R6>;
113
- <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(...fns: [
114
- FunctionLike<P, R0>,
115
- FunctionLike<[R0], R1>,
116
- FunctionLike<[R1], R2>,
117
- FunctionLike<[R2], R3>,
118
- FunctionLike<[R3], R4>,
119
- FunctionLike<[R4], R5>,
120
- FunctionLike<[R5], R6>,
121
- FunctionLike<[R6], R7>
122
- ]): FunctionLike<P, R7>;
123
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(...fns: [
124
- FunctionLike<P, R0>,
125
- FunctionLike<[R0], R1>,
126
- FunctionLike<[R1], R2>,
127
- FunctionLike<[R2], R3>,
128
- FunctionLike<[R3], R4>,
129
- FunctionLike<[R4], R5>,
130
- FunctionLike<[R5], R6>,
131
- FunctionLike<[R6], R7>,
132
- FunctionLike<[R7], R8>
133
- ]): FunctionLike<P, R8>;
134
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(...fns: [
135
- FunctionLike<P, R0>,
136
- FunctionLike<[R0], R1>,
137
- FunctionLike<[R1], R2>,
138
- FunctionLike<[R2], R3>,
139
- FunctionLike<[R3], R4>,
140
- FunctionLike<[R4], R5>,
141
- FunctionLike<[R5], R6>,
142
- FunctionLike<[R6], R7>,
143
- FunctionLike<[R7], R8>,
144
- FunctionLike<[R8], R9>
145
- ]): FunctionLike<P, R9>;
146
- };
147
- declare type PipeMultiAsync = {
148
- <R0, P extends any[]>(...fns: [FunctionLike<P, R0>]): FunctionLike<P, Promise<Await<R0>>>;
149
- <R0, R1, P extends any[]>(...fns: [FunctionLike<P, R0>, FunctionLike<[Await<R0>], R1>]): FunctionLike<P, Promise<Await<R1>>>;
150
- <R0, R1, R2, P extends any[]>(...fns: [
151
- FunctionLike<P, R0>,
152
- FunctionLike<[Await<R0>], R1>,
153
- FunctionLike<[Await<R1>], R2>
154
- ]): FunctionLike<P, Promise<Await<R2>>>;
155
- <R0, R1, R2, R3, P extends any[]>(...fns: [
156
- FunctionLike<P, R0>,
157
- FunctionLike<[Await<R0>], R1>,
158
- FunctionLike<[Await<R1>], R2>,
159
- FunctionLike<[Await<R2>], R3>
160
- ]): FunctionLike<P, Promise<Await<R3>>>;
161
- <R0, R1, R2, R3, R4, P extends any[]>(...fns: [
162
- FunctionLike<P, R0>,
163
- FunctionLike<[Await<R0>], R1>,
164
- FunctionLike<[Await<R1>], R2>,
165
- FunctionLike<[Await<R2>], R3>,
166
- FunctionLike<[Await<R3>], R4>
167
- ]): FunctionLike<P, Promise<Await<R4>>>;
168
- <R0, R1, R2, R3, R4, R5, P extends any[]>(...fns: [
169
- FunctionLike<P, R0>,
170
- FunctionLike<[Await<R0>], R1>,
171
- FunctionLike<[Await<R1>], R2>,
172
- FunctionLike<[Await<R2>], R3>,
173
- FunctionLike<[Await<R3>], R4>,
174
- FunctionLike<[Await<R4>], R5>
175
- ]): FunctionLike<P, Promise<Await<R5>>>;
176
- <R0, R1, R2, R3, R4, R5, R6, P extends any[]>(...fns: [
177
- FunctionLike<P, R0>,
178
- FunctionLike<[Await<R0>], R1>,
179
- FunctionLike<[Await<R1>], R2>,
180
- FunctionLike<[Await<R2>], R3>,
181
- FunctionLike<[Await<R3>], R4>,
182
- FunctionLike<[Await<R4>], R5>,
183
- FunctionLike<[Await<R5>], R6>
184
- ]): FunctionLike<P, Promise<Await<R6>>>;
185
- <R0, R1, R2, R3, R4, R5, R6, R7, P extends any[]>(...fns: [
186
- FunctionLike<P, R0>,
187
- FunctionLike<[Await<R0>], R1>,
188
- FunctionLike<[Await<R1>], R2>,
189
- FunctionLike<[Await<R2>], R3>,
190
- FunctionLike<[Await<R3>], R4>,
191
- FunctionLike<[Await<R4>], R5>,
192
- FunctionLike<[Await<R5>], R6>,
193
- FunctionLike<[Await<R6>], R7>
194
- ]): FunctionLike<P, Promise<Await<R7>>>;
195
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, P extends any[]>(...fns: [
196
- FunctionLike<P, R0>,
197
- FunctionLike<[Await<R0>], R1>,
198
- FunctionLike<[Await<R1>], R2>,
199
- FunctionLike<[Await<R2>], R3>,
200
- FunctionLike<[Await<R3>], R4>,
201
- FunctionLike<[Await<R4>], R5>,
202
- FunctionLike<[Await<R5>], R6>,
203
- FunctionLike<[Await<R6>], R7>,
204
- FunctionLike<[Await<R7>], R8>
205
- ]): FunctionLike<P, Promise<Await<R8>>>;
206
- <R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, P extends any[]>(...fns: [
207
- FunctionLike<P, R0>,
208
- FunctionLike<[Await<R0>], R1>,
209
- FunctionLike<[Await<R1>], R2>,
210
- FunctionLike<[Await<R2>], R3>,
211
- FunctionLike<[Await<R3>], R4>,
212
- FunctionLike<[Await<R4>], R5>,
213
- FunctionLike<[Await<R5>], R6>,
214
- FunctionLike<[Await<R6>], R7>,
215
- FunctionLike<[Await<R7>], R8>,
216
- FunctionLike<[Await<R8>], R9>
217
- ]): FunctionLike<P, Promise<Await<R9>>>;
218
- };
219
-
220
- export { Filter, Mapper, type PipeMultiAsync, type PipeMultiSync, handle, pipe, skip, transduce };
package/dist/index.js CHANGED
@@ -1,56 +1,18 @@
1
- import {
2
- Filter,
3
- Mapper,
4
- build,
5
- handle,
6
- pipe,
7
- skip,
8
- transduce,
9
- watch
10
- } from "./chunk-DPRINYB6.js";
11
- import {
12
- clean,
13
- cleanDirectories
14
- } from "./chunk-3PF5YMWK.js";
15
- import {
16
- DEFAULT_BUILD_OPTIONS,
17
- getDefaultBuildPlugins
18
- } from "./chunk-SKJRUPDP.js";
19
- import "./chunk-2TG2H4XL.js";
20
- import "./chunk-UYE6LM4C.js";
21
- import "./chunk-AZON722Q.js";
22
- import "./chunk-BWSIRV3D.js";
23
- import "./chunk-5RVOO3YF.js";
24
- import "./chunk-3QHFCKSI.js";
25
- import {
26
- emitDts,
27
- emitDtsFiles,
28
- ensureTempDeclarationDir,
29
- slash,
30
- toAbsolutePath
31
- } from "./chunk-2X5ZMEAN.js";
32
1
  import "./chunk-GGNOJ77I.js";
33
- import "./chunk-STCE44IS.js";
34
- import "./chunk-VQHKIS7J.js";
35
- import "./chunk-Y7JBB452.js";
36
- import "./chunk-XLUZXKDY.js";
37
- import "./chunk-CCEWV2BR.js";
2
+ import {
3
+ build
4
+ } from "./chunk-EBTMX5WL.js";
5
+ import "./chunk-OCDIIBBZ.js";
6
+ import "./chunk-EDLA3ZZN.js";
7
+ import "./chunk-DNZNN5SK.js";
8
+ import "./chunk-ECCVVXNX.js";
9
+ import "./chunk-ABRK5MYP.js";
10
+ import "./chunk-WXURMFT7.js";
11
+ import "./chunk-R2KKGNQL.js";
12
+ import "./chunk-NJJBR57W.js";
13
+ import "./chunk-QWTKBUQW.js";
14
+ import "./chunk-TSQT5MWW.js";
15
+ import "./chunk-4D6ICA75.js";
38
16
  export {
39
- DEFAULT_BUILD_OPTIONS,
40
- Filter,
41
- Mapper,
42
- build,
43
- clean,
44
- cleanDirectories,
45
- emitDts,
46
- emitDtsFiles,
47
- ensureTempDeclarationDir,
48
- getDefaultBuildPlugins,
49
- handle,
50
- pipe,
51
- skip,
52
- slash,
53
- toAbsolutePath,
54
- transduce,
55
- watch
17
+ build
56
18
  };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2CM3VAO5cjs = require('./chunk-2CM3VAO5.cjs');
4
+ require('./chunk-FQQYNAPT.cjs');
5
+ require('./chunk-EVDNG72R.cjs');
6
+ require('./chunk-YHMM6RY5.cjs');
7
+
8
+
9
+ exports.generatePackageJson = _chunk2CM3VAO5cjs.generatePackageJson;
@@ -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
+ * Generate the package.json file for the project
10
+ *
11
+ * @param context - The build context
12
+ * @returns The build context
13
+ */
14
+ declare function generatePackageJson(context: ESBuildContext): Promise<ESBuildContext>;
15
+
16
+ export { generatePackageJson };
@@ -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
+ * Generate the package.json file for the project
10
+ *
11
+ * @param context - The build context
12
+ * @returns The build context
13
+ */
14
+ declare function generatePackageJson(context: ESBuildContext): Promise<ESBuildContext>;
15
+
16
+ export { generatePackageJson };
@@ -0,0 +1,9 @@
1
+ import {
2
+ generatePackageJson
3
+ } from "./chunk-R2KKGNQL.js";
4
+ import "./chunk-NJJBR57W.js";
5
+ import "./chunk-TSQT5MWW.js";
6
+ import "./chunk-4D6ICA75.js";
7
+ export {
8
+ generatePackageJson
9
+ };