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,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk4NHFXDTQ_cjs = require('./chunk-4NHFXDTQ.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunkZ5JKSYRP_cjs = require('./chunk-Z5JKSYRP.cjs');
|
|
4
|
+
var chunkV2523R33_cjs = require('./chunk-V2523R33.cjs');
|
|
5
|
+
var chunkS4OH7KW6_cjs = require('./chunk-S4OH7KW6.cjs');
|
|
7
6
|
var chunkHRRI4KOM_cjs = require('./chunk-HRRI4KOM.cjs');
|
|
8
7
|
var chunkD6MI2V6R_cjs = require('./chunk-D6MI2V6R.cjs');
|
|
9
8
|
var chunkGA3RXX4R_cjs = require('./chunk-GA3RXX4R.cjs');
|
|
@@ -12,6 +11,7 @@ var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
|
|
|
12
11
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
13
12
|
var types = require('@storm-software/config-tools/types');
|
|
14
13
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
14
|
+
var unplugin = require('unplugin');
|
|
15
15
|
var core = require('@babel/core');
|
|
16
16
|
var console = require('@storm-software/config-tools/logger/console');
|
|
17
17
|
var toArray = require('@stryke/convert/to-array');
|
|
@@ -27,6 +27,7 @@ var replace = require('@stryke/path/replace');
|
|
|
27
27
|
var isError = require('@stryke/type-checks/is-error');
|
|
28
28
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
29
29
|
var isNumber = require('@stryke/type-checks/is-number');
|
|
30
|
+
var isObject = require('@stryke/type-checks/is-object');
|
|
30
31
|
var isPromise = require('@stryke/type-checks/is-promise');
|
|
31
32
|
var isSet = require('@stryke/type-checks/is-set');
|
|
32
33
|
var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
@@ -226,7 +227,9 @@ async function callHook(context, hook, options, ...args) {
|
|
|
226
227
|
if (!isFunction.isFunction(handler)) {
|
|
227
228
|
throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
|
|
228
229
|
}
|
|
229
|
-
return Promise.resolve(handler.apply(null,
|
|
230
|
+
return Promise.resolve(handler.apply(null, [
|
|
231
|
+
...args
|
|
232
|
+
]));
|
|
230
233
|
}));
|
|
231
234
|
} else {
|
|
232
235
|
for (const handler of handlers) {
|
|
@@ -234,7 +237,9 @@ async function callHook(context, hook, options, ...args) {
|
|
|
234
237
|
throw new Error(`Plugin hook handler for hook "${hook}" is not a function.`);
|
|
235
238
|
}
|
|
236
239
|
if (options?.result === "first" || options?.asNextParam === false) {
|
|
237
|
-
results.push(await Promise.resolve(handler.apply(null,
|
|
240
|
+
results.push(await Promise.resolve(handler.apply(null, [
|
|
241
|
+
...args
|
|
242
|
+
])));
|
|
238
243
|
if (options?.result === "first" && isSet.isSet(results[results.length - 1])) {
|
|
239
244
|
break;
|
|
240
245
|
}
|
|
@@ -246,12 +251,22 @@ async function callHook(context, hook, options, ...args) {
|
|
|
246
251
|
sequenceArgs[0] = isFunction.isFunction(options.asNextParam) ? await Promise.resolve(options.asNextParam(results[0])) : results[0];
|
|
247
252
|
}
|
|
248
253
|
const result = await Promise.resolve(
|
|
249
|
-
// eslint-disable-next-line ts/no-unsafe-call
|
|
250
|
-
handler.apply(null,
|
|
254
|
+
// eslint-disable-next-line ts/no-unsafe-call, no-useless-call
|
|
255
|
+
handler.apply(null, [
|
|
256
|
+
...sequenceArgs
|
|
257
|
+
])
|
|
251
258
|
);
|
|
252
|
-
|
|
253
|
-
result
|
|
254
|
-
|
|
259
|
+
if (result) {
|
|
260
|
+
if (options?.result === "last") {
|
|
261
|
+
results = [
|
|
262
|
+
result
|
|
263
|
+
];
|
|
264
|
+
} else {
|
|
265
|
+
results = [
|
|
266
|
+
defu.defu(result, results[0] ?? {})
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
255
270
|
}
|
|
256
271
|
}
|
|
257
272
|
}
|
|
@@ -319,13 +334,18 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
|
|
|
319
334
|
]);
|
|
320
335
|
}
|
|
321
336
|
chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
|
|
337
|
+
function getTsconfigDtsPath(context) {
|
|
338
|
+
const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(context.dtsPath)), filePathFns.findFileName(context.dtsPath));
|
|
339
|
+
return dtsRelativePath;
|
|
340
|
+
}
|
|
341
|
+
chunkUSNT2KNT_cjs.__name(getTsconfigDtsPath, "getTsconfigDtsPath");
|
|
322
342
|
async function resolveTsconfigChanges(context) {
|
|
323
343
|
const tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
|
|
324
344
|
const tsconfigFilePath = chunkGA3RXX4R_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
325
345
|
const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
326
346
|
tsconfigJson.compilerOptions ??= {};
|
|
327
347
|
if (context.config.output.dts !== false) {
|
|
328
|
-
const dtsRelativePath =
|
|
348
|
+
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
329
349
|
if (!tsconfigJson.include?.some((filePattern) => chunkGA3RXX4R_cjs.isIncludeMatchFound(filePattern, [
|
|
330
350
|
context.dtsPath,
|
|
331
351
|
dtsRelativePath
|
|
@@ -367,7 +387,7 @@ async function initializeTsconfig(context) {
|
|
|
367
387
|
context.tsconfig.originalTsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
368
388
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
369
389
|
context.log(types.LogLevelLabel.TRACE, "Writing updated TypeScript configuration (tsconfig.json) file to disk.");
|
|
370
|
-
await
|
|
390
|
+
await context.fs.write(tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson));
|
|
371
391
|
context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
372
392
|
}
|
|
373
393
|
chunkUSNT2KNT_cjs.__name(initializeTsconfig, "initializeTsconfig");
|
|
@@ -416,13 +436,11 @@ async function resolveTsconfig(context) {
|
|
|
416
436
|
`).join("\n")}
|
|
417
437
|
`);
|
|
418
438
|
}
|
|
419
|
-
await
|
|
439
|
+
await context.fs.write(context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
|
|
420
440
|
context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
421
441
|
if (!context.tsconfig) {
|
|
422
442
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
423
443
|
}
|
|
424
|
-
context.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
425
|
-
context.tsconfig.tsconfigJson.compilerOptions.strict = false;
|
|
426
444
|
}
|
|
427
445
|
chunkUSNT2KNT_cjs.__name(resolveTsconfig, "resolveTsconfig");
|
|
428
446
|
|
|
@@ -457,7 +475,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
457
475
|
* @returns A new instance of the Powerlines API
|
|
458
476
|
*/
|
|
459
477
|
static async from(workspaceRoot, config) {
|
|
460
|
-
const api = new _PowerlinesAPI(await
|
|
478
|
+
const api = new _PowerlinesAPI(await chunkV2523R33_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
|
|
461
479
|
api.#context.$$internal.api = api;
|
|
462
480
|
for (const plugin of api.context.config.plugins ?? []) {
|
|
463
481
|
await api.#addPlugin(plugin);
|
|
@@ -582,9 +600,13 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
582
600
|
let generatedTypes = await emitTypes(context, files);
|
|
583
601
|
context.log(types.LogLevelLabel.TRACE, `Generating TypeScript declaration file ${context.dtsPath}.`);
|
|
584
602
|
const directives = [];
|
|
603
|
+
const asNextParam = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((previousResult) => isObject.isObject(previousResult) ? previousResult.code : previousResult, "asNextParam");
|
|
585
604
|
let result = await this.callHook("generateTypes", {
|
|
586
605
|
environment: context,
|
|
587
|
-
|
|
606
|
+
sequential: true,
|
|
607
|
+
order: "pre",
|
|
608
|
+
result: "merge",
|
|
609
|
+
asNextParam
|
|
588
610
|
}, generatedTypes);
|
|
589
611
|
if (result) {
|
|
590
612
|
if (isSetObject.isSetObject(result)) {
|
|
@@ -598,7 +620,10 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
598
620
|
}
|
|
599
621
|
result = await this.callHook("generateTypes", {
|
|
600
622
|
environment: context,
|
|
601
|
-
|
|
623
|
+
sequential: true,
|
|
624
|
+
order: "normal",
|
|
625
|
+
result: "merge",
|
|
626
|
+
asNextParam
|
|
602
627
|
}, generatedTypes);
|
|
603
628
|
if (result) {
|
|
604
629
|
if (isSetObject.isSetObject(result)) {
|
|
@@ -612,7 +637,10 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
612
637
|
}
|
|
613
638
|
result = await this.callHook("generateTypes", {
|
|
614
639
|
environment: context,
|
|
615
|
-
|
|
640
|
+
sequential: true,
|
|
641
|
+
order: "post",
|
|
642
|
+
result: "merge",
|
|
643
|
+
asNextParam
|
|
616
644
|
}, generatedTypes);
|
|
617
645
|
if (result) {
|
|
618
646
|
if (isSetObject.isSetObject(result)) {
|
|
@@ -624,15 +652,24 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
624
652
|
generatedTypes = result;
|
|
625
653
|
}
|
|
626
654
|
}
|
|
627
|
-
|
|
655
|
+
if (generatedTypes?.trim() || directives.length > 0) {
|
|
656
|
+
await context.fs.write(context.dtsPath, `${directives ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
628
657
|
|
|
629
658
|
` : ""}${chunk4NHFXDTQ_cjs.getFileHeader(context, {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
659
|
+
directive: null,
|
|
660
|
+
prettierIgnore: false
|
|
661
|
+
})}
|
|
633
662
|
|
|
634
663
|
${formatTypes(generatedTypes)}
|
|
635
664
|
`);
|
|
665
|
+
} else {
|
|
666
|
+
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
667
|
+
if (context.tsconfig.tsconfigJson.include && chunkGA3RXX4R_cjs.isIncludeMatchFound(dtsRelativePath, context.tsconfig.tsconfigJson.include)) {
|
|
668
|
+
const normalizedDtsRelativePath = dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath;
|
|
669
|
+
context.tsconfig.tsconfigJson.include = context.tsconfig.tsconfigJson.include.filter((includeValue) => includeValue?.toString() !== normalizedDtsRelativePath);
|
|
670
|
+
await context.fs.write(context.tsconfig.tsconfigFilePath, JSON.stringify(context.tsconfig.tsconfigJson, null, 2));
|
|
671
|
+
}
|
|
672
|
+
}
|
|
636
673
|
}
|
|
637
674
|
context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
638
675
|
if (!context.tsconfig) {
|
|
@@ -669,7 +706,7 @@ ${formatTypes(generatedTypes)}
|
|
|
669
706
|
for (const file of files) {
|
|
670
707
|
context.log(types.LogLevelLabel.TRACE, `Adding template file: ${file}`);
|
|
671
708
|
const template = Handlebars__default.default.compile(file);
|
|
672
|
-
await
|
|
709
|
+
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
673
710
|
}
|
|
674
711
|
await this.callHook("new", {
|
|
675
712
|
environment: context,
|
|
@@ -680,14 +717,14 @@ ${formatTypes(generatedTypes)}
|
|
|
680
717
|
for (const file of files2) {
|
|
681
718
|
context.log(types.LogLevelLabel.TRACE, `Adding application template file: ${file}`);
|
|
682
719
|
const template = Handlebars__default.default.compile(file);
|
|
683
|
-
await
|
|
720
|
+
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
684
721
|
}
|
|
685
722
|
} else {
|
|
686
723
|
const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.powerlinesPath, "files/library/**/*.hbs"));
|
|
687
724
|
for (const file of files2) {
|
|
688
725
|
context.log(types.LogLevelLabel.TRACE, `Adding library template file: ${file}`);
|
|
689
726
|
const template = Handlebars__default.default.compile(file);
|
|
690
|
-
await
|
|
727
|
+
await context.fs.write(joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
691
728
|
}
|
|
692
729
|
}
|
|
693
730
|
await this.callHook("new", {
|
|
@@ -942,11 +979,11 @@ ${formatTypes(generatedTypes)}
|
|
|
942
979
|
if (isPromise.isPromiseLike(config)) {
|
|
943
980
|
awaited = await Promise.resolve(config);
|
|
944
981
|
}
|
|
945
|
-
if (!
|
|
982
|
+
if (!chunkS4OH7KW6_cjs.isPluginConfig(awaited)) {
|
|
946
983
|
throw new Error(`Invalid plugin specified in the configuration - ${JSON.stringify(awaited)}. Please ensure the value is a plugin name, an object with the \`plugin\` and \`props\` properties, or an instance of \`Plugin\`.`);
|
|
947
984
|
}
|
|
948
985
|
let plugin;
|
|
949
|
-
if (
|
|
986
|
+
if (chunkS4OH7KW6_cjs.isPlugin(awaited)) {
|
|
950
987
|
plugin = awaited;
|
|
951
988
|
} else if (isFunction.isFunction(awaited)) {
|
|
952
989
|
plugin = await Promise.resolve(awaited());
|
|
@@ -957,10 +994,10 @@ ${formatTypes(generatedTypes)}
|
|
|
957
994
|
} else {
|
|
958
995
|
plugin = resolved;
|
|
959
996
|
}
|
|
960
|
-
} else if (
|
|
997
|
+
} else if (chunkS4OH7KW6_cjs.isPluginConfigTuple(awaited) || chunkS4OH7KW6_cjs.isPluginConfigObject(awaited)) {
|
|
961
998
|
let pluginConfig;
|
|
962
999
|
let pluginOptions;
|
|
963
|
-
if (
|
|
1000
|
+
if (chunkS4OH7KW6_cjs.isPluginConfigTuple(awaited)) {
|
|
964
1001
|
pluginConfig = awaited[0];
|
|
965
1002
|
pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
|
|
966
1003
|
} else {
|
|
@@ -976,17 +1013,17 @@ ${formatTypes(generatedTypes)}
|
|
|
976
1013
|
}
|
|
977
1014
|
} else if (isFunction.isFunction(pluginConfig)) {
|
|
978
1015
|
plugin = await Promise.resolve(pluginConfig(pluginOptions));
|
|
979
|
-
} else if (
|
|
1016
|
+
} else if (chunkS4OH7KW6_cjs.isPlugin(pluginConfig)) {
|
|
980
1017
|
plugin = pluginConfig;
|
|
981
1018
|
}
|
|
982
1019
|
}
|
|
983
1020
|
if (!plugin) {
|
|
984
1021
|
throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
|
|
985
1022
|
}
|
|
986
|
-
if (!
|
|
1023
|
+
if (!chunkS4OH7KW6_cjs.isPlugin(plugin)) {
|
|
987
1024
|
throw new Error(`The plugin option ${JSON.stringify(plugin)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
988
1025
|
}
|
|
989
|
-
if (
|
|
1026
|
+
if (chunkS4OH7KW6_cjs.checkDedupe(plugin, this.context.plugins)) {
|
|
990
1027
|
this.context.log(types.LogLevelLabel.TRACE, `Duplicate ${chalk3__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
991
1028
|
return null;
|
|
992
1029
|
}
|
|
@@ -1057,8 +1094,8 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1057
1094
|
let api;
|
|
1058
1095
|
async function buildStart() {
|
|
1059
1096
|
log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
1060
|
-
|
|
1061
|
-
api
|
|
1097
|
+
api = await PowerlinesAPI.from(getWorkspaceRoot.getWorkspaceRoot(process.cwd()), userConfig);
|
|
1098
|
+
unplugin.setParseImpl(api.context.parse);
|
|
1062
1099
|
log(types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
|
|
1063
1100
|
await api.prepare({
|
|
1064
1101
|
command: "build"
|
|
@@ -6,9 +6,11 @@ import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
|
6
6
|
import { findFileName } from '@stryke/path/file-path-fns';
|
|
7
7
|
import { replaceExtension } from '@stryke/path/replace';
|
|
8
8
|
import { isString } from '@stryke/type-checks/is-string';
|
|
9
|
+
import { setParseImpl } from 'unplugin';
|
|
9
10
|
|
|
10
|
-
function createUnplugin(context
|
|
11
|
+
function createUnplugin(context) {
|
|
11
12
|
const ctx = context;
|
|
13
|
+
setParseImpl(ctx.parse);
|
|
12
14
|
return () => {
|
|
13
15
|
const log = extendLog(ctx.log, "unplugin");
|
|
14
16
|
log(LogLevelLabel.DEBUG, "Initializing Unplugin");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bundle } from './chunk-
|
|
1
|
+
import { bundle } from './chunk-GLWPZDAR.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
4
4
|
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQF3UTBJE_cjs = require('./chunk-QF3UTBJE.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var omit = require('@stryke/helpers/omit');
|
|
6
6
|
var joinPaths = require('@stryke/path/join-paths');
|
|
@@ -31,7 +31,7 @@ function resolveESBuildEntry(context, entryPoints = []) {
|
|
|
31
31
|
if (isString.isString(entry)) {
|
|
32
32
|
ret[replace.replaceExtension(replace.replacePath(entry, context.config.sourceRoot || context.config.projectRoot))] = replace.replacePath(entry, context.config.sourceRoot || context.config.projectRoot);
|
|
33
33
|
} else {
|
|
34
|
-
ret[entry.output ||
|
|
34
|
+
ret[entry.output || chunkQF3UTBJE_cjs.resolveEntryOutput(context, entry.input || entry)] = chunkQF3UTBJE_cjs.resolveEntryInputFile(context, entry.input || entry);
|
|
35
35
|
}
|
|
36
36
|
return ret;
|
|
37
37
|
}, {});
|
|
@@ -8,9 +8,11 @@ var types = require('@storm-software/config-tools/types');
|
|
|
8
8
|
var filePathFns = require('@stryke/path/file-path-fns');
|
|
9
9
|
var replace = require('@stryke/path/replace');
|
|
10
10
|
var isString = require('@stryke/type-checks/is-string');
|
|
11
|
+
var unplugin = require('unplugin');
|
|
11
12
|
|
|
12
|
-
function createUnplugin(context
|
|
13
|
+
function createUnplugin(context) {
|
|
13
14
|
const ctx = context;
|
|
15
|
+
unplugin.setParseImpl(ctx.parse);
|
|
14
16
|
return () => {
|
|
15
17
|
const log = chunkJA4HSQRN_cjs.extendLog(ctx.log, "unplugin");
|
|
16
18
|
log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkYXJJCE6V_cjs = require('./chunk-YXJJCE6V.cjs');
|
|
3
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
5
|
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
5
6
|
var toArray = require('@stryke/convert/to-array');
|
|
@@ -13,15 +14,6 @@ var replace = require('@stryke/path/replace');
|
|
|
13
14
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
14
15
|
var isString = require('@stryke/type-checks/is-string');
|
|
15
16
|
|
|
16
|
-
function replacePathTokens(context, path) {
|
|
17
|
-
if (!path) {
|
|
18
|
-
return path;
|
|
19
|
-
}
|
|
20
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).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}", replace.replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replace.replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replace.replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
21
|
-
}
|
|
22
|
-
chunkUSNT2KNT_cjs.__name(replacePathTokens, "replacePathTokens");
|
|
23
|
-
|
|
24
|
-
// src/lib/entry.ts
|
|
25
17
|
function resolveEntryInputFile(context, typeDefinition) {
|
|
26
18
|
return replace.replacePath(typeDefinition.file, joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot));
|
|
27
19
|
}
|
|
@@ -64,7 +56,7 @@ async function resolveEntries(context, typeDefinitions) {
|
|
|
64
56
|
}
|
|
65
57
|
chunkUSNT2KNT_cjs.__name(resolveEntries, "resolveEntries");
|
|
66
58
|
function resolveEntriesSync(context, typeDefinitions) {
|
|
67
|
-
return typeDefinitions.map((entry) => isString.isString(entry) ? replacePathTokens(context, entry) : replacePathTokens(context, entry.file)).map((typeDefinition) => {
|
|
59
|
+
return typeDefinitions.map((entry) => isString.isString(entry) ? chunkYXJJCE6V_cjs.replacePathTokens(context, entry) : chunkYXJJCE6V_cjs.replacePathTokens(context, entry.file)).map((typeDefinition) => {
|
|
68
60
|
const parsed = parseTypeDefinition.parseTypeDefinition(typeDefinition);
|
|
69
61
|
const filePath = append.appendPath(parsed.file, context.config.projectRoot);
|
|
70
62
|
if (isFile.isFile(filePath)) {
|
|
@@ -108,7 +100,6 @@ function getUniqueEntries(entries = []) {
|
|
|
108
100
|
chunkUSNT2KNT_cjs.__name(getUniqueEntries, "getUniqueEntries");
|
|
109
101
|
|
|
110
102
|
exports.getUniqueEntries = getUniqueEntries;
|
|
111
|
-
exports.replacePathTokens = replacePathTokens;
|
|
112
103
|
exports.resolveEntries = resolveEntries;
|
|
113
104
|
exports.resolveEntriesSync = resolveEntriesSync;
|
|
114
105
|
exports.resolveEntry = resolveEntry;
|
|
@@ -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 omit = require('@stryke/helpers/omit');
|
|
6
6
|
var joinPaths = require('@stryke/path/join-paths');
|
|
@@ -73,7 +73,7 @@ function extractViteConfig(context) {
|
|
|
73
73
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
74
74
|
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
75
75
|
},
|
|
76
|
-
esbuild:
|
|
76
|
+
esbuild: chunkOYLWPIBP_cjs.extractESBuildConfig(context),
|
|
77
77
|
logLevel: context.config.logLevel ?? void 0,
|
|
78
78
|
envDir: context.config.projectRoot
|
|
79
79
|
}, DEFAULT_VITE_CONFIG);
|