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
|
@@ -15,12 +15,15 @@ import { RolldownOptions, RolldownOutput } from 'rolldown';
|
|
|
15
15
|
import { RollupOptions, OutputOptions } from 'rollup';
|
|
16
16
|
import { Configuration } from 'webpack';
|
|
17
17
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
18
|
+
import { FetchRequestOptions } from '@stryke/http/fetch';
|
|
18
19
|
import { PackageJson } from '@stryke/types/package-json';
|
|
19
20
|
import { Worker } from 'jest-worker';
|
|
20
21
|
import { Jiti } from 'jiti';
|
|
21
22
|
import MagicString, { SourceMap } from 'magic-string';
|
|
23
|
+
import { ParserOptions, ParseResult } from 'oxc-parser';
|
|
22
24
|
import { Range } from 'semver';
|
|
23
25
|
import { Project } from 'ts-morph';
|
|
26
|
+
import { RequestInfo, Response } from 'undici';
|
|
24
27
|
import { TransformResult as TransformResult$1, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginMessage, UnpluginBuildContext } from 'unplugin';
|
|
25
28
|
import { V as VirtualFileSystemInterface, R as ResolveOptions, a as VirtualFile, b as StoragePort, c as StoragePreset } from './fs-Dg-aTfiN.js';
|
|
26
29
|
import { ArrayValues } from '@stryke/types/array';
|
|
@@ -218,7 +221,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> &
|
|
|
218
221
|
/**
|
|
219
222
|
* The resolved options for the Powerlines project configuration.
|
|
220
223
|
*/
|
|
221
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
|
|
224
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework" | "sourceRoot"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework" | "sourceRoot">> & {
|
|
222
225
|
/**
|
|
223
226
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
224
227
|
*/
|
|
@@ -608,6 +611,18 @@ interface InitContextOptions {
|
|
|
608
611
|
*/
|
|
609
612
|
isHighPriority: boolean;
|
|
610
613
|
}
|
|
614
|
+
interface FetchOptions extends FetchRequestOptions {
|
|
615
|
+
/**
|
|
616
|
+
* An indicator specifying that the request should bypass any caching
|
|
617
|
+
*/
|
|
618
|
+
skipCache?: boolean;
|
|
619
|
+
}
|
|
620
|
+
interface ParseOptions extends ParserOptions {
|
|
621
|
+
/**
|
|
622
|
+
* When true this allows return statements to be outside functions to e.g. support parsing CommonJS code.
|
|
623
|
+
*/
|
|
624
|
+
allowReturnOutsideFunction?: boolean;
|
|
625
|
+
}
|
|
611
626
|
/**
|
|
612
627
|
* The unresolved Powerlines context.
|
|
613
628
|
*
|
|
@@ -624,6 +639,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
624
639
|
*/
|
|
625
640
|
config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
|
|
626
641
|
projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
|
|
642
|
+
sourceRoot: NonUndefined<TResolvedConfig["userConfig"]["sourceRoot"]>;
|
|
627
643
|
output: TResolvedConfig["output"];
|
|
628
644
|
};
|
|
629
645
|
/**
|
|
@@ -743,6 +759,44 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
743
759
|
* This instance is created lazily on first access.
|
|
744
760
|
*/
|
|
745
761
|
program: Project;
|
|
762
|
+
/**
|
|
763
|
+
* A function to perform HTTP fetch requests
|
|
764
|
+
*
|
|
765
|
+
* @remarks
|
|
766
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
767
|
+
*
|
|
768
|
+
* @example
|
|
769
|
+
* ```ts
|
|
770
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
771
|
+
* const data = await response.json();
|
|
772
|
+
* ```
|
|
773
|
+
*
|
|
774
|
+
* @see https://github.com/nodejs/undici
|
|
775
|
+
*
|
|
776
|
+
* @param input - The URL to fetch.
|
|
777
|
+
* @param options - The fetch request options.
|
|
778
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
779
|
+
*/
|
|
780
|
+
fetch: (input: RequestInfo, options?: FetchOptions) => Promise<Response>;
|
|
781
|
+
/**
|
|
782
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
783
|
+
*
|
|
784
|
+
* @remarks
|
|
785
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
786
|
+
*
|
|
787
|
+
* @example
|
|
788
|
+
* ```ts
|
|
789
|
+
* const ast = context.parse("const x: number = 42;");
|
|
790
|
+
* ```
|
|
791
|
+
*
|
|
792
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
793
|
+
* @see https://github.com/oxc/oxc
|
|
794
|
+
*
|
|
795
|
+
* @param code - The source code to parse.
|
|
796
|
+
* @param options - The options to pass to the parser.
|
|
797
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
798
|
+
*/
|
|
799
|
+
parse: (code: string, options?: ParseOptions) => Promise<ParseResult>;
|
|
746
800
|
/**
|
|
747
801
|
* A helper function to resolve modules using the Jiti resolver
|
|
748
802
|
*
|
|
@@ -938,7 +992,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
938
992
|
*/
|
|
939
993
|
logger: LogFn;
|
|
940
994
|
}
|
|
941
|
-
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> =
|
|
995
|
+
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = UnpluginBuildContext & PluginContext<TResolvedConfig>;
|
|
942
996
|
|
|
943
997
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
944
998
|
/**
|
|
@@ -965,6 +1019,22 @@ type PluginConfigObject<TContext extends PluginContext = PluginContext, TOptions
|
|
|
965
1019
|
*/
|
|
966
1020
|
type PluginConfig<TContext extends PluginContext = PluginContext> = string | PluginFactory<TContext, void> | Plugin<TContext> | Promise<Plugin<TContext>> | PluginConfigTuple<TContext> | PluginConfigObject<TContext>;
|
|
967
1021
|
type ProjectType = "application" | "library";
|
|
1022
|
+
interface DeployConfig {
|
|
1023
|
+
/**
|
|
1024
|
+
* The deployment variant being used by the Powerlines engine.
|
|
1025
|
+
*
|
|
1026
|
+
* @example
|
|
1027
|
+
* ```ts
|
|
1028
|
+
* export default defineConfig({
|
|
1029
|
+
* deploy: {
|
|
1030
|
+
* variant: "cloudflare"
|
|
1031
|
+
* }
|
|
1032
|
+
* });
|
|
1033
|
+
*
|
|
1034
|
+
* ```
|
|
1035
|
+
*/
|
|
1036
|
+
variant?: string;
|
|
1037
|
+
}
|
|
968
1038
|
interface OutputConfig {
|
|
969
1039
|
/**
|
|
970
1040
|
* The path to output the final compiled files to
|
|
@@ -1087,7 +1157,7 @@ interface BaseConfig {
|
|
|
1087
1157
|
* @remarks
|
|
1088
1158
|
* If set to `false`, the deployment will be disabled.
|
|
1089
1159
|
*/
|
|
1090
|
-
deploy?:
|
|
1160
|
+
deploy?: DeployConfig | false;
|
|
1091
1161
|
/**
|
|
1092
1162
|
* The path to the tsconfig file to be used by the compiler
|
|
1093
1163
|
*
|
|
@@ -1214,7 +1284,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
1214
1284
|
*/
|
|
1215
1285
|
framework?: string;
|
|
1216
1286
|
}
|
|
1217
|
-
|
|
1287
|
+
interface UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> extends Omit<CommonUserConfig, "build"> {
|
|
1218
1288
|
/**
|
|
1219
1289
|
* Configuration provided to build processes
|
|
1220
1290
|
*
|
|
@@ -1234,7 +1304,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
1234
1304
|
*/
|
|
1235
1305
|
override?: Partial<TBuildResolvedConfig>;
|
|
1236
1306
|
};
|
|
1237
|
-
}
|
|
1307
|
+
}
|
|
1238
1308
|
type WebpackUserConfig = UserConfig<WebpackBuildConfig, WebpackResolvedBuildConfig, "webpack">;
|
|
1239
1309
|
type RspackUserConfig = UserConfig<RspackBuildConfig, RspackResolvedBuildConfig, "rspack">;
|
|
1240
1310
|
type RollupUserConfig = UserConfig<RollupBuildConfig, RollupResolvedBuildConfig, "rollup">;
|
|
@@ -1314,4 +1384,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineCon
|
|
|
1314
1384
|
command: "deploy";
|
|
1315
1385
|
};
|
|
1316
1386
|
|
|
1317
|
-
export type { APIContext as A, BuildPlugin as B, Context as C,
|
|
1387
|
+
export type { APIContext as A, BuildPlugin as B, Context as C, CleanInlineConfig as D, ESBuildResolvedBuildConfig as E, FetchOptions as F, BuildInlineConfig as G, HooksList as H, InitialUserConfig as I, LintInlineConfig as J, DocsInlineConfig as K, LogFn as L, MetaInfo as M, NewInlineConfig as N, DeployInlineConfig as O, PowerlinesCommand as P, ResolvedEntryTypeDefinition as R, SelectHooksOptions as S, TsupBuildConfig as T, UnbuildBuildConfig as U, ViteResolvedBuildConfig as V, WorkspaceConfig as W, ParsedUserConfig as a, RolldownResolvedBuildConfig as b, RollupResolvedBuildConfig as c, TsupResolvedBuildConfig as d, UnbuildResolvedBuildConfig as e, ResolvedConfig as f, EnvironmentContext as g, Plugin as h, PluginContext as i, EnvironmentResolvedConfig as j, InitContextOptions as k, EnvironmentContextPlugin as l, HookKeys as m, InferHookHandler as n, Resolver as o, ParseOptions as p, TransformResult as q, InferHookParameters as r, InferHookReturnType as s, UnpluginBuildVariant as t, InferResolvedConfig as u, InferUnpluginVariant as v, InferUserConfig as w, SourceFile as x, WorkerProcess as y, PrepareInlineConfig as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Jiti } from 'jiti';
|
|
2
|
-
import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-
|
|
2
|
+
import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-D2dTFLlQ.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -17,11 +17,14 @@ import 'rolldown';
|
|
|
17
17
|
import 'rollup';
|
|
18
18
|
import 'webpack';
|
|
19
19
|
import '@stryke/env/get-env-paths';
|
|
20
|
+
import '@stryke/http/fetch';
|
|
20
21
|
import '@stryke/types/package-json';
|
|
21
22
|
import 'jest-worker';
|
|
22
23
|
import 'magic-string';
|
|
24
|
+
import 'oxc-parser';
|
|
23
25
|
import 'semver';
|
|
24
26
|
import 'ts-morph';
|
|
27
|
+
import 'undici';
|
|
25
28
|
import 'unplugin';
|
|
26
29
|
import './fs-Dg-aTfiN.cjs';
|
|
27
30
|
import '@stryke/fs/resolve';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Jiti } from 'jiti';
|
|
2
|
-
import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-
|
|
2
|
+
import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-Dzk6j2mr.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -17,11 +17,14 @@ import 'rolldown';
|
|
|
17
17
|
import 'rollup';
|
|
18
18
|
import 'webpack';
|
|
19
19
|
import '@stryke/env/get-env-paths';
|
|
20
|
+
import '@stryke/http/fetch';
|
|
20
21
|
import '@stryke/types/package-json';
|
|
21
22
|
import 'jest-worker';
|
|
22
23
|
import 'magic-string';
|
|
24
|
+
import 'oxc-parser';
|
|
23
25
|
import 'semver';
|
|
24
26
|
import 'ts-morph';
|
|
27
|
+
import 'undici';
|
|
25
28
|
import 'unplugin';
|
|
26
29
|
import './fs-Dg-aTfiN.js';
|
|
27
30
|
import '@stryke/fs/resolve';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkV2523R33_cjs = require('../chunk-V2523R33.cjs');
|
|
4
|
+
require('../chunk-TWABN364.cjs');
|
|
5
5
|
require('../chunk-PIFNMTKN.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-S4OH7KW6.cjs');
|
|
7
7
|
require('../chunk-HRRI4KOM.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-Z6BSDYUR.cjs');
|
|
9
9
|
require('../chunk-6OYSDQXE.cjs');
|
|
10
10
|
require('../chunk-XUYQYUWZ.cjs');
|
|
11
11
|
require('../chunk-XLHFUATD.cjs');
|
|
@@ -14,12 +14,13 @@ require('../chunk-D6MI2V6R.cjs');
|
|
|
14
14
|
require('../chunk-GA3RXX4R.cjs');
|
|
15
15
|
require('../chunk-K3NBD5LL.cjs');
|
|
16
16
|
require('../chunk-JA4HSQRN.cjs');
|
|
17
|
-
require('../chunk-
|
|
17
|
+
require('../chunk-QF3UTBJE.cjs');
|
|
18
|
+
require('../chunk-YXJJCE6V.cjs');
|
|
18
19
|
require('../chunk-USNT2KNT.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
Object.defineProperty(exports, "PowerlinesAPIContext", {
|
|
23
24
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkV2523R33_cjs.PowerlinesAPIContext; }
|
|
25
26
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ResolvedConfig, A as APIContext, I as InitialUserConfig, g as EnvironmentContext, L as LogFn, h as Plugin, i as PluginContext, W as WorkspaceConfig, j as EnvironmentResolvedConfig, k as InitContextOptions } from '../config-
|
|
1
|
+
import { f as ResolvedConfig, A as APIContext, I as InitialUserConfig, g as EnvironmentContext, L as LogFn, h as Plugin, i as PluginContext, W as WorkspaceConfig, j as EnvironmentResolvedConfig, k as InitContextOptions } from '../config-D2dTFLlQ.cjs';
|
|
2
2
|
import { PowerlinesContext } from './context.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
@@ -17,12 +17,15 @@ import 'rolldown';
|
|
|
17
17
|
import 'rollup';
|
|
18
18
|
import 'webpack';
|
|
19
19
|
import '@stryke/env/get-env-paths';
|
|
20
|
+
import '@stryke/http/fetch';
|
|
20
21
|
import '@stryke/types/package-json';
|
|
21
22
|
import 'jest-worker';
|
|
22
23
|
import 'jiti';
|
|
23
24
|
import 'magic-string';
|
|
25
|
+
import 'oxc-parser';
|
|
24
26
|
import 'semver';
|
|
25
27
|
import 'ts-morph';
|
|
28
|
+
import 'undici';
|
|
26
29
|
import 'unplugin';
|
|
27
30
|
import '../fs-Dg-aTfiN.cjs';
|
|
28
31
|
import '@stryke/fs/resolve';
|
|
@@ -30,8 +33,9 @@ import '@stryke/types/array';
|
|
|
30
33
|
import '../tsconfig-Bz-CiFqD.cjs';
|
|
31
34
|
import '@stryke/types/tsconfig';
|
|
32
35
|
import 'typescript';
|
|
33
|
-
import '
|
|
34
|
-
import '../
|
|
36
|
+
import 'flat-cache';
|
|
37
|
+
import '../internal-DC9vYMIn.cjs';
|
|
38
|
+
import '../api-Wawenasn.cjs';
|
|
35
39
|
|
|
36
40
|
declare class PowerlinesAPIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements APIContext<TResolvedConfig> {
|
|
37
41
|
#private;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ResolvedConfig, A as APIContext, I as InitialUserConfig, g as EnvironmentContext, L as LogFn, h as Plugin, i as PluginContext, W as WorkspaceConfig, j as EnvironmentResolvedConfig, k as InitContextOptions } from '../config-
|
|
1
|
+
import { f as ResolvedConfig, A as APIContext, I as InitialUserConfig, g as EnvironmentContext, L as LogFn, h as Plugin, i as PluginContext, W as WorkspaceConfig, j as EnvironmentResolvedConfig, k as InitContextOptions } from '../config-Dzk6j2mr.js';
|
|
2
2
|
import { PowerlinesContext } from './context.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
@@ -17,12 +17,15 @@ import 'rolldown';
|
|
|
17
17
|
import 'rollup';
|
|
18
18
|
import 'webpack';
|
|
19
19
|
import '@stryke/env/get-env-paths';
|
|
20
|
+
import '@stryke/http/fetch';
|
|
20
21
|
import '@stryke/types/package-json';
|
|
21
22
|
import 'jest-worker';
|
|
22
23
|
import 'jiti';
|
|
23
24
|
import 'magic-string';
|
|
25
|
+
import 'oxc-parser';
|
|
24
26
|
import 'semver';
|
|
25
27
|
import 'ts-morph';
|
|
28
|
+
import 'undici';
|
|
26
29
|
import 'unplugin';
|
|
27
30
|
import '../fs-Dg-aTfiN.js';
|
|
28
31
|
import '@stryke/fs/resolve';
|
|
@@ -30,8 +33,9 @@ import '@stryke/types/array';
|
|
|
30
33
|
import '../tsconfig-Bz-CiFqD.js';
|
|
31
34
|
import '@stryke/types/tsconfig';
|
|
32
35
|
import 'typescript';
|
|
33
|
-
import '
|
|
34
|
-
import '../
|
|
36
|
+
import 'flat-cache';
|
|
37
|
+
import '../internal-Cgp0NF-t.js';
|
|
38
|
+
import '../api-BIHEKpyq.js';
|
|
35
39
|
|
|
36
40
|
declare class PowerlinesAPIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements APIContext<TResolvedConfig> {
|
|
37
41
|
#private;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { PowerlinesAPIContext } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { PowerlinesAPIContext } from '../chunk-GD7KTLPU.js';
|
|
2
|
+
import '../chunk-VKFXVPY6.js';
|
|
3
3
|
import '../chunk-OL35IC6Z.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-GSGF6RL2.js';
|
|
5
5
|
import '../chunk-OEF6EHQV.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-KG4HFVJU.js';
|
|
7
7
|
import '../chunk-L56XA427.js';
|
|
8
8
|
import '../chunk-ONETLSPO.js';
|
|
9
9
|
import '../chunk-VHCBD2IS.js';
|
|
@@ -12,5 +12,6 @@ import '../chunk-4W6WV35V.js';
|
|
|
12
12
|
import '../chunk-ZGMEHSNN.js';
|
|
13
13
|
import '../chunk-XBM7FHNK.js';
|
|
14
14
|
import '../chunk-ENRLU4UR.js';
|
|
15
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-DYGQQI74.js';
|
|
16
|
+
import '../chunk-T35JQHYE.js';
|
|
16
17
|
import '../chunk-SHUYVCID.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkS4OH7KW6_cjs = require('../chunk-S4OH7KW6.cjs');
|
|
4
4
|
require('../chunk-HRRI4KOM.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-Z6BSDYUR.cjs');
|
|
6
6
|
require('../chunk-6OYSDQXE.cjs');
|
|
7
7
|
require('../chunk-XUYQYUWZ.cjs');
|
|
8
8
|
require('../chunk-XLHFUATD.cjs');
|
|
@@ -11,12 +11,13 @@ require('../chunk-D6MI2V6R.cjs');
|
|
|
11
11
|
require('../chunk-GA3RXX4R.cjs');
|
|
12
12
|
require('../chunk-K3NBD5LL.cjs');
|
|
13
13
|
require('../chunk-JA4HSQRN.cjs');
|
|
14
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-QF3UTBJE.cjs');
|
|
15
|
+
require('../chunk-YXJJCE6V.cjs');
|
|
15
16
|
require('../chunk-USNT2KNT.cjs');
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
Object.defineProperty(exports, "PowerlinesContext", {
|
|
20
21
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkS4OH7KW6_cjs.PowerlinesContext; }
|
|
22
23
|
});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
2
2
|
import { PackageJson } from '@stryke/types/package-json';
|
|
3
|
+
import { FlatCache } from 'flat-cache';
|
|
4
|
+
import { ParseResult } from 'oxc-parser';
|
|
3
5
|
import { Range } from 'semver';
|
|
4
6
|
import { Project } from 'ts-morph';
|
|
7
|
+
import { RequestInfo, Response } from 'undici';
|
|
5
8
|
import { ExternalIdResult, UnpluginMessage } from 'unplugin';
|
|
6
|
-
import { f as ResolvedConfig, C as Context, I as InitialUserConfig, M as MetaInfo, o as Resolver, R as ResolvedEntryTypeDefinition, L as LogFn, W as WorkspaceConfig, p as TransformResult, k as InitContextOptions } from '../config-
|
|
9
|
+
import { f as ResolvedConfig, C as Context, I as InitialUserConfig, M as MetaInfo, o as Resolver, R as ResolvedEntryTypeDefinition, L as LogFn, W as WorkspaceConfig, F as FetchOptions, p as ParseOptions, q as TransformResult, k as InitContextOptions } from '../config-D2dTFLlQ.cjs';
|
|
7
10
|
import { V as VirtualFileSystemInterface, R as ResolveOptions, a as VirtualFile, W as WriteOptions } from '../fs-Dg-aTfiN.cjs';
|
|
8
|
-
import { a as UNSAFE_ContextInternal } from '../internal-
|
|
11
|
+
import { a as UNSAFE_ContextInternal } from '../internal-DC9vYMIn.cjs';
|
|
9
12
|
import { P as ParsedTypeScriptConfig } from '../tsconfig-Bz-CiFqD.cjs';
|
|
10
13
|
import '@storm-software/build-tools/types';
|
|
11
14
|
import '@storm-software/config-tools/types';
|
|
@@ -23,12 +26,13 @@ import 'esbuild';
|
|
|
23
26
|
import 'rolldown';
|
|
24
27
|
import 'rollup';
|
|
25
28
|
import 'webpack';
|
|
29
|
+
import '@stryke/http/fetch';
|
|
26
30
|
import 'jest-worker';
|
|
27
31
|
import 'jiti';
|
|
28
32
|
import 'magic-string';
|
|
29
33
|
import '@stryke/types/array';
|
|
30
34
|
import '@stryke/fs/resolve';
|
|
31
|
-
import '../api-
|
|
35
|
+
import '../api-Wawenasn.cjs';
|
|
32
36
|
import '@stryke/types/tsconfig';
|
|
33
37
|
import 'typescript';
|
|
34
38
|
|
|
@@ -70,6 +74,10 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
70
74
|
* The module resolver for the project
|
|
71
75
|
*/
|
|
72
76
|
resolver: Resolver;
|
|
77
|
+
/**
|
|
78
|
+
* The resolved configuration options
|
|
79
|
+
*/
|
|
80
|
+
private resolvePatterns;
|
|
73
81
|
/**
|
|
74
82
|
* Internal context fields and methods
|
|
75
83
|
*
|
|
@@ -157,6 +165,52 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
157
165
|
* This instance is created lazily on first access.
|
|
158
166
|
*/
|
|
159
167
|
get program(): Project;
|
|
168
|
+
/**
|
|
169
|
+
* Gets the parser cache.
|
|
170
|
+
*/
|
|
171
|
+
protected get parserCache(): FlatCache;
|
|
172
|
+
/**
|
|
173
|
+
* Gets the request cache.
|
|
174
|
+
*/
|
|
175
|
+
protected get requestCache(): FlatCache;
|
|
176
|
+
/**
|
|
177
|
+
* A function to perform HTTP fetch requests
|
|
178
|
+
*
|
|
179
|
+
* @remarks
|
|
180
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
185
|
+
* const data = await response.json();
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @see https://github.com/nodejs/undici
|
|
189
|
+
*
|
|
190
|
+
* @param input - The URL to fetch.
|
|
191
|
+
* @param options - The fetch request options.
|
|
192
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
193
|
+
*/
|
|
194
|
+
fetch(input: RequestInfo, options?: FetchOptions): Promise<Response>;
|
|
195
|
+
/**
|
|
196
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
197
|
+
*
|
|
198
|
+
* @remarks
|
|
199
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* const ast = context.parse("const x: number = 42;");
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
207
|
+
* @see https://github.com/oxc/oxc
|
|
208
|
+
*
|
|
209
|
+
* @param code - The source code to parse.
|
|
210
|
+
* @param options - The options to pass to the parser.
|
|
211
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
212
|
+
*/
|
|
213
|
+
parse(code: string, options?: ParseOptions): Promise<ParseResult>;
|
|
160
214
|
/**
|
|
161
215
|
* A helper function to resolve modules in the Virtual File System
|
|
162
216
|
*
|
|
@@ -272,6 +326,13 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
272
326
|
* @returns A logger function
|
|
273
327
|
*/
|
|
274
328
|
extendLog(name: string): LogFn;
|
|
329
|
+
/**
|
|
330
|
+
* Generates a checksum representing the current context state
|
|
331
|
+
*
|
|
332
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
333
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
334
|
+
*/
|
|
335
|
+
generateChecksum(root?: string): Promise<string>;
|
|
275
336
|
/**
|
|
276
337
|
* Creates a new StormContext instance.
|
|
277
338
|
*
|
|
@@ -286,13 +347,6 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
286
347
|
* A logger function specific to this context
|
|
287
348
|
*/
|
|
288
349
|
protected logFn: LogFn;
|
|
289
|
-
/**
|
|
290
|
-
* Generates a checksum representing the current context state
|
|
291
|
-
*
|
|
292
|
-
* @param root - The root directory of the project to generate the checksum for
|
|
293
|
-
* @returns A promise that resolves to a string representing the checksum
|
|
294
|
-
*/
|
|
295
|
-
generateChecksum(root?: string): Promise<string>;
|
|
296
350
|
/**
|
|
297
351
|
* Initialize the context with the provided configuration options
|
|
298
352
|
*
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
2
2
|
import { PackageJson } from '@stryke/types/package-json';
|
|
3
|
+
import { FlatCache } from 'flat-cache';
|
|
4
|
+
import { ParseResult } from 'oxc-parser';
|
|
3
5
|
import { Range } from 'semver';
|
|
4
6
|
import { Project } from 'ts-morph';
|
|
7
|
+
import { RequestInfo, Response } from 'undici';
|
|
5
8
|
import { ExternalIdResult, UnpluginMessage } from 'unplugin';
|
|
6
|
-
import { f as ResolvedConfig, C as Context, I as InitialUserConfig, M as MetaInfo, o as Resolver, R as ResolvedEntryTypeDefinition, L as LogFn, W as WorkspaceConfig, p as TransformResult, k as InitContextOptions } from '../config-
|
|
9
|
+
import { f as ResolvedConfig, C as Context, I as InitialUserConfig, M as MetaInfo, o as Resolver, R as ResolvedEntryTypeDefinition, L as LogFn, W as WorkspaceConfig, F as FetchOptions, p as ParseOptions, q as TransformResult, k as InitContextOptions } from '../config-Dzk6j2mr.js';
|
|
7
10
|
import { V as VirtualFileSystemInterface, R as ResolveOptions, a as VirtualFile, W as WriteOptions } from '../fs-Dg-aTfiN.js';
|
|
8
|
-
import { a as UNSAFE_ContextInternal } from '../internal-
|
|
11
|
+
import { a as UNSAFE_ContextInternal } from '../internal-Cgp0NF-t.js';
|
|
9
12
|
import { P as ParsedTypeScriptConfig } from '../tsconfig-Bz-CiFqD.js';
|
|
10
13
|
import '@storm-software/build-tools/types';
|
|
11
14
|
import '@storm-software/config-tools/types';
|
|
@@ -23,12 +26,13 @@ import 'esbuild';
|
|
|
23
26
|
import 'rolldown';
|
|
24
27
|
import 'rollup';
|
|
25
28
|
import 'webpack';
|
|
29
|
+
import '@stryke/http/fetch';
|
|
26
30
|
import 'jest-worker';
|
|
27
31
|
import 'jiti';
|
|
28
32
|
import 'magic-string';
|
|
29
33
|
import '@stryke/types/array';
|
|
30
34
|
import '@stryke/fs/resolve';
|
|
31
|
-
import '../api-
|
|
35
|
+
import '../api-BIHEKpyq.js';
|
|
32
36
|
import '@stryke/types/tsconfig';
|
|
33
37
|
import 'typescript';
|
|
34
38
|
|
|
@@ -70,6 +74,10 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
70
74
|
* The module resolver for the project
|
|
71
75
|
*/
|
|
72
76
|
resolver: Resolver;
|
|
77
|
+
/**
|
|
78
|
+
* The resolved configuration options
|
|
79
|
+
*/
|
|
80
|
+
private resolvePatterns;
|
|
73
81
|
/**
|
|
74
82
|
* Internal context fields and methods
|
|
75
83
|
*
|
|
@@ -157,6 +165,52 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
157
165
|
* This instance is created lazily on first access.
|
|
158
166
|
*/
|
|
159
167
|
get program(): Project;
|
|
168
|
+
/**
|
|
169
|
+
* Gets the parser cache.
|
|
170
|
+
*/
|
|
171
|
+
protected get parserCache(): FlatCache;
|
|
172
|
+
/**
|
|
173
|
+
* Gets the request cache.
|
|
174
|
+
*/
|
|
175
|
+
protected get requestCache(): FlatCache;
|
|
176
|
+
/**
|
|
177
|
+
* A function to perform HTTP fetch requests
|
|
178
|
+
*
|
|
179
|
+
* @remarks
|
|
180
|
+
* This function uses a caching layer to avoid duplicate requests during the Powerlines process.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const response = await context.fetch("https://api.example.com/data");
|
|
185
|
+
* const data = await response.json();
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @see https://github.com/nodejs/undici
|
|
189
|
+
*
|
|
190
|
+
* @param input - The URL to fetch.
|
|
191
|
+
* @param options - The fetch request options.
|
|
192
|
+
* @returns A promise that resolves to a response returned by the fetch.
|
|
193
|
+
*/
|
|
194
|
+
fetch(input: RequestInfo, options?: FetchOptions): Promise<Response>;
|
|
195
|
+
/**
|
|
196
|
+
* Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
197
|
+
*
|
|
198
|
+
* @remarks
|
|
199
|
+
* This function can be used to parse TypeScript code into an AST for further analysis or transformation.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* const ast = context.parse("const x: number = 42;");
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* @see https://rollupjs.org/plugin-development/#this-parse
|
|
207
|
+
* @see https://github.com/oxc/oxc
|
|
208
|
+
*
|
|
209
|
+
* @param code - The source code to parse.
|
|
210
|
+
* @param options - The options to pass to the parser.
|
|
211
|
+
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
212
|
+
*/
|
|
213
|
+
parse(code: string, options?: ParseOptions): Promise<ParseResult>;
|
|
160
214
|
/**
|
|
161
215
|
* A helper function to resolve modules in the Virtual File System
|
|
162
216
|
*
|
|
@@ -272,6 +326,13 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
272
326
|
* @returns A logger function
|
|
273
327
|
*/
|
|
274
328
|
extendLog(name: string): LogFn;
|
|
329
|
+
/**
|
|
330
|
+
* Generates a checksum representing the current context state
|
|
331
|
+
*
|
|
332
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
333
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
334
|
+
*/
|
|
335
|
+
generateChecksum(root?: string): Promise<string>;
|
|
275
336
|
/**
|
|
276
337
|
* Creates a new StormContext instance.
|
|
277
338
|
*
|
|
@@ -286,13 +347,6 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
286
347
|
* A logger function specific to this context
|
|
287
348
|
*/
|
|
288
349
|
protected logFn: LogFn;
|
|
289
|
-
/**
|
|
290
|
-
* Generates a checksum representing the current context state
|
|
291
|
-
*
|
|
292
|
-
* @param root - The root directory of the project to generate the checksum for
|
|
293
|
-
* @returns A promise that resolves to a string representing the checksum
|
|
294
|
-
*/
|
|
295
|
-
generateChecksum(root?: string): Promise<string>;
|
|
296
350
|
/**
|
|
297
351
|
* Initialize the context with the provided configuration options
|
|
298
352
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { PowerlinesContext } from '../chunk-
|
|
1
|
+
export { PowerlinesContext } from '../chunk-GSGF6RL2.js';
|
|
2
2
|
import '../chunk-OEF6EHQV.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-KG4HFVJU.js';
|
|
4
4
|
import '../chunk-L56XA427.js';
|
|
5
5
|
import '../chunk-ONETLSPO.js';
|
|
6
6
|
import '../chunk-VHCBD2IS.js';
|
|
@@ -9,5 +9,6 @@ import '../chunk-4W6WV35V.js';
|
|
|
9
9
|
import '../chunk-ZGMEHSNN.js';
|
|
10
10
|
import '../chunk-XBM7FHNK.js';
|
|
11
11
|
import '../chunk-ENRLU4UR.js';
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-DYGQQI74.js';
|
|
13
|
+
import '../chunk-T35JQHYE.js';
|
|
13
14
|
import '../chunk-SHUYVCID.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTWABN364_cjs = require('../chunk-TWABN364.cjs');
|
|
4
4
|
require('../chunk-PIFNMTKN.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-S4OH7KW6.cjs');
|
|
6
6
|
require('../chunk-HRRI4KOM.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-Z6BSDYUR.cjs');
|
|
8
8
|
require('../chunk-6OYSDQXE.cjs');
|
|
9
9
|
require('../chunk-XUYQYUWZ.cjs');
|
|
10
10
|
require('../chunk-XLHFUATD.cjs');
|
|
@@ -13,12 +13,13 @@ require('../chunk-D6MI2V6R.cjs');
|
|
|
13
13
|
require('../chunk-GA3RXX4R.cjs');
|
|
14
14
|
require('../chunk-K3NBD5LL.cjs');
|
|
15
15
|
require('../chunk-JA4HSQRN.cjs');
|
|
16
|
-
require('../chunk-
|
|
16
|
+
require('../chunk-QF3UTBJE.cjs');
|
|
17
|
+
require('../chunk-YXJJCE6V.cjs');
|
|
17
18
|
require('../chunk-USNT2KNT.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
Object.defineProperty(exports, "PowerlinesEnvironmentContext", {
|
|
22
23
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkTWABN364_cjs.PowerlinesEnvironmentContext; }
|
|
24
25
|
});
|