Comparing version 0.15.0 to 0.15.1-commit.09cccaf
@@ -6,2 +6,4 @@ import type { RolldownOptions } from '../types/rolldown-options'; | ||
* Write the output to the file system | ||
* | ||
* @default true | ||
*/ | ||
@@ -8,0 +10,0 @@ write?: boolean; |
import type { WatchOptions } from '../../options/watch-options'; | ||
import { Watcher } from './watcher'; | ||
export declare const watch: (input: WatchOptions) => Promise<Watcher>; | ||
import { RolldownWatcher } from './watch-emitter'; | ||
export declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher; |
import { BindingWatcher } from '../../binding'; | ||
import { MaybePromise } from '../../types/utils'; | ||
import { WatchOptions } from '../../options/watch-options'; | ||
import { WatcherEmitter } from './watch-emitter'; | ||
export declare class Watcher { | ||
closed: boolean; | ||
controller: AbortController; | ||
inner: BindingWatcher; | ||
stopWorkers?: () => Promise<void>; | ||
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>; | ||
constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>); | ||
emitter: WatcherEmitter; | ||
stopWorkers: ((() => Promise<void>) | undefined)[]; | ||
constructor(emitter: WatcherEmitter, inner: BindingWatcher, stopWorkers: ((() => Promise<void>) | undefined)[]); | ||
close(): Promise<void>; | ||
on(event: 'change', listener: (id: string, change: { | ||
event: ChangeEvent; | ||
}) => MaybePromise<void>): this; | ||
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this; | ||
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this; | ||
watch(): void; | ||
start(): void; | ||
} | ||
export type WatcherEvent = 'close' | 'event' | 'restart' | 'change'; | ||
export type ChangeEvent = 'create' | 'update' | 'delete'; | ||
export type RollupWatcherEvent = { | ||
code: 'START'; | ||
} | { | ||
code: 'BUNDLE_START'; | ||
} | { | ||
code: 'BUNDLE_END'; | ||
duration: number; | ||
output: readonly string[]; | ||
} | { | ||
code: 'END'; | ||
} | { | ||
code: 'ERROR'; | ||
error: Error; | ||
}; | ||
export declare function createWatcher(emitter: WatcherEmitter, input: WatchOptions | WatchOptions[]): Promise<void>; |
@@ -18,4 +18,5 @@ type MaybePromise<T> = T | Promise<T> | ||
export declare class BindingHookError { | ||
get errors(): Array<unknown> | ||
export declare class BindingError { | ||
kind: string | ||
message: string | ||
} | ||
@@ -34,2 +35,3 @@ | ||
dynamicallyImportedIds: Array<string> | ||
exports: Array<string> | ||
isEntry: boolean | ||
@@ -67,2 +69,3 @@ get code(): string | null | ||
get minify(): boolean | ||
get polyfillRequire(): boolean | ||
get comments(): 'none' | 'preserve-legal' | ||
@@ -74,4 +77,6 @@ } | ||
get originalFileName(): string | null | ||
get originalFileNames(): Array<string> | ||
get source(): BindingAssetSource | ||
get name(): string | null | ||
get names(): Array<string> | ||
} | ||
@@ -99,3 +104,3 @@ | ||
get assets(): Array<BindingOutputAsset> | ||
get errors(): Array<unknown> | ||
get errors(): Array<Error | BindingError> | ||
} | ||
@@ -123,2 +128,3 @@ | ||
export declare class BindingWatcher { | ||
constructor(options: Array<BindingBundlerOptions>, notifyOption?: BindingNotifyOption | undefined | null) | ||
close(): Promise<void> | ||
@@ -138,7 +144,7 @@ start(listener: (data: BindingWatcherEvent) => void): Promise<void> | ||
bundleEventKind(): string | ||
errors(): Array<unknown> | ||
errors(): Array<Error | BindingError> | ||
} | ||
export declare class Bundler { | ||
constructor(inputOptions: BindingInputOptions, outputOptions: BindingOutputOptions, parallelPluginsRegistry?: ParallelJsPluginRegistry | undefined | null) | ||
constructor(option: BindingBundlerOptions) | ||
write(): Promise<BindingOutputs> | ||
@@ -148,3 +154,2 @@ generate(): Promise<BindingOutputs> | ||
close(): Promise<void> | ||
watch(): Promise<BindingWatcher> | ||
get closed(): boolean | ||
@@ -222,2 +227,12 @@ } | ||
export interface BindingBundlerOptions { | ||
inputOptions: BindingInputOptions | ||
outputOptions: BindingOutputOptions | ||
parallelPluginsRegistry?: ParallelJsPluginRegistry | ||
} | ||
export interface BindingChecksOptions { | ||
circularDependency?: boolean | ||
} | ||
export interface BindingEmittedAsset { | ||
@@ -335,11 +350,17 @@ name?: string | ||
profilerNames?: boolean | ||
jsx?: JsxOptions | ||
jsx?: BindingJsx | ||
watch?: BindingWatchOption | ||
keepNames?: boolean | ||
checks?: BindingChecksOptions | ||
} | ||
export interface BindingJsonPluginConfig { | ||
stringify?: boolean | ||
stringify?: BindingJsonPluginStringify | ||
isBuild?: boolean | ||
namedExports?: boolean | ||
} | ||
export type BindingJsonPluginStringify = | ||
boolean | string | ||
export interface BindingJsonSourcemap { | ||
@@ -358,2 +379,7 @@ file?: string | ||
export type BindingJsx = | ||
| { type: 'Disable' } | ||
| { type: 'Preserve' } | ||
| { type: 'Enable', field0: JsxOptions } | ||
export declare enum BindingLogLevel { | ||
@@ -423,2 +449,3 @@ Silent = 0, | ||
comments?: 'none' | 'preserve-legal' | ||
polyfillRequire?: boolean | ||
} | ||
@@ -458,3 +485,3 @@ | ||
moduleParsedMeta?: BindingPluginHookMeta | ||
buildEnd?: (ctx: BindingPluginContext, error?: BindingHookError) => MaybePromise<VoidNullable> | ||
buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable> | ||
buildEndMeta?: BindingPluginHookMeta | ||
@@ -467,3 +494,3 @@ renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderStartMeta?: BindingPluginHookMeta | ||
renderError?: (ctx: BindingPluginContext, error: string) => void | ||
renderError?: (ctx: BindingPluginContext, error: (Error | BindingError)[]) => void | ||
renderErrorMeta?: BindingPluginHookMeta | ||
@@ -541,7 +568,8 @@ generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
reactRefresh?: boolean | ||
targets?: string | ||
target?: string | ||
browserslist?: string | ||
} | ||
export interface BindingTreeshake { | ||
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ||
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined) | ||
annotations?: boolean | ||
@@ -555,3 +583,4 @@ } | ||
external: true | string[] | ||
noExternal: true | string[] | ||
noExternal: true | Array<string | RegExp> | ||
dedupe: Array<string> | ||
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string> | ||
@@ -581,3 +610,2 @@ finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string> | ||
skipWrite?: boolean | ||
notify?: BindingNotifyOption | ||
include?: Array<BindingStringOrRegex> | ||
@@ -587,2 +615,16 @@ exclude?: Array<BindingStringOrRegex> | ||
export interface CompilerAssumptions { | ||
ignoreFunctionLength?: boolean | ||
noDocumentAll?: boolean | ||
objectRestNoSymbols?: boolean | ||
pureGetters?: boolean | ||
setPublicClassFields?: boolean | ||
} | ||
export interface ErrorLabel { | ||
message?: string | ||
start: number | ||
end: number | ||
} | ||
export interface Es2015Options { | ||
@@ -598,2 +640,28 @@ /** Transform arrow functions into function expressions. */ | ||
export type HelperMode = /** | ||
* Runtime mode (default): Helper functions are imported from a runtime package. | ||
* | ||
* Example: | ||
* | ||
* ```js | ||
* import helperName from "@babel/runtime/helpers/helperName"; | ||
* helperName(...arguments); | ||
* ``` | ||
*/ | ||
'Runtime'| | ||
/** | ||
* External mode: Helper functions are accessed from a global `babelHelpers` object. | ||
* | ||
* Example: | ||
* | ||
* ```js | ||
* babelHelpers.helperName(...arguments); | ||
* ``` | ||
*/ | ||
'External'; | ||
export interface Helpers { | ||
mode?: HelperMode | ||
} | ||
/** TypeScript Isolated Declarations for Standalone DTS Emit */ | ||
@@ -618,3 +686,3 @@ export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult | ||
map?: SourceMap | ||
errors: Array<string> | ||
errors: Array<OxcError> | ||
} | ||
@@ -629,4 +697,4 @@ | ||
export interface JsOutputAsset { | ||
name?: string | ||
originalFileName?: string | ||
names: Array<string> | ||
originalFileNames: Array<string> | ||
filename: string | ||
@@ -748,2 +816,9 @@ source: BindingAssetSource | ||
export interface OxcError { | ||
severity: Severity | ||
message: string | ||
labels: Array<ErrorLabel> | ||
helpMessage?: string | ||
} | ||
export interface PreRenderedChunk { | ||
@@ -789,2 +864,6 @@ name: string | ||
export type Severity = 'Error'| | ||
'Warning'| | ||
'Advice'; | ||
export interface SourceMap { | ||
@@ -839,6 +918,8 @@ file?: string | ||
sourcemap?: boolean | ||
/** Set assumptions in order to produce smaller output. */ | ||
assumptions?: CompilerAssumptions | ||
/** Configure how TypeScript is transformed. */ | ||
typescript?: TypeScriptOptions | ||
/** Configure how TSX and JSX are transformed. */ | ||
jsx?: JsxOptions | ||
jsx?: 'preserve' | JsxOptions | ||
/** | ||
@@ -859,2 +940,4 @@ * Sets the target environment for the generated JavaScript. | ||
target?: string | Array<string> | ||
/** Behaviour for runtime helpers. */ | ||
helpers?: Helpers | ||
/** Define Plugin */ | ||
@@ -897,2 +980,14 @@ define?: Record<string, string> | ||
/** | ||
* Helpers used. | ||
* | ||
* @internal | ||
* | ||
* Example: | ||
* | ||
* ```text | ||
* { "_objectSpread": "@babel/runtime/helpers/objectSpread2" } | ||
* ``` | ||
*/ | ||
helpersUsed: Record<string, string> | ||
/** | ||
* Parse and transformation errors. | ||
@@ -904,3 +999,3 @@ * | ||
*/ | ||
errors: Array<string> | ||
errors: Array<OxcError> | ||
} | ||
@@ -907,0 +1002,0 @@ |
@@ -16,6 +16,2 @@ import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig } from '../binding'; | ||
export declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin; | ||
export declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, 'runtime'>): BuiltinPlugin & { | ||
resolveId: (id: string, importer?: string | undefined | null, options?: import("../binding").BindingHookJsResolveIdOptions | undefined | null) => Promise<import("../binding").BindingHookJsResolveIdOutput | null>; | ||
load: (id: string) => Promise<import("../binding").BindingHookJsLoadOutput | null>; | ||
watchChange: (path: string, event: import("../binding").BindingJsWatchChangeEvent) => Promise<void>; | ||
}; | ||
export declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, 'runtime'>): BuiltinPlugin; |
@@ -1,5 +0,7 @@ | ||
export declare const flattenedSchema: Record<string, import("./types").Schema>; | ||
import { type NormalizedCliOptions } from './normalize'; | ||
import type { Schema } from './types'; | ||
export declare const flattenedSchema: Record<string, Schema>; | ||
export declare const options: { | ||
[k: string]: { | ||
type: "boolean" | "string"; | ||
type: 'boolean' | 'string'; | ||
multiple: boolean; | ||
@@ -13,2 +15,2 @@ short?: string; | ||
export type ParseArgsOptions = typeof options; | ||
export declare function parseCliArguments(): import("./normalize").NormalizedCliOptions; | ||
export declare function parseCliArguments(): NormalizedCliOptions; |
@@ -0,399 +1,12 @@ | ||
import { InputCliOptions } from '../../options/input-options'; | ||
import { OutputCliOptions } from '../../options/output-options'; | ||
import type { ObjectSchema } from './types'; | ||
import { z } from 'zod'; | ||
export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{ | ||
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>; | ||
help: z.ZodOptional<z.ZodBoolean>; | ||
version: z.ZodOptional<z.ZodBoolean>; | ||
watch: z.ZodOptional<z.ZodBoolean>; | ||
}, Omit<z.objectUtil.extendShape<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodType<import("../../plugin").RolldownPluginOption, z.ZodTypeDef, import("../../plugin").RolldownPluginOption>>; | ||
external: z.ZodOptional<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]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
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">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
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.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>; | ||
resolveNewUrlToAsset: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
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>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "plugins" | "onLog" | "onwarn" | "input" | "resolve" | "watch" | "experimental" | "profilerNames">>, 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">]>>; | ||
hashCharacters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"base64">, z.ZodLiteral<"base36">]>, z.ZodLiteral<"hex">]>>; | ||
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("../../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>]>>]>>; | ||
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>]>>]>>; | ||
intro: 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>]>>]>>; | ||
outro: 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>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<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.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>; | ||
}, { | ||
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>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
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, { | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
external?: 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
version?: boolean | undefined; | ||
}, { | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
external?: 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
version?: boolean | undefined; | ||
}>; | ||
export type CliOptions = z.infer<typeof cliOptionsSchema>; | ||
import type Z from 'zod'; | ||
export interface CliOptions extends InputCliOptions, OutputCliOptions { | ||
config?: string | boolean; | ||
help?: boolean; | ||
version?: boolean; | ||
watch?: boolean; | ||
} | ||
export declare const cliOptionsSchema: Z.ZodType<CliOptions>; | ||
export declare const schema: ObjectSchema; |
@@ -1,1 +0,11 @@ | ||
export declare const bold: import("colorette").Color, cyan: import("colorette").Color, dim: import("colorette").Color, gray: import("colorette").Color, green: import("colorette").Color, red: import("colorette").Color, underline: import("colorette").Color, yellow: import("colorette").Color; | ||
import { Color } from 'colorette'; | ||
export declare const colors: { | ||
bold: Color; | ||
cyan: Color; | ||
dim: Color; | ||
gray: Color; | ||
green: Color; | ||
red: Color; | ||
underline: Color; | ||
yellow: Color; | ||
}; |
import { Plugin } from '../plugin'; | ||
export declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"]; | ||
export declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"]; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange", "augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle", "footer", "banner", "intro", "outro"]; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: [ | ||
...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, | ||
...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, | ||
'footer', | ||
'banner', | ||
'intro', | ||
'outro' | ||
]; | ||
/** | ||
@@ -6,0 +13,0 @@ * Names of all properties in a `Plugin` object. Includes `name` and `api`. |
@@ -1,2 +0,2 @@ | ||
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output'; | ||
import { RolldownOutput, OutputAsset, OutputChunk, RenderedChunk, SourceMap } from './types/rolldown-output'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options'; | ||
@@ -23,8 +23,7 @@ import type { ModuleFormat, OutputOptions } from './options/output-options'; | ||
import { WatchOptions } from './options/watch-options'; | ||
import { Watcher } from './api/watch/watcher'; | ||
import { RolldownWatcher } from './api/watch/watch-emitter'; | ||
import { build, type BuildOptions } from './api/build'; | ||
export { defineConfig, rolldown, watch, build }; | ||
export declare const VERSION: string; | ||
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, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, Watcher, BuildOptions, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './rollup'; | ||
export type { OutputAsset, OutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedChunk, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './types/misc'; |
@@ -1,2 +0,2 @@ | ||
import type { LogHandler } from '../rollup'; | ||
import type { LogHandler } from '../types/misc'; | ||
import type { Plugin } from '../plugin'; | ||
@@ -3,0 +3,0 @@ import { type LogLevelOption } from './logging'; |
@@ -1,2 +0,2 @@ | ||
import { z } from 'zod'; | ||
import type Z from 'zod'; | ||
export type LogLevel = 'info' | 'debug' | 'warn'; | ||
@@ -7,5 +7,5 @@ export type LogLevelOption = LogLevel | 'silent'; | ||
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 declare const LogLevelSchema: Z.ZodType<LogLevel>; | ||
export declare const LogLevelOptionSchema: Z.ZodType<LogLevelOption>; | ||
export declare const LogLevelWithErrorSchema: Z.ZodType<LogLevelWithError>; | ||
export declare const LOG_LEVEL_SILENT: LogLevelOption; | ||
@@ -17,3 +17,3 @@ export declare const LOG_LEVEL_ERROR = "error"; | ||
export declare const logLevelPriority: Record<LogLevelOption, number>; | ||
export declare const RollupLogSchema: z.ZodAny; | ||
export declare const RollupLogWithStringSchema: z.ZodUnion<[z.ZodAny, z.ZodString]>; | ||
export declare const RollupLogSchema: Z.ZodAny; | ||
export declare const RollupLogWithStringSchema: Z.ZodUnion<[Z.ZodAny, Z.ZodString]>; |
@@ -1,4 +0,4 @@ | ||
import type { LoggingFunctionWithPosition, LogHandler, RollupLog } from '../rollup'; | ||
import type { LoggingFunctionWithPosition, LogHandler, RollupLog } from '../types/misc'; | ||
import { type LogLevel, type LogLevelOption } from './logging'; | ||
export declare const normalizeLog: (log: RollupLog | string | (() => RollupLog | string)) => RollupLog; | ||
export declare function getLogHandler(level: LogLevel, code: string, logger: LogHandler, pluginName: string, logLevel: LogLevelOption): LoggingFunctionWithPosition; |
@@ -1,5 +0,7 @@ | ||
import type { RollupLog } from '../rollup'; | ||
import type { RollupLog } from '../types/misc'; | ||
export declare function logMinifyWarning(): RollupLog; | ||
export declare function logInvalidLogPosition(pluginName: string): RollupLog; | ||
export declare function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog; | ||
export declare function logCycleLoading(pluginName: string, moduleId: string): RollupLog; | ||
export declare function logMultiplyNotifyOption(): RollupLog; | ||
export declare function logPluginError(error: Omit<RollupLog, 'code'> & { | ||
@@ -6,0 +8,0 @@ code?: unknown; |
import { z } from 'zod'; | ||
import type { RolldownPluginOption } from '../plugin'; | ||
export declare const inputOptionsSchema: z.ZodObject<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodType<RolldownPluginOption, z.ZodTypeDef, RolldownPluginOption>>; | ||
external: z.ZodOptional<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]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
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">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
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.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>; | ||
resolveNewUrlToAsset: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
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>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
plugins?: RolldownPluginOption; | ||
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; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
inject?: Record<string, string | [string, string]> | 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; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
profilerNames?: boolean | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
plugins?: RolldownPluginOption; | ||
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; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
inject?: Record<string, string | [string, string]> | 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; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
profilerNames?: boolean | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodType<RolldownPluginOption, z.ZodTypeDef, RolldownPluginOption>>; | ||
external: z.ZodOptional<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]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
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">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
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.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>; | ||
resolveNewUrlToAsset: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
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>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "plugins" | "onLog" | "onwarn" | "input" | "resolve" | "watch" | "experimental" | "profilerNames">, "strict", z.ZodTypeAny, { | ||
external?: 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
external?: 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; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
import type { InputCliOptions, InputOptions } from '../options/input-options'; | ||
export declare const inputOptionsSchema: z.ZodType<InputOptions>; | ||
export declare const inputCliOptionsSchema: z.ZodType<InputCliOptions>; |
@@ -9,3 +9,3 @@ import { RolldownPluginOption } from '../plugin'; | ||
export interface JsxOptions { | ||
mode?: 'classic' | 'automatic'; | ||
mode?: 'classic' | 'automatic' | 'preserve'; | ||
factory?: string; | ||
@@ -28,2 +28,9 @@ fragment?: string; | ||
} | ||
export interface ChecksOptions { | ||
/** | ||
* Wether to emit warnings when detecting circular dependencies. | ||
* @default false | ||
*/ | ||
circularDependency?: boolean; | ||
} | ||
export interface InputOptions { | ||
@@ -34,5 +41,11 @@ input?: InputOption; | ||
resolve?: { | ||
alias?: Record<string, string>; | ||
alias?: Record<string, string[] | string>; | ||
aliasFields?: string[][]; | ||
conditionNames?: string[]; | ||
/** | ||
* Map of extensions to alternative extensions. | ||
* | ||
* With writing `import './foo.js'` in a file, you want to resolve it to `foo.ts` instead of `foo.js`. | ||
* You can achieve this by setting: `extensionAlias: { '.js': ['.ts', '.js'] }`. | ||
*/ | ||
extensionAlias?: Record<string, string[]>; | ||
@@ -95,5 +108,15 @@ exportsFields?: string[][]; | ||
profilerNames?: boolean; | ||
jsx?: JsxOptions; | ||
/** | ||
* JSX options. | ||
* The `false` is disabled jsx parser, it will give you a syntax error if you use jsx syntax | ||
* The `mode: preserve` is disabled jsx transformer, it perverse original jsx syntax in the output. | ||
* The `mode: classic` is enabled jsx `classic` transformer. | ||
* The `mode: automatic` is enabled jsx `automatic` transformer. | ||
* @default mode = 'automatic' | ||
*/ | ||
jsx?: false | JsxOptions; | ||
watch?: WatchOptions | false; | ||
dropLabels?: string[]; | ||
keepNames?: boolean; | ||
checks?: ChecksOptions; | ||
} | ||
@@ -100,0 +123,0 @@ interface OverwriteInputOptionsForCli { |
@@ -1,2 +0,2 @@ | ||
import type { LogHandler } from '../rollup'; | ||
import type { LogHandler } from '../types/misc'; | ||
import { BindingNormalizedOptions } from '../binding'; | ||
@@ -17,3 +17,3 @@ import { InputOptions } from '..'; | ||
get cwd(): string | undefined; | ||
get platform(): "node" | "browser" | "neutral"; | ||
get platform(): 'browser' | 'node' | 'neutral'; | ||
} |
import type { BindingNormalizedOptions } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../types/misc'; | ||
import type { ChunkFileNamesFunction, GlobalsFunction, OutputOptions } from './output-options'; | ||
@@ -32,3 +32,5 @@ export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd' | 'app'; | ||
comments: 'none' | 'preserve-legal'; | ||
polyfillRequire: boolean; | ||
} | ||
type UnsupportedFnRet = () => never; | ||
export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions { | ||
@@ -38,10 +40,10 @@ inner: BindingNormalizedOptions; | ||
get dir(): string | undefined; | ||
get entryFileNames(): string | (() => never); | ||
get chunkFileNames(): string | (() => never); | ||
get entryFileNames(): string | UnsupportedFnRet; | ||
get chunkFileNames(): string | UnsupportedFnRet; | ||
get assetFileNames(): string; | ||
get format(): "es" | "cjs" | "iife" | "umd" | "app"; | ||
get exports(): "auto" | "named" | "default" | "none"; | ||
get sourcemap(): boolean | "inline" | "hidden"; | ||
get cssEntryFileNames(): string | (() => never); | ||
get cssChunkFileNames(): string | (() => never); | ||
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd'; | ||
get exports(): 'default' | 'named' | 'none' | 'auto'; | ||
get sourcemap(): boolean | 'inline' | 'hidden'; | ||
get cssEntryFileNames(): string | UnsupportedFnRet; | ||
get cssChunkFileNames(): string | UnsupportedFnRet; | ||
get shimMissingExports(): boolean; | ||
@@ -52,15 +54,17 @@ get name(): string | undefined; | ||
get externalLiveBindings(): boolean; | ||
get banner(): string | (() => never) | undefined; | ||
get footer(): string | (() => never) | undefined; | ||
get intro(): string | (() => never) | undefined; | ||
get outro(): string | (() => never) | undefined; | ||
get esModule(): boolean | "if-default-prop"; | ||
get banner(): string | UnsupportedFnRet | undefined; | ||
get footer(): string | UnsupportedFnRet | undefined; | ||
get intro(): string | UnsupportedFnRet | undefined; | ||
get outro(): string | UnsupportedFnRet | undefined; | ||
get esModule(): boolean | 'if-default-prop'; | ||
get extend(): boolean; | ||
get globals(): Record<string, string> | (() => never); | ||
get hashCharacters(): "base64" | "base36" | "hex"; | ||
get globals(): Record<string, string> | UnsupportedFnRet; | ||
get hashCharacters(): 'base64' | 'base36' | 'hex'; | ||
get sourcemapDebugIds(): boolean; | ||
get sourcemapIgnoreList(): (() => never) | undefined; | ||
get sourcemapPathTransform(): (() => never) | undefined; | ||
get sourcemapIgnoreList(): UnsupportedFnRet | undefined; | ||
get sourcemapPathTransform(): UnsupportedFnRet | undefined; | ||
get minify(): boolean; | ||
get comments(): "none" | "preserve-legal"; | ||
get comments(): 'none' | 'preserve-legal'; | ||
get polyfillRequire(): boolean; | ||
} | ||
export {}; |
import { z } from 'zod'; | ||
import type { PreRenderedChunk } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
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">]>>; | ||
hashCharacters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"base64">, z.ZodLiteral<"base36">]>, z.ZodLiteral<"hex">]>>; | ||
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<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<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], 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]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
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>]>>; | ||
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<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.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>; | ||
}, { | ||
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>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
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, { | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}, { | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}>; | ||
import type { OutputCliOptions } from '../options/output-options'; | ||
export declare const outputCliOptionsSchema: z.ZodType<OutputCliOptions>; |
import type { StringOrRegExp } from '../types/utils'; | ||
import type { PreRenderedChunk } from '../binding'; | ||
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../types/misc'; | ||
import { RolldownOutputPluginOption } from '../plugin'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
import { RenderedChunk } from '../types/rolldown-output'; | ||
export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd' | 'experimental-app'; | ||
export type AddonFunction = (chunk: RolldownRenderedChunk) => string | Promise<string>; | ||
export type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>; | ||
export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string; | ||
@@ -63,2 +63,3 @@ export type GlobalsFunction = (name: string) => string; | ||
plugins?: RolldownOutputPluginOption; | ||
polyfillRequire?: boolean; | ||
} | ||
@@ -65,0 +66,0 @@ interface OverwriteOutputOptionsForCli { |
@@ -5,3 +5,3 @@ import type { BindingPluginOptions } from '../binding'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
import type { LogHandler, LogLevelOption } from '../types/misc'; | ||
import type { InputOptions } from '../options/input-options'; | ||
@@ -8,0 +8,0 @@ export interface BindingifyPluginArgs { |
@@ -11,3 +11,3 @@ import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs } from '../binding'; | ||
import type { LogLevel } from '../log/logging'; | ||
import type { RollupLog } from '../rollup'; | ||
import type { RollupLog } from '../types/misc'; | ||
import type { MinimalPluginContext } from './minimal-plugin-context'; | ||
@@ -21,3 +21,3 @@ import type { InputOptions, OutputOptions } from '..'; | ||
import type { HookFilter } from './hook-filter'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
import { RenderedChunk } from '../types/rolldown-output'; | ||
export type ModuleSideEffects = boolean | 'no-treeshake' | null; | ||
@@ -75,7 +75,7 @@ export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {}); | ||
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void; | ||
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
code: string; | ||
map?: SourceMapInput; | ||
}; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void; | ||
@@ -113,3 +113,3 @@ [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void; | ||
}; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>; | ||
export type AddonHook = string | AddonHookFunction; | ||
@@ -121,3 +121,3 @@ export interface OutputPlugin extends Partial<{ | ||
}> { | ||
name?: string; | ||
name: string; | ||
} | ||
@@ -124,0 +124,0 @@ export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> { |
@@ -1,3 +0,2 @@ | ||
import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../rollup'; | ||
import type { Plugin } from '../plugin'; | ||
import type { LoggingFunction, LogHandler, LogLevelOption, RollupError } from '../types/misc'; | ||
export interface PluginContextMeta { | ||
@@ -9,2 +8,3 @@ rollupVersion: string; | ||
export declare class MinimalPluginContext { | ||
readonly pluginName: string; | ||
info: LoggingFunction; | ||
@@ -14,4 +14,4 @@ warn: LoggingFunction; | ||
meta: PluginContextMeta; | ||
readonly error: (error: RollupError | string) => never; | ||
constructor(onLog: LogHandler, logLevel: LogLevelOption, plugin: Plugin); | ||
constructor(onLog: LogHandler, logLevel: LogLevelOption, pluginName: string); | ||
error(e: RollupError | string): never; | ||
} |
import { BindingPluginContext } from '../binding'; | ||
import { ModuleOptions } from '..'; | ||
import { PluginContextResolveOptions } from './plugin-context'; | ||
import type { ModuleInfo } from '../types/module-info'; | ||
export declare class PluginContextData { | ||
@@ -10,3 +11,3 @@ moduleOptionMap: Map<string, ModuleOptions>; | ||
getModuleOption(id: string): ModuleOptions; | ||
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null; | ||
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null; | ||
getModuleIds(context: BindingPluginContext): ArrayIterator<string>; | ||
@@ -13,0 +14,0 @@ saveResolveOptions(options: PluginContextResolveOptions): number; |
@@ -9,3 +9,3 @@ import type { BindingPluginContext } from '../binding'; | ||
import { PartialNull } from '../types/utils'; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
import type { LogHandler, LogLevelOption } from '../types/misc'; | ||
export interface EmittedAsset { | ||
@@ -27,17 +27,21 @@ type: 'asset'; | ||
export declare class PluginContext extends MinimalPluginContext { | ||
readonly load: (options: { | ||
private context; | ||
private data; | ||
private onLog; | ||
private currentLoadingModule?; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string | undefined); | ||
load(options: { | ||
id: string; | ||
resolveDependencies?: boolean; | ||
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>; | ||
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>; | ||
readonly emitFile: (file: EmittedAsset) => string; | ||
readonly getFileName: (referenceId: string) => string; | ||
readonly getModuleInfo: (id: string) => ModuleInfo | null; | ||
readonly getModuleIds: () => IterableIterator<string>; | ||
readonly addWatchFile: (id: string) => void; | ||
} & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>; | ||
resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>; | ||
emitFile(file: EmittedAsset): string; | ||
getFileName(referenceId: string): string; | ||
getModuleInfo(id: string): ModuleInfo | null; | ||
getModuleIds(): IterableIterator<string>; | ||
addWatchFile(id: string): void; | ||
/** | ||
* @deprecated This rollup API won't be supported by rolldown. Using this API will cause runtime error. | ||
*/ | ||
readonly parse: (input: string, options?: any) => any; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string); | ||
parse(_input: string, _options?: any): any; | ||
} |
import type { BindingPluginContext, BindingTransformPluginContext } from '../binding'; | ||
import type { LogHandler, LogLevelOption, RollupError } from '../rollup'; | ||
import type { LogHandler, LogLevelOption, RollupError } from '../types/misc'; | ||
import { PluginContext } from './plugin-context'; | ||
@@ -8,8 +8,11 @@ import { PluginContextData } from './plugin-context-data'; | ||
export declare class TransformPluginContext extends PluginContext { | ||
error: (error: RollupError | string, pos?: number | { | ||
private inner; | ||
private moduleId; | ||
private moduleSource; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption); | ||
error(e: RollupError | string, pos?: number | { | ||
column: number; | ||
line: number; | ||
}) => never; | ||
getCombinedSourcemap: () => SourceMap; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption); | ||
}): never; | ||
getCombinedSourcemap(): SourceMap; | ||
} |
@@ -1,115 +0,14 @@ | ||
import { z } from 'zod'; | ||
export type ModuleSideEffectsOption = z.infer<typeof ModuleSideEffectsOptionSchema>; | ||
export declare const ModuleSideEffectsRuleSchema: z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
import type Z from 'zod'; | ||
export interface ModuleSideEffectsRule { | ||
test?: RegExp; | ||
external?: boolean; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>; | ||
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>; | ||
export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>; | ||
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>; | ||
} | ||
export declare const ModuleSideEffectsRuleSchema: Z.ZodType<ModuleSideEffectsRule>; | ||
export type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | 'no-external'; | ||
export declare const ModuleSideEffectsOptionSchema: Z.ZodType<ModuleSideEffectsOption>; | ||
export type TreeshakingOptions = { | ||
moduleSideEffects?: ModuleSideEffectsOption; | ||
annotations?: boolean; | ||
} | boolean; | ||
export declare const TreeshakingOptionsSchema: Z.ZodType<TreeshakingOptions>; |
@@ -13,3 +13,4 @@ import { ModuleOptions } from '..'; | ||
dynamicallyImportedIds: string[]; | ||
exports: string[]; | ||
isEntry: boolean; | ||
} |
@@ -1,4 +0,4 @@ | ||
import type { RolldownOutputAsset, RolldownOutputChunk } from './rolldown-output'; | ||
import type { OutputAsset, OutputChunk } from './rolldown-output'; | ||
export interface OutputBundle { | ||
[fileName: string]: RolldownOutputAsset | RolldownOutputChunk; | ||
[fileName: string]: OutputAsset | OutputChunk; | ||
} |
import { AssetSource } from '../utils/asset-source'; | ||
import type { RenderedChunk } from '../binding'; | ||
export interface RolldownOutputAsset { | ||
import type { RenderedChunk as BindingRenderedChunk } from '../binding'; | ||
export interface OutputAsset { | ||
type: 'asset'; | ||
fileName: string; | ||
/** @deprecated Use "originalFileNames" instead. */ | ||
originalFileName: string | null; | ||
originalFileNames: string[]; | ||
source: AssetSource; | ||
/** @deprecated Use "names" instead. */ | ||
name: string | undefined; | ||
names: string[]; | ||
} | ||
@@ -17,13 +21,15 @@ export interface SourceMap { | ||
version: number; | ||
toString(): string; | ||
toUrl(): string; | ||
} | ||
export interface RolldownRenderedModule { | ||
export interface RenderedModule { | ||
readonly code: string | null; | ||
renderedLength: number; | ||
} | ||
export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> { | ||
export interface RenderedChunk extends Omit<BindingRenderedChunk, 'modules'> { | ||
modules: { | ||
[id: string]: RolldownRenderedModule; | ||
[id: string]: RenderedModule; | ||
}; | ||
} | ||
export interface RolldownOutputChunk { | ||
export interface OutputChunk { | ||
type: 'chunk'; | ||
@@ -36,3 +42,3 @@ code: string; | ||
modules: { | ||
[id: string]: RolldownRenderedModule; | ||
[id: string]: RenderedModule; | ||
}; | ||
@@ -49,6 +55,3 @@ imports: string[]; | ||
export interface RolldownOutput { | ||
output: [ | ||
RolldownOutputChunk, | ||
...(RolldownOutputChunk | RolldownOutputAsset)[] | ||
]; | ||
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]]; | ||
} |
@@ -1,7 +0,7 @@ | ||
import type { RolldownPlugin } from 'rolldown'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import type { BindingInputOptions } from '../binding'; | ||
import { LogHandler } from '../rollup'; | ||
import { LogHandler } from '../types/misc'; | ||
import { LogLevelOption } from '../log/logging'; | ||
export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: InputOptions, outputOptions: OutputOptions, onLog: LogHandler, logLevel: LogLevelOption): BindingInputOptions; |
@@ -1,1 +0,2 @@ | ||
export declare function normalizeErrors(rawErrors: unknown[]): Error; | ||
import { BindingError } from '../binding'; | ||
export declare function normalizeErrors(rawErrors: (BindingError | Error)[]): Error; |
@@ -5,3 +5,3 @@ export declare function arraify<T>(value: T | T[]): T[]; | ||
export declare function unreachable(info?: string): never; | ||
export declare function unsupported(info: string): () => never; | ||
export declare function unsupported(info: string): never; | ||
export declare function noop(..._args: any[]): void; |
import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import { LogHandler } from '../rollup'; | ||
import { LogHandler } from '../types/misc'; | ||
export declare const normalizePluginOption: { | ||
@@ -6,0 +6,0 @@ (plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>; |
@@ -1,4 +0,4 @@ | ||
import { RenderedChunk } from '../binding'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
export declare function transformRenderedChunk(chunk: RenderedChunk): RolldownRenderedChunk; | ||
export declare function transformChunkModules(modules: RenderedChunk['modules']): RolldownRenderedChunk['modules']; | ||
import { RenderedChunk as BindingRenderedChunk } from '../binding'; | ||
import { RenderedChunk } from '../types/rolldown-output'; | ||
export declare function transformRenderedChunk(chunk: BindingRenderedChunk): RenderedChunk; | ||
export declare function transformChunkModules(modules: BindingRenderedChunk['modules']): RenderedChunk['modules']; |
import { BindingRenderedModule } from '../binding'; | ||
import { RolldownRenderedModule } from '../types/rolldown-output'; | ||
export declare function transformToRenderedModule(bindingRenderedModule: BindingRenderedModule): RolldownRenderedModule; | ||
import { RenderedModule } from '../types/rolldown-output'; | ||
export declare function transformToRenderedModule(bindingRenderedModule: BindingRenderedModule): RenderedModule; |
@@ -1,3 +0,3 @@ | ||
import { ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap'; | ||
import { type ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap'; | ||
export declare function isEmptySourcemapFiled(array: undefined | (string | null)[]): boolean; | ||
export declare function normalizeTransformHookSourcemap(id: string, originalCode: string, rawMap?: SourceMapInput): ExistingRawSourceMap | undefined; |
@@ -0,15 +1,16 @@ | ||
import type Z from 'zod'; | ||
import { z } from 'zod'; | ||
export declare const stringOrRegExp: () => z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>; | ||
export declare const optionalStringArray: () => z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
export declare const stringOrRegExp: () => Z.ZodUnion<[Z.ZodString, Z.ZodType<RegExp, Z.ZodTypeDef, RegExp>]>; | ||
export declare const optionalStringArray: () => Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>; | ||
/** | ||
* We use this to ensure the type of a value is `T` but the value is not checked. | ||
*/ | ||
export declare const phantom: <T>() => z.ZodType<T, z.ZodTypeDef, T>; | ||
export declare const phantom: <T>() => Z.ZodType<T>; | ||
/** | ||
* @description Shortcut for `T | null | undefined | void` | ||
*/ | ||
export declare const voidNullableWith: <T extends z.ZodTypeAny>(t: T) => z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, T]>; | ||
export declare const voidNullableWith: <T extends z.ZodTypeAny>(t: T) => Z.ZodUnion<[Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>, T]>; | ||
/** | ||
* @description Shortcut for `T | null | undefined | void` | ||
*/ | ||
export declare const voidNullable: () => z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>; | ||
export declare const voidNullable: () => Z.ZodUnion<[Z.ZodUnion<[Z.ZodVoid, Z.ZodNull]>, Z.ZodUndefined]>; |
{ | ||
"name": "rolldown", | ||
"version": "0.15.0", | ||
"version": "0.15.1-commit.09cccaf", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -94,3 +94,3 @@ "homepage": "https://rolldown.rs/", | ||
"@jridgewell/sourcemap-codec": "^1.5.0", | ||
"@napi-rs/cli": "^3.0.0-alpha.60", | ||
"@napi-rs/cli": "^3.0.0-alpha.65", | ||
"@napi-rs/wasm-runtime": "^0.2.4", | ||
@@ -113,21 +113,21 @@ "@types/fs-extra": "^11.0.4", | ||
"type-fest": "^4.20.0", | ||
"unbuild": "^2.0.0", | ||
"unbuild": "^3.0.0", | ||
"why-is-node-running": "^3.0.0", | ||
"zod-to-json-schema": "^3.23.2", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "0.15.0" | ||
"rolldown": "0.15.1-commit.09cccaf", | ||
"@rolldown/testing": "0.0.1" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-arm64": "0.15.0", | ||
"@rolldown/binding-freebsd-x64": "0.15.0", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0", | ||
"@rolldown/binding-darwin-x64": "0.15.0", | ||
"@rolldown/binding-linux-arm64-gnu": "0.15.0", | ||
"@rolldown/binding-linux-arm64-musl": "0.15.0", | ||
"@rolldown/binding-linux-x64-gnu": "0.15.0", | ||
"@rolldown/binding-linux-x64-musl": "0.15.0", | ||
"@rolldown/binding-wasm32-wasi": "0.15.0", | ||
"@rolldown/binding-win32-arm64-msvc": "0.15.0", | ||
"@rolldown/binding-win32-ia32-msvc": "0.15.0", | ||
"@rolldown/binding-win32-x64-msvc": "0.15.0" | ||
"@rolldown/binding-darwin-arm64": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-darwin-x64": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-freebsd-x64": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-linux-arm64-gnu": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-linux-arm64-musl": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-linux-x64-musl": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-linux-x64-gnu": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-win32-arm64-msvc": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-wasm32-wasi": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-win32-ia32-msvc": "0.15.1-commit.09cccaf", | ||
"@rolldown/binding-win32-x64-msvc": "0.15.1-commit.09cccaf" | ||
}, | ||
@@ -134,0 +134,0 @@ "scripts": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
770799
111
15659
27