@powerlines/plugin-babel 0.12.130 → 0.12.132
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-BcmWaIan.cjs +45 -0
- package/dist/ast-utils-Bs6DBkKg.d.mts +19 -0
- package/dist/ast-utils-DU1foCxH.mjs +32 -0
- package/dist/ast-utils-DeuXcuqs.d.cts +19 -0
- package/dist/babel-BBpAODp3.d.cts +1812 -0
- package/dist/babel-Cbfq7l5M.d.mts +1812 -0
- package/dist/{_virtual/rolldown_runtime.cjs → chunk-CbDLau6x.cjs} +6 -1
- package/dist/create-plugin-BPSvsem_.mjs +73 -0
- package/dist/create-plugin-Bovo30sw.d.cts +14 -0
- package/dist/create-plugin-C9ijark9.d.mts +14 -0
- package/dist/create-plugin-Cs1zZrvI.cjs +80 -0
- package/dist/filters-BKYGMZeC.d.cts +41 -0
- package/dist/filters-BjswEAwZ.d.mts +44 -0
- package/dist/filters-C04cfcQR.mjs +55 -0
- package/dist/filters-Dl2RKvrm.cjs +79 -0
- package/dist/helpers/ast-utils.cjs +3 -34
- package/dist/helpers/ast-utils.d.cts +2 -19
- package/dist/helpers/ast-utils.d.mts +2 -19
- package/dist/helpers/ast-utils.mjs +1 -30
- package/dist/helpers/create-plugin.cjs +2 -40
- package/dist/helpers/create-plugin.d.cts +2 -14
- package/dist/helpers/create-plugin.d.mts +2 -14
- package/dist/helpers/create-plugin.mjs +1 -37
- package/dist/helpers/filters.cjs +5 -58
- package/dist/helpers/filters.d.cts +2 -41
- package/dist/helpers/filters.d.mts +2 -42
- package/dist/helpers/filters.mjs +1 -53
- package/dist/helpers/index.cjs +22 -21
- package/dist/helpers/index.d.cts +7 -5
- package/dist/helpers/index.d.mts +7 -5
- package/dist/helpers/index.mjs +6 -5
- package/dist/helpers/module-helpers.cjs +9 -102
- package/dist/helpers/module-helpers.d.cts +2 -48
- package/dist/helpers/module-helpers.d.mts +2 -48
- package/dist/helpers/module-helpers.mjs +2 -93
- package/dist/helpers/options.cjs +4 -49
- package/dist/helpers/options.d.cts +2 -17
- package/dist/helpers/options.d.mts +2 -17
- package/dist/helpers/options.mjs +2 -45
- package/dist/helpers-BnW_4z5h.mjs +1 -0
- package/dist/helpers-Bx2yBrpn.cjs +0 -0
- package/dist/index-ClXLQ1fw.d.mts +1 -0
- package/dist/index-DeEmP3Jc.d.cts +1 -0
- package/dist/index-QbUkWSLh.d.mts +1 -0
- package/dist/index-zO0Ly4bS.d.cts +1 -0
- package/dist/index.cjs +29 -27
- package/dist/index.d.cts +9 -8
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +8 -6
- package/dist/module-helpers-Ckq8sc4l.mjs +95 -0
- package/dist/module-helpers-CrrcOmWC.d.cts +49 -0
- package/dist/module-helpers-Non-jHMu.cjs +138 -0
- package/dist/module-helpers-R1r-1jnQ.d.mts +49 -0
- package/dist/options-BQhc80ih.mjs +47 -0
- package/dist/options-BR6Dzmpl.d.mts +17 -0
- package/dist/options-jLnSoEkN.d.cts +17 -0
- package/dist/options-u2MhTIFH.cjs +60 -0
- package/dist/plugin-BL8TLixo.mjs +1 -0
- package/dist/plugin-BSBH78mm.cjs +0 -0
- package/dist/plugin-CctoTNv_.d.mts +17 -0
- package/dist/plugin-DzY_qzHo.d.cts +17 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +3 -1
- package/dist/types/index.d.mts +3 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +2 -18
- package/dist/types/plugin.d.mts +2 -18
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CKPddlfS.cjs +0 -0
- package/dist/types-CvhspRRt.mjs +1 -0
- package/package.json +5 -5
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
- package/dist/powerlines/src/lib/logger.cjs +0 -41
- package/dist/powerlines/src/lib/logger.mjs +0 -39
- package/dist/powerlines/src/types/api.d.mts +0 -5
- package/dist/powerlines/src/types/babel.d.cts +0 -50
- package/dist/powerlines/src/types/babel.d.mts +0 -50
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -145
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -380
- package/dist/powerlines/src/types/config.d.mts +0 -380
- package/dist/powerlines/src/types/context.d.cts +0 -403
- package/dist/powerlines/src/types/context.d.mts +0 -405
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -82
- package/dist/powerlines/src/types/resolved.d.mts +0 -82
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.mts +0 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { o as ImportSpecifier } from "./babel-Cbfq7l5M.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
|
+
/**
|
|
9
|
+
* Finds an export in the given Babel AST program by its key.
|
|
10
|
+
*
|
|
11
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
12
|
+
* @param key - The name of the export to find (e.g., "default" or a named export).
|
|
13
|
+
* @returns The declaration of the export if found, otherwise undefined.
|
|
14
|
+
*/
|
|
15
|
+
declare function findExport(ast: ParseResult<t.File>, key: string): any;
|
|
16
|
+
/**
|
|
17
|
+
* Lists all exports from the given Babel AST program.
|
|
18
|
+
*
|
|
19
|
+
* @param codeOrAst - The parsed Babel AST result containing the program body.
|
|
20
|
+
* @returns An array of export names, including "default" for default exports.
|
|
21
|
+
*/
|
|
22
|
+
declare function listExports(codeOrAst: ParseResult<t.File> | string): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Lists all imports from the given Babel AST program.
|
|
25
|
+
*
|
|
26
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
27
|
+
* @returns An array of import names, including "default" for default imports.
|
|
28
|
+
*/
|
|
29
|
+
declare function listImports(ast: ParseResult<t.File> | t.File): string[];
|
|
30
|
+
declare function isImportCall(calleePath: NodePath<t.CallExpression | t.NewExpression>): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the import declaration for a given name and specifier.
|
|
33
|
+
*
|
|
34
|
+
* @param specifier - The specifier of the import.
|
|
35
|
+
* @param name - The name of the import.
|
|
36
|
+
* @param named - Optional named import.
|
|
37
|
+
* @returns The import declaration.
|
|
38
|
+
*/
|
|
39
|
+
declare function getImport(specifier: string, name: string, named?: string): t.ImportDeclaration;
|
|
40
|
+
/**
|
|
41
|
+
* Adds an import to the program if it doesn't already exist.
|
|
42
|
+
*
|
|
43
|
+
* @param path - The current NodePath in the AST.
|
|
44
|
+
* @param specifier - The import specifier.
|
|
45
|
+
*/
|
|
46
|
+
declare function addImport(path: NodePath<any>, specifier: ImportSpecifier): void;
|
|
47
|
+
declare function addImportsToProgram(path: NodePath<t.Program>, specifier: ImportSpecifier): void;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { isImportCall as a, getImport as i, addImportsToProgram as n, listExports as o, findExport as r, listImports as s, addImport as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { r as getPluginName } from "./filters-C04cfcQR.mjs";
|
|
2
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
+
import { isFunction } from "@stryke/type-checks/is-function";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
|
|
6
|
+
//#region src/helpers/options.ts
|
|
7
|
+
function resolvePluginFunction(context, plugin) {
|
|
8
|
+
try {
|
|
9
|
+
return Array.isArray(plugin) && plugin.length > 0 && plugin[0] ? isFunction(plugin[0]) ? plugin[0](context) : plugin[0] : isFunction(plugin) ? plugin(context) : plugin;
|
|
10
|
+
} catch {
|
|
11
|
+
return plugin[0];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The context for the transformation.
|
|
18
|
+
* @param code - The code to be transformed.
|
|
19
|
+
* @param id - The ID of the source file.
|
|
20
|
+
* @param plugin - The Babel plugin to resolve.
|
|
21
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
22
|
+
*/
|
|
23
|
+
function resolveBabelPlugin(context, code, id, plugin) {
|
|
24
|
+
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
25
|
+
if (plugin.length > 2 && plugin[2] && isFunction(plugin[2]) && !plugin[2](code, id)) {
|
|
26
|
+
context.log(LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.bold.cyanBright(getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return plugin.length > 2 ? [
|
|
30
|
+
resolvePluginFunction(context, plugin),
|
|
31
|
+
plugin[1],
|
|
32
|
+
plugin[2]
|
|
33
|
+
] : [
|
|
34
|
+
resolvePluginFunction(context, plugin),
|
|
35
|
+
plugin[1],
|
|
36
|
+
null
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
return [
|
|
40
|
+
resolvePluginFunction(context, plugin),
|
|
41
|
+
{},
|
|
42
|
+
null
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { resolvePluginFunction as n, resolveBabelPlugin as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { i as BabelTransformPluginOptions, s as ResolvedBabelTransformPluginOptions, u as Context } from "./babel-Cbfq7l5M.mjs";
|
|
2
|
+
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/options.d.ts
|
|
5
|
+
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The context for the transformation.
|
|
10
|
+
* @param code - The code to be transformed.
|
|
11
|
+
* @param id - The ID of the source file.
|
|
12
|
+
* @param plugin - The Babel plugin to resolve.
|
|
13
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { resolvePluginFunction as n, resolveBabelPlugin as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { i as BabelTransformPluginOptions, s as ResolvedBabelTransformPluginOptions, u as Context } from "./babel-BBpAODp3.cjs";
|
|
2
|
+
import { PluginOptions, PluginTarget } from "@babel/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/options.d.ts
|
|
5
|
+
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The context for the transformation.
|
|
10
|
+
* @param code - The code to be transformed.
|
|
11
|
+
* @param id - The ID of the source file.
|
|
12
|
+
* @param plugin - The Babel plugin to resolve.
|
|
13
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { resolvePluginFunction as n, resolveBabelPlugin as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
+
const require_filters = require('./filters-Dl2RKvrm.cjs');
|
|
3
|
+
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
|
+
let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
5
|
+
let chalk = require("chalk");
|
|
6
|
+
chalk = require_chunk.__toESM(chalk);
|
|
7
|
+
|
|
8
|
+
//#region src/helpers/options.ts
|
|
9
|
+
function resolvePluginFunction(context, plugin) {
|
|
10
|
+
try {
|
|
11
|
+
return Array.isArray(plugin) && plugin.length > 0 && plugin[0] ? (0, __stryke_type_checks_is_function.isFunction)(plugin[0]) ? plugin[0](context) : plugin[0] : (0, __stryke_type_checks_is_function.isFunction)(plugin) ? plugin(context) : plugin;
|
|
12
|
+
} catch {
|
|
13
|
+
return plugin[0];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
18
|
+
*
|
|
19
|
+
* @param context - The context for the transformation.
|
|
20
|
+
* @param code - The code to be transformed.
|
|
21
|
+
* @param id - The ID of the source file.
|
|
22
|
+
* @param plugin - The Babel plugin to resolve.
|
|
23
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
24
|
+
*/
|
|
25
|
+
function resolveBabelPlugin(context, code, id, plugin) {
|
|
26
|
+
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
27
|
+
if (plugin.length > 2 && plugin[2] && (0, __stryke_type_checks_is_function.isFunction)(plugin[2]) && !plugin[2](code, id)) {
|
|
28
|
+
context.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.default.bold.cyanBright(require_filters.getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
return plugin.length > 2 ? [
|
|
32
|
+
resolvePluginFunction(context, plugin),
|
|
33
|
+
plugin[1],
|
|
34
|
+
plugin[2]
|
|
35
|
+
] : [
|
|
36
|
+
resolvePluginFunction(context, plugin),
|
|
37
|
+
plugin[1],
|
|
38
|
+
null
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
return [
|
|
42
|
+
resolvePluginFunction(context, plugin),
|
|
43
|
+
{},
|
|
44
|
+
null
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
Object.defineProperty(exports, 'resolveBabelPlugin', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return resolveBabelPlugin;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, 'resolvePluginFunction', {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return resolvePluginFunction;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { c as BabelUserConfig, d as PluginContext, l as UserConfig, m as ResolvedConfig, p as BabelResolvedConfig } from "./babel-Cbfq7l5M.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/types/plugin.d.ts
|
|
4
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
5
|
+
type BabelPluginUserConfig = UserConfig;
|
|
6
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
7
|
+
transform: {
|
|
8
|
+
babel: BabelResolvedConfig;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
12
|
+
declare type __ΩBabelPluginOptions = any[];
|
|
13
|
+
declare type __ΩBabelPluginUserConfig = any[];
|
|
14
|
+
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
15
|
+
declare type __ΩBabelPluginContext = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { __ΩBabelPluginContext as a, __ΩBabelPluginUserConfig as c, BabelPluginUserConfig as i, BabelPluginOptions as n, __ΩBabelPluginOptions as o, BabelPluginResolvedConfig as r, __ΩBabelPluginResolvedConfig as s, BabelPluginContext as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { c as BabelUserConfig, d as PluginContext, l as UserConfig, m as ResolvedConfig, p as BabelResolvedConfig } from "./babel-BBpAODp3.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/types/plugin.d.ts
|
|
4
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
5
|
+
type BabelPluginUserConfig = UserConfig;
|
|
6
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
7
|
+
transform: {
|
|
8
|
+
babel: BabelResolvedConfig;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
12
|
+
declare type __ΩBabelPluginOptions = any[];
|
|
13
|
+
declare type __ΩBabelPluginUserConfig = any[];
|
|
14
|
+
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
15
|
+
declare type __ΩBabelPluginContext = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { __ΩBabelPluginContext as a, __ΩBabelPluginUserConfig as c, BabelPluginUserConfig as i, BabelPluginOptions as n, __ΩBabelPluginOptions as o, BabelPluginResolvedConfig as r, __ΩBabelPluginResolvedConfig as s, BabelPluginContext as t };
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../babel-BBpAODp3.cjs";
|
|
2
|
+
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-DzY_qzHo.cjs";
|
|
3
|
+
import "../index-zO0Ly4bS.cjs";
|
|
2
4
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../babel-Cbfq7l5M.mjs";
|
|
2
|
+
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-CctoTNv_.mjs";
|
|
3
|
+
import "../index-QbUkWSLh.mjs";
|
|
2
4
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-BSBH78mm.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.cjs";
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
-
type BabelPluginUserConfig = UserConfig;
|
|
8
|
-
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
-
transform: {
|
|
10
|
-
babel: BabelResolvedConfig;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
declare type __ΩBabelPluginOptions = any[];
|
|
15
|
-
declare type __ΩBabelPluginUserConfig = any[];
|
|
16
|
-
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
17
|
-
declare type __ΩBabelPluginContext = any[];
|
|
18
|
-
//#endregion
|
|
1
|
+
import "../babel-BBpAODp3.cjs";
|
|
2
|
+
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-DzY_qzHo.cjs";
|
|
19
3
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
-
type BabelPluginUserConfig = UserConfig;
|
|
8
|
-
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
-
transform: {
|
|
10
|
-
babel: BabelResolvedConfig;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
declare type __ΩBabelPluginOptions = any[];
|
|
15
|
-
declare type __ΩBabelPluginUserConfig = any[];
|
|
16
|
-
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
17
|
-
declare type __ΩBabelPluginContext = any[];
|
|
18
|
-
//#endregion
|
|
1
|
+
import "../babel-Cbfq7l5M.mjs";
|
|
2
|
+
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-CctoTNv_.mjs";
|
|
19
3
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.132",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -162,15 +162,15 @@
|
|
|
162
162
|
"chalk": "5.6.2",
|
|
163
163
|
"defu": "^6.1.4",
|
|
164
164
|
"jiti": "^2.6.1",
|
|
165
|
-
"powerlines": "^0.36.
|
|
165
|
+
"powerlines": "^0.36.27",
|
|
166
166
|
"unplugin": "3.0.0-beta.3"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@babel/plugin-syntax-typescript": "^7.27.1",
|
|
170
|
-
"@powerlines/nx": "^0.11.
|
|
171
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
170
|
+
"@powerlines/nx": "^0.11.53",
|
|
171
|
+
"@powerlines/plugin-plugin": "^0.12.75",
|
|
172
172
|
"@types/node": "^24.10.4"
|
|
173
173
|
},
|
|
174
174
|
"publishConfig": { "access": "public" },
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "fbc59ce584fd0f78d90d2dbaa18f9c9267bd3b61"
|
|
176
176
|
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
3
|
-
let chalk = require("chalk");
|
|
4
|
-
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
5
|
-
require("@storm-software/config-tools/logger");
|
|
6
|
-
require("@storm-software/config-tools/utilities/colors");
|
|
7
|
-
require("@stryke/helpers/noop");
|
|
8
|
-
require("@stryke/string-format/kebab-case");
|
|
9
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
-
|
|
11
|
-
//#region ../powerlines/src/lib/logger.ts
|
|
12
|
-
const BADGE_COLORS = [
|
|
13
|
-
"#00A0DD",
|
|
14
|
-
"#6FCE4E",
|
|
15
|
-
"#FBBF24",
|
|
16
|
-
"#F43F5E",
|
|
17
|
-
"#3B82F6",
|
|
18
|
-
"#A855F7",
|
|
19
|
-
"#469592",
|
|
20
|
-
"#288EDF",
|
|
21
|
-
"#D8B4FE",
|
|
22
|
-
"#10B981",
|
|
23
|
-
"#EF4444",
|
|
24
|
-
"#F0EC56",
|
|
25
|
-
"#F472B6",
|
|
26
|
-
"#22D3EE",
|
|
27
|
-
"#EAB308",
|
|
28
|
-
"#84CC16",
|
|
29
|
-
"#F87171",
|
|
30
|
-
"#0EA5E9",
|
|
31
|
-
"#D946EF",
|
|
32
|
-
"#FACC15",
|
|
33
|
-
"#34D399",
|
|
34
|
-
"#8B5CF6"
|
|
35
|
-
];
|
|
36
|
-
const extendLog = (logFn, name) => {
|
|
37
|
-
return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.extendLog = extendLog;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
import "@storm-software/config-tools/logger";
|
|
4
|
-
import "@storm-software/config-tools/utilities/colors";
|
|
5
|
-
import "@stryke/helpers/noop";
|
|
6
|
-
import "@stryke/string-format/kebab-case";
|
|
7
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
-
|
|
9
|
-
//#region ../powerlines/src/lib/logger.ts
|
|
10
|
-
const BADGE_COLORS = [
|
|
11
|
-
"#00A0DD",
|
|
12
|
-
"#6FCE4E",
|
|
13
|
-
"#FBBF24",
|
|
14
|
-
"#F43F5E",
|
|
15
|
-
"#3B82F6",
|
|
16
|
-
"#A855F7",
|
|
17
|
-
"#469592",
|
|
18
|
-
"#288EDF",
|
|
19
|
-
"#D8B4FE",
|
|
20
|
-
"#10B981",
|
|
21
|
-
"#EF4444",
|
|
22
|
-
"#F0EC56",
|
|
23
|
-
"#F472B6",
|
|
24
|
-
"#22D3EE",
|
|
25
|
-
"#EAB308",
|
|
26
|
-
"#84CC16",
|
|
27
|
-
"#F87171",
|
|
28
|
-
"#0EA5E9",
|
|
29
|
-
"#D946EF",
|
|
30
|
-
"#FACC15",
|
|
31
|
-
"#34D399",
|
|
32
|
-
"#8B5CF6"
|
|
33
|
-
];
|
|
34
|
-
const extendLog = (logFn, name) => {
|
|
35
|
-
return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { extendLog };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Context } from "./context.cjs";
|
|
2
|
-
import { LogFn } from "./config.cjs";
|
|
3
|
-
import { PluginItem, PluginObj, PluginPass } from "@babel/core";
|
|
4
|
-
import { BabelAPI } from "@babel/helper-plugin-utils";
|
|
5
|
-
|
|
6
|
-
//#region ../powerlines/src/types/babel.d.ts
|
|
7
|
-
|
|
8
|
-
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
9
|
-
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
10
|
-
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
|
|
11
|
-
name: string;
|
|
12
|
-
log: LogFn;
|
|
13
|
-
api: BabelAPI;
|
|
14
|
-
options: TOptions;
|
|
15
|
-
context: TContext;
|
|
16
|
-
dirname: string;
|
|
17
|
-
}) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
|
|
18
|
-
$$name: string;
|
|
19
|
-
};
|
|
20
|
-
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
21
|
-
type ResolvedBabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter | null];
|
|
22
|
-
interface BabelTransformPluginBuilderParams<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>> {
|
|
23
|
-
name: string;
|
|
24
|
-
log: LogFn;
|
|
25
|
-
api: BabelAPI;
|
|
26
|
-
options: TOptions;
|
|
27
|
-
context: TContext;
|
|
28
|
-
dirname: string;
|
|
29
|
-
}
|
|
30
|
-
type BabelTransformPluginBuilder<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = (params: BabelTransformPluginBuilderParams<TContext, TOptions>) => PluginObj<TState & BabelPluginPass<TOptions>>;
|
|
31
|
-
type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
|
|
32
|
-
/**
|
|
33
|
-
* A non-local import specifier represents an import that is not defined within the current module.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* import { bar as baz } from 'foo';
|
|
38
|
-
* // { name: 'baz', module: 'foo', imported: 'bar' }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* 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.
|
|
43
|
-
*/
|
|
44
|
-
interface ImportSpecifier {
|
|
45
|
-
name?: string;
|
|
46
|
-
module: string;
|
|
47
|
-
imported: string;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn, ImportSpecifier, ResolvedBabelTransformPluginOptions };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Context } from "./context.mjs";
|
|
2
|
-
import { LogFn } from "./config.mjs";
|
|
3
|
-
import { PluginItem, PluginObj, PluginPass } from "@babel/core";
|
|
4
|
-
import { BabelAPI } from "@babel/helper-plugin-utils";
|
|
5
|
-
|
|
6
|
-
//#region ../powerlines/src/types/babel.d.ts
|
|
7
|
-
|
|
8
|
-
type BabelPluginPass<TState = unknown> = PluginPass & TState;
|
|
9
|
-
type BabelTransformPluginFilter = (code: string, id: string) => boolean;
|
|
10
|
-
type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
|
|
11
|
-
name: string;
|
|
12
|
-
log: LogFn;
|
|
13
|
-
api: BabelAPI;
|
|
14
|
-
options: TOptions;
|
|
15
|
-
context: TContext;
|
|
16
|
-
dirname: string;
|
|
17
|
-
}) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
|
|
18
|
-
$$name: string;
|
|
19
|
-
};
|
|
20
|
-
type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
|
|
21
|
-
type ResolvedBabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter | null];
|
|
22
|
-
interface BabelTransformPluginBuilderParams<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>> {
|
|
23
|
-
name: string;
|
|
24
|
-
log: LogFn;
|
|
25
|
-
api: BabelAPI;
|
|
26
|
-
options: TOptions;
|
|
27
|
-
context: TContext;
|
|
28
|
-
dirname: string;
|
|
29
|
-
}
|
|
30
|
-
type BabelTransformPluginBuilder<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = (params: BabelTransformPluginBuilderParams<TContext, TOptions>) => PluginObj<TState & BabelPluginPass<TOptions>>;
|
|
31
|
-
type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
|
|
32
|
-
/**
|
|
33
|
-
* A non-local import specifier represents an import that is not defined within the current module.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* import { bar as baz } from 'foo';
|
|
38
|
-
* // { name: 'baz', module: 'foo', imported: 'bar' }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* 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.
|
|
43
|
-
*/
|
|
44
|
-
interface ImportSpecifier {
|
|
45
|
-
name?: string;
|
|
46
|
-
module: string;
|
|
47
|
-
imported: string;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginBuilder, BabelTransformPluginBuilderParams, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn, ImportSpecifier, ResolvedBabelTransformPluginOptions };
|