unplugin-combine
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -1,10 +0,2 @@ | ||
import { Factory, FactoryOutput } from './types.js'; | ||
import { Plugin } from 'esbuild'; | ||
import 'unplugin'; | ||
import 'webpack'; | ||
import 'rollup'; | ||
import 'vite'; | ||
declare const getEsbuildPlugin: <UserOptions>(factory: Factory<UserOptions>) => FactoryOutput<UserOptions, Plugin>; | ||
export { getEsbuildPlugin }; | ||
import type { EsbuildPlugin, Factory, UnpluginCombineInstance } from './types'; | ||
export declare const getEsbuildPlugin: <UserOptions>(factory: Factory<UserOptions>) => import("./types").FactoryOutput<UserOptions, EsbuildPlugin>; |
@@ -1,13 +0,5 @@ | ||
import { PluginType, OptionsPlugin, PluginMap, Factory, UnpluginCombineInstance } from './types.js'; | ||
export { CombineOptions, Factory, FactoryOutput, OptionsPlugin, Plugin, PluginMap, PluginType, RollupPlugin, RollupPluginList, Unplugin, UnpluginCombineInstance, WebpackPlugin } from './types.js'; | ||
export { Plugin as VitePlugin } from 'vite'; | ||
export { Plugin as EsbuildPlugin } from 'esbuild'; | ||
import 'unplugin'; | ||
import 'webpack'; | ||
import 'rollup'; | ||
declare function resolvePlugin<T extends PluginType>(plugin: OptionsPlugin, type: T): Array<PluginMap[T]>; | ||
declare function resolvePlugins<T extends PluginType>(plugins: OptionsPlugin[], type: T): Array<PluginMap[T]>; | ||
declare const createCombinePlugin: <UserOptions>(factory: Factory<UserOptions>) => UnpluginCombineInstance<UserOptions>; | ||
export { createCombinePlugin, resolvePlugin, resolvePlugins }; | ||
import type { Factory, OptionsPlugin, PluginMap, PluginType, UnpluginCombineInstance } from './types'; | ||
export * from './types'; | ||
export declare function resolvePlugin<T extends PluginType>(plugin: OptionsPlugin, type: T): Array<PluginMap[T]>; | ||
export declare function resolvePlugins<T extends PluginType>(plugins: OptionsPlugin[], type: T): Array<PluginMap[T]>; | ||
export declare const createCombinePlugin: <UserOptions>(factory: Factory<UserOptions>) => UnpluginCombineInstance<UserOptions>; |
@@ -1,11 +0,3 @@ | ||
import { RollupPluginList, RollupPlugin, Factory, FactoryOutput } from './types.js'; | ||
import 'unplugin'; | ||
import 'webpack'; | ||
import 'rollup'; | ||
import 'vite'; | ||
import 'esbuild'; | ||
declare function addPlugin(name: string, pluginList: RollupPluginList, plugins: RollupPlugin[]): void; | ||
declare const getRollupPlugin: <UserOptions>(factory: Factory<UserOptions>, vite?: boolean) => FactoryOutput<UserOptions, RollupPlugin>; | ||
export { addPlugin, getRollupPlugin }; | ||
import type { Factory, RollupPlugin, RollupPluginList, UnpluginCombineInstance } from './types'; | ||
export declare function addPlugin(name: string, pluginList: RollupPluginList, plugins: RollupPlugin[]): void; | ||
export declare const getRollupPlugin: <UserOptions>(factory: Factory<UserOptions>, vite?: boolean) => import("./types").FactoryOutput<UserOptions, RollupPlugin>; |
@@ -1,31 +0,29 @@ | ||
import { UnpluginInstance } from 'unplugin'; | ||
import { Configuration } from 'webpack'; | ||
import { InputOptions, Plugin as Plugin$1 } from 'rollup'; | ||
import { Plugin as Plugin$2 } from 'vite'; | ||
export { Plugin as VitePlugin } from 'vite'; | ||
import { Plugin as Plugin$3 } from 'esbuild'; | ||
export { Plugin as EsbuildPlugin } from 'esbuild'; | ||
declare type RollupPluginList = NonNullable<InputOptions['plugins']>; | ||
declare type RollupPlugin = Plugin$1 & { | ||
import type { UnpluginInstance } from 'unplugin'; | ||
import type { Configuration } from 'webpack'; | ||
import type { InputOptions, Plugin as _RollupPlugin } from 'rollup'; | ||
import type { Plugin as VitePlugin } from 'vite'; | ||
import type { Plugin as EsbuildPlugin } from 'esbuild'; | ||
export declare type RollupPluginList = NonNullable<InputOptions['plugins']>; | ||
export declare type RollupPlugin = _RollupPlugin & { | ||
combinedPlugins: RollupPlugin[]; | ||
}; | ||
declare type WebpackPlugin = NonNullable<Configuration['plugins']> extends Array<infer T> ? T : never; | ||
interface PluginMap { | ||
export type { VitePlugin }; | ||
export type { EsbuildPlugin }; | ||
export declare type WebpackPlugin = NonNullable<Configuration['plugins']> extends Array<infer T> ? T : never; | ||
export interface PluginMap { | ||
rollup: RollupPlugin; | ||
vite: Plugin$2; | ||
esbuild: Plugin$3; | ||
vite: VitePlugin; | ||
esbuild: EsbuildPlugin; | ||
webpack: WebpackPlugin; | ||
} | ||
declare type PluginType = keyof PluginMap; | ||
declare type Plugin = PluginMap[PluginType]; | ||
declare type Factory<UserOptions> = (userOptions: UserOptions) => CombineOptions; | ||
declare type FactoryOutput<UserOptions, Return> = [never] extends UserOptions ? () => Return : undefined extends UserOptions ? (options?: UserOptions) => Return : (options: UserOptions) => Return; | ||
declare type Unplugin<UserOptions> = [ | ||
export declare type PluginType = keyof PluginMap; | ||
export declare type Plugin = PluginMap[PluginType]; | ||
export declare type Factory<UserOptions> = (userOptions: UserOptions) => CombineOptions; | ||
export declare type FactoryOutput<UserOptions, Return> = [never] extends UserOptions ? () => Return : undefined extends UserOptions ? (options?: UserOptions) => Return : (options: UserOptions) => Return; | ||
export declare type Unplugin<UserOptions> = [ | ||
instance: UnpluginInstance<UserOptions, any> | UnpluginCombineInstance<any>, | ||
options: UserOptions | ||
]; | ||
declare type OptionsPlugin = Plugin | Unplugin<any> | UnpluginCombineInstance<any>; | ||
interface CombineOptions { | ||
export declare type OptionsPlugin = Plugin | Unplugin<any> | UnpluginCombineInstance<any>; | ||
export interface CombineOptions { | ||
name: string; | ||
@@ -36,10 +34,8 @@ /** vite only */ | ||
} | ||
interface UnpluginCombineInstance<UserOptions> { | ||
export interface UnpluginCombineInstance<UserOptions> { | ||
rollup: FactoryOutput<UserOptions, RollupPlugin>; | ||
webpack: FactoryOutput<UserOptions, WebpackPlugin>; | ||
vite: FactoryOutput<UserOptions, Plugin$2[]>; | ||
esbuild: FactoryOutput<UserOptions, Plugin$3>; | ||
vite: FactoryOutput<UserOptions, VitePlugin[]>; | ||
esbuild: FactoryOutput<UserOptions, EsbuildPlugin>; | ||
raw: Factory<UserOptions>; | ||
} | ||
export { CombineOptions, Factory, FactoryOutput, OptionsPlugin, Plugin, PluginMap, PluginType, RollupPlugin, RollupPluginList, Unplugin, UnpluginCombineInstance, WebpackPlugin }; |
@@ -1,10 +0,2 @@ | ||
import { Factory, FactoryOutput } from './types.js'; | ||
import * as vite from 'vite'; | ||
import 'unplugin'; | ||
import 'webpack'; | ||
import 'rollup'; | ||
import 'esbuild'; | ||
declare const getVitePlugin: <UserOptions>(factory: Factory<UserOptions>) => FactoryOutput<UserOptions, vite.Plugin[]>; | ||
export { getVitePlugin }; | ||
import type { Factory, UnpluginCombineInstance } from './types'; | ||
export declare const getVitePlugin: <UserOptions>(factory: Factory<UserOptions>) => import("./types").FactoryOutput<UserOptions, import("vite").Plugin[]>; |
@@ -1,11 +0,3 @@ | ||
import { Factory, FactoryOutput } from './types.js'; | ||
import * as webpack from 'webpack'; | ||
import { Compiler } from 'webpack'; | ||
import 'unplugin'; | ||
import 'rollup'; | ||
import 'vite'; | ||
import 'esbuild'; | ||
declare const getWebpackPlugin: <UserOptions>(factory: Factory<UserOptions>) => FactoryOutput<UserOptions, ((this: Compiler, compiler: Compiler) => void) | webpack.WebpackPluginInstance>; | ||
export { getWebpackPlugin }; | ||
import type { Factory, UnpluginCombineInstance } from './types'; | ||
import type { Compiler } from 'webpack'; | ||
export declare const getWebpackPlugin: <UserOptions>(factory: Factory<UserOptions>) => import("./types").FactoryOutput<UserOptions, ((this: Compiler, compiler: Compiler) => void) | import("webpack").WebpackPluginInstance>; |
{ | ||
"name": "unplugin-combine", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"packageManager": "pnpm@7.9.0", | ||
@@ -95,3 +95,3 @@ "description": "Unified plugin that combines other plugins into one plugin.", | ||
"lint:fix": "pnpm run lint --fix", | ||
"build": "tsup", | ||
"build": "tsup && tsc -p tsconfig.lib.json --declaration --emitDeclarationOnly", | ||
"test": "vitest", | ||
@@ -98,0 +98,0 @@ "release": "bumpp && pnpm publish" |
14990
318