@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
72 lines (69 loc) • 2.87 kB
TypeScript
import { BabelPluginItem, Context, CompilerOptions, BabelPluginTarget } from '../../types/index.js';
import '@babel/core';
import '@babel/types';
import '@storm-stack/types/shared/error';
import '@stryke/types/base';
import 'magic-string';
import '@storm-software/config-tools/types';
import '@stryke/types/configuration';
import 'hookable';
import '@storm-software/build-tools/types';
import '@storm-software/config/types';
import '@storm-software/esbuild/types';
import '@storm-software/unbuild/types';
import 'c12';
import 'esbuild';
import 'unbuild';
import '@deepkit/type';
import '../../reflection-DTM1oT21.js';
import '@stryke/capnp';
import '@storm-stack/types/shared/log';
import '@stryke/env/get-env-paths';
import '@stryke/types/package-json';
import 'jest-worker';
import 'jiti';
import 'memfs';
import 'unimport';
import '../../types/tsconfig.js';
import '@stryke/types/tsconfig';
import 'typescript';
import '../../types/vfs.js';
import 'memfs/lib/volume';
import 'node:fs';
import 'unionfs';
/**
* Get the name of the Babel plugin.
*
* @param plugin - The Babel plugin to get the name from.
* @returns The name of the Babel plugin, or undefined if not found.
*/
declare function getPluginName(plugin: BabelPluginItem): string | undefined;
/**
* Check if a Babel plugin is a duplicate of another plugin in the list.
*
* @param plugins - The list of existing Babel plugins.
* @param plugin - The Babel plugin to check for duplicates.
* @returns True if the plugin is a duplicate, false otherwise.
*/
declare function isDuplicatePlugin(plugins: BabelPluginItem[], plugin: BabelPluginItem): boolean;
declare function filterPluginByRuntimeId(context: Context, runtimeId: string): (sourceFile: any) => boolean;
/**
* Adds a filter to a Babel plugin or a list of Babel plugins.
*
* @param context - The context in which the plugin is being added.
* @param plugins - The Babel plugins to add the filter to.
* @param filter - The filter function to apply to the plugins.
* @param name - The name of the plugin to add the filter to.
* @returns The updated list of Babel plugins with the filter applied.
*/
declare function addPluginFilter(context: Context, plugins: BabelPluginItem[], filter: NonNullable<CompilerOptions["filter"]>, name: string): BabelPluginItem[];
/**
* Adds a filter to a Babel plugin or a list of Babel plugins.
*
* @param context - The context in which the plugin is being added.
* @param plugin - The Babel plugin to add the filter to.
* @param filter - The filter function to apply to the plugin.
* @returns The updated Babel plugin with the filter applied.
*/
declare function addPluginFilter(context: Context, plugin: BabelPluginTarget | BabelPluginItem, filter: NonNullable<CompilerOptions["filter"]>): BabelPluginItem;
export { addPluginFilter, filterPluginByRuntimeId, getPluginName, isDuplicatePlugin };