@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.
Files changed (66) hide show
  1. package/dist/ast-utils-BGST1RhV.d.cts +19 -0
  2. package/dist/ast-utils-BGST1RhV.d.cts.map +1 -0
  3. package/dist/ast-utils-BeOv3AgV.d.mts +19 -0
  4. package/dist/ast-utils-BeOv3AgV.d.mts.map +1 -0
  5. package/dist/{_virtual/_rolldown/runtime.cjs → chunk-C0xms8kb.cjs} +6 -1
  6. package/dist/config-BzcRczcc.d.mts +100 -0
  7. package/dist/config-BzcRczcc.d.mts.map +1 -0
  8. package/dist/config-CgI9xWKl.d.cts +100 -0
  9. package/dist/config-CgI9xWKl.d.cts.map +1 -0
  10. package/dist/create-plugin-Be2v0jCm.d.mts +15 -0
  11. package/dist/create-plugin-Be2v0jCm.d.mts.map +1 -0
  12. package/dist/create-plugin-CeH6OQaE.d.cts +15 -0
  13. package/dist/create-plugin-CeH6OQaE.d.cts.map +1 -0
  14. package/dist/filters-C3Ky7-QS.d.cts +51 -0
  15. package/dist/filters-C3Ky7-QS.d.cts.map +1 -0
  16. package/dist/filters-DpefCFsp.d.mts +51 -0
  17. package/dist/filters-DpefCFsp.d.mts.map +1 -0
  18. package/dist/helpers/ast-utils.cjs +2 -2
  19. package/dist/helpers/ast-utils.d.cts +2 -19
  20. package/dist/helpers/ast-utils.d.mts +2 -19
  21. package/dist/helpers/create-plugin.cjs +2 -2
  22. package/dist/helpers/create-plugin.d.cts +2 -15
  23. package/dist/helpers/create-plugin.d.mts +2 -15
  24. package/dist/helpers/filters.cjs +1 -1
  25. package/dist/helpers/filters.d.cts +2 -51
  26. package/dist/helpers/filters.d.mts +2 -51
  27. package/dist/helpers/index.d.cts +5 -5
  28. package/dist/helpers/index.d.mts +5 -5
  29. package/dist/helpers/module-helpers.cjs +2 -2
  30. package/dist/helpers/module-helpers.d.cts +2 -49
  31. package/dist/helpers/module-helpers.d.mts +2 -49
  32. package/dist/helpers/options.cjs +2 -2
  33. package/dist/helpers/options.d.cts +2 -44
  34. package/dist/helpers/options.d.mts +2 -44
  35. package/dist/index.cjs +4 -3
  36. package/dist/index.d.cts +6 -6
  37. package/dist/index.d.mts +6 -6
  38. package/dist/index.mjs +2 -1
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/module-helpers-BMn9yIG3.d.mts +49 -0
  41. package/dist/module-helpers-BMn9yIG3.d.mts.map +1 -0
  42. package/dist/module-helpers-CLxiipi8.d.cts +49 -0
  43. package/dist/module-helpers-CLxiipi8.d.cts.map +1 -0
  44. package/dist/options-C7VppRhK.d.mts +44 -0
  45. package/dist/options-C7VppRhK.d.mts.map +1 -0
  46. package/dist/options-CUWLPHiG.d.cts +44 -0
  47. package/dist/options-CUWLPHiG.d.cts.map +1 -0
  48. package/dist/types/config.d.cts +2 -100
  49. package/dist/types/config.d.mts +2 -100
  50. package/dist/types/index.d.cts +1 -1
  51. package/dist/types/index.d.mts +1 -1
  52. package/dist/types/plugin.d.cts +1 -1
  53. package/dist/types/plugin.d.mts +1 -1
  54. package/package.json +10 -10
  55. package/dist/helpers/ast-utils.d.cts.map +0 -1
  56. package/dist/helpers/ast-utils.d.mts.map +0 -1
  57. package/dist/helpers/create-plugin.d.cts.map +0 -1
  58. package/dist/helpers/create-plugin.d.mts.map +0 -1
  59. package/dist/helpers/filters.d.cts.map +0 -1
  60. package/dist/helpers/filters.d.mts.map +0 -1
  61. package/dist/helpers/module-helpers.d.cts.map +0 -1
  62. package/dist/helpers/module-helpers.d.mts.map +0 -1
  63. package/dist/helpers/options.d.cts.map +0 -1
  64. package/dist/helpers/options.d.mts.map +0 -1
  65. package/dist/types/config.d.cts.map +0 -1
  66. package/dist/types/config.d.mts.map +0 -1
@@ -1,51 +1,2 @@
1
- import { BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, BabelTransformPresetOptions, ResolvedBabelTransformPluginOptions, ResolvedBabelTransformPresetOptions } from "../types/config.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 { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset };
51
- //# sourceMappingURL=filters.d.mts.map
1
+ import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "../filters-DpefCFsp.mjs";
2
+ export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset };
@@ -1,6 +1,6 @@
1
- import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./ast-utils.cjs";
2
- import { createBabelPlugin } from "./create-plugin.cjs";
3
- import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset } from "./filters.cjs";
4
- import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./module-helpers.cjs";
5
- import { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction } from "./options.cjs";
1
+ import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "../ast-utils-BGST1RhV.cjs";
2
+ import { t as createBabelPlugin } from "../create-plugin-CeH6OQaE.cjs";
3
+ import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "../filters-C3Ky7-QS.cjs";
4
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "../module-helpers-CLxiipi8.cjs";
5
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "../options-CUWLPHiG.cjs";
6
6
  export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, addImport, addImportsToProgram, addPluginFilter, createBabelPlugin, filterPluginByFileId, findExport, generateFromAst, getImport, getPluginName, getUniquePlugins, getUniquePresets, isDuplicatePlugin, isDuplicatePreset, isImportCall, listExports, listImports, parseAst, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
@@ -1,6 +1,6 @@
1
- import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./ast-utils.mjs";
2
- import { createBabelPlugin } from "./create-plugin.mjs";
3
- import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset } from "./filters.mjs";
4
- import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./module-helpers.mjs";
5
- import { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction } from "./options.mjs";
1
+ import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "../ast-utils-BeOv3AgV.mjs";
2
+ import { t as createBabelPlugin } from "../create-plugin-Be2v0jCm.mjs";
3
+ import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "../filters-DpefCFsp.mjs";
4
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "../module-helpers-BMn9yIG3.mjs";
5
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "../options-C7VppRhK.mjs";
6
6
  export { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, addImport, addImportsToProgram, addPluginFilter, createBabelPlugin, filterPluginByFileId, findExport, generateFromAst, getImport, getPluginName, getUniquePlugins, getUniquePresets, isDuplicatePlugin, isDuplicatePreset, isImportCall, listExports, listImports, parseAst, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_chunk = require('../chunk-C0xms8kb.cjs');
3
3
  const require_helpers_ast_utils = require('./ast-utils.cjs');
4
4
  let _babel_types = require("@babel/types");
5
- _babel_types = require_runtime.__toESM(_babel_types, 1);
5
+ _babel_types = require_chunk.__toESM(_babel_types, 1);
6
6
  let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
7
7
 
8
8
  //#region src/helpers/module-helpers.ts
@@ -1,49 +1,2 @@
1
- import { ImportSpecifier } from "../types/config.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 { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
49
- //# sourceMappingURL=module-helpers.d.cts.map
1
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "../module-helpers-CLxiipi8.cjs";
2
+ export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
@@ -1,49 +1,2 @@
1
- import { ImportSpecifier } from "../types/config.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 { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
49
- //# sourceMappingURL=module-helpers.d.mts.map
1
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "../module-helpers-BMn9yIG3.mjs";
2
+ export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_chunk = require('../chunk-C0xms8kb.cjs');
3
3
  const require_helpers_filters = require('./filters.cjs');
4
4
  let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
5
5
  let chalk = require("chalk");
6
- chalk = require_runtime.__toESM(chalk, 1);
6
+ chalk = require_chunk.__toESM(chalk, 1);
7
7
 
8
8
  //#region src/helpers/options.ts
9
9
  function resolvePluginFunction(context, plugin) {
@@ -1,44 +1,2 @@
1
- import { BabelTransformPluginOptions, BabelTransformPresetOptions, ResolvedBabelTransformPluginOptions, ResolvedBabelTransformPresetOptions } from "../types/config.cjs";
2
- import { Context } from "@powerlines/core";
3
- import { PluginItem, PluginTarget, PresetItem, PresetTarget } from "@babel/core";
4
-
5
- //#region src/helpers/options.d.ts
6
- declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginItem] | [PluginTarget, PluginItem, string | undefined]): BabelTransformPluginOptions;
7
- declare function resolvePresetFunction(context: Context, preset: any | PresetTarget | any[] | [PresetTarget, PresetItem] | [PresetTarget, PresetItem, string | undefined]): BabelTransformPresetOptions;
8
- /**
9
- * Resolve the [Babel](https://babeljs.io/) plugin.
10
- *
11
- * @param context - The context for the transformation.
12
- * @param code - The code to be transformed.
13
- * @param id - The ID of the source file.
14
- * @param plugin - The Babel plugin to resolve.
15
- * @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
16
- */
17
- declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
18
- /**
19
- * Resolve the [Babel](https://babeljs.io/) preset.
20
- *
21
- * @param context - The context for the transformation.
22
- * @param code - The code to be transformed.
23
- * @param id - The ID of the source file.
24
- * @param preset - The Babel preset to resolve.
25
- * @returns The resolved Babel preset options, or undefined if the preset is filtered out.
26
- */
27
- declare function resolveBabelPreset(context: Context, code: string, id: string, preset: BabelTransformPresetOptions): ResolvedBabelTransformPresetOptions | undefined;
28
- /**
29
- * Get a list of unique Babel plugins, filtering out duplicates based on their names.
30
- *
31
- * @param plugins - The list of Babel plugins to filter for uniqueness.
32
- * @returns A list of unique Babel plugins.
33
- */
34
- declare function getUniquePlugins<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[]): T[];
35
- /**
36
- * Get a list of unique Babel presets, filtering out duplicates based on their names.
37
- *
38
- * @param presets - The list of Babel presets to filter for uniqueness.
39
- * @returns A list of unique Babel presets.
40
- */
41
- declare function getUniquePresets<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[]): T[];
42
- //#endregion
43
- export { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
44
- //# sourceMappingURL=options.d.cts.map
1
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "../options-CUWLPHiG.cjs";
2
+ export { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
@@ -1,44 +1,2 @@
1
- import { BabelTransformPluginOptions, BabelTransformPresetOptions, ResolvedBabelTransformPluginOptions, ResolvedBabelTransformPresetOptions } from "../types/config.mjs";
2
- import { PluginItem, PluginTarget, PresetItem, PresetTarget } 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, PluginItem] | [PluginTarget, PluginItem, string | undefined]): BabelTransformPluginOptions;
7
- declare function resolvePresetFunction(context: Context, preset: any | PresetTarget | any[] | [PresetTarget, PresetItem] | [PresetTarget, PresetItem, string | undefined]): BabelTransformPresetOptions;
8
- /**
9
- * Resolve the [Babel](https://babeljs.io/) plugin.
10
- *
11
- * @param context - The context for the transformation.
12
- * @param code - The code to be transformed.
13
- * @param id - The ID of the source file.
14
- * @param plugin - The Babel plugin to resolve.
15
- * @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
16
- */
17
- declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
18
- /**
19
- * Resolve the [Babel](https://babeljs.io/) preset.
20
- *
21
- * @param context - The context for the transformation.
22
- * @param code - The code to be transformed.
23
- * @param id - The ID of the source file.
24
- * @param preset - The Babel preset to resolve.
25
- * @returns The resolved Babel preset options, or undefined if the preset is filtered out.
26
- */
27
- declare function resolveBabelPreset(context: Context, code: string, id: string, preset: BabelTransformPresetOptions): ResolvedBabelTransformPresetOptions | undefined;
28
- /**
29
- * Get a list of unique Babel plugins, filtering out duplicates based on their names.
30
- *
31
- * @param plugins - The list of Babel plugins to filter for uniqueness.
32
- * @returns A list of unique Babel plugins.
33
- */
34
- declare function getUniquePlugins<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[]): T[];
35
- /**
36
- * Get a list of unique Babel presets, filtering out duplicates based on their names.
37
- *
38
- * @param presets - The list of Babel presets to filter for uniqueness.
39
- * @returns A list of unique Babel presets.
40
- */
41
- declare function getUniquePresets<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[]): T[];
42
- //#endregion
43
- export { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
44
- //# sourceMappingURL=options.d.mts.map
1
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "../options-C7VppRhK.mjs";
2
+ export { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction };
package/dist/index.cjs CHANGED
@@ -1,11 +1,12 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_chunk = require('./chunk-C0xms8kb.cjs');
3
3
  const require_helpers_filters = require('./helpers/filters.cjs');
4
4
  const require_helpers_options = require('./helpers/options.cjs');
5
5
  const require_helpers_ast_utils = require('./helpers/ast-utils.cjs');
6
6
  const require_helpers_create_plugin = require('./helpers/create-plugin.cjs');
7
7
  const require_helpers_module_helpers = require('./helpers/module-helpers.cjs');
8
8
  require('./helpers/index.cjs');
9
+ require('./types/index.cjs');
9
10
  let _babel_core = require("@babel/core");
10
11
  let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
11
12
  let _stryke_helpers_omit = require("@stryke/helpers/omit");
@@ -14,7 +15,7 @@ let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
14
15
  let _stryke_type_checks_is_empty_object = require("@stryke/type-checks/is-empty-object");
15
16
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
16
17
  let defu = require("defu");
17
- defu = require_runtime.__toESM(defu, 1);
18
+ defu = require_chunk.__toESM(defu, 1);
18
19
  let node_util_types = require("node:util/types");
19
20
 
20
21
  //#region src/index.ts
@@ -72,7 +73,7 @@ const plugin = (options = {}) => {
72
73
  configFile: false,
73
74
  babelrc: false,
74
75
  envName: this.config.mode,
75
- caller: { name: this.config.framework },
76
+ caller: { name: this.config.framework?.name || "powerlines" },
76
77
  ...(0, _stryke_helpers_omit.omit)(this.config.babel ?? {}, ["skipConfigResolution", "skipTransform"]),
77
78
  filename: (0, _powerlines_core_plugin_utils.removeVirtualPrefix)(id),
78
79
  plugins: plugins.map((plugin) => {
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.cjs";
2
- import { BabelPluginPass, BabelResolvedConfig, BabelTransformInput, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, BabelTransformPreset, BabelTransformPresetOptions, BabelUserConfig, DeclareBabelTransformPluginReturn, DefaultImportDefinition, ImportDefinition, ImportSpecifier, NamedImportDefinition, ResolvedBabelTransformPluginOptions, ResolvedBabelTransformPresetOptions, __ΩBabelPluginPass, __ΩBabelResolvedConfig, __ΩBabelTransformInput, __ΩBabelTransformPlugin, __ΩBabelTransformPluginBuilder, __ΩBabelTransformPluginBuilderParams, __ΩBabelTransformPluginFilter, __ΩBabelTransformPluginOptions, __ΩBabelTransformPreset, __ΩBabelTransformPresetOptions, __ΩBabelUserConfig, __ΩDeclareBabelTransformPluginReturn, __ΩDefaultImportDefinition, __ΩImportDefinition, __ΩImportSpecifier, __ΩNamedImportDefinition, __ΩResolvedBabelTransformPluginOptions, __ΩResolvedBabelTransformPresetOptions } from "./types/config.cjs";
3
- import { createBabelPlugin } from "./helpers/create-plugin.cjs";
4
- import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset } from "./helpers/filters.cjs";
5
- import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.cjs";
6
- import { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction } from "./helpers/options.cjs";
1
+ import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "./ast-utils-BGST1RhV.cjs";
2
+ import { A as __ΩDeclareBabelTransformPluginReturn, C as __ΩBabelTransformPluginBuilder, D as __ΩBabelTransformPreset, E as __ΩBabelTransformPluginOptions, F as __ΩResolvedBabelTransformPluginOptions, I as __ΩResolvedBabelTransformPresetOptions, M as __ΩImportDefinition, N as __ΩImportSpecifier, O as __ΩBabelTransformPresetOptions, P as __ΩNamedImportDefinition, S as __ΩBabelTransformPlugin, T as __ΩBabelTransformPluginFilter, _ as ResolvedBabelTransformPluginOptions, a as BabelTransformPluginBuilder, b as __ΩBabelResolvedConfig, c as BabelTransformPluginOptions, d as BabelUserConfig, f as DeclareBabelTransformPluginReturn, g as NamedImportDefinition, h as ImportSpecifier, i as BabelTransformPlugin, j as __ΩDefaultImportDefinition, k as __ΩBabelUserConfig, l as BabelTransformPreset, m as ImportDefinition, n as BabelResolvedConfig, o as BabelTransformPluginBuilderParams, p as DefaultImportDefinition, r as BabelTransformInput, s as BabelTransformPluginFilter, t as BabelPluginPass, u as BabelTransformPresetOptions, v as ResolvedBabelTransformPresetOptions, w as __ΩBabelTransformPluginBuilderParams, x as __ΩBabelTransformInput, y as __ΩBabelPluginPass } from "./config-CgI9xWKl.cjs";
3
+ import { t as createBabelPlugin } from "./create-plugin-CeH6OQaE.cjs";
4
+ import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "./filters-C3Ky7-QS.cjs";
5
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "./module-helpers-CLxiipi8.cjs";
6
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "./options-CUWLPHiG.cjs";
7
7
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.cjs";
8
8
  import { Plugin } from "@powerlines/core";
9
9
 
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { GenerateFromAstOptions, GeneratorResult, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from "./helpers/ast-utils.mjs";
2
- import { BabelPluginPass, BabelResolvedConfig, BabelTransformInput, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, BabelTransformPreset, BabelTransformPresetOptions, BabelUserConfig, DeclareBabelTransformPluginReturn, DefaultImportDefinition, ImportDefinition, ImportSpecifier, NamedImportDefinition, ResolvedBabelTransformPluginOptions, ResolvedBabelTransformPresetOptions, __ΩBabelPluginPass, __ΩBabelResolvedConfig, __ΩBabelTransformInput, __ΩBabelTransformPlugin, __ΩBabelTransformPluginBuilder, __ΩBabelTransformPluginBuilderParams, __ΩBabelTransformPluginFilter, __ΩBabelTransformPluginOptions, __ΩBabelTransformPreset, __ΩBabelTransformPresetOptions, __ΩBabelUserConfig, __ΩDeclareBabelTransformPluginReturn, __ΩDefaultImportDefinition, __ΩImportDefinition, __ΩImportSpecifier, __ΩNamedImportDefinition, __ΩResolvedBabelTransformPluginOptions, __ΩResolvedBabelTransformPresetOptions } from "./types/config.mjs";
3
- import { createBabelPlugin } from "./helpers/create-plugin.mjs";
4
- import { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin, isDuplicatePreset } from "./helpers/filters.mjs";
5
- import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.mjs";
6
- import { getUniquePlugins, getUniquePresets, resolveBabelPlugin, resolveBabelPreset, resolvePluginFunction, resolvePresetFunction } from "./helpers/options.mjs";
1
+ import { a as parseAst, i as generateFromAst, n as GeneratorResult, r as __ΩGenerateFromAstOptions, t as GenerateFromAstOptions } from "./ast-utils-BeOv3AgV.mjs";
2
+ import { A as __ΩDeclareBabelTransformPluginReturn, C as __ΩBabelTransformPluginBuilder, D as __ΩBabelTransformPreset, E as __ΩBabelTransformPluginOptions, F as __ΩResolvedBabelTransformPluginOptions, I as __ΩResolvedBabelTransformPresetOptions, M as __ΩImportDefinition, N as __ΩImportSpecifier, O as __ΩBabelTransformPresetOptions, P as __ΩNamedImportDefinition, S as __ΩBabelTransformPlugin, T as __ΩBabelTransformPluginFilter, _ as ResolvedBabelTransformPluginOptions, a as BabelTransformPluginBuilder, b as __ΩBabelResolvedConfig, c as BabelTransformPluginOptions, d as BabelUserConfig, f as DeclareBabelTransformPluginReturn, g as NamedImportDefinition, h as ImportSpecifier, i as BabelTransformPlugin, j as __ΩDefaultImportDefinition, k as __ΩBabelUserConfig, l as BabelTransformPreset, m as ImportDefinition, n as BabelResolvedConfig, o as BabelTransformPluginBuilderParams, p as DefaultImportDefinition, r as BabelTransformInput, s as BabelTransformPluginFilter, t as BabelPluginPass, u as BabelTransformPresetOptions, v as ResolvedBabelTransformPresetOptions, w as __ΩBabelTransformPluginBuilderParams, x as __ΩBabelTransformInput, y as __ΩBabelPluginPass } from "./config-BzcRczcc.mjs";
3
+ import { t as createBabelPlugin } from "./create-plugin-Be2v0jCm.mjs";
4
+ import { a as isDuplicatePreset, i as isDuplicatePlugin, n as filterPluginByFileId, r as getPluginName, t as addPluginFilter } from "./filters-DpefCFsp.mjs";
5
+ import { a as isImportCall, i as getImport, n as addImportsToProgram, o as listExports, r as findExport, s as listImports, t as addImport } from "./module-helpers-BMn9yIG3.mjs";
6
+ import { a as resolvePluginFunction, i as resolveBabelPreset, n as getUniquePresets, o as resolvePresetFunction, r as resolveBabelPlugin, t as getUniquePlugins } from "./options-C7VppRhK.mjs";
7
7
  import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./types/plugin.mjs";
8
8
  import { Plugin } from "@powerlines/core";
9
9
 
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import { generateFromAst, parseAst } from "./helpers/ast-utils.mjs";
4
4
  import { createBabelPlugin } from "./helpers/create-plugin.mjs";
5
5
  import { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from "./helpers/module-helpers.mjs";
6
6
  import "./helpers/index.mjs";
7
+ import "./types/index.mjs";
7
8
  import { transformAsync } from "@babel/core";
8
9
  import { removeVirtualPrefix } from "@powerlines/core/plugin-utils";
9
10
  import { omit } from "@stryke/helpers/omit";
@@ -69,7 +70,7 @@ const plugin = (options = {}) => {
69
70
  configFile: false,
70
71
  babelrc: false,
71
72
  envName: this.config.mode,
72
- caller: { name: this.config.framework },
73
+ caller: { name: this.config.framework?.name || "powerlines" },
73
74
  ...omit(this.config.babel ?? {}, ["skipConfigResolution", "skipTransform"]),
74
75
  filename: removeVirtualPrefix(id),
75
76
  plugins: plugins.map((plugin) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginItem, PresetItem, transformAsync } from \"@babel/core\";\nimport type { Plugin } from \"@powerlines/core\";\nimport { removeVirtualPrefix } from \"@powerlines/core/plugin-utils\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { isSet } from \"node:util/types\";\nimport { isDuplicatePlugin, isDuplicatePreset } from \"./helpers/filters\";\nimport {\n getUniquePlugins,\n getUniquePresets,\n resolveBabelPlugin,\n resolveBabelPreset\n} from \"./helpers/options\";\nimport {\n ResolvedBabelTransformPluginOptions,\n ResolvedBabelTransformPresetOptions\n} from \"./types/config\";\nimport { BabelPluginContext, BabelPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n babel?: BabelPluginOptions;\n }\n}\n\n/**\n * Babel plugin for Powerlines.\n *\n * @param options - The Babel plugin user configuration options.\n * @returns A Powerlines plugin that integrates Babel transformations.\n */\nexport const plugin = <\n TContext extends BabelPluginContext = BabelPluginContext\n>(\n options: BabelPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"babel\",\n config() {\n if (!isSetObject(options)) {\n return undefined;\n }\n\n return {\n babel: options\n };\n },\n configResolved: {\n order: \"pre\",\n handler() {\n this.config.babel = defu(this.config.babel ?? {}, {\n plugins: [],\n presets: []\n });\n\n this.config.babel.plugins = getUniquePlugins(this.config.babel.plugins);\n this.config.babel.presets = getUniquePresets(this.config.babel.presets);\n }\n },\n async transform(code: string, id: string) {\n if (\n isParentPath(id, this.powerlinesPath) ||\n code.includes(\"/* @powerlines-ignore */\") ||\n code.includes(\"/* @powerlines-disable */\")\n ) {\n this.trace(`Skipping Babel transformation for: ${id}`);\n\n return { code, id };\n }\n\n const plugins = getUniquePlugins(\n this.config.babel.plugins\n .map(plugin => resolveBabelPlugin(this, code, id, plugin))\n .filter(Boolean) as ResolvedBabelTransformPluginOptions[]\n );\n const presets = getUniquePresets(\n this.config.babel.presets\n .map(preset => resolveBabelPreset(this, code, id, preset))\n .filter(Boolean) as ResolvedBabelTransformPresetOptions[]\n );\n\n if (\n Array.isArray(plugins) &&\n plugins.length === 0 &&\n Array.isArray(presets) &&\n presets.length === 0\n ) {\n return { code, id };\n }\n\n if (!this.config.babel?.skipConfigResolution) {\n if (\n /^(?:m|c)?tsx?$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-typescript\") &&\n !isDuplicatePreset(presets, \"@babel/preset-typescript\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-typescript\");\n }\n\n if (\n /^(?:t|j)sx$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-jsx\") &&\n !isDuplicatePreset(presets, \"@babel/preset-react\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-jsx\");\n }\n }\n\n this.trace(\n `Running babel transformations with ${plugins.length} plugins and ${\n presets.length\n } presets for file: ${id}`\n );\n\n const result = await transformAsync(code, {\n cwd: this.config.cwd,\n highlightCode: true,\n code: true,\n ast: false,\n cloneInputAst: false,\n comments: true,\n sourceType: \"module\",\n configFile: false,\n babelrc: false,\n envName: this.config.mode,\n caller: {\n name: this.config.framework\n },\n ...omit(this.config.babel ?? {}, [\n \"skipConfigResolution\",\n \"skipTransform\"\n ]),\n filename: removeVirtualPrefix(id),\n plugins: plugins\n .map(plugin => {\n if (Array.isArray(plugin) && plugin.length >= 2) {\n if (\n plugin\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return plugin[0];\n }\n\n return [\n plugin[0],\n plugin.length > 1 && plugin[1] ? plugin[1] : {}\n ];\n }\n\n return plugin;\n })\n .filter(Boolean) as PluginItem<object>[],\n presets: presets\n .map(preset => {\n if (Array.isArray(preset) && preset.length >= 2) {\n if (\n preset\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return preset[0];\n }\n\n return [\n preset[0],\n preset.length > 1 && preset[1] ? preset[1] : {}\n ];\n }\n\n return preset;\n })\n .filter(Boolean) as PresetItem<object>[]\n });\n if (!result?.code) {\n throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);\n }\n\n this.trace(`Completed babel transformations for file: ${id}`);\n\n return {\n code: this.config.babel?.skipTransform ? code : result.code,\n id\n };\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginItem, PresetItem, transformAsync } from \"@babel/core\";\nimport type { Plugin } from \"@powerlines/core\";\nimport { removeVirtualPrefix } from \"@powerlines/core/plugin-utils\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileExtensionSafe } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { isSet } from \"node:util/types\";\nimport { isDuplicatePlugin, isDuplicatePreset } from \"./helpers/filters\";\nimport {\n getUniquePlugins,\n getUniquePresets,\n resolveBabelPlugin,\n resolveBabelPreset\n} from \"./helpers/options\";\nimport {\n ResolvedBabelTransformPluginOptions,\n ResolvedBabelTransformPresetOptions\n} from \"./types/config\";\nimport { BabelPluginContext, BabelPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n babel?: BabelPluginOptions;\n }\n}\n\n/**\n * Babel plugin for Powerlines.\n *\n * @param options - The Babel plugin user configuration options.\n * @returns A Powerlines plugin that integrates Babel transformations.\n */\nexport const plugin = <\n TContext extends BabelPluginContext = BabelPluginContext\n>(\n options: BabelPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"babel\",\n config() {\n if (!isSetObject(options)) {\n return undefined;\n }\n\n return {\n babel: options\n };\n },\n configResolved: {\n order: \"pre\",\n handler() {\n this.config.babel = defu(this.config.babel ?? {}, {\n plugins: [],\n presets: []\n });\n\n this.config.babel.plugins = getUniquePlugins(this.config.babel.plugins);\n this.config.babel.presets = getUniquePresets(this.config.babel.presets);\n }\n },\n async transform(code: string, id: string) {\n if (\n isParentPath(id, this.powerlinesPath) ||\n code.includes(\"/* @powerlines-ignore */\") ||\n code.includes(\"/* @powerlines-disable */\")\n ) {\n this.trace(`Skipping Babel transformation for: ${id}`);\n\n return { code, id };\n }\n\n const plugins = getUniquePlugins(\n this.config.babel.plugins\n .map(plugin => resolveBabelPlugin(this, code, id, plugin))\n .filter(Boolean) as ResolvedBabelTransformPluginOptions[]\n );\n const presets = getUniquePresets(\n this.config.babel.presets\n .map(preset => resolveBabelPreset(this, code, id, preset))\n .filter(Boolean) as ResolvedBabelTransformPresetOptions[]\n );\n\n if (\n Array.isArray(plugins) &&\n plugins.length === 0 &&\n Array.isArray(presets) &&\n presets.length === 0\n ) {\n return { code, id };\n }\n\n if (!this.config.babel?.skipConfigResolution) {\n if (\n /^(?:m|c)?tsx?$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-typescript\") &&\n !isDuplicatePreset(presets, \"@babel/preset-typescript\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-typescript\");\n }\n\n if (\n /^(?:t|j)sx$/.test(\n findFileExtensionSafe(id, {\n fullExtension: true\n })\n ) &&\n !isDuplicatePlugin(plugins, \"@babel/plugin-syntax-jsx\") &&\n !isDuplicatePreset(presets, \"@babel/preset-react\")\n ) {\n plugins.unshift(\"@babel/plugin-syntax-jsx\");\n }\n }\n\n this.trace(\n `Running babel transformations with ${plugins.length} plugins and ${\n presets.length\n } presets for file: ${id}`\n );\n\n const result = await transformAsync(code, {\n cwd: this.config.cwd,\n highlightCode: true,\n code: true,\n ast: false,\n cloneInputAst: false,\n comments: true,\n sourceType: \"module\",\n configFile: false,\n babelrc: false,\n envName: this.config.mode,\n caller: {\n name: this.config.framework?.name || \"powerlines\"\n },\n ...omit(this.config.babel ?? {}, [\n \"skipConfigResolution\",\n \"skipTransform\"\n ]),\n filename: removeVirtualPrefix(id),\n plugins: plugins\n .map(plugin => {\n if (Array.isArray(plugin) && plugin.length >= 2) {\n if (\n plugin\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return plugin[0];\n }\n\n return [\n plugin[0],\n plugin.length > 1 && plugin[1] ? plugin[1] : {}\n ];\n }\n\n return plugin;\n })\n .filter(Boolean) as PluginItem<object>[],\n presets: presets\n .map(preset => {\n if (Array.isArray(preset) && preset.length >= 2) {\n if (\n preset\n .slice(1)\n .every(item => !isSet(item) || isEmptyObject(item))\n ) {\n return preset[0];\n }\n\n return [\n preset[0],\n preset.length > 1 && preset[1] ? preset[1] : {}\n ];\n }\n\n return preset;\n })\n .filter(Boolean) as PresetItem<object>[]\n });\n if (!result?.code) {\n throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);\n }\n\n this.trace(`Completed babel transformations for file: ${id}`);\n\n return {\n code: this.config.babel?.skipTransform ? code : result.code,\n id\n };\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":"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"}
@@ -0,0 +1,49 @@
1
+ import { h as ImportSpecifier } from "./config-BzcRczcc.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-BMn9yIG3.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-helpers-BMn9yIG3.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"}
@@ -0,0 +1,49 @@
1
+ import { h as ImportSpecifier } from "./config-CgI9xWKl.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-CLxiipi8.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-helpers-CLxiipi8.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"}
@@ -0,0 +1,44 @@
1
+ import { _ as ResolvedBabelTransformPluginOptions, c as BabelTransformPluginOptions, u as BabelTransformPresetOptions, v as ResolvedBabelTransformPresetOptions } from "./config-BzcRczcc.mjs";
2
+ import { PluginItem, PluginTarget, PresetItem, PresetTarget } 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, PluginItem] | [PluginTarget, PluginItem, string | undefined]): BabelTransformPluginOptions;
7
+ declare function resolvePresetFunction(context: Context, preset: any | PresetTarget | any[] | [PresetTarget, PresetItem] | [PresetTarget, PresetItem, string | undefined]): BabelTransformPresetOptions;
8
+ /**
9
+ * Resolve the [Babel](https://babeljs.io/) plugin.
10
+ *
11
+ * @param context - The context for the transformation.
12
+ * @param code - The code to be transformed.
13
+ * @param id - The ID of the source file.
14
+ * @param plugin - The Babel plugin to resolve.
15
+ * @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
16
+ */
17
+ declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
18
+ /**
19
+ * Resolve the [Babel](https://babeljs.io/) preset.
20
+ *
21
+ * @param context - The context for the transformation.
22
+ * @param code - The code to be transformed.
23
+ * @param id - The ID of the source file.
24
+ * @param preset - The Babel preset to resolve.
25
+ * @returns The resolved Babel preset options, or undefined if the preset is filtered out.
26
+ */
27
+ declare function resolveBabelPreset(context: Context, code: string, id: string, preset: BabelTransformPresetOptions): ResolvedBabelTransformPresetOptions | undefined;
28
+ /**
29
+ * Get a list of unique Babel plugins, filtering out duplicates based on their names.
30
+ *
31
+ * @param plugins - The list of Babel plugins to filter for uniqueness.
32
+ * @returns A list of unique Babel plugins.
33
+ */
34
+ declare function getUniquePlugins<T extends BabelTransformPluginOptions | ResolvedBabelTransformPluginOptions>(plugins: T[]): T[];
35
+ /**
36
+ * Get a list of unique Babel presets, filtering out duplicates based on their names.
37
+ *
38
+ * @param presets - The list of Babel presets to filter for uniqueness.
39
+ * @returns A list of unique Babel presets.
40
+ */
41
+ declare function getUniquePresets<T extends BabelTransformPresetOptions | ResolvedBabelTransformPresetOptions>(presets: T[]): T[];
42
+ //#endregion
43
+ export { resolvePluginFunction as a, resolveBabelPreset as i, getUniquePresets as n, resolvePresetFunction as o, resolveBabelPlugin as r, getUniquePlugins as t };
44
+ //# sourceMappingURL=options-C7VppRhK.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options-C7VppRhK.d.mts","names":[],"sources":["../src/helpers/options.ts"],"mappings":";;;;;iBAmCgB,qBAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,QAEI,YAAA,YAEC,YAAA,EAAc,UAAA,KACd,YAAA,EAAc,UAAA,wBAClB,2BAAA;AAAA,iBAca,qBAAA,CACd,OAAA,EAAS,OAAA,EACT,MAAA,QAEI,YAAA,YAEC,YAAA,EAAc,UAAA,KACd,YAAA,EAAc,UAAA,wBAClB,2BAAA;AA9BH;;;;;;;;;AAAA,iBAqDgB,kBAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,UACA,EAAA,UACA,MAAA,EAAQ,2BAAA,GACP,mCAAA;;;;;;;;;;iBAwCa,kBAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,UACA,EAAA,UACA,MAAA,EAAQ,2BAAA,GACP,mCAAA;;;;AAjFH;;;iBAsHgB,gBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,KAAM,CAAA;;;;;;;iBAgBD,gBAAA,WACJ,2BAAA,GAA8B,mCAAA,CAAA,CACxC,OAAA,EAAS,CAAA,KAAM,CAAA"}