@powerlines/plugin-babel 0.12.349 → 0.12.351
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/{chunk-C0xms8kb.cjs → _virtual/_rolldown/runtime.cjs} +1 -6
- package/dist/helpers/ast-utils.cjs +2 -2
- package/dist/helpers/ast-utils.d.cts +19 -2
- package/dist/helpers/ast-utils.d.cts.map +1 -0
- package/dist/helpers/ast-utils.d.mts +19 -2
- package/dist/helpers/ast-utils.d.mts.map +1 -0
- package/dist/helpers/create-plugin.cjs +2 -2
- package/dist/helpers/create-plugin.d.cts +15 -2
- package/dist/helpers/create-plugin.d.cts.map +1 -0
- package/dist/helpers/create-plugin.d.mts +15 -2
- package/dist/helpers/create-plugin.d.mts.map +1 -0
- package/dist/helpers/filters.cjs +1 -1
- package/dist/helpers/filters.d.cts +43 -2
- package/dist/helpers/filters.d.cts.map +1 -0
- package/dist/helpers/filters.d.mts +43 -2
- package/dist/helpers/filters.d.mts.map +1 -0
- 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 +49 -2
- package/dist/helpers/module-helpers.d.cts.map +1 -0
- package/dist/helpers/module-helpers.d.mts +49 -2
- package/dist/helpers/module-helpers.d.mts.map +1 -0
- package/dist/helpers/options.cjs +2 -2
- package/dist/helpers/options.d.cts +19 -2
- package/dist/helpers/options.d.cts.map +1 -0
- package/dist/helpers/options.d.mts +19 -2
- package/dist/helpers/options.d.mts.map +1 -0
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/config.d.cts +86 -2
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +86 -2
- package/dist/types/config.d.mts.map +1 -0
- 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 +4 -5
- package/dist/ast-utils-BGST1RhV.d.cts +0 -19
- package/dist/ast-utils-BGST1RhV.d.cts.map +0 -1
- package/dist/ast-utils-BeOv3AgV.d.mts +0 -19
- package/dist/ast-utils-BeOv3AgV.d.mts.map +0 -1
- package/dist/config-CuJGOt8R.d.cts +0 -86
- package/dist/config-CuJGOt8R.d.cts.map +0 -1
- package/dist/config-D_d7N-Sl.d.mts +0 -86
- package/dist/config-D_d7N-Sl.d.mts.map +0 -1
- package/dist/create-plugin-BIwCYvvY.d.mts +0 -15
- package/dist/create-plugin-BIwCYvvY.d.mts.map +0 -1
- package/dist/create-plugin-D_a-SigP.d.cts +0 -15
- package/dist/create-plugin-D_a-SigP.d.cts.map +0 -1
- package/dist/filters-CJGhJSwI.d.mts +0 -43
- package/dist/filters-CJGhJSwI.d.mts.map +0 -1
- package/dist/filters-DSaGPmrz.d.cts +0 -43
- package/dist/filters-DSaGPmrz.d.cts.map +0 -1
- package/dist/module-helpers-BeUcHHvL.d.cts +0 -49
- package/dist/module-helpers-BeUcHHvL.d.cts.map +0 -1
- package/dist/module-helpers-BmiPAh2F.d.mts +0 -49
- package/dist/module-helpers-BmiPAh2F.d.mts.map +0 -1
- package/dist/options-CuRFY_V6.d.mts +0 -19
- package/dist/options-CuRFY_V6.d.mts.map +0 -1
- package/dist/options-ku57q3v6.d.cts +0 -19
- package/dist/options-ku57q3v6.d.cts.map +0 -1
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { c as BabelTransformPluginOptions, h as ResolvedBabelTransformPluginOptions, i as BabelTransformPlugin, s as BabelTransformPluginFilter } from "./config-CuJGOt8R.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(plugins: (ResolvedBabelTransformPluginOptions | undefined)[], plugin: BabelTransformPluginOptions): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Filters a Babel plugin by its runtime ID.
|
|
16
|
-
*
|
|
17
|
-
* @param context - The context in which the filter is applied.
|
|
18
|
-
* @param fileId - The file ID to filter by.
|
|
19
|
-
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
20
|
-
*/
|
|
21
|
-
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
22
|
-
/**
|
|
23
|
-
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
24
|
-
*
|
|
25
|
-
* @param context - The context in which the plugin is being added.
|
|
26
|
-
* @param plugins - The Babel plugins to add the filter to.
|
|
27
|
-
* @param filter - The filter function to apply to the plugins.
|
|
28
|
-
* @param name - The name of the plugin to add the filter to.
|
|
29
|
-
* @returns The updated list of Babel plugins with the filter applied.
|
|
30
|
-
*/
|
|
31
|
-
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
32
|
-
/**
|
|
33
|
-
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
34
|
-
*
|
|
35
|
-
* @param context - The context in which the plugin is being added.
|
|
36
|
-
* @param plugin - The Babel plugin to add the filter to.
|
|
37
|
-
* @param filter - The filter function to apply to the plugin.
|
|
38
|
-
* @returns The updated Babel plugin with the filter applied.
|
|
39
|
-
*/
|
|
40
|
-
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { isDuplicatePlugin as i, filterPluginByFileId as n, getPluginName as r, addPluginFilter as t };
|
|
43
|
-
//# sourceMappingURL=filters-DSaGPmrz.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters-DSaGPmrz.d.cts","names":[],"sources":["../src/helpers/filters.ts"],"mappings":";;;;iBA6BgB,aAAA,CACd,MAAA,GACI,2BAAA,kCAIK,IAAA;;AANX;;;;;;iBA2BgB,iBAAA,CACd,OAAA,GAAU,mCAAA,iBACV,MAAA,EAAQ,2BAAA;;;AAFV;;;;;iBAqBgB,oBAAA,kBAAsC,OAAA,GAAU,OAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,MAAA,WACC,0BAAA;;;;;AAHH;;;;;iBAuBgB,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,49 +0,0 @@
|
|
|
1
|
-
import { p as ImportSpecifier } from "./config-CuJGOt8R.cjs";
|
|
2
|
-
import { ParseResult } from "@babel/parser";
|
|
3
|
-
import * as t from "@babel/types";
|
|
4
|
-
import { NodePath } from "@babel/core";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/module-helpers.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Finds an export in the given Babel AST program by its key.
|
|
9
|
-
*
|
|
10
|
-
* @param ast - The parsed Babel AST result containing the program body.
|
|
11
|
-
* @param key - The name of the export to find (e.g., "default" or a named export).
|
|
12
|
-
* @returns The declaration of the export if found, otherwise undefined.
|
|
13
|
-
*/
|
|
14
|
-
declare function findExport(ast: ParseResult<t.File>, key: string): any;
|
|
15
|
-
/**
|
|
16
|
-
* Lists all exports from the given Babel AST program.
|
|
17
|
-
*
|
|
18
|
-
* @param codeOrAst - The parsed Babel AST result containing the program body.
|
|
19
|
-
* @returns An array of export names, including "default" for default exports.
|
|
20
|
-
*/
|
|
21
|
-
declare function listExports(codeOrAst: ParseResult<t.File> | string): string[];
|
|
22
|
-
/**
|
|
23
|
-
* Lists all imports from the given Babel AST program.
|
|
24
|
-
*
|
|
25
|
-
* @param ast - The parsed Babel AST result containing the program body.
|
|
26
|
-
* @returns An array of import names, including "default" for default imports.
|
|
27
|
-
*/
|
|
28
|
-
declare function listImports(ast: ParseResult<t.File> | t.File): string[];
|
|
29
|
-
declare function isImportCall(calleePath: NodePath<t.CallExpression | t.NewExpression>): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the import declaration for a given name and specifier.
|
|
32
|
-
*
|
|
33
|
-
* @param specifier - The specifier of the import.
|
|
34
|
-
* @param name - The name of the import.
|
|
35
|
-
* @param named - Optional named import.
|
|
36
|
-
* @returns The import declaration.
|
|
37
|
-
*/
|
|
38
|
-
declare function getImport(specifier: string, name: string, named?: string): t.ImportDeclaration;
|
|
39
|
-
/**
|
|
40
|
-
* Adds an import to the program if it doesn't already exist.
|
|
41
|
-
*
|
|
42
|
-
* @param path - The current NodePath in the AST.
|
|
43
|
-
* @param specifier - The import specifier.
|
|
44
|
-
*/
|
|
45
|
-
declare function addImport(path: NodePath<any>, specifier: ImportSpecifier): void;
|
|
46
|
-
declare function addImportsToProgram(path: NodePath<t.Program>, specifier: ImportSpecifier): void;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { isImportCall as a, getImport as i, addImportsToProgram as n, listExports as o, findExport as r, listImports as s, addImport as t };
|
|
49
|
-
//# sourceMappingURL=module-helpers-BeUcHHvL.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-helpers-BeUcHHvL.d.cts","names":[],"sources":["../src/helpers/module-helpers.ts"],"mappings":";;;;;;;;AAgCA;;;;;iBAAgB,UAAA,CAAW,GAAA,EAAK,WAAA,CAAY,CAAA,CAAE,IAAA,GAAO,GAAA;;;;;;AA6BrD;iBAAgB,WAAA,CAAY,SAAA,EAAW,WAAA,CAAY,CAAA,CAAE,IAAA;;;;;;;iBA4BrC,WAAA,CAAY,GAAA,EAAK,WAAA,CAAY,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,IAAA;AAAA,iBAsBzC,YAAA,CACd,UAAA,EAAY,QAAA,CAAS,CAAA,CAAE,cAAA,GAAiB,CAAA,CAAE,aAAA;AAvB5C;;;;;;;;AAAA,iBAoCgB,SAAA,CACd,SAAA,UACA,IAAA,UACA,KAAA,YACC,CAAA,CAAE,iBAAA;;;;;;;iBAaW,SAAA,CAAU,IAAA,EAAM,QAAA,OAAe,SAAA,EAAW,eAAA;AAAA,iBAuC1C,mBAAA,CACd,IAAA,EAAM,QAAA,CAAS,CAAA,CAAE,OAAA,GACjB,SAAA,EAAW,eAAA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { p as ImportSpecifier } from "./config-D_d7N-Sl.mjs";
|
|
2
|
-
import { NodePath } from "@babel/core";
|
|
3
|
-
import { ParseResult } from "@babel/parser";
|
|
4
|
-
import * as t from "@babel/types";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/module-helpers.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Finds an export in the given Babel AST program by its key.
|
|
9
|
-
*
|
|
10
|
-
* @param ast - The parsed Babel AST result containing the program body.
|
|
11
|
-
* @param key - The name of the export to find (e.g., "default" or a named export).
|
|
12
|
-
* @returns The declaration of the export if found, otherwise undefined.
|
|
13
|
-
*/
|
|
14
|
-
declare function findExport(ast: ParseResult<t.File>, key: string): any;
|
|
15
|
-
/**
|
|
16
|
-
* Lists all exports from the given Babel AST program.
|
|
17
|
-
*
|
|
18
|
-
* @param codeOrAst - The parsed Babel AST result containing the program body.
|
|
19
|
-
* @returns An array of export names, including "default" for default exports.
|
|
20
|
-
*/
|
|
21
|
-
declare function listExports(codeOrAst: ParseResult<t.File> | string): string[];
|
|
22
|
-
/**
|
|
23
|
-
* Lists all imports from the given Babel AST program.
|
|
24
|
-
*
|
|
25
|
-
* @param ast - The parsed Babel AST result containing the program body.
|
|
26
|
-
* @returns An array of import names, including "default" for default imports.
|
|
27
|
-
*/
|
|
28
|
-
declare function listImports(ast: ParseResult<t.File> | t.File): string[];
|
|
29
|
-
declare function isImportCall(calleePath: NodePath<t.CallExpression | t.NewExpression>): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the import declaration for a given name and specifier.
|
|
32
|
-
*
|
|
33
|
-
* @param specifier - The specifier of the import.
|
|
34
|
-
* @param name - The name of the import.
|
|
35
|
-
* @param named - Optional named import.
|
|
36
|
-
* @returns The import declaration.
|
|
37
|
-
*/
|
|
38
|
-
declare function getImport(specifier: string, name: string, named?: string): t.ImportDeclaration;
|
|
39
|
-
/**
|
|
40
|
-
* Adds an import to the program if it doesn't already exist.
|
|
41
|
-
*
|
|
42
|
-
* @param path - The current NodePath in the AST.
|
|
43
|
-
* @param specifier - The import specifier.
|
|
44
|
-
*/
|
|
45
|
-
declare function addImport(path: NodePath<any>, specifier: ImportSpecifier): void;
|
|
46
|
-
declare function addImportsToProgram(path: NodePath<t.Program>, specifier: ImportSpecifier): void;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { isImportCall as a, getImport as i, addImportsToProgram as n, listExports as o, findExport as r, listImports as s, addImport as t };
|
|
49
|
-
//# sourceMappingURL=module-helpers-BmiPAh2F.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-helpers-BmiPAh2F.d.mts","names":[],"sources":["../src/helpers/module-helpers.ts"],"mappings":";;;;;;;;AAgCA;;;;;iBAAgB,UAAA,CAAW,GAAA,EAAK,WAAA,CAAY,CAAA,CAAE,IAAA,GAAO,GAAA;;;;;;AA6BrD;iBAAgB,WAAA,CAAY,SAAA,EAAW,WAAA,CAAY,CAAA,CAAE,IAAA;;;;;;;iBA4BrC,WAAA,CAAY,GAAA,EAAK,WAAA,CAAY,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,IAAA;AAAA,iBAsBzC,YAAA,CACd,UAAA,EAAY,QAAA,CAAS,CAAA,CAAE,cAAA,GAAiB,CAAA,CAAE,aAAA;AAvB5C;;;;;;;;AAAA,iBAoCgB,SAAA,CACd,SAAA,UACA,IAAA,UACA,KAAA,YACC,CAAA,CAAE,iBAAA;;;;;;;iBAaW,SAAA,CAAU,IAAA,EAAM,QAAA,OAAe,SAAA,EAAW,eAAA;AAAA,iBAuC1C,mBAAA,CACd,IAAA,EAAM,QAAA,CAAS,CAAA,CAAE,OAAA,GACjB,SAAA,EAAW,eAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { c as BabelTransformPluginOptions, h as ResolvedBabelTransformPluginOptions } from "./config-D_d7N-Sl.mjs";
|
|
2
|
-
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
3
|
-
import { Context } from "@powerlines/core";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/options.d.ts
|
|
6
|
-
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
7
|
-
/**
|
|
8
|
-
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The context for the transformation.
|
|
11
|
-
* @param code - The code to be transformed.
|
|
12
|
-
* @param id - The ID of the source file.
|
|
13
|
-
* @param plugin - The Babel plugin to resolve.
|
|
14
|
-
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
15
|
-
*/
|
|
16
|
-
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { resolvePluginFunction as n, resolveBabelPlugin as t };
|
|
19
|
-
//# sourceMappingURL=options-CuRFY_V6.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options-CuRFY_V6.d.mts","names":[],"sources":["../src/helpers/options.ts"],"mappings":";;;;;iBA4BgB,qBAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,QAEI,YAAA,YAEC,YAAA,EAAc,aAAA,KACd,YAAA,EAAc,aAAA,wBAClB,2BAAA;;AARH;;;;;;;;iBA+BgB,kBAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,UACA,EAAA,UACA,MAAA,EAAQ,2BAAA,GACP,mCAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { c as BabelTransformPluginOptions, h as ResolvedBabelTransformPluginOptions } from "./config-CuJGOt8R.cjs";
|
|
2
|
-
import { Context } from "@powerlines/core";
|
|
3
|
-
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/options.d.ts
|
|
6
|
-
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
7
|
-
/**
|
|
8
|
-
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The context for the transformation.
|
|
11
|
-
* @param code - The code to be transformed.
|
|
12
|
-
* @param id - The ID of the source file.
|
|
13
|
-
* @param plugin - The Babel plugin to resolve.
|
|
14
|
-
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
15
|
-
*/
|
|
16
|
-
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { resolvePluginFunction as n, resolveBabelPlugin as t };
|
|
19
|
-
//# sourceMappingURL=options-ku57q3v6.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options-ku57q3v6.d.cts","names":[],"sources":["../src/helpers/options.ts"],"mappings":";;;;;iBA4BgB,qBAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,QAEI,YAAA,YAEC,YAAA,EAAc,aAAA,KACd,YAAA,EAAc,aAAA,wBAClB,2BAAA;;AARH;;;;;;;;iBA+BgB,kBAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,UACA,EAAA,UACA,MAAA,EAAQ,2BAAA,GACP,mCAAA"}
|