Comparing version 0.13.2 to 0.14.0-snapshot-18ee4d3-20241107003320
type MaybePromise<T> = T | Promise<T> | ||
type Nullable<T> = T | null | undefined | ||
type VoidNullable<T = void> = T | null | undefined | void | ||
export type BindingStringOrRegex = string | RegExp | ||
export declare class BindingLog { | ||
@@ -23,3 +25,2 @@ code: string | ||
get source(): BindingAssetSource | ||
set source(source: BindingAssetSource) | ||
get name(): string | null | ||
@@ -37,8 +38,5 @@ } | ||
get imports(): Array<string> | ||
set imports(imports: Array<string>) | ||
get dynamicImports(): Array<string> | ||
get code(): string | ||
set code(code: string) | ||
get map(): string | null | ||
set map(map: string) | ||
get sourcemapFileName(): string | null | ||
@@ -49,7 +47,5 @@ get preliminaryFileName(): string | ||
/** The `BindingOutputs` owner `Vec<Output>` the mutable reference, it avoid `Clone` at call `writeBundle/generateBundle` hook, and make it mutable. */ | ||
export declare class BindingOutputs { | ||
get chunks(): Array<BindingOutputChunk> | ||
get assets(): Array<BindingOutputAsset> | ||
delete(fileName: string): void | ||
} | ||
@@ -62,3 +58,4 @@ | ||
getModuleInfo(moduleId: string): BindingModuleInfo | null | ||
getModuleIds(): Array<string> | null | ||
getModuleIds(): Array<string> | ||
addWatchFile(file: string): void | ||
} | ||
@@ -70,18 +67,16 @@ | ||
export declare class BindingWatcher { | ||
close(): Promise<void> | ||
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void | ||
} | ||
export declare class Bundler { | ||
constructor(inputOptions: BindingInputOptions, outputOptions: BindingOutputOptions, parallelPluginsRegistry?: ParallelJsPluginRegistry | undefined | null) | ||
write(): Promise<FinalBindingOutputs> | ||
generate(): Promise<FinalBindingOutputs> | ||
write(): Promise<BindingOutputs> | ||
generate(): Promise<BindingOutputs> | ||
scan(): Promise<void> | ||
close(): Promise<void> | ||
watch(): Promise<BindingWatcher> | ||
} | ||
/** | ||
* The `FinalBindingOutputs` is used at `write()` or `generate()`, it is similar to `BindingOutputs`, if using `BindingOutputs` has unexpected behavior. | ||
* TODO find a way to export it gracefully. | ||
*/ | ||
export declare class FinalBindingOutputs { | ||
get chunks(): Array<BindingOutputChunk> | ||
get assets(): Array<BindingOutputAsset> | ||
} | ||
export declare class ParallelJsPluginRegistry { | ||
@@ -98,3 +93,3 @@ id: number | ||
export interface ArrowFunctionsBindingOptions { | ||
export interface ArrowFunctionsOptions { | ||
/** | ||
@@ -165,2 +160,7 @@ * This option enables the following: | ||
export interface BindingExperimentalOptions { | ||
strictExecutionOrder?: boolean | ||
disableLiveBindings?: boolean | ||
} | ||
export interface BindingGeneralHookFilter { | ||
@@ -245,2 +245,6 @@ include?: Array<BindingStringOrRegex> | ||
inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace> | ||
experimental?: BindingExperimentalOptions | ||
profilerNames?: boolean | ||
jsx?: JsxOptions | ||
watch?: BindingWatchOption | ||
} | ||
@@ -276,3 +280,3 @@ | ||
name: string | ||
test?: string | ||
test?: BindingStringOrRegex | ||
priority?: number | ||
@@ -287,2 +291,7 @@ minSize?: number | ||
export interface BindingNotifyOption { | ||
pollInterval?: number | ||
compareContents?: boolean | ||
} | ||
export interface BindingOutputOptions { | ||
@@ -295,2 +304,3 @@ name?: string | ||
dir?: string | ||
file?: string | ||
esModule?: boolean | 'if-default-prop' | ||
@@ -301,3 +311,3 @@ exports?: 'default' | 'named' | 'none' | 'auto' | ||
footer?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>> | ||
format?: 'es' | 'cjs' | 'iife' | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | ||
globals?: Record<string, string> | ||
@@ -310,2 +320,3 @@ inlineDynamicImports?: boolean | ||
sourcemapIgnoreList?: (source: string, sourcemapPath: string) => boolean | ||
sourcemapDebugIds?: boolean | ||
sourcemapPathTransform?: (source: string, sourcemapPath: string) => string | ||
@@ -358,6 +369,12 @@ minify?: boolean | ||
renderErrorMeta?: BindingPluginHookMeta | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable> | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundleMeta?: BindingPluginHookMeta | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable> | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundleMeta?: BindingPluginHookMeta | ||
closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
closeBundleMeta?: BindingPluginHookMeta | ||
watchChange?: (ctx: BindingPluginContext, path: string, event: string) => MaybePromise<VoidNullable> | ||
watchChangeMeta?: BindingPluginHookMeta | ||
closeWatcher?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
closeWatcherMeta?: BindingPluginHookMeta | ||
banner?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void | ||
@@ -400,2 +417,3 @@ bannerMeta?: BindingPluginHookMeta | ||
extensions?: Array<string> | ||
extensionAlias?: Array<ExtensionAliasItem> | ||
mainFields?: Array<string> | ||
@@ -412,16 +430,2 @@ mainFiles?: Array<string> | ||
/** | ||
* For String, value is the string content, flag is the `None` | ||
* For Regex, value is the regular expression, flag is the `Some()`. | ||
* Make sure put a `Some("")` in flag even there is no flag in regexp. | ||
*/ | ||
export interface BindingStringOrRegex { | ||
value: string | ||
/** | ||
* There is a more compact way to represent this, `Option<u8>` with bitflags, but it will be hard | ||
* to use(in js side), since construct a `JsRegex` is not used frequently. Optimize it when it is needed. | ||
*/ | ||
flag?: string | ||
} | ||
export interface BindingTransformHookExtraArgs { | ||
@@ -441,2 +445,3 @@ moduleType: string | ||
jsxInject?: string | ||
targets?: string | ||
} | ||
@@ -448,12 +453,40 @@ | ||
export interface Es2015BindingOptions { | ||
export declare enum BindingWatcherEvent { | ||
Close = 0, | ||
Event = 1, | ||
ReStart = 2, | ||
Change = 3 | ||
} | ||
export interface BindingWatchOption { | ||
skipWrite?: boolean | ||
notify?: BindingNotifyOption | ||
include?: Array<BindingStringOrRegex> | ||
exclude?: Array<BindingStringOrRegex> | ||
} | ||
export interface Es2015Options { | ||
/** Transform arrow functions into function expressions. */ | ||
arrowFunction?: ArrowFunctionsBindingOptions | ||
arrowFunction?: ArrowFunctionsOptions | ||
} | ||
export interface ExtensionAliasItem { | ||
target: string | ||
replacements: Array<string> | ||
} | ||
/** TypeScript Isolated Declarations for Standalone DTS Emit */ | ||
export declare function isolatedDeclaration(filename: string, sourceText: string, options: IsolatedDeclarationsOptions): IsolatedDeclarationsResult | ||
export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult | ||
export interface IsolatedDeclarationsOptions { | ||
sourcemap: boolean | ||
/** | ||
* Do not emit declarations for code that has an @internal annotation in its JSDoc comment. | ||
* This is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid. | ||
* | ||
* Default: `false` | ||
* | ||
* See <https://www.typescriptlang.org/tsconfig/#stripInternal> | ||
*/ | ||
stripInternal?: boolean | ||
sourcemap?: boolean | ||
} | ||
@@ -467,3 +500,16 @@ | ||
export interface PreRenderedChunk { | ||
export interface JsChangedOutputs { | ||
chunks: Array<JsOutputChunk> | ||
assets: Array<JsOutputAsset> | ||
deleted: Array<string> | ||
} | ||
export interface JsOutputAsset { | ||
name?: string | ||
originalFileName?: string | ||
filename: string | ||
source: BindingAssetSource | ||
} | ||
export interface JsOutputChunk { | ||
name: string | ||
@@ -475,2 +521,10 @@ isEntry: boolean | ||
exports: Array<string> | ||
filename: string | ||
modules: Record<string, BindingRenderedModule> | ||
imports: Array<string> | ||
dynamicImports: Array<string> | ||
code: string | ||
map?: BindingSourcemap | ||
sourcemapFilename?: string | ||
preliminaryFilename: string | ||
} | ||
@@ -481,5 +535,5 @@ | ||
* | ||
* @see [@babel/plugin-transform-react-jsx](https://babeljs.io/docs/babel-plugin-transform-react-jsx#options) | ||
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options} | ||
*/ | ||
export interface ReactBindingOptions { | ||
export interface JsxOptions { | ||
/** | ||
@@ -499,3 +553,3 @@ * Decides which runtime to use. | ||
* | ||
* @see [@babel/plugin-transform-react-jsx-development](https://babeljs.io/docs/babel-plugin-transform-react-jsx-development) | ||
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development} | ||
*/ | ||
@@ -514,6 +568,8 @@ development?: boolean | ||
/** | ||
* Enables [@babel/plugin-transform-react-pure-annotations](https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations). | ||
* Enables `@babel/plugin-transform-react-pure-annotations`. | ||
* | ||
* It will mark top-level React method calls as pure for tree shaking. | ||
* | ||
* @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations} | ||
* | ||
* @default true | ||
@@ -564,4 +620,37 @@ */ | ||
useSpread?: boolean | ||
/** | ||
* Enable React Fast Refresh . | ||
* | ||
* Conforms to the implementation in {@link https://github.com/facebook/react/tree/main/packages/react-refresh} | ||
* | ||
* @default false | ||
*/ | ||
refresh?: boolean | ReactRefreshOptions | ||
} | ||
export interface PreRenderedChunk { | ||
name: string | ||
isEntry: boolean | ||
isDynamicEntry: boolean | ||
facadeModuleId?: string | ||
moduleIds: Array<string> | ||
exports: Array<string> | ||
} | ||
export interface ReactRefreshOptions { | ||
/** | ||
* Specify the identifier of the refresh registration variable. | ||
* | ||
* @default `$RefreshReg$`. | ||
*/ | ||
refreshReg?: string | ||
/** | ||
* Specify the identifier of the refresh signature variable. | ||
* | ||
* @default `$RefreshSig$`. | ||
*/ | ||
refreshSig?: string | ||
emitFullSignatures?: boolean | ||
} | ||
export declare function registerPlugins(id: number, plugins: Array<BindingPluginWithIndex>): void | ||
@@ -584,7 +673,9 @@ | ||
file?: string | ||
mappings?: string | ||
mappings: string | ||
names: Array<string> | ||
sourceRoot?: string | ||
sources?: Array<string | undefined | null> | ||
sourcesContent?: Array<string | undefined | null> | ||
names?: Array<string> | ||
sources: Array<string> | ||
sourcesContent?: Array<string> | ||
version: number | ||
x_google_ignoreList?: Array<number> | ||
} | ||
@@ -613,2 +704,4 @@ | ||
sourceType?: 'script' | 'module' | 'unambiguous' | undefined | ||
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */ | ||
lang?: 'js' | 'jsx' | 'ts' | 'tsx' | ||
/** | ||
@@ -620,14 +713,2 @@ * The current working directory. Used to resolve relative paths in other | ||
/** | ||
* Force jsx parsing, | ||
* | ||
* @default false | ||
*/ | ||
jsx?: boolean | ||
/** Configure how TypeScript is transformed. */ | ||
typescript?: TypeScriptBindingOptions | ||
/** Configure how TSX and JSX are transformed. */ | ||
react?: ReactBindingOptions | ||
/** Enable ES2015 transformations. */ | ||
es2015?: Es2015BindingOptions | ||
/** | ||
* Enable source map generation. | ||
@@ -642,2 +723,10 @@ * | ||
sourcemap?: boolean | ||
/** Configure how TypeScript is transformed. */ | ||
typescript?: TypeScriptOptions | ||
/** Configure how TSX and JSX are transformed. */ | ||
jsx?: JsxOptions | ||
/** Define Plugin */ | ||
define?: Record<string, string> | ||
/** Inject Plugin */ | ||
inject?: Record<string, string | [string, string]> | ||
} | ||
@@ -665,3 +754,3 @@ | ||
* | ||
* @see {@link TypeScriptBindingOptions#declaration} | ||
* @see {@link TypeScriptOptions#declaration} | ||
* @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration) | ||
@@ -672,3 +761,3 @@ */ | ||
* Declaration source map. Only generated if both | ||
* {@link TypeScriptBindingOptions#declaration declaration} and | ||
* {@link TypeScriptOptions#declaration declaration} and | ||
* {@link TransformOptions#sourcemap sourcemap} are set to `true`. | ||
@@ -687,3 +776,3 @@ */ | ||
export interface TypeScriptBindingOptions { | ||
export interface TypeScriptOptions { | ||
jsxPragma?: string | ||
@@ -703,3 +792,3 @@ jsxPragmaFrag?: string | ||
*/ | ||
declaration?: boolean | ||
declaration?: IsolatedDeclarationsOptions | ||
/** | ||
@@ -717,2 +806,1 @@ * Rewrite or remove TypeScript import/export declaration extensions. | ||
} | ||
@@ -7,3 +7,4 @@ import { CliOptions } from './schema'; | ||
hint?: string; | ||
reverse?: boolean; | ||
} | ||
export declare const alias: Partial<Record<keyof CliOptions, OptionConfig>>; |
@@ -9,3 +9,3 @@ export declare const flattenedSchema: Record<string, import("./types").Schema>; | ||
hint?: string; | ||
description?: string; | ||
description: string; | ||
}; | ||
@@ -12,0 +12,0 @@ }; |
@@ -1,8 +0,4 @@ | ||
/** | ||
* @description This file is used for normalize the options. | ||
* In CLI, the input options and output options are mixed together. We need to tell them apart. | ||
*/ | ||
import { InputOptions } from '../../options/input-options'; | ||
import { OutputOptions } from '../../options/output-options'; | ||
import { CliOptions } from './schema'; | ||
import type { InputOptions } from '../../types/input-options'; | ||
import type { OutputOptions } from '../../types/output-options'; | ||
export interface NormalizedCliOptions { | ||
@@ -14,3 +10,4 @@ input: InputOptions; | ||
version: boolean; | ||
watch: boolean; | ||
} | ||
export declare function normalizeCliOptions(cliOptions: CliOptions, positionals: string[]): NormalizedCliOptions; |
@@ -7,2 +7,3 @@ import type { ObjectSchema } from './types'; | ||
version: z.ZodOptional<z.ZodBoolean>; | ||
watch: z.ZodOptional<z.ZodBoolean>; | ||
}, Omit<z.objectUtil.extendShape<{ | ||
@@ -16,2 +17,3 @@ input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
@@ -25,3 +27,5 @@ extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -33,7 +37,8 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -45,3 +50,2 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
@@ -57,8 +61,14 @@ tsconfigFilename?: string | undefined; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -68,2 +78,62 @@ }>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, { | ||
@@ -73,9 +143,10 @@ external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental">>, Omit<z.objectUtil.extendShape<{ | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">>, Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../options/output-options").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../options/output-options").SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../options/output-options").SourcemapPathTransformOption, z.ZodTypeDef, import("../../options/output-options").SourcemapPathTransformOption>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../rollup").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../rollup").SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../rollup").SourcemapPathTransformOption, z.ZodTypeDef, import("../../rollup").SourcemapPathTransformOption>>; | ||
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
@@ -100,3 +171,3 @@ footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
name: z.ZodString; | ||
test: z.ZodOptional<z.ZodString>; | ||
test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
@@ -109,3 +180,3 @@ minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -116,3 +187,3 @@ }, { | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -127,3 +198,3 @@ }>, "many">>; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -138,3 +209,3 @@ }[] | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -149,5 +220,14 @@ }[] | undefined; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodBoolean>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodUndefined>; | ||
}>, "sourcemapPathTransform">>, "strict", z.ZodTypeAny, { | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}>>; | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, { | ||
treeshake?: boolean | undefined; | ||
external?: string[] | undefined; | ||
@@ -157,7 +237,16 @@ cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: boolean | undefined; | ||
footer?: string | undefined; | ||
@@ -167,12 +256,16 @@ banner?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
@@ -183,13 +276,2 @@ minify?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
version?: boolean | undefined; | ||
@@ -199,2 +281,3 @@ config?: string | boolean | undefined; | ||
}, { | ||
treeshake?: boolean | undefined; | ||
external?: string[] | undefined; | ||
@@ -204,7 +287,16 @@ cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: boolean | undefined; | ||
footer?: string | undefined; | ||
@@ -214,12 +306,16 @@ banner?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
@@ -230,13 +326,2 @@ minify?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
version?: boolean | undefined; | ||
@@ -243,0 +328,0 @@ config?: string | boolean | undefined; |
import { Plugin } from '../plugin'; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro"]; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange", "closeWatcher"]; | ||
/** | ||
@@ -4,0 +4,0 @@ * Names of all properties in a `Plugin` object. Includes `name` and `api`. |
export { defineParallelPlugin } from './plugin/parallel-plugin'; | ||
export { experimental_scan as scan } from './rolldown'; | ||
export { transform } from './binding'; | ||
export type { TransformOptions, TransformResult } from './binding'; | ||
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, } from './plugin/builtin-plugin'; |
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output'; | ||
import type { ExternalOption, InputOption, InputOptions } from './options/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './options/output-options'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './types/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './types/output-options'; | ||
import type { RolldownOptions } from './types/rolldown-options'; | ||
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import { DefineParallelPluginResult } from './plugin/parallel-plugin'; | ||
import { defineConfig } from './utils/define-config'; | ||
import { rolldown } from './rolldown'; | ||
import { rolldown, watch } from './rolldown'; | ||
import { ConfigExport } from './types/config-export'; | ||
@@ -21,6 +21,7 @@ import { RolldownBuild } from './rolldown-build'; | ||
import { OutputBundle } from './types/output-bundle'; | ||
export { defineConfig, rolldown }; | ||
import { WatchOptions } from './options/watch-option'; | ||
export { defineConfig, rolldown, watch }; | ||
export declare const VERSION: string; | ||
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, }; | ||
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './rollup'; |
import type { LoggingFunction, LogHandler, RollupError } from '../rollup'; | ||
import type { Plugin } from '../plugin'; | ||
import { type LogLevelOption } from './logging'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
export interface MinimalPluginContext { | ||
export interface PluginContextMeta { | ||
rollupVersion: string; | ||
rolldownVersion: string; | ||
watchMode: boolean; | ||
} | ||
export declare class MinimalPluginContext { | ||
debug: LoggingFunction; | ||
error: (error: RollupError | string) => never; | ||
info: LoggingFunction; | ||
meta: PluginContextMeta; | ||
warn: LoggingFunction; | ||
readonly error: (error: RollupError | string) => never; | ||
constructor(options: NormalizedInputOptions, plugin: Plugin); | ||
} | ||
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"]; |
import { z } from 'zod'; | ||
export type LogLevel = 'info' | 'debug' | 'warn'; | ||
export type LogLevelOption = LogLevel | 'silent'; | ||
export type LogLevelWithError = LogLevel | 'error'; | ||
export type RollupLog = any; | ||
export type RollupLogWithString = RollupLog | string; | ||
export declare const LogLevelSchema: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>; | ||
export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>; | ||
export declare const LogLevelWithErrorSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>; | ||
export type LogLevel = z.infer<typeof LogLevelSchema>; | ||
export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>; | ||
export type LogLevelOption = z.infer<typeof LogLevelOptionSchema>; | ||
export declare const LOG_LEVEL_SILENT: LogLevelOption; | ||
@@ -8,0 +11,0 @@ export declare const LOG_LEVEL_ERROR = "error"; |
@@ -0,6 +1,4 @@ | ||
import { z } from 'zod'; | ||
import type { RolldownPluginRec } from '../plugin'; | ||
import { z } from 'zod'; | ||
import { TreeshakingOptions } from '../treeshake'; | ||
declare const inputOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>; | ||
declare const externalSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>; | ||
import type { TreeshakingOptions } from '../treeshake'; | ||
export declare const inputOptionsSchema: z.ZodObject<{ | ||
@@ -14,2 +12,3 @@ input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
@@ -23,3 +22,5 @@ extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -31,7 +32,8 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -43,3 +45,2 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
@@ -55,8 +56,14 @@ tsconfigFilename?: string | undefined; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -66,8 +73,71 @@ }>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, "strict", z.ZodTypeAny, { | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args_3: unknown[]) => boolean | void | null | undefined) | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -79,3 +149,2 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
@@ -87,8 +156,9 @@ tsconfigFilename?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args_2: unknown[]) => unknown, ...args_3: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args_1: unknown[]) => unknown, ...args_2: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -98,8 +168,31 @@ } | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
}, { | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args_3: unknown[]) => boolean | void | null | undefined) | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -111,3 +204,2 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
@@ -119,8 +211,9 @@ tsconfigFilename?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args_2: unknown[]) => unknown, ...args_3: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args_1: unknown[]) => unknown, ...args_2: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -130,2 +223,22 @@ } | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
}>; | ||
@@ -140,2 +253,3 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
@@ -149,3 +263,5 @@ extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -157,7 +273,8 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
@@ -169,3 +286,2 @@ conditionNames?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
@@ -181,8 +297,14 @@ tsconfigFilename?: string | undefined; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -192,2 +314,62 @@ }>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, { | ||
@@ -197,3 +379,4 @@ external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental">, "strict", z.ZodTypeAny, { | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">, "strict", z.ZodTypeAny, { | ||
treeshake?: boolean | undefined; | ||
external?: string[] | undefined; | ||
@@ -203,8 +386,17 @@ cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
}, { | ||
treeshake?: boolean | undefined; | ||
external?: string[] | undefined; | ||
@@ -214,38 +406,15 @@ cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined; | ||
moduleTypes?: Record<string, "jsx" | "js" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
}>; | ||
type RawInputOptions = z.infer<typeof inputOptionsSchema>; | ||
interface OverwriteInputOptionsWithDoc { | ||
/** | ||
* Inject import statements on demand. | ||
* | ||
* ## Supported patterns | ||
* ```js | ||
* { | ||
* // import { Promise } from 'es6-promise' | ||
* Promise: ['es6-promise', 'Promise'], | ||
* | ||
* // import { Promise as P } from 'es6-promise' | ||
* P: ['es6-promise', 'Promise'], | ||
* | ||
* // import $ from 'jquery' | ||
* $: 'jquery', | ||
* | ||
* // import * as fs from 'node:fs' | ||
* fs: ['node:fs', '*'], | ||
* | ||
* // Inject shims for property access pattern | ||
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ), | ||
* } | ||
* ``` | ||
*/ | ||
inject?: RawInputOptions['inject']; | ||
} | ||
export type InputOption = z.infer<typeof inputOptionSchema>; | ||
export type InputOptions = Omit<RawInputOptions, keyof OverwriteInputOptionsWithDoc> & OverwriteInputOptionsWithDoc; | ||
export type ExternalOption = z.infer<typeof externalSchema>; | ||
export {}; |
@@ -1,2 +0,1 @@ | ||
import { BindingAliasPluginConfig } from '../binding'; | ||
type AliasPluginAlias = { | ||
@@ -9,3 +8,2 @@ find: string | RegExp; | ||
}; | ||
export declare function normalizeAliasPluginConfig(config?: AliasPluginConfig): BindingAliasPluginConfig | undefined; | ||
export {}; |
import type { LogLevelOption, RollupLog, NormalizedInputOptions as RollupNormalizedInputOptions } from '../rollup'; | ||
import type { InputOptions } from './input-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
@@ -4,0 +4,0 @@ import type { LogLevel } from '../log/logging'; |
@@ -1,11 +0,7 @@ | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import type { OutputOptions } from './output-options'; | ||
import type { SourcemapIgnoreListOption } from '../rollup'; | ||
import type { AddonFunction, OutputOptions } from '../types/output-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { PreRenderedChunk, RenderedChunk } from '../binding'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife'; | ||
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>; | ||
type ChunkFileNamesOption = string | ((chunk: PreRenderedChunk) => string) | undefined; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd'; | ||
export interface NormalizedOutputOptions extends OutputOptions { | ||
plugins: RolldownPlugin[]; | ||
dir: string | undefined; | ||
format: InternalModuleFormat; | ||
@@ -15,3 +11,2 @@ exports: 'auto' | 'named' | 'default' | 'none'; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption; | ||
sourcemapPathTransform: SourcemapPathTransformOption | undefined; | ||
banner: AddonFunction; | ||
@@ -22,8 +17,4 @@ footer: AddonFunction; | ||
esModule: boolean | 'if-default-prop'; | ||
entryFileNames: ChunkFileNamesOption; | ||
chunkFileNames: ChunkFileNamesOption; | ||
assetFileNames: string; | ||
name: string | undefined; | ||
inlineDynamicImports: boolean; | ||
} | ||
export {}; |
@@ -1,8 +0,9 @@ | ||
import type { PreRenderedChunk, RenderedChunk } from '../binding'; | ||
import { z } from 'zod'; | ||
declare const ModuleFormatSchema: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>>; | ||
declare const outputOptionsSchema: z.ZodObject<{ | ||
import type { RenderedChunk, PreRenderedChunk } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
@@ -30,3 +31,3 @@ sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>; | ||
name: z.ZodString; | ||
test: z.ZodOptional<z.ZodString>; | ||
test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
@@ -39,3 +40,3 @@ minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -46,3 +47,3 @@ }, { | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -57,3 +58,3 @@ }>, "many">>; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
@@ -68,144 +69,23 @@ }[] | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
}, "strict", z.ZodTypeAny, { | ||
footer?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
banner?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
intro?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
outro?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform?: SourcemapPathTransformOption | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | "if-default-prop" | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}, { | ||
footer?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
banner?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
intro?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
outro?: string | ((args_0: RenderedChunk, ...args_1: unknown[]) => string | Promise<string>) | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform?: SourcemapPathTransformOption | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | "if-default-prop" | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}>; | ||
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<SourcemapPathTransformOption, z.ZodTypeDef, SourcemapPathTransformOption>>; | ||
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
test: z.ZodOptional<z.ZodString>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
}, { | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodBoolean>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodUndefined>; | ||
}>, "sourcemapPathTransform">, "strict", z.ZodTypeAny, { | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">, "strict", z.ZodTypeAny, { | ||
footer?: string | undefined; | ||
@@ -215,12 +95,16 @@ banner?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
@@ -231,13 +115,2 @@ minify?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}, { | ||
@@ -248,12 +121,16 @@ footer?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args_1: unknown[]) => string) | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
@@ -264,18 +141,2 @@ minify?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}>; | ||
export type OutputOptions = z.infer<typeof outputOptionsSchema>; | ||
export type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean; | ||
export type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string; | ||
export type ModuleFormat = z.infer<typeof ModuleFormatSchema>; | ||
export {}; |
import { BindingGeneralHookFilter, BindingTransformHookFilter } from '../binding.d'; | ||
import { hookFilterExtension } from '.'; | ||
import type { StringFilter } from './hook-filter'; | ||
export declare function bindingifyStringFilter(matcher: StringFilter): BindingGeneralHookFilter; | ||
export declare function bindingifyResolveIdFilter(filterOption?: hookFilterExtension<'resolveId'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyLoadFilter(filterOption?: hookFilterExtension<'load'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyTransformFilter(filterOption?: hookFilterExtension<'transform'>['filter']): BindingTransformHookFilter | undefined; |
@@ -13,2 +13,3 @@ import type { BindingPluginOptions } from '../binding'; | ||
export declare function bindingifyWriteBundle(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['writeBundle']>; | ||
export declare function bindingifyCloseBundle(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['closeBundle']>; | ||
export declare function bindingifyBanner(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['banner']>; | ||
@@ -15,0 +16,0 @@ export declare function bindingifyFooter(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['footer']>; |
@@ -19,2 +19,3 @@ import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs, RenderedChunk } from '../binding'; | ||
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import { HookFilter } from './hook-filter'; | ||
export type ModuleSideEffects = boolean | 'no-treeshake' | null; | ||
@@ -80,3 +81,9 @@ export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {}); | ||
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void; | ||
[DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void; | ||
[DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: { | ||
event: ChangeEvent; | ||
}) => void; | ||
[DEFINED_HOOK_NAMES.closeWatcher]: (this: PluginContext) => void; | ||
} | ||
export type ChangeEvent = 'create' | 'update' | 'delete'; | ||
export type PluginOrder = 'pre' | 'post' | null; | ||
@@ -97,19 +104,6 @@ export type ObjectHookMeta<O = {}> = { | ||
export type hookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? { | ||
filter?: BaseHookFilter; | ||
filter?: HookFilter; | ||
} : K extends 'load' | 'resolveId' ? { | ||
filter?: Omit<BaseHookFilter, 'code' | 'moduleType'>; | ||
filter?: Pick<HookFilter, 'id'>; | ||
} : {}; | ||
export type BaseHookFilter = { | ||
id?: { | ||
include?: (string | RegExp)[]; | ||
exclude?: (string | RegExp)[]; | ||
}; | ||
moduleType?: ModuleType[] | { | ||
include?: ModuleType[]; | ||
}; | ||
code?: { | ||
include?: (string | RegExp)[]; | ||
exclude?: (string | RegExp)[]; | ||
}; | ||
}; | ||
export type PluginHooks = { | ||
@@ -116,0 +110,0 @@ [K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], hookFilterExtension<K>>; |
import { BindingPluginContext } from '../binding'; | ||
import { ModuleInfo, ModuleOptions } from '..'; | ||
import { ModuleOptions } from '..'; | ||
import { PluginContextResolveOptions } from './plugin-context'; | ||
export declare class PluginContextData { | ||
modules: Map<string, ModuleInfo>; | ||
moduleIds: Array<string> | null; | ||
moduleOptionMap: Map<string, ModuleOptions>; | ||
@@ -11,4 +9,4 @@ resolveOptionsMap: Map<number, PluginContextResolveOptions>; | ||
getModuleOption(id: string): ModuleOptions | undefined; | ||
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null; | ||
getModuleIds(context: BindingPluginContext): IterableIterator<string>; | ||
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null; | ||
getModuleIds(context: BindingPluginContext): ArrayIterator<string>; | ||
saveResolveOptions(options: PluginContextResolveOptions): number; | ||
@@ -15,0 +13,0 @@ getSavedResolveOptions(receipt: number): PluginContextResolveOptions | undefined; |
@@ -1,5 +0,5 @@ | ||
import type { RollupError, LoggingFunction } from '../rollup'; | ||
import type { BindingPluginContext } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { CustomPluginOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../log/logger'; | ||
import { AssetSource } from '../utils/asset-source'; | ||
@@ -24,7 +24,3 @@ import { ModuleInfo } from '../types/module-info'; | ||
} | ||
export declare class PluginContext { | ||
debug: LoggingFunction; | ||
info: LoggingFunction; | ||
warn: LoggingFunction; | ||
readonly error: (error: RollupError | string) => never; | ||
export declare class PluginContext extends MinimalPluginContext { | ||
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>; | ||
@@ -31,0 +27,0 @@ readonly emitFile: (file: EmittedAsset) => string; |
@@ -9,1 +9,2 @@ import { Plugin, RolldownPluginRec } from './'; | ||
export declare function getObjectPlugins(plugins: RolldownPluginRec[]): Plugin[]; | ||
export declare function getSortedPlugins(hookName: 'options' | 'outputOptions' | 'onLog', plugins: readonly Plugin[]): Plugin[]; |
@@ -1,4 +0,4 @@ | ||
import type { OutputOptions } from './options/output-options'; | ||
import type { InputOptions } from './types/input-options'; | ||
import type { OutputOptions } from './types/output-options'; | ||
import type { RolldownOutput } from './types/rolldown-output'; | ||
import type { InputOptions } from './options/input-options'; | ||
export declare class RolldownBuild { | ||
@@ -9,3 +9,3 @@ #private; | ||
write(outputOptions?: OutputOptions): Promise<RolldownOutput>; | ||
destroy(): Promise<void>; | ||
close(): Promise<void>; | ||
} |
@@ -1,4 +0,7 @@ | ||
import type { InputOptions } from './options/input-options'; | ||
import type { InputOptions } from './types/input-options'; | ||
import { RolldownBuild } from './rolldown-build'; | ||
import { Watcher } from './watcher'; | ||
import { WatchOptions } from './options/watch-option'; | ||
export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>; | ||
export declare const watch: (input: WatchOptions) => Promise<Watcher>; | ||
/** | ||
@@ -5,0 +8,0 @@ * @description |
@@ -1,5 +0,5 @@ | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
export interface RolldownOptions extends InputOptions { | ||
output?: OutputOptions; | ||
} |
@@ -12,1 +12,3 @@ export type MaybePromise<T> = T | Promise<T>; | ||
export type MakeAsync<Function_> = Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never; | ||
export type MaybeArray<T> = T | T[]; | ||
export type StringOrRegExp = string | RegExp; |
import { Bundler } from '../binding'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export declare function createBundler(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<{ | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
export declare function createBundler(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<BundlerWithStopWorker>; | ||
export interface BundlerWithStopWorker { | ||
bundler: Bundler; | ||
stopWorkers?: () => Promise<void>; | ||
}>; | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
export declare function normalizeInputOptions(config: InputOptions): Promise<NormalizedInputOptions>; |
@@ -1,3 +0,3 @@ | ||
import type { OutputOptions } from '../options/output-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
import type { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
export declare function normalizeOutputOptions(opts: OutputOptions): NormalizedOutputOptions; |
import type { OutputOptions, OutputPlugin } from '../rollup-types'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
@@ -4,0 +4,0 @@ export declare const normalizePluginOption: { |
@@ -1,3 +0,3 @@ | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import { NormalizedTreeshakingOptions } from '../treeshake'; | ||
export declare function normalizeTreeshakeOptions(config: InputOptions['treeshake']): NormalizedTreeshakingOptions | undefined; |
import type { RolldownOutput } from '../types/rolldown-output'; | ||
import type { OutputBundle } from '../types/output-bundle'; | ||
import type { BindingOutputs, FinalBindingOutputs } from '../binding'; | ||
export declare function transformToRollupOutput(output: BindingOutputs | FinalBindingOutputs): RolldownOutput; | ||
export declare function transformToOutputBundle(output: BindingOutputs): OutputBundle; | ||
import type { BindingOutputs, JsChangedOutputs } from '../binding'; | ||
export declare function transformToRollupOutput(output: BindingOutputs, changed?: ChangedOutputs): RolldownOutput; | ||
export declare function transformToOutputBundle(output: BindingOutputs, changed: ChangedOutputs): OutputBundle; | ||
export interface ChangedOutputs { | ||
updated: Set<string>; | ||
deleted: Set<string>; | ||
} | ||
export declare function collectChangedBundle(changed: ChangedOutputs, bundle: OutputBundle): JsChangedOutputs; |
{ | ||
"name": "rolldown", | ||
"version": "0.13.2", | ||
"version": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -47,2 +47,3 @@ "homepage": "https://rolldown.rs/", | ||
}, | ||
"./watcher-worker": "./dist/shared/watcher-worker.js", | ||
"./package.json": "./package.json" | ||
@@ -80,3 +81,3 @@ }, | ||
}, | ||
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\n" | ||
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n" | ||
}, | ||
@@ -98,5 +99,6 @@ "dependencies": { | ||
"locate-character": "^3.0.0", | ||
"npm-run-all2": "^6.2.0", | ||
"npm-run-all2": "^7.0.0", | ||
"remeda": "^2.10.0", | ||
"rollup": "^4.18.0", | ||
"signal-exit": "4.1.0", | ||
"type-fest": "^4.20.0", | ||
@@ -109,17 +111,17 @@ "unbuild": "^2.0.0", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "0.13.2" | ||
"rolldown": "0.14.0-snapshot-18ee4d3-20241107003320" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-arm64": "0.13.2", | ||
"@rolldown/binding-darwin-x64": "0.13.2", | ||
"@rolldown/binding-freebsd-x64": "0.13.2", | ||
"@rolldown/binding-linux-arm64-gnu": "0.13.2", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.13.2", | ||
"@rolldown/binding-linux-arm64-musl": "0.13.2", | ||
"@rolldown/binding-linux-x64-gnu": "0.13.2", | ||
"@rolldown/binding-linux-x64-musl": "0.13.2", | ||
"@rolldown/binding-wasm32-wasi": "0.13.2", | ||
"@rolldown/binding-win32-arm64-msvc": "0.13.2", | ||
"@rolldown/binding-win32-ia32-msvc": "0.13.2", | ||
"@rolldown/binding-win32-x64-msvc": "0.13.2" | ||
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-18ee4d3-20241107003320", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-18ee4d3-20241107003320" | ||
}, | ||
@@ -143,3 +145,3 @@ "scripts": { | ||
"# Scrips for checking #": "_", | ||
"test": "cross-env ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests", | ||
"test": "cross-env RUST_BACKTRACE=1 ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests", | ||
"test:update": "vitest run -u", | ||
@@ -146,0 +148,0 @@ "type-check": "tsc" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
684602
108
17178
8
23
5418
2
371