@powerlines/plugin-babel 0.13.1 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ast-utils-BGST1RhV.d.cts +19 -0
- package/dist/ast-utils-BGST1RhV.d.cts.map +1 -0
- package/dist/ast-utils-BeOv3AgV.d.mts +19 -0
- package/dist/ast-utils-BeOv3AgV.d.mts.map +1 -0
- package/dist/{_virtual/_rolldown/runtime.cjs → chunk-C0xms8kb.cjs} +6 -1
- package/dist/config-BzcRczcc.d.mts +100 -0
- package/dist/config-BzcRczcc.d.mts.map +1 -0
- package/dist/config-CgI9xWKl.d.cts +100 -0
- package/dist/config-CgI9xWKl.d.cts.map +1 -0
- package/dist/create-plugin-Be2v0jCm.d.mts +15 -0
- package/dist/create-plugin-Be2v0jCm.d.mts.map +1 -0
- package/dist/create-plugin-CeH6OQaE.d.cts +15 -0
- package/dist/create-plugin-CeH6OQaE.d.cts.map +1 -0
- package/dist/filters-C3Ky7-QS.d.cts +51 -0
- package/dist/filters-C3Ky7-QS.d.cts.map +1 -0
- package/dist/filters-DpefCFsp.d.mts +51 -0
- package/dist/filters-DpefCFsp.d.mts.map +1 -0
- package/dist/helpers/ast-utils.cjs +2 -2
- package/dist/helpers/ast-utils.d.cts +2 -19
- package/dist/helpers/ast-utils.d.mts +2 -19
- package/dist/helpers/create-plugin.cjs +2 -2
- package/dist/helpers/create-plugin.d.cts +2 -15
- package/dist/helpers/create-plugin.d.mts +2 -15
- package/dist/helpers/filters.cjs +1 -1
- package/dist/helpers/filters.d.cts +2 -51
- package/dist/helpers/filters.d.mts +2 -51
- package/dist/helpers/index.d.cts +5 -5
- package/dist/helpers/index.d.mts +5 -5
- package/dist/helpers/module-helpers.cjs +2 -2
- package/dist/helpers/module-helpers.d.cts +2 -49
- package/dist/helpers/module-helpers.d.mts +2 -49
- package/dist/helpers/options.cjs +2 -2
- package/dist/helpers/options.d.cts +2 -44
- package/dist/helpers/options.d.mts +2 -44
- package/dist/index.cjs +4 -3
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/module-helpers-BMn9yIG3.d.mts +49 -0
- package/dist/module-helpers-BMn9yIG3.d.mts.map +1 -0
- package/dist/module-helpers-CLxiipi8.d.cts +49 -0
- package/dist/module-helpers-CLxiipi8.d.cts.map +1 -0
- package/dist/options-C7VppRhK.d.mts +44 -0
- package/dist/options-C7VppRhK.d.mts.map +1 -0
- package/dist/options-CUWLPHiG.d.cts +44 -0
- package/dist/options-CUWLPHiG.d.cts.map +1 -0
- package/dist/types/config.d.cts +2 -100
- package/dist/types/config.d.mts +2 -100
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.mts +1 -1
- package/package.json +10 -10
- package/dist/helpers/ast-utils.d.cts.map +0 -1
- package/dist/helpers/ast-utils.d.mts.map +0 -1
- package/dist/helpers/create-plugin.d.cts.map +0 -1
- package/dist/helpers/create-plugin.d.mts.map +0 -1
- package/dist/helpers/filters.d.cts.map +0 -1
- package/dist/helpers/filters.d.mts.map +0 -1
- package/dist/helpers/module-helpers.d.cts.map +0 -1
- package/dist/helpers/module-helpers.d.mts.map +0 -1
- package/dist/helpers/options.d.cts.map +0 -1
- package/dist/helpers/options.d.mts.map +0 -1
- package/dist/types/config.d.cts.map +0 -1
- package/dist/types/config.d.mts.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GeneratorOptions, GeneratorResult, GeneratorResult as GeneratorResult$1 } from "@babel/generator";
|
|
2
|
+
import { ParseResult, ParserOptions } from "@babel/parser";
|
|
3
|
+
import * as t from "@babel/types";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/ast-utils.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Parse the given code into an AST.
|
|
8
|
+
*
|
|
9
|
+
* @param code - The code to parse.
|
|
10
|
+
* @param opts - The options for parsing.
|
|
11
|
+
* @returns The parsed AST.
|
|
12
|
+
*/
|
|
13
|
+
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
+
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
16
|
+
declare type __ΩGenerateFromAstOptions = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { parseAst as a, generateFromAst as i, GeneratorResult$1 as n, __ΩGenerateFromAstOptions as r, GenerateFromAstOptions as t };
|
|
19
|
+
//# sourceMappingURL=ast-utils-BGST1RhV.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-utils-BGST1RhV.d.cts","names":[],"sources":["../src/helpers/ast-utils.ts"],"mappings":";;;;;;;AA+BA;;;;;iBAAgB,QAAA,CACd,IAAA,UACA,IAAA,GAAM,aAAA,GACL,WAAA,CAAY,CAAA,CAAE,IAAA;AAAA,KAeL,sBAAA,GAAyB,gBAAA,GACnC,QAAA,CAAS,IAAA,CAAK,gBAAA;AAAA,iBAEA,eAAA,CACd,GAAA,EAAK,CAAA,CAAE,IAAA,EACP,IAAA,GAAO,sBAAA,GACN,eAAA;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GeneratorOptions, GeneratorResult, GeneratorResult as GeneratorResult$1 } from "@babel/generator";
|
|
2
|
+
import { ParseResult, ParserOptions } from "@babel/parser";
|
|
3
|
+
import * as t from "@babel/types";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/ast-utils.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Parse the given code into an AST.
|
|
8
|
+
*
|
|
9
|
+
* @param code - The code to parse.
|
|
10
|
+
* @param opts - The options for parsing.
|
|
11
|
+
* @returns The parsed AST.
|
|
12
|
+
*/
|
|
13
|
+
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
+
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
16
|
+
declare type __ΩGenerateFromAstOptions = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { parseAst as a, generateFromAst as i, GeneratorResult$1 as n, __ΩGenerateFromAstOptions as r, GenerateFromAstOptions as t };
|
|
19
|
+
//# sourceMappingURL=ast-utils-BeOv3AgV.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-utils-BeOv3AgV.d.mts","names":[],"sources":["../src/helpers/ast-utils.ts"],"mappings":";;;;;;;AA+BA;;;;;iBAAgB,QAAA,CACd,IAAA,UACA,IAAA,GAAM,aAAA,GACL,WAAA,CAAY,CAAA,CAAE,IAAA;AAAA,KAeL,sBAAA,GAAyB,gBAAA,GACnC,QAAA,CAAS,IAAA,CAAK,gBAAA;AAAA,iBAEA,eAAA,CACd,GAAA,EAAK,CAAA,CAAE,IAAA,EACP,IAAA,GAAO,sBAAA,GACN,eAAA;AAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ConfigItem, InputOptions, PluginAPI, PluginItem, PluginObject, PluginPass, PluginTarget, PresetAPI, PresetItem, PresetObject, PresetTarget } from "@babel/core";
|
|
2
|
+
import { Context, LogFn, Logger } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/config.d.ts
|
|
5
|
+
interface NamedImportDefinition {
|
|
6
|
+
name: string;
|
|
7
|
+
source: string;
|
|
8
|
+
kind: "named";
|
|
9
|
+
}
|
|
10
|
+
interface DefaultImportDefinition {
|
|
11
|
+
source: string;
|
|
12
|
+
kind: "default";
|
|
13
|
+
}
|
|
14
|
+
type ImportDefinition = NamedImportDefinition | DefaultImportDefinition;
|
|
15
|
+
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
16
|
+
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
17
|
+
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = ((context: TContext) => (options: {
|
|
18
|
+
name: string;
|
|
19
|
+
log: LogFn;
|
|
20
|
+
api: PluginAPI;
|
|
21
|
+
options: TOptions;
|
|
22
|
+
context: TContext;
|
|
23
|
+
dirname: string;
|
|
24
|
+
}) => PluginObject<TOptions & BabelPluginPass<TState>>) & {
|
|
25
|
+
$$name: string;
|
|
26
|
+
};
|
|
27
|
+
type BabelTransformPreset<TContext extends Context = Context, TOptions extends object = object> = ((context: TContext) => (options: {
|
|
28
|
+
name: string;
|
|
29
|
+
log: LogFn;
|
|
30
|
+
api: PresetAPI;
|
|
31
|
+
options: TOptions;
|
|
32
|
+
context: TContext;
|
|
33
|
+
dirname: string;
|
|
34
|
+
}) => PresetObject) & {
|
|
35
|
+
$$name: string;
|
|
36
|
+
};
|
|
37
|
+
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = ConfigItem<PluginAPI> | PluginTarget<TOptions> | BabelTransformPlugin<TContext, TOptions, TState> | [PluginTarget<TOptions> | BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
38
|
+
type BabelTransformPresetOptions<TContext extends Context = Context, TOptions extends object = object> = ConfigItem<PresetAPI> | PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions> | [PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions>, TOptions] | [PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions>, TOptions, BabelTransformPluginFilter];
|
|
39
|
+
type ResolvedBabelTransformPluginOptions<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = PluginItem<TOptions> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter | string | null];
|
|
40
|
+
type ResolvedBabelTransformPresetOptions<TContext extends Context = Context, TOptions extends object = object> = PresetItem<TOptions> | [BabelTransformPreset<TContext, TOptions>, TOptions, BabelTransformPluginFilter | string | null];
|
|
41
|
+
type BabelTransformInput = Omit<InputOptions & Required<Pick<InputOptions, "presets" | "plugins">>, "filename" | "root" | "sourceFileName" | "sourceMaps" | "inputSourceMap">;
|
|
42
|
+
interface BabelTransformPluginBuilderParams<TContext extends Context = Context, TOptions extends object = object> {
|
|
43
|
+
name: string;
|
|
44
|
+
logger: Logger;
|
|
45
|
+
api: PluginAPI;
|
|
46
|
+
options: TOptions;
|
|
47
|
+
context: TContext;
|
|
48
|
+
dirname: string;
|
|
49
|
+
}
|
|
50
|
+
type BabelTransformPluginBuilder<TContext extends Context = Context, TOptions extends object = object, TState = any> = (params: BabelTransformPluginBuilderParams<TContext, TOptions>) => PluginObject<TState & BabelPluginPass<TOptions>>;
|
|
51
|
+
type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends object = object, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
|
|
52
|
+
/**
|
|
53
|
+
* A non-local import specifier represents an import that is not defined within the current module.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* import { bar as baz } from 'foo';
|
|
58
|
+
* // { name: 'baz', module: 'foo', imported: 'bar' }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* It captures the details of an import statement, including the local name used in the module, the source module from which it is imported, and the original name of the export in the source module.
|
|
63
|
+
*/
|
|
64
|
+
interface ImportSpecifier {
|
|
65
|
+
name?: string;
|
|
66
|
+
module: string;
|
|
67
|
+
imported: string;
|
|
68
|
+
}
|
|
69
|
+
type BabelUserConfig = Omit<InputOptions, "plugins" | "presets"> & {
|
|
70
|
+
/**
|
|
71
|
+
* The Babel plugins to be used during the build process
|
|
72
|
+
*/
|
|
73
|
+
plugins?: BabelTransformPluginOptions[];
|
|
74
|
+
/**
|
|
75
|
+
* The Babel presets to be used during the build process
|
|
76
|
+
*/
|
|
77
|
+
presets?: BabelTransformPresetOptions[];
|
|
78
|
+
};
|
|
79
|
+
type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
|
|
80
|
+
declare type __ΩNamedImportDefinition = any[];
|
|
81
|
+
declare type __ΩDefaultImportDefinition = any[];
|
|
82
|
+
declare type __ΩImportDefinition = any[];
|
|
83
|
+
declare type __ΩBabelPluginPass = any[];
|
|
84
|
+
declare type __ΩBabelTransformPluginFilter = any[];
|
|
85
|
+
declare type __ΩBabelTransformPlugin = any[];
|
|
86
|
+
declare type __ΩBabelTransformPreset = any[];
|
|
87
|
+
declare type __ΩBabelTransformPluginOptions = any[];
|
|
88
|
+
declare type __ΩBabelTransformPresetOptions = any[];
|
|
89
|
+
declare type __ΩResolvedBabelTransformPluginOptions = any[];
|
|
90
|
+
declare type __ΩResolvedBabelTransformPresetOptions = any[];
|
|
91
|
+
declare type __ΩBabelTransformInput = any[];
|
|
92
|
+
declare type __ΩBabelTransformPluginBuilderParams = any[];
|
|
93
|
+
declare type __ΩBabelTransformPluginBuilder = any[];
|
|
94
|
+
declare type __ΩDeclareBabelTransformPluginReturn = any[];
|
|
95
|
+
declare type __ΩImportSpecifier = any[];
|
|
96
|
+
declare type __ΩBabelUserConfig = any[];
|
|
97
|
+
declare type __ΩBabelResolvedConfig = any[];
|
|
98
|
+
//#endregion
|
|
99
|
+
export { __ΩDeclareBabelTransformPluginReturn as A, __ΩBabelTransformPluginBuilder as C, __ΩBabelTransformPreset as D, __ΩBabelTransformPluginOptions as E, __ΩResolvedBabelTransformPluginOptions as F, __ΩResolvedBabelTransformPresetOptions as I, __ΩImportDefinition as M, __ΩImportSpecifier as N, __ΩBabelTransformPresetOptions as O, __ΩNamedImportDefinition as P, __ΩBabelTransformPlugin as S, __ΩBabelTransformPluginFilter as T, ResolvedBabelTransformPluginOptions as _, BabelTransformPluginBuilder as a, __ΩBabelResolvedConfig as b, BabelTransformPluginOptions as c, BabelUserConfig as d, DeclareBabelTransformPluginReturn as f, NamedImportDefinition as g, ImportSpecifier as h, BabelTransformPlugin as i, __ΩDefaultImportDefinition as j, __ΩBabelUserConfig as k, BabelTransformPreset as l, ImportDefinition as m, BabelResolvedConfig as n, BabelTransformPluginBuilderParams as o, DefaultImportDefinition as p, BabelTransformInput as r, BabelTransformPluginFilter as s, BabelPluginPass as t, BabelTransformPresetOptions as u, ResolvedBabelTransformPresetOptions as v, __ΩBabelTransformPluginBuilderParams as w, __ΩBabelTransformInput as x, __ΩBabelPluginPass as y };
|
|
100
|
+
//# sourceMappingURL=config-BzcRczcc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-BzcRczcc.d.mts","names":[],"sources":["../src/types/config.ts"],"mappings":"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"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Context, LogFn, Logger } from "@powerlines/core";
|
|
2
|
+
import { ConfigItem, InputOptions, PluginAPI, PluginItem, PluginObject, PluginPass, PluginTarget, PresetAPI, PresetItem, PresetObject, PresetTarget } from "@babel/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/config.d.ts
|
|
5
|
+
interface NamedImportDefinition {
|
|
6
|
+
name: string;
|
|
7
|
+
source: string;
|
|
8
|
+
kind: "named";
|
|
9
|
+
}
|
|
10
|
+
interface DefaultImportDefinition {
|
|
11
|
+
source: string;
|
|
12
|
+
kind: "default";
|
|
13
|
+
}
|
|
14
|
+
type ImportDefinition = NamedImportDefinition | DefaultImportDefinition;
|
|
15
|
+
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
16
|
+
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
17
|
+
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = ((context: TContext) => (options: {
|
|
18
|
+
name: string;
|
|
19
|
+
log: LogFn;
|
|
20
|
+
api: PluginAPI;
|
|
21
|
+
options: TOptions;
|
|
22
|
+
context: TContext;
|
|
23
|
+
dirname: string;
|
|
24
|
+
}) => PluginObject<TOptions & BabelPluginPass<TState>>) & {
|
|
25
|
+
$$name: string;
|
|
26
|
+
};
|
|
27
|
+
type BabelTransformPreset<TContext extends Context = Context, TOptions extends object = object> = ((context: TContext) => (options: {
|
|
28
|
+
name: string;
|
|
29
|
+
log: LogFn;
|
|
30
|
+
api: PresetAPI;
|
|
31
|
+
options: TOptions;
|
|
32
|
+
context: TContext;
|
|
33
|
+
dirname: string;
|
|
34
|
+
}) => PresetObject) & {
|
|
35
|
+
$$name: string;
|
|
36
|
+
};
|
|
37
|
+
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = ConfigItem<PluginAPI> | PluginTarget<TOptions> | BabelTransformPlugin<TContext, TOptions, TState> | [PluginTarget<TOptions> | BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
38
|
+
type BabelTransformPresetOptions<TContext extends Context = Context, TOptions extends object = object> = ConfigItem<PresetAPI> | PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions> | [PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions>, TOptions] | [PresetTarget<TOptions> | BabelTransformPreset<TContext, TOptions>, TOptions, BabelTransformPluginFilter];
|
|
39
|
+
type ResolvedBabelTransformPluginOptions<TContext extends Context = Context, TOptions extends object = object, TState = unknown> = PluginItem<TOptions> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter | string | null];
|
|
40
|
+
type ResolvedBabelTransformPresetOptions<TContext extends Context = Context, TOptions extends object = object> = PresetItem<TOptions> | [BabelTransformPreset<TContext, TOptions>, TOptions, BabelTransformPluginFilter | string | null];
|
|
41
|
+
type BabelTransformInput = Omit<InputOptions & Required<Pick<InputOptions, "presets" | "plugins">>, "filename" | "root" | "sourceFileName" | "sourceMaps" | "inputSourceMap">;
|
|
42
|
+
interface BabelTransformPluginBuilderParams<TContext extends Context = Context, TOptions extends object = object> {
|
|
43
|
+
name: string;
|
|
44
|
+
logger: Logger;
|
|
45
|
+
api: PluginAPI;
|
|
46
|
+
options: TOptions;
|
|
47
|
+
context: TContext;
|
|
48
|
+
dirname: string;
|
|
49
|
+
}
|
|
50
|
+
type BabelTransformPluginBuilder<TContext extends Context = Context, TOptions extends object = object, TState = any> = (params: BabelTransformPluginBuilderParams<TContext, TOptions>) => PluginObject<TState & BabelPluginPass<TOptions>>;
|
|
51
|
+
type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends object = object, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
|
|
52
|
+
/**
|
|
53
|
+
* A non-local import specifier represents an import that is not defined within the current module.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* import { bar as baz } from 'foo';
|
|
58
|
+
* // { name: 'baz', module: 'foo', imported: 'bar' }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* It captures the details of an import statement, including the local name used in the module, the source module from which it is imported, and the original name of the export in the source module.
|
|
63
|
+
*/
|
|
64
|
+
interface ImportSpecifier {
|
|
65
|
+
name?: string;
|
|
66
|
+
module: string;
|
|
67
|
+
imported: string;
|
|
68
|
+
}
|
|
69
|
+
type BabelUserConfig = Omit<InputOptions, "plugins" | "presets"> & {
|
|
70
|
+
/**
|
|
71
|
+
* The Babel plugins to be used during the build process
|
|
72
|
+
*/
|
|
73
|
+
plugins?: BabelTransformPluginOptions[];
|
|
74
|
+
/**
|
|
75
|
+
* The Babel presets to be used during the build process
|
|
76
|
+
*/
|
|
77
|
+
presets?: BabelTransformPresetOptions[];
|
|
78
|
+
};
|
|
79
|
+
type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
|
|
80
|
+
declare type __ΩNamedImportDefinition = any[];
|
|
81
|
+
declare type __ΩDefaultImportDefinition = any[];
|
|
82
|
+
declare type __ΩImportDefinition = any[];
|
|
83
|
+
declare type __ΩBabelPluginPass = any[];
|
|
84
|
+
declare type __ΩBabelTransformPluginFilter = any[];
|
|
85
|
+
declare type __ΩBabelTransformPlugin = any[];
|
|
86
|
+
declare type __ΩBabelTransformPreset = any[];
|
|
87
|
+
declare type __ΩBabelTransformPluginOptions = any[];
|
|
88
|
+
declare type __ΩBabelTransformPresetOptions = any[];
|
|
89
|
+
declare type __ΩResolvedBabelTransformPluginOptions = any[];
|
|
90
|
+
declare type __ΩResolvedBabelTransformPresetOptions = any[];
|
|
91
|
+
declare type __ΩBabelTransformInput = any[];
|
|
92
|
+
declare type __ΩBabelTransformPluginBuilderParams = any[];
|
|
93
|
+
declare type __ΩBabelTransformPluginBuilder = any[];
|
|
94
|
+
declare type __ΩDeclareBabelTransformPluginReturn = any[];
|
|
95
|
+
declare type __ΩImportSpecifier = any[];
|
|
96
|
+
declare type __ΩBabelUserConfig = any[];
|
|
97
|
+
declare type __ΩBabelResolvedConfig = any[];
|
|
98
|
+
//#endregion
|
|
99
|
+
export { __ΩDeclareBabelTransformPluginReturn as A, __ΩBabelTransformPluginBuilder as C, __ΩBabelTransformPreset as D, __ΩBabelTransformPluginOptions as E, __ΩResolvedBabelTransformPluginOptions as F, __ΩResolvedBabelTransformPresetOptions as I, __ΩImportDefinition as M, __ΩImportSpecifier as N, __ΩBabelTransformPresetOptions as O, __ΩNamedImportDefinition as P, __ΩBabelTransformPlugin as S, __ΩBabelTransformPluginFilter as T, ResolvedBabelTransformPluginOptions as _, BabelTransformPluginBuilder as a, __ΩBabelResolvedConfig as b, BabelTransformPluginOptions as c, BabelUserConfig as d, DeclareBabelTransformPluginReturn as f, NamedImportDefinition as g, ImportSpecifier as h, BabelTransformPlugin as i, __ΩDefaultImportDefinition as j, __ΩBabelUserConfig as k, BabelTransformPreset as l, ImportDefinition as m, BabelResolvedConfig as n, BabelTransformPluginBuilderParams as o, DefaultImportDefinition as p, BabelTransformInput as r, BabelTransformPluginFilter as s, BabelPluginPass as t, BabelTransformPresetOptions as u, ResolvedBabelTransformPresetOptions as v, __ΩBabelTransformPluginBuilderParams as w, __ΩBabelTransformInput as x, __ΩBabelPluginPass as y };
|
|
100
|
+
//# sourceMappingURL=config-CgI9xWKl.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CgI9xWKl.d.cts","names":[],"sources":["../src/types/config.ts"],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as BabelTransformPluginBuilder, f as DeclareBabelTransformPluginReturn } from "./config-BzcRczcc.mjs";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/create-plugin.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Babel plugin using the provided builder function.
|
|
7
|
+
*
|
|
8
|
+
* @param name - The name of the plugin.
|
|
9
|
+
* @param builder - The builder function that defines the plugin behavior.
|
|
10
|
+
* @returns A Babel plugin declaration.
|
|
11
|
+
*/
|
|
12
|
+
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends object = object>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { createBabelPlugin as t };
|
|
15
|
+
//# sourceMappingURL=create-plugin-Be2v0jCm.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-plugin-Be2v0jCm.d.mts","names":[],"sources":["../src/helpers/create-plugin.ts"],"mappings":";;;;;;AAiCA;;;;;iBAAgB,iBAAA,kBACG,OAAA,GAAU,OAAA,mCAAA,CAG3B,IAAA,UACA,OAAA,EAAS,2BAAA,CAA4B,QAAA,EAAU,QAAA,IAC9C,iCAAA,CAAkC,QAAA,EAAU,QAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as BabelTransformPluginBuilder, f as DeclareBabelTransformPluginReturn } from "./config-CgI9xWKl.cjs";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/create-plugin.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Babel plugin using the provided builder function.
|
|
7
|
+
*
|
|
8
|
+
* @param name - The name of the plugin.
|
|
9
|
+
* @param builder - The builder function that defines the plugin behavior.
|
|
10
|
+
* @returns A Babel plugin declaration.
|
|
11
|
+
*/
|
|
12
|
+
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends object = object>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { createBabelPlugin as t };
|
|
15
|
+
//# sourceMappingURL=create-plugin-CeH6OQaE.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-plugin-CeH6OQaE.d.cts","names":[],"sources":["../src/helpers/create-plugin.ts"],"mappings":";;;;;;AAiCA;;;;;iBAAgB,iBAAA,kBACG,OAAA,GAAU,OAAA,mCAAA,CAG3B,IAAA,UACA,OAAA,EAAS,2BAAA,CAA4B,QAAA,EAAU,QAAA,IAC9C,iCAAA,CAAkC,QAAA,EAAU,QAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _ as ResolvedBabelTransformPluginOptions, c as BabelTransformPluginOptions, i as BabelTransformPlugin, s as BabelTransformPluginFilter, u as BabelTransformPresetOptions, v as ResolvedBabelTransformPresetOptions } from "./config-CgI9xWKl.cjs";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/filters.d.ts
|
|
5
|
+
declare function getPluginName(plugin?: BabelTransformPluginOptions | string | false | object | ((...args: any[]) => any) | undefined): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
8
|
+
*
|
|
9
|
+
* @param plugins - The list of existing Babel plugins.
|
|
10
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
11
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
12
|
+
*/
|
|
13
|
+
declare function isDuplicatePlugin<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[], plugin: T): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a Babel preset is a duplicate of another preset in the list.
|
|
16
|
+
*
|
|
17
|
+
* @param presets - The list of existing Babel presets.
|
|
18
|
+
* @param preset - The Babel preset to check for duplicates.
|
|
19
|
+
* @returns True if the preset is a duplicate, false otherwise.
|
|
20
|
+
*/
|
|
21
|
+
declare function isDuplicatePreset<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[], preset: T): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Filters a Babel plugin by its runtime ID.
|
|
24
|
+
*
|
|
25
|
+
* @param context - The context in which the filter is applied.
|
|
26
|
+
* @param fileId - The file ID to filter by.
|
|
27
|
+
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
28
|
+
*/
|
|
29
|
+
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
32
|
+
*
|
|
33
|
+
* @param context - The context in which the plugin is being added.
|
|
34
|
+
* @param plugins - The Babel plugins to add the filter to.
|
|
35
|
+
* @param filter - The filter function to apply to the plugins.
|
|
36
|
+
* @param name - The name of the plugin to add the filter to.
|
|
37
|
+
* @returns The updated list of Babel plugins with the filter applied.
|
|
38
|
+
*/
|
|
39
|
+
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
40
|
+
/**
|
|
41
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
42
|
+
*
|
|
43
|
+
* @param context - The context in which the plugin is being added.
|
|
44
|
+
* @param plugin - The Babel plugin to add the filter to.
|
|
45
|
+
* @param filter - The filter function to apply to the plugin.
|
|
46
|
+
* @returns The updated Babel plugin with the filter applied.
|
|
47
|
+
*/
|
|
48
|
+
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { isDuplicatePreset as a, isDuplicatePlugin as i, filterPluginByFileId as n, getPluginName as r, addPluginFilter as t };
|
|
51
|
+
//# sourceMappingURL=filters-C3Ky7-QS.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-C3Ky7-QS.d.cts","names":[],"sources":["../src/helpers/filters.ts"],"mappings":";;;;iBA+BgB,aAAA,CACd,MAAA,GACI,2BAAA,kCAIK,IAAA;;AANX;;;;;;iBA2BgB,iBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,IAAK,MAAA,EAAQ,CAAA;;;AAFxB;;;;;iBAoBgB,iBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,IAAK,MAAA,EAAQ,CAAA;;;;;;;;iBAkBR,oBAAA,kBAAsC,OAAA,GAAU,OAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,MAAA,WACC,0BAAA;;;;;AAvBH;;;;;iBA2CgB,eAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,EAAS,2BAAA,IACT,MAAA,EAAQ,0BAAA,qBACR,IAAA,WACC,2BAAA;;;;;;;;;iBAUa,eAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,EAAQ,oBAAA,GAAuB,2BAAA,EAC/B,MAAA,EAAQ,WAAA,CAAY,0BAAA,IACnB,2BAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _ as ResolvedBabelTransformPluginOptions, c as BabelTransformPluginOptions, i as BabelTransformPlugin, s as BabelTransformPluginFilter, u as BabelTransformPresetOptions, v as ResolvedBabelTransformPresetOptions } from "./config-BzcRczcc.mjs";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/filters.d.ts
|
|
5
|
+
declare function getPluginName(plugin?: BabelTransformPluginOptions | string | false | object | ((...args: any[]) => any) | undefined): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
8
|
+
*
|
|
9
|
+
* @param plugins - The list of existing Babel plugins.
|
|
10
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
11
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
12
|
+
*/
|
|
13
|
+
declare function isDuplicatePlugin<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[], plugin: T): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a Babel preset is a duplicate of another preset in the list.
|
|
16
|
+
*
|
|
17
|
+
* @param presets - The list of existing Babel presets.
|
|
18
|
+
* @param preset - The Babel preset to check for duplicates.
|
|
19
|
+
* @returns True if the preset is a duplicate, false otherwise.
|
|
20
|
+
*/
|
|
21
|
+
declare function isDuplicatePreset<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[], preset: T): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Filters a Babel plugin by its runtime ID.
|
|
24
|
+
*
|
|
25
|
+
* @param context - The context in which the filter is applied.
|
|
26
|
+
* @param fileId - The file ID to filter by.
|
|
27
|
+
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
28
|
+
*/
|
|
29
|
+
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
32
|
+
*
|
|
33
|
+
* @param context - The context in which the plugin is being added.
|
|
34
|
+
* @param plugins - The Babel plugins to add the filter to.
|
|
35
|
+
* @param filter - The filter function to apply to the plugins.
|
|
36
|
+
* @param name - The name of the plugin to add the filter to.
|
|
37
|
+
* @returns The updated list of Babel plugins with the filter applied.
|
|
38
|
+
*/
|
|
39
|
+
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
40
|
+
/**
|
|
41
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
42
|
+
*
|
|
43
|
+
* @param context - The context in which the plugin is being added.
|
|
44
|
+
* @param plugin - The Babel plugin to add the filter to.
|
|
45
|
+
* @param filter - The filter function to apply to the plugin.
|
|
46
|
+
* @returns The updated Babel plugin with the filter applied.
|
|
47
|
+
*/
|
|
48
|
+
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { isDuplicatePreset as a, isDuplicatePlugin as i, filterPluginByFileId as n, getPluginName as r, addPluginFilter as t };
|
|
51
|
+
//# sourceMappingURL=filters-DpefCFsp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-DpefCFsp.d.mts","names":[],"sources":["../src/helpers/filters.ts"],"mappings":";;;;iBA+BgB,aAAA,CACd,MAAA,GACI,2BAAA,kCAIK,IAAA;;AANX;;;;;;iBA2BgB,iBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,IAAK,MAAA,EAAQ,CAAA;;;AAFxB;;;;;iBAoBgB,iBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,IAAK,MAAA,EAAQ,CAAA;;;;;;;;iBAkBR,oBAAA,kBAAsC,OAAA,GAAU,OAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,MAAA,WACC,0BAAA;;;;;AAvBH;;;;;iBA2CgB,eAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,EAAS,2BAAA,IACT,MAAA,EAAQ,0BAAA,qBACR,IAAA,WACC,2BAAA;;;;;;;;;iBAUa,eAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,EAAQ,oBAAA,GAAuB,2BAAA,EAC/B,MAAA,EAAQ,WAAA,CAAY,0BAAA,IACnB,2BAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
3
|
let _babel_generator = require("@babel/generator");
|
|
4
|
-
_babel_generator =
|
|
4
|
+
_babel_generator = require_chunk.__toESM(_babel_generator, 1);
|
|
5
5
|
let _babel_parser = require("@babel/parser");
|
|
6
6
|
|
|
7
7
|
//#region src/helpers/ast-utils.ts
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import * as t from "@babel/types";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/ast-utils.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Parse the given code into an AST.
|
|
8
|
-
*
|
|
9
|
-
* @param code - The code to parse.
|
|
10
|
-
* @param opts - The options for parsing.
|
|
11
|
-
* @returns The parsed AST.
|
|
12
|
-
*/
|
|
13
|
-
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
-
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
-
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult$1;
|
|
16
|
-
declare type __ΩGenerateFromAstOptions = any[];
|
|
17
|
-
//#endregion
|
|
18
|
-
export { GenerateFromAstOptions, type GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
19
|
-
//# sourceMappingURL=ast-utils.d.cts.map
|
|
1
|
+
import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "../ast-utils-BGST1RhV.cjs";
|
|
2
|
+
export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import * as t from "@babel/types";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/ast-utils.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Parse the given code into an AST.
|
|
8
|
-
*
|
|
9
|
-
* @param code - The code to parse.
|
|
10
|
-
* @param opts - The options for parsing.
|
|
11
|
-
* @returns The parsed AST.
|
|
12
|
-
*/
|
|
13
|
-
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
-
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
-
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult$1;
|
|
16
|
-
declare type __ΩGenerateFromAstOptions = any[];
|
|
17
|
-
//#endregion
|
|
18
|
-
export { GenerateFromAstOptions, type GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
19
|
-
//# sourceMappingURL=ast-utils.d.mts.map
|
|
1
|
+
import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "../ast-utils-BeOv3AgV.mjs";
|
|
2
|
+
export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
3
|
let chalk = require("chalk");
|
|
4
|
-
chalk =
|
|
4
|
+
chalk = require_chunk.__toESM(chalk, 1);
|
|
5
5
|
let _babel_helper_plugin_utils = require("@babel/helper-plugin-utils");
|
|
6
6
|
|
|
7
7
|
//#region src/helpers/create-plugin.ts
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/create-plugin.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Create a Babel plugin using the provided builder function.
|
|
7
|
-
*
|
|
8
|
-
* @param name - The name of the plugin.
|
|
9
|
-
* @param builder - The builder function that defines the plugin behavior.
|
|
10
|
-
* @returns A Babel plugin declaration.
|
|
11
|
-
*/
|
|
12
|
-
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends object = object>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { createBabelPlugin };
|
|
15
|
-
//# sourceMappingURL=create-plugin.d.cts.map
|
|
1
|
+
import { t as createBabelPlugin } from "../create-plugin-CeH6OQaE.cjs";
|
|
2
|
+
export { createBabelPlugin };
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/create-plugin.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Create a Babel plugin using the provided builder function.
|
|
7
|
-
*
|
|
8
|
-
* @param name - The name of the plugin.
|
|
9
|
-
* @param builder - The builder function that defines the plugin behavior.
|
|
10
|
-
* @returns A Babel plugin declaration.
|
|
11
|
-
*/
|
|
12
|
-
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends object = object>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { createBabelPlugin };
|
|
15
|
-
//# sourceMappingURL=create-plugin.d.mts.map
|
|
1
|
+
import { t as createBabelPlugin } from "../create-plugin-Be2v0jCm.mjs";
|
|
2
|
+
export { createBabelPlugin };
|
package/dist/helpers/filters.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
3
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
4
4
|
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
5
5
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/filters.d.ts
|
|
5
|
-
declare function getPluginName(plugin?: BabelTransformPluginOptions | string | false | object | ((...args: any[]) => any) | undefined): string | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
8
|
-
*
|
|
9
|
-
* @param plugins - The list of existing Babel plugins.
|
|
10
|
-
* @param plugin - The Babel plugin to check for duplicates.
|
|
11
|
-
* @returns True if the plugin is a duplicate, false otherwise.
|
|
12
|
-
*/
|
|
13
|
-
declare function isDuplicatePlugin<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[], plugin: T): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Check if a Babel preset is a duplicate of another preset in the list.
|
|
16
|
-
*
|
|
17
|
-
* @param presets - The list of existing Babel presets.
|
|
18
|
-
* @param preset - The Babel preset to check for duplicates.
|
|
19
|
-
* @returns True if the preset is a duplicate, false otherwise.
|
|
20
|
-
*/
|
|
21
|
-
declare function isDuplicatePreset<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[], preset: T): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Filters a Babel plugin by its runtime ID.
|
|
24
|
-
*
|
|
25
|
-
* @param context - The context in which the filter is applied.
|
|
26
|
-
* @param fileId - The file ID to filter by.
|
|
27
|
-
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
28
|
-
*/
|
|
29
|
-
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
30
|
-
/**
|
|
31
|
-
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
32
|
-
*
|
|
33
|
-
* @param context - The context in which the plugin is being added.
|
|
34
|
-
* @param plugins - The Babel plugins to add the filter to.
|
|
35
|
-
* @param filter - The filter function to apply to the plugins.
|
|
36
|
-
* @param name - The name of the plugin to add the filter to.
|
|
37
|
-
* @returns The updated list of Babel plugins with the filter applied.
|
|
38
|
-
*/
|
|
39
|
-
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
40
|
-
/**
|
|
41
|
-
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
42
|
-
*
|
|
43
|
-
* @param context - The context in which the plugin is being added.
|
|
44
|
-
* @param plugin - The Babel plugin to add the filter to.
|
|
45
|
-
* @param filter - The filter function to apply to the plugin.
|
|
46
|
-
* @returns The updated Babel plugin with the filter applied.
|
|
47
|
-
*/
|
|
48
|
-
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset };
|
|
51
|
-
//# sourceMappingURL=filters.d.cts.map
|
|
1
|
+
import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "../filters-C3Ky7-QS.cjs";
|
|
2
|
+
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset };
|