powerlines 0.27.0 → 0.28.0
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/dist/{api-CHbGX3BG.d.ts → api-BgDfE1J3.d.ts} +2 -2
- package/dist/{api-DGMQopJ5.d.cts → api-D-3EvHyy.d.cts} +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.cts +5 -2
- package/dist/api.d.ts +5 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.d.cts +4 -1
- package/dist/astro.d.ts +4 -1
- package/dist/astro.js +3 -3
- package/dist/{chunk-PYID3NKT.js → chunk-5CV2NNIR.js} +6 -5
- package/dist/chunk-C3APS65S.cjs +12 -0
- package/dist/{chunk-HG7JY6AQ.cjs → chunk-DD4XJNKQ.cjs} +7 -6
- package/dist/{chunk-RCYXXBJ3.cjs → chunk-ERZWC77E.cjs} +272 -117
- package/dist/{chunk-KW66GUWJ.cjs → chunk-FJ67PPIW.cjs} +4 -4
- package/dist/{chunk-YULFP33E.cjs → chunk-MRHWIMY2.cjs} +2 -2
- package/dist/{chunk-CSJMUAPJ.js → chunk-NHZBSVDJ.js} +3 -3
- package/dist/{chunk-2DWFEC7G.js → chunk-QRE6JMCD.js} +271 -116
- package/dist/{chunk-P647W2BA.js → chunk-UMZ2WNMA.js} +2 -2
- package/dist/{chunk-ISPXQBOL.js → chunk-VJ26HHRE.js} +3 -3
- package/dist/{chunk-CF7B5HOG.cjs → chunk-XMYY4XUM.cjs} +4 -4
- package/dist/{chunk-BH4JSKPK.js → chunk-Z3HPP53Q.js} +3 -3
- package/dist/{context-BjOICcQB.d.cts → context-CDZY3RHt.d.cts} +80 -21
- package/dist/{context-BqTYt9FC.d.ts → context-CcPf9RC_.d.ts} +80 -21
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.d.cts +4 -1
- package/dist/esbuild.d.ts +4 -1
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.d.cts +4 -1
- package/dist/farm.d.ts +4 -1
- package/dist/farm.js +2 -2
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +10 -7
- package/dist/lib/{api-_rRpguWX.d.cts → api-BIHEKpyq.d.ts} +2 -2
- package/dist/lib/{api-Cxmk8sFc.d.ts → api-Wawenasn.d.cts} +2 -2
- package/dist/lib/build/esbuild.cjs +6 -5
- package/dist/lib/build/esbuild.d.cts +4 -1
- package/dist/lib/build/esbuild.d.ts +4 -1
- package/dist/lib/build/esbuild.js +3 -2
- package/dist/lib/build/index.cjs +13 -12
- package/dist/lib/build/index.d.cts +6 -3
- package/dist/lib/build/index.d.ts +6 -3
- package/dist/lib/build/index.js +5 -4
- package/dist/lib/build/rolldown.d.cts +4 -1
- package/dist/lib/build/rolldown.d.ts +4 -1
- package/dist/lib/build/rollup.d.cts +4 -1
- package/dist/lib/build/rollup.d.ts +4 -1
- package/dist/lib/build/rspack.d.cts +4 -1
- package/dist/lib/build/rspack.d.ts +4 -1
- package/dist/lib/build/tsup.cjs +7 -6
- package/dist/lib/build/tsup.d.cts +4 -1
- package/dist/lib/build/tsup.d.ts +4 -1
- package/dist/lib/build/tsup.js +4 -3
- package/dist/lib/build/unbuild.d.cts +6 -3
- package/dist/lib/build/unbuild.d.ts +6 -3
- package/dist/lib/build/vite.cjs +6 -5
- package/dist/lib/build/vite.d.cts +4 -1
- package/dist/lib/build/vite.d.ts +4 -1
- package/dist/lib/build/vite.js +4 -3
- package/dist/lib/build/webpack.d.cts +4 -1
- package/dist/lib/build/webpack.d.ts +4 -1
- package/dist/lib/{chunk-UNUP4XMO.cjs → chunk-3Y4F37CB.cjs} +2 -2
- package/dist/lib/{chunk-Q4D2L67H.cjs → chunk-7VRXU4F7.cjs} +2 -2
- package/dist/lib/{chunk-N5YLKWC2.js → chunk-DYGQQI74.js} +2 -10
- package/dist/lib/{chunk-HM52GHX3.js → chunk-GD7KTLPU.js} +2 -2
- package/dist/lib/{chunk-CU23POMD.js → chunk-GLWPZDAR.js} +1 -1
- package/dist/lib/{chunk-HE6HOGLS.js → chunk-GSGF6RL2.js} +154 -26
- package/dist/lib/{chunk-4SULM54S.js → chunk-KG4HFVJU.js} +55 -44
- package/dist/lib/{chunk-ZDBHX3VV.cjs → chunk-LBR46BPB.cjs} +72 -35
- package/dist/lib/{chunk-YB54H3SQ.js → chunk-N22WOZ3U.js} +3 -1
- package/dist/lib/{chunk-QR2N3DPP.js → chunk-NZ6NCXM2.js} +1 -1
- package/dist/lib/{chunk-AFLI3CLM.js → chunk-OKXWWMEF.js} +1 -1
- package/dist/lib/{chunk-R3E56AJ4.cjs → chunk-OYLWPIBP.cjs} +2 -2
- package/dist/lib/{chunk-I76RI47U.cjs → chunk-PURLNHXG.cjs} +3 -1
- package/dist/lib/{chunk-N5XEKCVW.cjs → chunk-QF3UTBJE.cjs} +2 -11
- package/dist/lib/{chunk-QDRITYHV.cjs → chunk-R3XAVNPY.cjs} +2 -2
- package/dist/lib/{chunk-Z5JKSYRP.cjs → chunk-S4OH7KW6.cjs} +165 -37
- package/dist/lib/{chunk-YGSXCTX2.js → chunk-S6WYOXLM.js} +1 -1
- package/dist/lib/chunk-T35JQHYE.js +12 -0
- package/dist/lib/{chunk-GKCWJVF7.cjs → chunk-TWABN364.cjs} +10 -10
- package/dist/lib/{chunk-UJYCAW2D.cjs → chunk-V2523R33.cjs} +4 -4
- package/dist/lib/{chunk-KJDASLW3.js → chunk-VKFXVPY6.js} +1 -1
- package/dist/lib/{chunk-AJDYMANR.cjs → chunk-XBSGDSV3.cjs} +2 -2
- package/dist/lib/{chunk-7GCAHOJK.js → chunk-XIK3Y6BP.js} +1 -1
- package/dist/lib/{chunk-CP77I6WM.js → chunk-Y2DPOC4G.js} +65 -28
- package/dist/lib/chunk-YXJJCE6V.cjs +14 -0
- package/dist/lib/{chunk-4V5OI73E.cjs → chunk-Z6BSDYUR.cjs} +55 -44
- package/dist/lib/{config-DMXVnKGF.d.cts → config-D2dTFLlQ.d.cts} +76 -6
- package/dist/lib/{config-B2q8Me0M.d.ts → config-Dzk6j2mr.d.ts} +76 -6
- package/dist/lib/config-file.d.cts +4 -1
- package/dist/lib/config-file.d.ts +4 -1
- package/dist/lib/contexts/api-context.cjs +7 -6
- package/dist/lib/contexts/api-context.d.cts +7 -3
- package/dist/lib/contexts/api-context.d.ts +7 -3
- package/dist/lib/contexts/api-context.js +6 -5
- package/dist/lib/contexts/context.cjs +5 -4
- package/dist/lib/contexts/context.d.cts +64 -10
- package/dist/lib/contexts/context.d.ts +64 -10
- package/dist/lib/contexts/context.js +4 -3
- package/dist/lib/contexts/environment-context.cjs +6 -5
- package/dist/lib/contexts/environment-context.d.cts +7 -3
- package/dist/lib/contexts/environment-context.d.ts +7 -3
- package/dist/lib/contexts/environment-context.js +5 -4
- package/dist/lib/contexts/index.cjs +9 -8
- package/dist/lib/contexts/index.d.cts +7 -3
- package/dist/lib/contexts/index.d.ts +7 -3
- package/dist/lib/contexts/index.js +6 -5
- package/dist/lib/contexts/plugin-context.d.cts +6 -3
- package/dist/lib/contexts/plugin-context.d.ts +6 -3
- package/dist/lib/entry.cjs +10 -9
- package/dist/lib/entry.d.cts +4 -1
- package/dist/lib/entry.d.ts +4 -1
- package/dist/lib/entry.js +2 -1
- package/dist/lib/fs/index.cjs +3 -2
- package/dist/lib/fs/index.d.cts +4 -1
- package/dist/lib/fs/index.d.ts +4 -1
- package/dist/lib/fs/index.js +2 -1
- package/dist/lib/fs/vfs.cjs +3 -2
- package/dist/lib/fs/vfs.d.cts +4 -1
- package/dist/lib/fs/vfs.d.ts +4 -1
- package/dist/lib/fs/vfs.js +2 -1
- package/dist/lib/index.cjs +32 -31
- package/dist/lib/index.d.cts +8 -5
- package/dist/lib/index.d.ts +8 -5
- package/dist/lib/index.js +12 -11
- package/dist/lib/{internal-CGIi3MOX.d.ts → internal-Cgp0NF-t.d.ts} +2 -2
- package/dist/lib/{internal-CfIJWv8T.d.cts → internal-DC9vYMIn.d.cts} +2 -2
- package/dist/lib/logger.d.cts +4 -1
- package/dist/lib/logger.d.ts +4 -1
- package/dist/lib/typescript/import-transformer.d.cts +4 -1
- package/dist/lib/typescript/import-transformer.d.ts +4 -1
- package/dist/lib/typescript/index.d.cts +4 -1
- package/dist/lib/typescript/index.d.ts +4 -1
- package/dist/lib/typescript/ts-morph.d.cts +4 -1
- package/dist/lib/typescript/ts-morph.d.ts +4 -1
- package/dist/lib/unplugin/factory.cjs +8 -8
- package/dist/lib/unplugin/factory.d.cts +6 -3
- package/dist/lib/unplugin/factory.d.ts +6 -3
- package/dist/lib/unplugin/factory.js +7 -7
- package/dist/lib/unplugin/helpers.d.cts +4 -1
- package/dist/lib/unplugin/helpers.d.ts +4 -1
- package/dist/lib/unplugin/index.cjs +10 -10
- package/dist/lib/unplugin/index.d.cts +7 -4
- package/dist/lib/unplugin/index.d.ts +7 -4
- package/dist/lib/unplugin/index.js +8 -8
- package/dist/lib/unplugin/plugin.cjs +2 -2
- package/dist/lib/unplugin/plugin.d.cts +8 -18
- package/dist/lib/unplugin/plugin.d.ts +8 -18
- package/dist/lib/unplugin/plugin.js +1 -1
- package/dist/lib/{unplugin-B_F1TZK4.d.cts → unplugin-CvYjC7ZL.d.cts} +2 -2
- package/dist/lib/{unplugin-Da9GAj4a.d.ts → unplugin-D7lpyIpN.d.ts} +2 -2
- package/dist/lib/utilities/bundle.cjs +5 -4
- package/dist/lib/utilities/bundle.d.cts +4 -1
- package/dist/lib/utilities/bundle.d.ts +4 -1
- package/dist/lib/utilities/bundle.js +4 -3
- package/dist/lib/utilities/cache.d.cts +4 -1
- package/dist/lib/utilities/cache.d.ts +4 -1
- package/dist/lib/utilities/file-header.d.cts +4 -1
- package/dist/lib/utilities/file-header.d.ts +4 -1
- package/dist/lib/utilities/index.cjs +12 -11
- package/dist/lib/utilities/index.d.cts +4 -1
- package/dist/lib/utilities/index.d.ts +4 -1
- package/dist/lib/utilities/index.js +6 -5
- package/dist/lib/utilities/meta.d.cts +4 -1
- package/dist/lib/utilities/meta.d.ts +4 -1
- package/dist/lib/utilities/resolve.cjs +6 -5
- package/dist/lib/utilities/resolve.d.cts +4 -1
- package/dist/lib/utilities/resolve.d.ts +4 -1
- package/dist/lib/utilities/resolve.js +5 -4
- package/dist/lib/utilities/source-file.d.cts +4 -1
- package/dist/lib/utilities/source-file.d.ts +4 -1
- package/dist/lib/utilities/source-map.d.cts +4 -1
- package/dist/lib/utilities/source-map.d.ts +4 -1
- package/dist/lib/utilities/worker.d.cts +4 -1
- package/dist/lib/utilities/worker.d.ts +4 -1
- package/dist/lib/utilities/write-file.d.cts +4 -1
- package/dist/lib/utilities/write-file.d.ts +4 -1
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +6 -6
- package/dist/nuxt.js +4 -4
- package/dist/plugin-utils/chunk-DCJAIIJ5.cjs +14 -0
- package/dist/plugin-utils/chunk-FBLNGP3S.js +12 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -1
- package/dist/plugin-utils/context-helpers.d.ts +4 -1
- package/dist/plugin-utils/{context-y3G_SQPM.d.cts → context-iOcgJtAf.d.cts} +75 -5
- package/dist/plugin-utils/{context-y3G_SQPM.d.ts → context-iOcgJtAf.d.ts} +75 -5
- package/dist/plugin-utils/enforce.d.cts +4 -1
- package/dist/plugin-utils/enforce.d.ts +4 -1
- package/dist/plugin-utils/extend.d.cts +4 -1
- package/dist/plugin-utils/extend.d.ts +4 -1
- package/dist/plugin-utils/get-config-path.d.cts +4 -1
- package/dist/plugin-utils/get-config-path.d.ts +4 -1
- package/dist/plugin-utils/helpers.d.cts +14 -11
- package/dist/plugin-utils/helpers.d.ts +14 -11
- package/dist/plugin-utils/index.cjs +2 -2
- package/dist/plugin-utils/index.d.cts +4 -1
- package/dist/plugin-utils/index.d.ts +4 -1
- package/dist/plugin-utils/index.js +1 -1
- package/dist/plugin-utils/merge.d.cts +4 -1
- package/dist/plugin-utils/merge.d.ts +4 -1
- package/dist/plugin-utils/paths.cjs +2 -2
- package/dist/plugin-utils/paths.d.cts +5 -1
- package/dist/plugin-utils/paths.d.ts +5 -1
- package/dist/plugin-utils/paths.js +1 -1
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.d.cts +4 -1
- package/dist/rolldown.d.ts +4 -1
- package/dist/rolldown.js +2 -2
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +4 -1
- package/dist/rollup.d.ts +4 -1
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.d.cts +4 -1
- package/dist/rspack.d.ts +4 -1
- package/dist/rspack.js +2 -2
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/types/api.d.cts +5 -2
- package/dist/types/api.d.ts +5 -2
- package/dist/types/babel.d.cts +4 -1
- package/dist/types/babel.d.ts +4 -1
- package/dist/types/commands.d.cts +4 -1
- package/dist/types/commands.d.ts +4 -1
- package/dist/types/config.d.cts +4 -1
- package/dist/types/config.d.ts +4 -1
- package/dist/types/context.cjs +2 -2
- package/dist/types/context.d.cts +4 -1
- package/dist/types/context.d.ts +4 -1
- package/dist/types/context.js +1 -1
- package/dist/types/hooks.d.cts +4 -1
- package/dist/types/hooks.d.ts +4 -1
- package/dist/types/index.cjs +3 -3
- package/dist/types/index.d.cts +5 -2
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.js +2 -2
- package/dist/types/internal.d.cts +5 -2
- package/dist/types/internal.d.ts +5 -2
- package/dist/types/plugin.d.cts +4 -1
- package/dist/types/plugin.d.ts +4 -1
- package/dist/types/resolved.d.cts +4 -1
- package/dist/types/resolved.d.ts +4 -1
- package/dist/types/unplugin.d.cts +5 -2
- package/dist/types/unplugin.d.ts +5 -2
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.d.cts +4 -1
- package/dist/unloader.d.ts +4 -1
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +8 -6
- package/dist/unplugin.d.cts +7 -17
- package/dist/unplugin.d.ts +7 -17
- package/dist/unplugin.js +6 -4
- package/dist/vite.cjs +6 -6
- package/dist/vite.d.cts +4 -1
- package/dist/vite.d.ts +4 -1
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.d.cts +4 -1
- package/dist/webpack.d.ts +4 -1
- package/dist/webpack.js +3 -3
- package/package.json +24 -21
- package/dist/babel-types.d.ts +0 -292
- package/dist/chunk-GBIIAZH5.cjs +0 -13
- package/dist/chunk-QXHINXRM.js +0 -11
- package/dist/chunk-UWLQNNZE.cjs +0 -12
- package/dist/config.cjs +0 -13
- package/dist/config.d.cts +0 -45
- package/dist/config.d.ts +0 -45
- package/dist/config.js +0 -4
- package/dist/plugin-utils/chunk-K2GWRZPV.js +0 -12
- package/dist/plugin-utils/chunk-VWFJOPKC.cjs +0 -14
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkHRRI4KOM_cjs = require('./chunk-HRRI4KOM.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkZ6BSDYUR_cjs = require('./chunk-Z6BSDYUR.cjs');
|
|
5
5
|
var chunkD6MI2V6R_cjs = require('./chunk-D6MI2V6R.cjs');
|
|
6
6
|
var chunkGA3RXX4R_cjs = require('./chunk-GA3RXX4R.cjs');
|
|
7
7
|
var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
|
|
8
8
|
var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkQF3UTBJE_cjs = require('./chunk-QF3UTBJE.cjs');
|
|
10
|
+
var chunkYXJJCE6V_cjs = require('./chunk-YXJJCE6V.cjs');
|
|
10
11
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
11
12
|
var types = require('@storm-software/config-tools/types');
|
|
12
13
|
var toArray = require('@stryke/convert/to-array');
|
|
@@ -19,6 +20,7 @@ var hashFiles = require('@stryke/hash/hash-files');
|
|
|
19
20
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
20
21
|
var getUnique = require('@stryke/helpers/get-unique');
|
|
21
22
|
var omit = require('@stryke/helpers/omit');
|
|
23
|
+
var fetch = require('@stryke/http/fetch');
|
|
22
24
|
var stormJson = require('@stryke/json/storm-json');
|
|
23
25
|
var append = require('@stryke/path/append');
|
|
24
26
|
var isType = require('@stryke/path/is-type');
|
|
@@ -32,6 +34,9 @@ var isString = require('@stryke/type-checks/is-string');
|
|
|
32
34
|
var uuid = require('@stryke/unique-id/uuid');
|
|
33
35
|
var bundleRequire = require('bundle-require');
|
|
34
36
|
var defu2 = require('defu');
|
|
37
|
+
var flatCache = require('flat-cache');
|
|
38
|
+
var oxcParser = require('oxc-parser');
|
|
39
|
+
var undici = require('undici');
|
|
35
40
|
var joinPaths = require('@stryke/path/join-paths');
|
|
36
41
|
var jiti = require('jiti');
|
|
37
42
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
@@ -151,7 +156,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
151
156
|
#fs;
|
|
152
157
|
#tsconfig;
|
|
153
158
|
#program;
|
|
154
|
-
#
|
|
159
|
+
#parserCache;
|
|
160
|
+
#requestCache;
|
|
155
161
|
#getConfigProps(config = {}) {
|
|
156
162
|
return {
|
|
157
163
|
variant: config.build?.variant,
|
|
@@ -175,7 +181,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
175
181
|
lint: config.lint,
|
|
176
182
|
transform: config.transform,
|
|
177
183
|
build: config.build,
|
|
178
|
-
framework: config.framework
|
|
184
|
+
framework: config.framework,
|
|
185
|
+
...config
|
|
179
186
|
};
|
|
180
187
|
}
|
|
181
188
|
/**
|
|
@@ -223,6 +230,10 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
223
230
|
*/
|
|
224
231
|
resolver;
|
|
225
232
|
/**
|
|
233
|
+
* The resolved configuration options
|
|
234
|
+
*/
|
|
235
|
+
resolvePatterns = [];
|
|
236
|
+
/**
|
|
226
237
|
* Internal context fields and methods
|
|
227
238
|
*
|
|
228
239
|
* @internal
|
|
@@ -236,7 +247,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
236
247
|
* The resolved entry type definitions for the project
|
|
237
248
|
*/
|
|
238
249
|
get entry() {
|
|
239
|
-
return
|
|
250
|
+
return chunkQF3UTBJE_cjs.resolveEntriesSync(this, toArray.toArray(this.config.entry));
|
|
240
251
|
}
|
|
241
252
|
/**
|
|
242
253
|
* The TypeScript configuration parsed from the tsconfig file
|
|
@@ -254,14 +265,14 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
254
265
|
*/
|
|
255
266
|
set tsconfig(value) {
|
|
256
267
|
this.#tsconfig = value;
|
|
257
|
-
this
|
|
268
|
+
this.resolvePatterns = bundleRequire.tsconfigPathsToRegExp(value?.options?.paths ?? {});
|
|
258
269
|
}
|
|
259
270
|
/**
|
|
260
271
|
* The virtual file system interface for the project
|
|
261
272
|
*/
|
|
262
273
|
get fs() {
|
|
263
274
|
if (!this.#fs) {
|
|
264
|
-
this.#fs =
|
|
275
|
+
this.#fs = chunkZ6BSDYUR_cjs.VirtualFileSystem.createSync(this);
|
|
265
276
|
}
|
|
266
277
|
return this.#fs;
|
|
267
278
|
}
|
|
@@ -395,6 +406,123 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
395
406
|
return this.#program;
|
|
396
407
|
}
|
|
397
408
|
/**
|
|
409
|
+
* Gets the parser cache.
|
|
410
|
+
*/
|
|
411
|
+
get parserCache() {
|
|
412
|
+
if (!this.#parserCache) {
|
|
413
|
+
this.#parserCache = flatCache.create({
|
|
414
|
+
cacheId: "parser",
|
|
415
|
+
cacheDir: this.cachePath,
|
|
416
|
+
ttl: 2 * 60 * 60 * 1e3,
|
|
417
|
+
lruSize: 5e3,
|
|
418
|
+
persistInterval: 250
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
return this.#parserCache;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Gets the request cache.
|
|
425
|
+
*/
|
|
426
|
+
get requestCache() {
|
|
427
|
+
if (!this.#requestCache) {
|
|
428
|
+
this.#requestCache = flatCache.create({
|
|
429
|
+
cacheId: "http",
|
|
430
|
+
cacheDir: this.cachePath,
|
|
431
|
+
ttl: 5 * 60 * 1e3,
|
|
432
|
+
lruSize: 5e3,
|
|
433
|
+
persistInterval: 250
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
return this.#requestCache;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* A function to perform HTTP fetch requests
|
|
440
|
+
*
|
|
441
|
+
* @remarks
|
|
442
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
443
|
+
*
|
|
444
|
+
* @example
|
|
445
|
+
* ```ts
|
|
446
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
447
|
+
* const data = await response.json();
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* @see https://github.com/nodejs/undici
|
|
451
|
+
*
|
|
452
|
+
* @param input - The URL to fetch.
|
|
453
|
+
* @param options - The fetch request options.
|
|
454
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
455
|
+
*/
|
|
456
|
+
async fetch(input, options = {}) {
|
|
457
|
+
const cacheKey = murmurhash.murmurhash({
|
|
458
|
+
input: input.toString(),
|
|
459
|
+
options: JSON.stringify(options)
|
|
460
|
+
});
|
|
461
|
+
if (!this.config.skipCache && !options.skipCache) {
|
|
462
|
+
const cached = this.requestCache.get(cacheKey);
|
|
463
|
+
if (cached) {
|
|
464
|
+
return new undici.Response(cached.body, {
|
|
465
|
+
status: cached.status,
|
|
466
|
+
statusText: cached.statusText,
|
|
467
|
+
headers: cached.headers
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const result = await fetch.fetchRequest(input, options);
|
|
472
|
+
if (!this.config.skipCache && !options.skipCache) {
|
|
473
|
+
try {
|
|
474
|
+
this.requestCache.set(cacheKey, {
|
|
475
|
+
body: await result.text(),
|
|
476
|
+
status: result.status,
|
|
477
|
+
statusText: result.statusText,
|
|
478
|
+
headers: Object.fromEntries(result.headers.entries())
|
|
479
|
+
});
|
|
480
|
+
} catch {
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
487
|
+
*
|
|
488
|
+
* @remarks
|
|
489
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* ```ts
|
|
493
|
+
* const ast = context.parse("const x: number = 42;");
|
|
494
|
+
* ```
|
|
495
|
+
*
|
|
496
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
497
|
+
* @see https://github.com/oxc/oxc
|
|
498
|
+
*
|
|
499
|
+
* @param code - The source code to parse.
|
|
500
|
+
* @param options - The options to pass to the parser.
|
|
501
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
502
|
+
*/
|
|
503
|
+
async parse(code, options = {}) {
|
|
504
|
+
const cacheKey = murmurhash.murmurhash({
|
|
505
|
+
code,
|
|
506
|
+
options
|
|
507
|
+
});
|
|
508
|
+
let result;
|
|
509
|
+
if (!this.config.skipCache) {
|
|
510
|
+
result = this.parserCache.get(cacheKey);
|
|
511
|
+
if (result) {
|
|
512
|
+
return result;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
result = await oxcParser.parse(`source.${options.lang || "ts"}`, code, {
|
|
516
|
+
...options,
|
|
517
|
+
sourceType: "module",
|
|
518
|
+
showSemanticErrors: this.config.mode === "development"
|
|
519
|
+
});
|
|
520
|
+
if (!this.config.skipCache) {
|
|
521
|
+
this.parserCache.set(cacheKey, result);
|
|
522
|
+
}
|
|
523
|
+
return result;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
398
526
|
* A helper function to resolve modules in the Virtual File System
|
|
399
527
|
*
|
|
400
528
|
* @remarks
|
|
@@ -439,7 +567,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
439
567
|
};
|
|
440
568
|
}
|
|
441
569
|
if (this.config.build.skipNodeModulesBundle) {
|
|
442
|
-
if (bundleRequire.match(moduleId, this
|
|
570
|
+
if (bundleRequire.match(moduleId, this.resolvePatterns) || bundleRequire.match(moduleId, this.config.build.noExternal)) {
|
|
443
571
|
return void 0;
|
|
444
572
|
}
|
|
445
573
|
if (bundleRequire.match(moduleId, this.config.build.external) || moduleId.startsWith("node:")) {
|
|
@@ -633,6 +761,26 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
633
761
|
return chunkJA4HSQRN_cjs.extendLog(this.log, name);
|
|
634
762
|
}
|
|
635
763
|
/**
|
|
764
|
+
* Generates a checksum representing the current context state
|
|
765
|
+
*
|
|
766
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
767
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
768
|
+
*/
|
|
769
|
+
async generateChecksum(root = this.config.projectRoot) {
|
|
770
|
+
this.#checksum = await hashFiles.hashDirectory(root, {
|
|
771
|
+
ignore: [
|
|
772
|
+
"node_modules",
|
|
773
|
+
".git",
|
|
774
|
+
".nx",
|
|
775
|
+
".cache",
|
|
776
|
+
".storm",
|
|
777
|
+
"tmp",
|
|
778
|
+
"dist"
|
|
779
|
+
]
|
|
780
|
+
});
|
|
781
|
+
return this.#checksum;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
636
784
|
* Creates a new StormContext instance.
|
|
637
785
|
*
|
|
638
786
|
* @param workspaceConfig - The workspace configuration.
|
|
@@ -654,26 +802,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
654
802
|
*/
|
|
655
803
|
logFn;
|
|
656
804
|
/**
|
|
657
|
-
* Generates a checksum representing the current context state
|
|
658
|
-
*
|
|
659
|
-
* @param root - The root directory of the project to generate the checksum for
|
|
660
|
-
* @returns A promise that resolves to a string representing the checksum
|
|
661
|
-
*/
|
|
662
|
-
async generateChecksum(root = this.config.projectRoot) {
|
|
663
|
-
this.#checksum = await hashFiles.hashDirectory(root, {
|
|
664
|
-
ignore: [
|
|
665
|
-
"node_modules",
|
|
666
|
-
".git",
|
|
667
|
-
".nx",
|
|
668
|
-
".cache",
|
|
669
|
-
".storm",
|
|
670
|
-
"tmp",
|
|
671
|
-
"dist"
|
|
672
|
-
]
|
|
673
|
-
});
|
|
674
|
-
return this.#checksum;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
805
|
* Initialize the context with the provided configuration options
|
|
678
806
|
*
|
|
679
807
|
* @param config - The partial user configuration to use for initialization.
|
|
@@ -785,7 +913,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
785
913
|
}
|
|
786
914
|
});
|
|
787
915
|
}
|
|
788
|
-
this.config.entry =
|
|
916
|
+
this.config.entry = chunkQF3UTBJE_cjs.getUniqueEntries(this.config.entry);
|
|
789
917
|
if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) {
|
|
790
918
|
this.config.name = this.config.name.split("/").filter(Boolean)[1];
|
|
791
919
|
}
|
|
@@ -831,24 +959,24 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
831
959
|
return ret;
|
|
832
960
|
}, []);
|
|
833
961
|
if (this.config.tsconfig) {
|
|
834
|
-
this.config.tsconfig =
|
|
962
|
+
this.config.tsconfig = chunkYXJJCE6V_cjs.replacePathTokens(this, this.config.tsconfig);
|
|
835
963
|
}
|
|
836
964
|
if (this.config.output.dts) {
|
|
837
|
-
this.config.output.dts =
|
|
965
|
+
this.config.output.dts = chunkYXJJCE6V_cjs.replacePathTokens(this, this.config.output.dts);
|
|
838
966
|
}
|
|
839
967
|
if (this.config.build.polyfill) {
|
|
840
|
-
this.config.build.polyfill = this.config.build.polyfill.map((polyfill) =>
|
|
968
|
+
this.config.build.polyfill = this.config.build.polyfill.map((polyfill) => chunkYXJJCE6V_cjs.replacePathTokens(this, polyfill));
|
|
841
969
|
}
|
|
842
970
|
if (this.config.output.assets) {
|
|
843
971
|
this.config.output.assets = this.config.output.assets.map((asset) => ({
|
|
844
972
|
...asset,
|
|
845
|
-
glob:
|
|
846
|
-
ignore: asset.ignore ? asset.ignore.map((ignore) =>
|
|
847
|
-
input:
|
|
848
|
-
output:
|
|
973
|
+
glob: chunkYXJJCE6V_cjs.replacePathTokens(this, asset.glob),
|
|
974
|
+
ignore: asset.ignore ? asset.ignore.map((ignore) => chunkYXJJCE6V_cjs.replacePathTokens(this, ignore)) : void 0,
|
|
975
|
+
input: chunkYXJJCE6V_cjs.replacePathTokens(this, asset.input),
|
|
976
|
+
output: chunkYXJJCE6V_cjs.replacePathTokens(this, asset.output)
|
|
849
977
|
}));
|
|
850
978
|
}
|
|
851
|
-
this.#fs ??= await
|
|
979
|
+
this.#fs ??= await chunkZ6BSDYUR_cjs.VirtualFileSystem.create(this);
|
|
852
980
|
}
|
|
853
981
|
mergeUserConfig(from = {}, into = this.config.userConfig ?? {}) {
|
|
854
982
|
this.config.userConfig = defu2__default.default({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveESBuildEntry } from './chunk-
|
|
1
|
+
import { resolveESBuildEntry } from './chunk-XIK3Y6BP.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { DEFAULT_BUILD_OPTIONS } from '@storm-software/tsup/constants';
|
|
4
4
|
import { omit } from '@stryke/helpers/omit';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
2
|
+
import { replacePath } from '@stryke/path/replace';
|
|
3
|
+
|
|
4
|
+
function replacePathTokens(context, path) {
|
|
5
|
+
if (!path) {
|
|
6
|
+
return path;
|
|
7
|
+
}
|
|
8
|
+
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
9
|
+
}
|
|
10
|
+
__name(replacePathTokens, "replacePathTokens");
|
|
11
|
+
|
|
12
|
+
export { replacePathTokens };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkPIFNMTKN_cjs = require('./chunk-PIFNMTKN.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkS4OH7KW6_cjs = require('./chunk-S4OH7KW6.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var resolve = require('@stryke/fs/resolve');
|
|
7
7
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
@@ -18,7 +18,7 @@ var PLUGIN_NON_HOOK_FIELDS = [
|
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
// src/lib/contexts/environment-context.ts
|
|
21
|
-
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends
|
|
21
|
+
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends chunkS4OH7KW6_cjs.PowerlinesContext {
|
|
22
22
|
static {
|
|
23
23
|
chunkUSNT2KNT_cjs.__name(this, "PowerlinesEnvironmentContext");
|
|
24
24
|
}
|
|
@@ -66,7 +66,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
66
66
|
if (!result || isObject.isObject(result) && Object.keys(result).length === 0) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
resolvedPlugin =
|
|
69
|
+
resolvedPlugin = chunkS4OH7KW6_cjs.isPlugin(result) ? result : plugin;
|
|
70
70
|
}
|
|
71
71
|
const context = chunkPIFNMTKN_cjs.createPluginContext(resolvedPlugin, this);
|
|
72
72
|
this.plugins.push({
|
|
@@ -76,28 +76,28 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
76
76
|
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
|
|
77
77
|
const hook = key;
|
|
78
78
|
const pluginHook = resolvedPlugin[hook];
|
|
79
|
-
if (!
|
|
79
|
+
if (!chunkS4OH7KW6_cjs.isPluginHook(pluginHook)) {
|
|
80
80
|
return ret;
|
|
81
81
|
}
|
|
82
|
-
if (!
|
|
82
|
+
if (!chunkS4OH7KW6_cjs.isHookExternal(hook)) {
|
|
83
83
|
ret[hook] ??= {};
|
|
84
84
|
if (resolvedPlugin.enforce) {
|
|
85
85
|
ret[hook][`${resolvedPlugin.enforce}Enforced`] ??= [];
|
|
86
|
-
|
|
86
|
+
chunkS4OH7KW6_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${resolvedPlugin.enforce}Enforced`]);
|
|
87
87
|
return ret;
|
|
88
88
|
}
|
|
89
89
|
if (isFunction.isFunction(pluginHook) || !pluginHook.order) {
|
|
90
90
|
ret[hook].normal ??= [];
|
|
91
|
-
|
|
91
|
+
chunkS4OH7KW6_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook].normal);
|
|
92
92
|
return ret;
|
|
93
93
|
}
|
|
94
94
|
ret[hook][`${pluginHook.order}Ordered`] ??= [];
|
|
95
|
-
|
|
95
|
+
chunkS4OH7KW6_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${pluginHook.order}Ordered`]);
|
|
96
96
|
} else {
|
|
97
97
|
ret[hook] ??= [];
|
|
98
98
|
ret[hook].push({
|
|
99
99
|
plugin: resolvedPlugin,
|
|
100
|
-
hook:
|
|
100
|
+
hook: chunkS4OH7KW6_cjs.getHookHandler(pluginHook).bind(context)
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
return ret;
|
|
@@ -109,7 +109,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
109
109
|
selectHooks(hook, options) {
|
|
110
110
|
const handlers = [];
|
|
111
111
|
if (this.hooks[hook]) {
|
|
112
|
-
if (!
|
|
112
|
+
if (!chunkS4OH7KW6_cjs.isHookExternal(hook)) {
|
|
113
113
|
const hooks = this.hooks[hook];
|
|
114
114
|
if (options?.order) {
|
|
115
115
|
if (options?.order === "pre") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTWABN364_cjs = require('./chunk-TWABN364.cjs');
|
|
4
|
+
var chunkS4OH7KW6_cjs = require('./chunk-S4OH7KW6.cjs');
|
|
5
5
|
var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
|
|
6
6
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
7
7
|
var types = require('@storm-software/config-tools/types');
|
|
@@ -64,7 +64,7 @@ function createDefaultEnvironment(userConfig) {
|
|
|
64
64
|
chunkUSNT2KNT_cjs.__name(createDefaultEnvironment, "createDefaultEnvironment");
|
|
65
65
|
|
|
66
66
|
// src/lib/contexts/api-context.ts
|
|
67
|
-
var PowerlinesAPIContext = class _PowerlinesAPIContext extends
|
|
67
|
+
var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkS4OH7KW6_cjs.PowerlinesContext {
|
|
68
68
|
static {
|
|
69
69
|
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
|
|
70
70
|
}
|
|
@@ -127,7 +127,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkZ5JKSYRP_cjs
|
|
|
127
127
|
if (this.environments[environment.name]) {
|
|
128
128
|
context = this.environments[environment.name];
|
|
129
129
|
} else {
|
|
130
|
-
context = await
|
|
130
|
+
context = await chunkTWABN364_cjs.PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
|
|
131
131
|
}
|
|
132
132
|
if (isSetObject.isSetObject(this.config.inlineConfig)) {
|
|
133
133
|
await context.withInlineConfig(this.config.inlineConfig);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginContext } from './chunk-OL35IC6Z.js';
|
|
2
|
-
import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-
|
|
2
|
+
import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-GSGF6RL2.js';
|
|
3
3
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
4
|
import { resolvePackage } from '@stryke/fs/resolve';
|
|
5
5
|
import { isFunction } from '@stryke/type-checks/is-function';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOYLWPIBP_cjs = require('./chunk-OYLWPIBP.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var types = require('@storm-software/config-tools/types');
|
|
6
6
|
var esbuild = require('esbuild');
|
|
@@ -11,7 +11,7 @@ async function bundle(context, file, overrides = {}) {
|
|
|
11
11
|
throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
12
12
|
}
|
|
13
13
|
const result = await esbuild.build({
|
|
14
|
-
...
|
|
14
|
+
...chunkOYLWPIBP_cjs.extractESBuildConfig(context),
|
|
15
15
|
entry: [
|
|
16
16
|
path
|
|
17
17
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveEntryInputFile, resolveEntryOutput } from './chunk-
|
|
1
|
+
import { resolveEntryInputFile, resolveEntryOutput } from './chunk-DYGQQI74.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { omit } from '@stryke/helpers/omit';
|
|
4
4
|
import { joinPaths } from '@stryke/path/join-paths';
|