@powerlines/plugin-babel 0.12.7 → 0.12.9
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-FBBMZ4NC.cjs +7 -0
- package/dist/chunk-UCUR73HG.js +7 -0
- package/dist/helpers/ast-utils.cjs +7 -0
- package/dist/helpers/ast-utils.d.cts +17 -0
- package/dist/helpers/ast-utils.d.ts +17 -0
- package/dist/helpers/ast-utils.js +7 -0
- package/dist/helpers/create-plugin.cjs +7 -0
- package/dist/helpers/create-plugin.d.cts +34 -0
- package/dist/helpers/create-plugin.d.ts +34 -0
- package/dist/helpers/create-plugin.js +7 -0
- package/dist/helpers/filters.cjs +7 -0
- package/dist/helpers/filters.d.cts +62 -0
- package/dist/helpers/filters.d.ts +62 -0
- package/dist/helpers/filters.js +7 -0
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.d.cts +31 -0
- package/dist/helpers/index.d.ts +31 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/module-helpers.cjs +7 -0
- package/dist/helpers/module-helpers.d.cts +68 -0
- package/dist/helpers/module-helpers.d.ts +68 -0
- package/dist/helpers/module-helpers.js +7 -0
- package/dist/helpers/options.cjs +7 -0
- package/dist/helpers/options.d.cts +37 -0
- package/dist/helpers/options.d.ts +37 -0
- package/dist/helpers/options.js +7 -0
- package/dist/plugin-CObsHnry.d.cts +1367 -0
- package/dist/plugin-CObsHnry.d.ts +1367 -0
- package/dist/src/index.cjs +7 -0
- package/dist/src/index.d.cts +43 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.js +7 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +24 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.js +1 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +34 -0
- package/dist/types/plugin.d.ts +34 -0
- package/dist/types/plugin.js +0 -0
- package/package.json +14 -9
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),a=require('@babel/generator'),parser=require('@babel/parser');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function u(r,e={}){return parser.parse(r,{plugins:["typescript"],sourceType:"module",allowImportExportEverywhere:true,allowAwaitOutsideFunction:true,...e})}chunkFBBMZ4NC_cjs.a(u,"parseAst");let t=a__default.default;"default"in t&&(t=t.default);function l(r,e){return t(r,e?{importAttributesKeyword:"with",sourceMaps:true,...e}:void 0)}chunkFBBMZ4NC_cjs.a(l,"generateFromAst");exports.generateFromAst=l;exports.parseAst=u;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GeneratorOptions, GeneratorResult } from '@babel/generator';
|
|
2
|
+
export { GeneratorResult } from '@babel/generator';
|
|
3
|
+
import { ParserOptions, ParseResult } from '@babel/parser';
|
|
4
|
+
import * as t from '@babel/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parse the given code into an AST.
|
|
8
|
+
*
|
|
9
|
+
* @param code - The code to parse.
|
|
10
|
+
* @param opts - The options for parsing.
|
|
11
|
+
* @returns The parsed AST.
|
|
12
|
+
*/
|
|
13
|
+
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
+
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
16
|
+
|
|
17
|
+
export { type GenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GeneratorOptions, GeneratorResult } from '@babel/generator';
|
|
2
|
+
export { GeneratorResult } from '@babel/generator';
|
|
3
|
+
import { ParserOptions, ParseResult } from '@babel/parser';
|
|
4
|
+
import * as t from '@babel/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parse the given code into an AST.
|
|
8
|
+
*
|
|
9
|
+
* @param code - The code to parse.
|
|
10
|
+
* @param opts - The options for parsing.
|
|
11
|
+
* @returns The parsed AST.
|
|
12
|
+
*/
|
|
13
|
+
declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
|
|
14
|
+
type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
|
|
15
|
+
declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
|
|
16
|
+
|
|
17
|
+
export { type GenerateFromAstOptions, generateFromAst, parseAst };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import a$1 from'@babel/generator';import {parse}from'@babel/parser';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function l(r,e={}){return parse(r,{plugins:["typescript"],sourceType:"module",allowImportExportEverywhere:true,allowAwaitOutsideFunction:true,...e})}a(l,"parseAst");let t=a$1;"default"in t&&(t=t.default);function m(r,e){return t(r,e?{importAttributesKeyword:"with",sourceMaps:true,...e}:void 0)}a(m,"generateFromAst");export{m as generateFromAst,l as parseAst};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),helperPluginUtils=require('@babel/helper-plugin-utils'),types=require('@storm-software/config-tools/types'),s=require('chalk'),logger=require('powerlines/lib/logger');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var s__default=/*#__PURE__*/_interopDefault(s);/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function y(t,g){const i=chunkFBBMZ4NC_cjs.a(e=>helperPluginUtils.declare((r,u,m)=>{r.cache.using(()=>e.meta.checksum),r.assertVersion("^7.0.0-0");const n=logger.extendLog(e.log,t);n(types.LogLevelLabel.TRACE,`Initializing the ${s__default.default.bold.cyanBright(t)} Babel plugin`);const l=g({log:n,name:t,api:r,options:u,context:e,dirname:m});return l.name=t,n(types.LogLevelLabel.TRACE,`Completed initialization of the ${s__default.default.bold.cyanBright(t)} Babel plugin`),l}),"plugin");return i.$$name=t,i}chunkFBBMZ4NC_cjs.a(y,"createBabelPlugin");exports.createBabelPlugin=y;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-CObsHnry.cjs';
|
|
2
|
+
import '@stryke/types/base';
|
|
3
|
+
import 'unplugin';
|
|
4
|
+
import '@stryke/types/array';
|
|
5
|
+
import '@babel/core';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a Babel plugin using the provided builder function.
|
|
27
|
+
*
|
|
28
|
+
* @param name - The name of the plugin.
|
|
29
|
+
* @param builder - The builder function that defines the plugin behavior.
|
|
30
|
+
* @returns A Babel plugin declaration.
|
|
31
|
+
*/
|
|
32
|
+
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
33
|
+
|
|
34
|
+
export { createBabelPlugin };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-CObsHnry.js';
|
|
2
|
+
import '@stryke/types/base';
|
|
3
|
+
import 'unplugin';
|
|
4
|
+
import '@stryke/types/array';
|
|
5
|
+
import '@babel/core';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a Babel plugin using the provided builder function.
|
|
27
|
+
*
|
|
28
|
+
* @param name - The name of the plugin.
|
|
29
|
+
* @param builder - The builder function that defines the plugin behavior.
|
|
30
|
+
* @returns A Babel plugin declaration.
|
|
31
|
+
*/
|
|
32
|
+
declare function createBabelPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>>(name: string, builder: BabelTransformPluginBuilder<TContext, TOptions>): DeclareBabelTransformPluginReturn<TContext, TOptions>;
|
|
33
|
+
|
|
34
|
+
export { createBabelPlugin };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import {declare}from'@babel/helper-plugin-utils';import {LogLevelLabel}from'@storm-software/config-tools/types';import s from'chalk';import {extendLog}from'powerlines/lib/logger';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function L(t,g){const i=a(e=>declare((r,u,m)=>{r.cache.using(()=>e.meta.checksum),r.assertVersion("^7.0.0-0");const n=extendLog(e.log,t);n(LogLevelLabel.TRACE,`Initializing the ${s.bold.cyanBright(t)} Babel plugin`);const l=g({log:n,name:t,api:r,options:u,context:e,dirname:m});return l.name=t,n(LogLevelLabel.TRACE,`Completed initialization of the ${s.bold.cyanBright(t)} Babel plugin`),l}),"plugin");return i.$$name=t,i}a(L,"createBabelPlugin");export{L as createBabelPlugin};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),isFunction=require('@stryke/type-checks/is-function'),isObject=require('@stryke/type-checks/is-object'),isSetString=require('@stryke/type-checks/is-set-string');/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function s(e){return isSetString.isSetString(e)?e:Array.isArray(e)&&e.length>0?s(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}chunkFBBMZ4NC_cjs.a(s,"getPluginName");function w(e,r){return !!(s(r)&&e.some(n=>Array.isArray(n)&&s(n[0])===s(r)))}chunkFBBMZ4NC_cjs.a(w,"isDuplicatePlugin");function N(e,r){return (n,o)=>r!==o&&e.fs.ids[r]!==o&&r!==e.fs.ids[o]&&e.fs.ids[r]!==e.fs.ids[o]}chunkFBBMZ4NC_cjs.a(N,"filterPluginByFileId");function T(e,r,n,o){if(!Array.isArray(r)||!r.some(t=>Array.isArray(t))&&r.length<4&&r.length>0&&(isSetString.isSetString(r[0])||isFunction.isFunction(r[0])||r.length>1&&isObject.isObject(r[1])||r.length>2&&isObject.isObject(r[2])))return Array.isArray(r)?[r[0],r.length>1?r[1]:{},{filter:chunkFBBMZ4NC_cjs.a((t,i)=>n(t,i)&&(r.length<2||!isFunction.isFunction(r[2])||r[2]?.(t,i)),"filter")}]:[r,{},{filter:n}];if(!o)throw new Error("No name was provided to `addPluginFilter`, could not find babel plugin without it.");const f=r.findIndex(t=>s(t)?.toLowerCase()===o.toLowerCase());return f>-1&&(r[f]=T(e,r[f],n,o)),r}chunkFBBMZ4NC_cjs.a(T,"addPluginFilter");exports.addPluginFilter=T;exports.filterPluginByFileId=N;exports.getPluginName=s;exports.isDuplicatePlugin=w;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-CObsHnry.cjs';
|
|
2
|
+
import '@stryke/types/base';
|
|
3
|
+
import 'unplugin';
|
|
4
|
+
import '@stryke/types/array';
|
|
5
|
+
import '@babel/core';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
declare function getPluginName(plugin: BabelTransformPluginOptions): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
28
|
+
*
|
|
29
|
+
* @param plugins - The list of existing Babel plugins.
|
|
30
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
31
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
32
|
+
*/
|
|
33
|
+
declare function isDuplicatePlugin(plugins: (ResolvedBabelTransformPluginOptions | undefined)[], plugin: BabelTransformPluginOptions): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Filters a Babel plugin by its runtime ID.
|
|
36
|
+
*
|
|
37
|
+
* @param context - The context in which the filter is applied.
|
|
38
|
+
* @param fileId - The file ID to filter by.
|
|
39
|
+
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
40
|
+
*/
|
|
41
|
+
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
42
|
+
/**
|
|
43
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
44
|
+
*
|
|
45
|
+
* @param context - The context in which the plugin is being added.
|
|
46
|
+
* @param plugins - The Babel plugins to add the filter to.
|
|
47
|
+
* @param filter - The filter function to apply to the plugins.
|
|
48
|
+
* @param name - The name of the plugin to add the filter to.
|
|
49
|
+
* @returns The updated list of Babel plugins with the filter applied.
|
|
50
|
+
*/
|
|
51
|
+
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
52
|
+
/**
|
|
53
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
54
|
+
*
|
|
55
|
+
* @param context - The context in which the plugin is being added.
|
|
56
|
+
* @param plugin - The Babel plugin to add the filter to.
|
|
57
|
+
* @param filter - The filter function to apply to the plugin.
|
|
58
|
+
* @returns The updated Babel plugin with the filter applied.
|
|
59
|
+
*/
|
|
60
|
+
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
61
|
+
|
|
62
|
+
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-CObsHnry.js';
|
|
2
|
+
import '@stryke/types/base';
|
|
3
|
+
import 'unplugin';
|
|
4
|
+
import '@stryke/types/array';
|
|
5
|
+
import '@babel/core';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
declare function getPluginName(plugin: BabelTransformPluginOptions): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a Babel plugin is a duplicate of another plugin in the list.
|
|
28
|
+
*
|
|
29
|
+
* @param plugins - The list of existing Babel plugins.
|
|
30
|
+
* @param plugin - The Babel plugin to check for duplicates.
|
|
31
|
+
* @returns True if the plugin is a duplicate, false otherwise.
|
|
32
|
+
*/
|
|
33
|
+
declare function isDuplicatePlugin(plugins: (ResolvedBabelTransformPluginOptions | undefined)[], plugin: BabelTransformPluginOptions): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Filters a Babel plugin by its runtime ID.
|
|
36
|
+
*
|
|
37
|
+
* @param context - The context in which the filter is applied.
|
|
38
|
+
* @param fileId - The file ID to filter by.
|
|
39
|
+
* @returns A filter function that checks if a plugin's ID matches the runtime ID.
|
|
40
|
+
*/
|
|
41
|
+
declare function filterPluginByFileId<TContext extends Context = Context>(context: TContext, fileId: string): BabelTransformPluginFilter;
|
|
42
|
+
/**
|
|
43
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
44
|
+
*
|
|
45
|
+
* @param context - The context in which the plugin is being added.
|
|
46
|
+
* @param plugins - The Babel plugins to add the filter to.
|
|
47
|
+
* @param filter - The filter function to apply to the plugins.
|
|
48
|
+
* @param name - The name of the plugin to add the filter to.
|
|
49
|
+
* @returns The updated list of Babel plugins with the filter applied.
|
|
50
|
+
*/
|
|
51
|
+
declare function addPluginFilter(context: Context, plugins: BabelTransformPluginOptions[], filter: BabelTransformPluginFilter | null | undefined, name: string): BabelTransformPluginOptions[];
|
|
52
|
+
/**
|
|
53
|
+
* Adds a filter to a Babel plugin or a list of Babel plugins.
|
|
54
|
+
*
|
|
55
|
+
* @param context - The context in which the plugin is being added.
|
|
56
|
+
* @param plugin - The Babel plugin to add the filter to.
|
|
57
|
+
* @param filter - The filter function to apply to the plugin.
|
|
58
|
+
* @returns The updated Babel plugin with the filter applied.
|
|
59
|
+
*/
|
|
60
|
+
declare function addPluginFilter(context: Context, plugin: BabelTransformPlugin | BabelTransformPluginOptions, filter: NonNullable<BabelTransformPluginFilter>): BabelTransformPluginOptions;
|
|
61
|
+
|
|
62
|
+
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import {isFunction}from'@stryke/type-checks/is-function';import {isObject}from'@stryke/type-checks/is-object';import {isSetString}from'@stryke/type-checks/is-set-string';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function s(e){return isSetString(e)?e:Array.isArray(e)&&e.length>0?s(e[0]):e.$$name||e.name?e.$$name||e.name:void 0}a(s,"getPluginName");function N(e,r){return !!(s(r)&&e.some(n=>Array.isArray(n)&&s(n[0])===s(r)))}a(N,"isDuplicatePlugin");function $(e,r){return (n,o)=>r!==o&&e.fs.ids[r]!==o&&r!==e.fs.ids[o]&&e.fs.ids[r]!==e.fs.ids[o]}a($,"filterPluginByFileId");function T(e,r,n,o){if(!Array.isArray(r)||!r.some(t=>Array.isArray(t))&&r.length<4&&r.length>0&&(isSetString(r[0])||isFunction(r[0])||r.length>1&&isObject(r[1])||r.length>2&&isObject(r[2])))return Array.isArray(r)?[r[0],r.length>1?r[1]:{},{filter:a((t,i)=>n(t,i)&&(r.length<2||!isFunction(r[2])||r[2]?.(t,i)),"filter")}]:[r,{},{filter:n}];if(!o)throw new Error("No name was provided to `addPluginFilter`, could not find babel plugin without it.");const f=r.findIndex(t=>s(t)?.toLowerCase()===o.toLowerCase());return f>-1&&(r[f]=T(e,r[f],n,o)),r}a(T,"addPluginFilter");export{T as addPluginFilter,$ as filterPluginByFileId,s as getPluginName,N as isDuplicatePlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var astUtils=require('./ast-utils'),createPlugin=require('./create-plugin'),filters=require('./filters'),moduleHelpers=require('./module-helpers'),options=require('./options');Object.keys(astUtils).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return astUtils[k]}})});Object.keys(createPlugin).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return createPlugin[k]}})});Object.keys(filters).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return filters[k]}})});Object.keys(moduleHelpers).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return moduleHelpers[k]}})});Object.keys(options).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return options[k]}})});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { GenerateFromAstOptions, generateFromAst, parseAst } from './ast-utils.cjs';
|
|
2
|
+
export { createBabelPlugin } from './create-plugin.cjs';
|
|
3
|
+
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from './filters.cjs';
|
|
4
|
+
export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from './module-helpers.cjs';
|
|
5
|
+
export { resolveBabelPlugin, resolvePluginFunction } from './options.cjs';
|
|
6
|
+
export { GeneratorResult } from '@babel/generator';
|
|
7
|
+
import '@babel/parser';
|
|
8
|
+
import '@babel/types';
|
|
9
|
+
import '../plugin-CObsHnry.cjs';
|
|
10
|
+
import '@stryke/types/base';
|
|
11
|
+
import 'unplugin';
|
|
12
|
+
import '@stryke/types/array';
|
|
13
|
+
import '@babel/core';
|
|
14
|
+
import '@storm-software/build-tools/types';
|
|
15
|
+
import '@storm-software/config-tools/types';
|
|
16
|
+
import '@storm-software/config/types';
|
|
17
|
+
import '@stryke/types/configuration';
|
|
18
|
+
import '@stryke/types/file';
|
|
19
|
+
import 'vite';
|
|
20
|
+
import '@babel/helper-plugin-utils';
|
|
21
|
+
import '@stryke/env/get-env-paths';
|
|
22
|
+
import '@stryke/types/package-json';
|
|
23
|
+
import 'jiti';
|
|
24
|
+
import 'oxc-parser';
|
|
25
|
+
import 'semver';
|
|
26
|
+
import '@stryke/types/tsconfig';
|
|
27
|
+
import 'typescript';
|
|
28
|
+
import '@stryke/json/types';
|
|
29
|
+
import 'memfs';
|
|
30
|
+
import 'node:fs';
|
|
31
|
+
import 'unionfs';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { GenerateFromAstOptions, generateFromAst, parseAst } from './ast-utils.js';
|
|
2
|
+
export { createBabelPlugin } from './create-plugin.js';
|
|
3
|
+
export { addPluginFilter, filterPluginByFileId, getPluginName, isDuplicatePlugin } from './filters.js';
|
|
4
|
+
export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports } from './module-helpers.js';
|
|
5
|
+
export { resolveBabelPlugin, resolvePluginFunction } from './options.js';
|
|
6
|
+
export { GeneratorResult } from '@babel/generator';
|
|
7
|
+
import '@babel/parser';
|
|
8
|
+
import '@babel/types';
|
|
9
|
+
import '../plugin-CObsHnry.js';
|
|
10
|
+
import '@stryke/types/base';
|
|
11
|
+
import 'unplugin';
|
|
12
|
+
import '@stryke/types/array';
|
|
13
|
+
import '@babel/core';
|
|
14
|
+
import '@storm-software/build-tools/types';
|
|
15
|
+
import '@storm-software/config-tools/types';
|
|
16
|
+
import '@storm-software/config/types';
|
|
17
|
+
import '@stryke/types/configuration';
|
|
18
|
+
import '@stryke/types/file';
|
|
19
|
+
import 'vite';
|
|
20
|
+
import '@babel/helper-plugin-utils';
|
|
21
|
+
import '@stryke/env/get-env-paths';
|
|
22
|
+
import '@stryke/types/package-json';
|
|
23
|
+
import 'jiti';
|
|
24
|
+
import 'oxc-parser';
|
|
25
|
+
import 'semver';
|
|
26
|
+
import '@stryke/types/tsconfig';
|
|
27
|
+
import 'typescript';
|
|
28
|
+
import '@stryke/json/types';
|
|
29
|
+
import 'memfs';
|
|
30
|
+
import 'node:fs';
|
|
31
|
+
import 'unionfs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from'./ast-utils';export*from'./create-plugin';export*from'./filters';export*from'./module-helpers';export*from'./options';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),o=require('@babel/types'),isString=require('@stryke/type-checks/is-string'),astUtils=require('./ast-utils');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var o__namespace=/*#__PURE__*/_interopNamespace(o);/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function D(r,t){const e=t==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(const n of r.program.body)if(n.type===e){if(t==="default")return n.declaration;if(n.declaration&&"declarations"in n.declaration){const a=n.declaration.declarations[0];if(a&&"name"in a.id&&a.id.name===t)return a.init}}}chunkFBBMZ4NC_cjs.a(D,"findExport");function E(r){return (isString.isString(r)?astUtils.parseAst(r):r).program.body.flatMap(e=>e.type==="ExportDefaultDeclaration"?["default"]:e.type==="ExportNamedDeclaration"&&e.declaration&&"declarations"in e.declaration?e.declaration.declarations.map(n=>"name"in n.id?n.id.name:""):[]).filter(Boolean)}chunkFBBMZ4NC_cjs.a(E,"listExports");function S(r){return r.program.body.flatMap(t=>t.type==="ImportDeclaration"?t.specifiers.map(e=>e.type==="ImportDefaultSpecifier"?"default":e.type==="ImportSpecifier"&&"imported"in e?e.imported.type==="Identifier"?e.imported.name:e.imported.value:""):[]).filter(Boolean)}chunkFBBMZ4NC_cjs.a(S,"listImports");function h(r){return o__namespace.isImport(r.node.callee)}chunkFBBMZ4NC_cjs.a(h,"isImportCall");function b(r,t,e){return o__namespace.importDeclaration([o__namespace.importSpecifier(o__namespace.identifier(t),o__namespace.stringLiteral(e||t))],o__namespace.stringLiteral(r))}chunkFBBMZ4NC_cjs.a(b,"getImport");function v(r,t){s(r.scope.getProgramParent().path,t);}chunkFBBMZ4NC_cjs.a(v,"addImport");function l(r){return r.get("specifiers").filter(Boolean).every(t=>t?.isImportSpecifier())&&r.node.importKind!=="type"&&r.node.importKind!=="typeof"}chunkFBBMZ4NC_cjs.a(l,"isNonNamespacedImport");function d(r){const t=new Map;return r.traverse({ImportDeclaration(e){l(e)&&t.set(e.node.source.value,e);}}),t}chunkFBBMZ4NC_cjs.a(d,"getExistingImports");function s(r,t){d(r).get(t.module)||r.unshiftContainer("body",o__namespace.importDeclaration([o__namespace.importSpecifier(o__namespace.identifier(t.name||t.imported),o__namespace.identifier(t.imported))],o__namespace.stringLiteral(t.module)));}chunkFBBMZ4NC_cjs.a(s,"addImportsToProgram");exports.addImport=v;exports.addImportsToProgram=s;exports.findExport=D;exports.getImport=b;exports.isImportCall=h;exports.listExports=E;exports.listImports=S;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NodePath } from '@babel/core';
|
|
2
|
+
import { ParseResult } from '@babel/parser';
|
|
3
|
+
import * as t from '@babel/types';
|
|
4
|
+
import { I as ImportSpecifier } from '../plugin-CObsHnry.cjs';
|
|
5
|
+
import '@stryke/types/base';
|
|
6
|
+
import 'unplugin';
|
|
7
|
+
import '@stryke/types/array';
|
|
8
|
+
import '@storm-software/build-tools/types';
|
|
9
|
+
import '@storm-software/config-tools/types';
|
|
10
|
+
import '@storm-software/config/types';
|
|
11
|
+
import '@stryke/types/configuration';
|
|
12
|
+
import '@stryke/types/file';
|
|
13
|
+
import 'vite';
|
|
14
|
+
import '@babel/helper-plugin-utils';
|
|
15
|
+
import '@stryke/env/get-env-paths';
|
|
16
|
+
import '@stryke/types/package-json';
|
|
17
|
+
import 'jiti';
|
|
18
|
+
import 'oxc-parser';
|
|
19
|
+
import 'semver';
|
|
20
|
+
import '@stryke/types/tsconfig';
|
|
21
|
+
import 'typescript';
|
|
22
|
+
import '@stryke/json/types';
|
|
23
|
+
import 'memfs';
|
|
24
|
+
import 'node:fs';
|
|
25
|
+
import 'unionfs';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Finds an export in the given Babel AST program by its key.
|
|
29
|
+
*
|
|
30
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
31
|
+
* @param key - The name of the export to find (e.g., "default" or a named export).
|
|
32
|
+
* @returns The declaration of the export if found, otherwise undefined.
|
|
33
|
+
*/
|
|
34
|
+
declare function findExport(ast: ParseResult<t.File>, key: string): any;
|
|
35
|
+
/**
|
|
36
|
+
* Lists all exports from the given Babel AST program.
|
|
37
|
+
*
|
|
38
|
+
* @param codeOrAst - The parsed Babel AST result containing the program body.
|
|
39
|
+
* @returns An array of export names, including "default" for default exports.
|
|
40
|
+
*/
|
|
41
|
+
declare function listExports(codeOrAst: ParseResult<t.File> | string): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Lists all imports from the given Babel AST program.
|
|
44
|
+
*
|
|
45
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
46
|
+
* @returns An array of import names, including "default" for default imports.
|
|
47
|
+
*/
|
|
48
|
+
declare function listImports(ast: ParseResult<t.File> | t.File): string[];
|
|
49
|
+
declare function isImportCall(calleePath: NodePath<t.CallExpression | t.NewExpression>): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the import declaration for a given name and specifier.
|
|
52
|
+
*
|
|
53
|
+
* @param specifier - The specifier of the import.
|
|
54
|
+
* @param name - The name of the import.
|
|
55
|
+
* @param named - Optional named import.
|
|
56
|
+
* @returns The import declaration.
|
|
57
|
+
*/
|
|
58
|
+
declare function getImport(specifier: string, name: string, named?: string): t.ImportDeclaration;
|
|
59
|
+
/**
|
|
60
|
+
* Adds an import to the program if it doesn't already exist.
|
|
61
|
+
*
|
|
62
|
+
* @param path - The current NodePath in the AST.
|
|
63
|
+
* @param specifier - The import specifier.
|
|
64
|
+
*/
|
|
65
|
+
declare function addImport(path: NodePath<any>, specifier: ImportSpecifier): void;
|
|
66
|
+
declare function addImportsToProgram(path: NodePath<t.Program>, specifier: ImportSpecifier): void;
|
|
67
|
+
|
|
68
|
+
export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NodePath } from '@babel/core';
|
|
2
|
+
import { ParseResult } from '@babel/parser';
|
|
3
|
+
import * as t from '@babel/types';
|
|
4
|
+
import { I as ImportSpecifier } from '../plugin-CObsHnry.js';
|
|
5
|
+
import '@stryke/types/base';
|
|
6
|
+
import 'unplugin';
|
|
7
|
+
import '@stryke/types/array';
|
|
8
|
+
import '@storm-software/build-tools/types';
|
|
9
|
+
import '@storm-software/config-tools/types';
|
|
10
|
+
import '@storm-software/config/types';
|
|
11
|
+
import '@stryke/types/configuration';
|
|
12
|
+
import '@stryke/types/file';
|
|
13
|
+
import 'vite';
|
|
14
|
+
import '@babel/helper-plugin-utils';
|
|
15
|
+
import '@stryke/env/get-env-paths';
|
|
16
|
+
import '@stryke/types/package-json';
|
|
17
|
+
import 'jiti';
|
|
18
|
+
import 'oxc-parser';
|
|
19
|
+
import 'semver';
|
|
20
|
+
import '@stryke/types/tsconfig';
|
|
21
|
+
import 'typescript';
|
|
22
|
+
import '@stryke/json/types';
|
|
23
|
+
import 'memfs';
|
|
24
|
+
import 'node:fs';
|
|
25
|
+
import 'unionfs';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Finds an export in the given Babel AST program by its key.
|
|
29
|
+
*
|
|
30
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
31
|
+
* @param key - The name of the export to find (e.g., "default" or a named export).
|
|
32
|
+
* @returns The declaration of the export if found, otherwise undefined.
|
|
33
|
+
*/
|
|
34
|
+
declare function findExport(ast: ParseResult<t.File>, key: string): any;
|
|
35
|
+
/**
|
|
36
|
+
* Lists all exports from the given Babel AST program.
|
|
37
|
+
*
|
|
38
|
+
* @param codeOrAst - The parsed Babel AST result containing the program body.
|
|
39
|
+
* @returns An array of export names, including "default" for default exports.
|
|
40
|
+
*/
|
|
41
|
+
declare function listExports(codeOrAst: ParseResult<t.File> | string): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Lists all imports from the given Babel AST program.
|
|
44
|
+
*
|
|
45
|
+
* @param ast - The parsed Babel AST result containing the program body.
|
|
46
|
+
* @returns An array of import names, including "default" for default imports.
|
|
47
|
+
*/
|
|
48
|
+
declare function listImports(ast: ParseResult<t.File> | t.File): string[];
|
|
49
|
+
declare function isImportCall(calleePath: NodePath<t.CallExpression | t.NewExpression>): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the import declaration for a given name and specifier.
|
|
52
|
+
*
|
|
53
|
+
* @param specifier - The specifier of the import.
|
|
54
|
+
* @param name - The name of the import.
|
|
55
|
+
* @param named - Optional named import.
|
|
56
|
+
* @returns The import declaration.
|
|
57
|
+
*/
|
|
58
|
+
declare function getImport(specifier: string, name: string, named?: string): t.ImportDeclaration;
|
|
59
|
+
/**
|
|
60
|
+
* Adds an import to the program if it doesn't already exist.
|
|
61
|
+
*
|
|
62
|
+
* @param path - The current NodePath in the AST.
|
|
63
|
+
* @param specifier - The import specifier.
|
|
64
|
+
*/
|
|
65
|
+
declare function addImport(path: NodePath<any>, specifier: ImportSpecifier): void;
|
|
66
|
+
declare function addImportsToProgram(path: NodePath<t.Program>, specifier: ImportSpecifier): void;
|
|
67
|
+
|
|
68
|
+
export { addImport, addImportsToProgram, findExport, getImport, isImportCall, listExports, listImports };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import*as o from'@babel/types';import {isString}from'@stryke/type-checks/is-string';import {parseAst}from'./ast-utils';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function E(r,t){const e=t==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(const n of r.program.body)if(n.type===e){if(t==="default")return n.declaration;if(n.declaration&&"declarations"in n.declaration){const a=n.declaration.declarations[0];if(a&&"name"in a.id&&a.id.name===t)return a.init}}}a(E,"findExport");function S(r){return (isString(r)?parseAst(r):r).program.body.flatMap(e=>e.type==="ExportDefaultDeclaration"?["default"]:e.type==="ExportNamedDeclaration"&&e.declaration&&"declarations"in e.declaration?e.declaration.declarations.map(n=>"name"in n.id?n.id.name:""):[]).filter(Boolean)}a(S,"listExports");function h(r){return r.program.body.flatMap(t=>t.type==="ImportDeclaration"?t.specifiers.map(e=>e.type==="ImportDefaultSpecifier"?"default":e.type==="ImportSpecifier"&&"imported"in e?e.imported.type==="Identifier"?e.imported.name:e.imported.value:""):[]).filter(Boolean)}a(h,"listImports");function b(r){return o.isImport(r.node.callee)}a(b,"isImportCall");function v(r,t,e){return o.importDeclaration([o.importSpecifier(o.identifier(t),o.stringLiteral(e||t))],o.stringLiteral(r))}a(v,"getImport");function F(r,t){s(r.scope.getProgramParent().path,t);}a(F,"addImport");function l(r){return r.get("specifiers").filter(Boolean).every(t=>t?.isImportSpecifier())&&r.node.importKind!=="type"&&r.node.importKind!=="typeof"}a(l,"isNonNamespacedImport");function d(r){const t=new Map;return r.traverse({ImportDeclaration(e){l(e)&&t.set(e.node.source.value,e);}}),t}a(d,"getExistingImports");function s(r,t){d(r).get(t.module)||r.unshiftContainer("body",o.importDeclaration([o.importSpecifier(o.identifier(t.name||t.imported),o.identifier(t.imported))],o.stringLiteral(t.module)));}a(s,"addImportsToProgram");export{F as addImport,s as addImportsToProgram,E as findExport,v as getImport,b as isImportCall,S as listExports,h as listImports};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),types=require('@storm-software/config-tools/types'),isFunction=require('@stryke/type-checks/is-function'),f=require('chalk'),filters=require('./filters');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
function a(o,e){try{return Array.isArray(e)&&e.length>0&&e[0]?isFunction.isFunction(e[0])?e[0](o):e[0]:isFunction.isFunction(e)?e(o):e}catch{return e[0]}}chunkFBBMZ4NC_cjs.a(a,"resolvePluginFunction");function c(o,e,i,r){if(Array.isArray(r)&&r.length>0&&r[0]){if(r.length>2&&r[2]&&isFunction.isFunction(r[2])&&!r[2](e,i)){o.log(types.LogLevelLabel.TRACE,`Skipping filtered Babel plugin ${f__default.default.bold.cyanBright(filters.getPluginName(r)||"unnamed")} for ${i}`);return}return r.length>2?[a(o,r),r[1],r[2]]:[a(o,r),r[1],null]}return [a(o,r),{},null]}chunkFBBMZ4NC_cjs.a(c,"resolveBabelPlugin");exports.resolveBabelPlugin=c;exports.resolvePluginFunction=a;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PluginTarget, PluginOptions } from '@babel/core';
|
|
2
|
+
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-CObsHnry.cjs';
|
|
3
|
+
import '@stryke/types/base';
|
|
4
|
+
import 'unplugin';
|
|
5
|
+
import '@stryke/types/array';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
28
|
+
*
|
|
29
|
+
* @param context - The context for the transformation.
|
|
30
|
+
* @param code - The code to be transformed.
|
|
31
|
+
* @param id - The ID of the source file.
|
|
32
|
+
* @param plugin - The Babel plugin to resolve.
|
|
33
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
34
|
+
*/
|
|
35
|
+
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
36
|
+
|
|
37
|
+
export { resolveBabelPlugin, resolvePluginFunction };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PluginTarget, PluginOptions } from '@babel/core';
|
|
2
|
+
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-CObsHnry.js';
|
|
3
|
+
import '@stryke/types/base';
|
|
4
|
+
import 'unplugin';
|
|
5
|
+
import '@stryke/types/array';
|
|
6
|
+
import '@storm-software/build-tools/types';
|
|
7
|
+
import '@storm-software/config-tools/types';
|
|
8
|
+
import '@storm-software/config/types';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@babel/helper-plugin-utils';
|
|
13
|
+
import '@stryke/env/get-env-paths';
|
|
14
|
+
import '@stryke/types/package-json';
|
|
15
|
+
import 'jiti';
|
|
16
|
+
import 'oxc-parser';
|
|
17
|
+
import 'semver';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
|
|
25
|
+
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
28
|
+
*
|
|
29
|
+
* @param context - The context for the transformation.
|
|
30
|
+
* @param code - The code to be transformed.
|
|
31
|
+
* @param id - The ID of the source file.
|
|
32
|
+
* @param plugin - The Babel plugin to resolve.
|
|
33
|
+
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
34
|
+
*/
|
|
35
|
+
declare function resolveBabelPlugin(context: Context, code: string, id: string, plugin: BabelTransformPluginOptions): ResolvedBabelTransformPluginOptions | undefined;
|
|
36
|
+
|
|
37
|
+
export { resolveBabelPlugin, resolvePluginFunction };
|