Comparing version 0.14.0 to 0.15.0-commit.1265c2c
@@ -6,2 +6,19 @@ type MaybePromise<T> = T | Promise<T> | ||
export declare class BindingBundleEndEventData { | ||
output: string | ||
duration: number | ||
} | ||
export declare class BindingCallableBuiltinPlugin { | ||
constructor(plugin: BindingBuiltinPlugin) | ||
resolveId(id: string, importer?: string | undefined | null, options?: BindingHookJsResolveIdOptions | undefined | null): Promise<BindingHookJsResolveIdOutput | null> | ||
load(id: string): Promise<BindingHookJsLoadOutput | null> | ||
watchChange(path: string, event: BindingJsWatchChangeEvent): Promise<void> | ||
} | ||
export declare class BindingError { | ||
kind: string | ||
message: string | ||
} | ||
export declare class BindingLog { | ||
@@ -22,7 +39,41 @@ code: string | ||
export declare class BindingNormalizedOptions { | ||
get input(): Array<string> | Record<string, string> | ||
get cwd(): string | null | ||
get platform(): 'node' | 'browser' | 'neutral' | ||
get shimMissingExports(): boolean | ||
get name(): string | null | ||
get cssEntryFilenames(): string | undefined | ||
get cssChunkFilenames(): string | undefined | ||
get entryFilenames(): string | undefined | ||
get chunkFilenames(): string | undefined | ||
get assetFilenames(): string | ||
get dir(): string | null | ||
get file(): string | null | ||
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd' | ||
get exports(): 'default' | 'named' | 'none' | 'auto' | ||
get esModule(): boolean | 'if-default-prop' | ||
get inlineDynamicImports(): boolean | ||
get sourcemap(): boolean | 'inline' | 'hidden' | ||
get banner(): string | undefined | null | undefined | ||
get footer(): string | undefined | null | undefined | ||
get intro(): string | undefined | null | undefined | ||
get outro(): string | undefined | null | undefined | ||
get externalLiveBindings(): boolean | ||
get extend(): boolean | ||
get globals(): Record<string, string> | undefined | ||
get hashCharacters(): 'base64' | 'base36' | 'hex' | ||
get sourcemapDebugIds(): boolean | ||
get minify(): boolean | ||
get polyfillRequire(): boolean | ||
get comments(): 'none' | 'preserve-legal' | ||
} | ||
export declare class BindingOutputAsset { | ||
get fileName(): string | ||
get originalFileName(): string | null | ||
get originalFileNames(): Array<string> | ||
get source(): BindingAssetSource | ||
get name(): string | null | ||
get names(): Array<string> | ||
} | ||
@@ -50,5 +101,7 @@ | ||
get assets(): Array<BindingOutputAsset> | ||
get errors(): Array<Error | BindingError> | ||
} | ||
export declare class BindingPluginContext { | ||
load(specifier: string, sideEffects: BindingHookSideEffects | undefined, fn: () => void): Promise<void> | ||
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null> | ||
@@ -58,7 +111,12 @@ emitFile(file: BindingEmittedAsset): string | ||
getModuleInfo(moduleId: string): BindingModuleInfo | null | ||
getModuleIds(): Array<string> | null | ||
getModuleIds(): Array<string> | ||
addWatchFile(file: string): void | ||
} | ||
export declare class BindingRenderedModule { | ||
get code(): string | null | ||
} | ||
export declare class BindingTransformPluginContext { | ||
getCombinedSourcemap(): string | ||
inner(): BindingPluginContext | ||
@@ -68,13 +126,27 @@ } | ||
export declare class BindingWatcher { | ||
constructor(options: Array<BindingBundlerOptions>, notifyOption?: BindingNotifyOption | undefined | null) | ||
close(): Promise<void> | ||
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void | ||
start(listener: (data: BindingWatcherEvent) => void): Promise<void> | ||
} | ||
export declare class BindingWatcherChangeData { | ||
path: string | ||
kind: string | ||
} | ||
export declare class BindingWatcherEvent { | ||
eventKind(): string | ||
watchChangeData(): BindingWatcherChangeData | ||
bundleEndData(): BindingBundleEndEventData | ||
bundleEventKind(): string | ||
errors(): Array<Error | BindingError> | ||
} | ||
export declare class Bundler { | ||
constructor(inputOptions: BindingInputOptions, outputOptions: BindingOutputOptions, parallelPluginsRegistry?: ParallelJsPluginRegistry | undefined | null) | ||
constructor(option: BindingBundlerOptions) | ||
write(): Promise<BindingOutputs> | ||
generate(): Promise<BindingOutputs> | ||
scan(): Promise<void> | ||
scan(): Promise<BindingOutputs> | ||
close(): Promise<void> | ||
watch(): Promise<BindingWatcher> | ||
get closed(): boolean | ||
} | ||
@@ -137,17 +209,26 @@ | ||
export declare enum BindingBuiltinPluginName { | ||
WasmHelperPlugin = 0, | ||
ImportGlobPlugin = 1, | ||
DynamicImportVarsPlugin = 2, | ||
ModulePreloadPolyfillPlugin = 3, | ||
ManifestPlugin = 4, | ||
LoadFallbackPlugin = 5, | ||
TransformPlugin = 6, | ||
WasmFallbackPlugin = 7, | ||
AliasPlugin = 8, | ||
JsonPlugin = 9, | ||
BuildImportAnalysisPlugin = 10, | ||
ReplacePlugin = 11 | ||
export type BindingBuiltinPluginName = 'builtin:wasm-helper'| | ||
'builtin:import-glob'| | ||
'builtin:dynamic-import-vars'| | ||
'builtin:module-preload-polyfill'| | ||
'builtin:manifest'| | ||
'builtin:load-fallback'| | ||
'builtin:transform'| | ||
'builtin:wasm-fallback'| | ||
'builtin:alias'| | ||
'builtin:json'| | ||
'builtin:build-import-analysis'| | ||
'builtin:replace'| | ||
'builtin:vite-resolve'; | ||
export interface BindingBundlerOptions { | ||
inputOptions: BindingInputOptions | ||
outputOptions: BindingOutputOptions | ||
parallelPluginsRegistry?: ParallelJsPluginRegistry | ||
} | ||
export interface BindingChecksOptions { | ||
circularDependency?: boolean | ||
} | ||
export interface BindingEmittedAsset { | ||
@@ -163,2 +244,4 @@ name?: string | ||
disableLiveBindings?: boolean | ||
viteMode?: boolean | ||
resolveNewUrlToAsset?: boolean | ||
} | ||
@@ -176,2 +259,18 @@ | ||
export interface BindingHookJsLoadOutput { | ||
code: string | ||
map?: string | ||
sideEffects: boolean | 'no-treeshake' | ||
} | ||
export interface BindingHookJsResolveIdOptions { | ||
scan?: boolean | ||
} | ||
export interface BindingHookJsResolveIdOutput { | ||
id: string | ||
external?: boolean | ||
sideEffects: boolean | 'no-treeshake' | ||
} | ||
export interface BindingHookLoadOutput { | ||
@@ -239,3 +338,3 @@ code: string | ||
platform?: 'node' | 'browser' | 'neutral' | ||
logLevel?: BindingLogLevel | ||
logLevel: BindingLogLevel | ||
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void | ||
@@ -246,2 +345,3 @@ cwd: string | ||
define?: Array<[string, string]> | ||
dropLabels?: Array<string> | ||
inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace> | ||
@@ -252,9 +352,15 @@ experimental?: BindingExperimentalOptions | ||
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 { | ||
@@ -269,2 +375,6 @@ file?: string | ||
export interface BindingJsWatchChangeEvent { | ||
event: string | ||
} | ||
export declare enum BindingLogLevel { | ||
@@ -294,2 +404,8 @@ Silent = 0, | ||
export interface BindingModuleSideEffectsRule { | ||
test?: RegExp | undefined | ||
sideEffects: boolean | ||
external?: boolean | undefined | ||
} | ||
export interface BindingNotifyOption { | ||
@@ -302,5 +418,7 @@ pollInterval?: number | ||
name?: string | ||
assetFileNames?: string | ||
entryFileNames?: string | ((chunk: PreRenderedChunk) => string) | ||
chunkFileNames?: string | ((chunk: PreRenderedChunk) => string) | ||
assetFileNames?: string | ||
cssEntryFileNames?: string | ((chunk: PreRenderedChunk) => string) | ||
cssChunkFileNames?: string | ((chunk: PreRenderedChunk) => string) | ||
banner?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>> | ||
@@ -314,4 +432,5 @@ dir?: string | ||
footer?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>> | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | ||
globals?: Record<string, string> | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | 'app' | ||
globals?: Record<string, string> | ((name: string) => string) | ||
hashCharacters?: 'base64' | 'base36' | 'hex' | ||
inlineDynamicImports?: boolean | ||
@@ -327,2 +446,4 @@ intro?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>> | ||
advancedChunks?: BindingAdvancedChunksOptions | ||
comments?: 'none' | 'preserve-legal' | ||
polyfillRequire?: boolean | ||
} | ||
@@ -347,3 +468,3 @@ | ||
name: string | ||
buildStart?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable> | ||
buildStartMeta?: BindingPluginHookMeta | ||
@@ -363,15 +484,15 @@ resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>> | ||
moduleParsedMeta?: BindingPluginHookMeta | ||
buildEnd?: (ctx: BindingPluginContext, error: Nullable<string>) => MaybePromise<VoidNullable> | ||
buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable> | ||
buildEndMeta?: BindingPluginHookMeta | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunkMeta?: BindingPluginHookMeta | ||
augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string> | ||
augmentChunkHashMeta?: BindingPluginHookMeta | ||
renderStart?: (ctx: BindingPluginContext) => void | ||
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void | ||
renderStartMeta?: BindingPluginHookMeta | ||
renderError?: (ctx: BindingPluginContext, error: string) => void | ||
renderError?: (ctx: BindingPluginContext, error: (Error | BindingError)[]) => void | ||
renderErrorMeta?: BindingPluginHookMeta | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundleMeta?: BindingPluginHookMeta | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundleMeta?: BindingPluginHookMeta | ||
@@ -404,6 +525,2 @@ closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
export interface BindingRenderedModule { | ||
code?: string | ||
} | ||
export interface BindingReplacePluginConfig { | ||
@@ -414,2 +531,3 @@ values: Record<string, string> | ||
objectGuards?: boolean | ||
sourcemap?: boolean | ||
} | ||
@@ -449,19 +567,43 @@ | ||
jsxInject?: string | ||
targets?: string | ||
reactRefresh?: boolean | ||
target?: string | ||
browserslist?: string | ||
} | ||
export interface BindingTreeshake { | ||
moduleSideEffects: string | ||
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined) | ||
annotations?: boolean | ||
} | ||
export declare enum BindingWatcherEvent { | ||
Close = 0, | ||
Event = 1, | ||
ReStart = 2, | ||
Change = 3 | ||
export interface BindingViteResolvePluginConfig { | ||
resolveOptions: BindingViteResolvePluginResolveOptions | ||
environmentConsumer: string | ||
environmentName: string | ||
external: true | string[] | ||
noExternal: true | Array<string | RegExp> | ||
dedupe: Array<string> | ||
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string> | ||
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string> | ||
runtime: string | ||
} | ||
export interface BindingViteResolvePluginResolveOptions { | ||
isBuild: boolean | ||
isProduction: boolean | ||
asSrc: boolean | ||
preferRelative: boolean | ||
isRequire?: boolean | ||
root: string | ||
scan: boolean | ||
mainFields: Array<string> | ||
conditions: Array<string> | ||
externalConditions: Array<string> | ||
extensions: Array<string> | ||
tryIndex: boolean | ||
tryPrefix?: string | ||
preserveSymlinks: boolean | ||
} | ||
export interface BindingWatchOption { | ||
skipWrite?: boolean | ||
notify?: BindingNotifyOption | ||
include?: Array<BindingStringOrRegex> | ||
@@ -471,2 +613,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 { | ||
@@ -482,2 +638,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 */ | ||
@@ -502,3 +684,3 @@ export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult | ||
map?: SourceMap | ||
errors: Array<string> | ||
errors: Array<OxcError> | ||
} | ||
@@ -513,4 +695,4 @@ | ||
export interface JsOutputAsset { | ||
name?: string | ||
originalFileName?: string | ||
names: Array<string> | ||
originalFileNames: Array<string> | ||
filename: string | ||
@@ -625,3 +807,3 @@ source: BindingAssetSource | ||
* | ||
* Conforms to the implementation in {@link https://github.com/facebook/react/tree/main/packages/react-refresh} | ||
* Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh} | ||
* | ||
@@ -633,2 +815,9 @@ * @default false | ||
export interface OxcError { | ||
severity: Severity | ||
message: string | ||
labels: Array<ErrorLabel> | ||
helpMessage?: string | ||
} | ||
export interface PreRenderedChunk { | ||
@@ -674,2 +863,6 @@ name: string | ||
export type Severity = 'Error'| | ||
'Warning'| | ||
'Advice'; | ||
export interface SourceMap { | ||
@@ -724,2 +917,4 @@ file?: string | ||
sourcemap?: boolean | ||
/** Set assumptions in order to produce smaller output. */ | ||
assumptions?: CompilerAssumptions | ||
/** Configure how TypeScript is transformed. */ | ||
@@ -729,2 +924,19 @@ typescript?: TypeScriptOptions | ||
jsx?: JsxOptions | ||
/** | ||
* Sets the target environment for the generated JavaScript. | ||
* | ||
* The lowest target is `es2015`. | ||
* | ||
* Example: | ||
* | ||
* * 'es2015' | ||
* * ['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11'] | ||
* | ||
* @default `esnext` (No transformation) | ||
* | ||
* @see [esbuild#target](https://esbuild.github.io/api/#target) | ||
*/ | ||
target?: string | Array<string> | ||
/** Behaviour for runtime helpers. */ | ||
helpers?: Helpers | ||
/** Define Plugin */ | ||
@@ -767,2 +979,14 @@ define?: Record<string, string> | ||
/** | ||
* Helpers used. | ||
* | ||
* @internal | ||
* | ||
* Example: | ||
* | ||
* ```text | ||
* { "_objectSpread": "@babel/runtime/helpers/objectSpread2" } | ||
* ``` | ||
*/ | ||
helpersUsed: Record<string, string> | ||
/** | ||
* Parse and transformation errors. | ||
@@ -774,3 +998,3 @@ * | ||
*/ | ||
errors: Array<string> | ||
errors: Array<OxcError> | ||
} | ||
@@ -777,0 +1001,0 @@ |
@@ -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; |
@@ -1,8 +0,4 @@ | ||
/** | ||
* @description This file is used for normalize the options. | ||
* In CLI, the input options and output options are mixed together. We need to tell them apart. | ||
*/ | ||
import { InputOptions } from '../../options/input-options'; | ||
import { OutputOptions } from '../../options/output-options'; | ||
import { CliOptions } from './schema'; | ||
import type { InputOptions } from '../../options/input-options'; | ||
import type { OutputOptions } from '../../options/output-options'; | ||
export interface NormalizedCliOptions { | ||
@@ -9,0 +5,0 @@ input: InputOptions; |
@@ -0,311 +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.ZodArray<z.ZodType<import("../../plugin").RolldownPluginRec, z.ZodTypeDef, import("../../plugin").RolldownPluginRec>, "many">>; | ||
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, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: 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.ZodType<boolean | import("../../treeshake").TreeshakingOptions, z.ZodTypeDef, boolean | import("../../treeshake").TreeshakingOptions>>; | ||
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>; | ||
}, "strict", z.ZodTypeAny, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
}, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: 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, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
}, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | 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, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">>, Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../options/output-options").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../options/output-options").SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../options/output-options").SourcemapPathTransformOption, z.ZodTypeDef, import("../../options/output-options").SourcemapPathTransformOption>>; | ||
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]>>; | ||
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>]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
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; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
}, { | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
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, { | ||
external?: string[] | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
version?: boolean | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
version?: boolean | undefined; | ||
config?: string | boolean | undefined; | ||
help?: 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_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange", "closeWatcher"]; | ||
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: [ | ||
...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, | ||
...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, | ||
'footer', | ||
'banner', | ||
'intro', | ||
'outro' | ||
]; | ||
/** | ||
@@ -4,0 +13,0 @@ * Names of all properties in a `Plugin` object. Includes `name` and `api`. |
export { defineParallelPlugin } from './plugin/parallel-plugin'; | ||
export { experimental_scan as scan } from './rolldown'; | ||
export { experimental_scan as scan } from './api/experimental'; | ||
export { transform } from './binding'; | ||
export type { TransformOptions, TransformResult } from './binding'; | ||
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, } from './plugin/builtin-plugin'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, } from './builtin-plugin/constructors'; | ||
export { transformPlugin } from './builtin-plugin/transform-plugin'; | ||
export { replacePlugin } from './builtin-plugin/replace-plugin'; | ||
export { aliasPlugin } from './builtin-plugin/alias-plugin'; |
@@ -1,3 +0,3 @@ | ||
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output'; | ||
import type { ExternalOption, InputOption, InputOptions, JsxOptions } from './options/input-options'; | ||
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './options/output-options'; | ||
@@ -8,20 +8,23 @@ import type { RolldownOptions } from './types/rolldown-options'; | ||
import { defineConfig } from './utils/define-config'; | ||
import { rolldown, watch } from './rolldown'; | ||
import { rolldown } from './api/rolldown'; | ||
import { watch } from './api/watch'; | ||
import { ConfigExport } from './types/config-export'; | ||
import { RolldownBuild } from './rolldown-build'; | ||
import { RolldownBuild } from './api/rolldown/rolldown-build'; | ||
import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context'; | ||
import { TransformPluginContext } from './plugin/transform-plugin-context'; | ||
import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options'; | ||
import { RenderedChunk, PreRenderedChunk } from './binding'; | ||
import { PreRenderedChunk } from './binding'; | ||
import { PartialNull } from './types/utils'; | ||
import { NormalizedInputOptions } from './options/normalized-input-options'; | ||
import { ModuleInfo } from './types/module-info'; | ||
import { MinimalPluginContext } from './log/logger'; | ||
import { MinimalPluginContext } from './plugin/minimal-plugin-context'; | ||
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap'; | ||
import { OutputBundle } from './types/output-bundle'; | ||
import { WatchOptions } from './options/watch-option'; | ||
export { defineConfig, rolldown, watch }; | ||
import { WatchOptions } from './options/watch-options'; | ||
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, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, }; | ||
export type { 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, RolldownWatcher, BuildOptions, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, RolldownWatcher as RollupWatcher, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './rollup'; |
@@ -1,20 +0,6 @@ | ||
import type { LoggingFunction, LogHandler, RollupError } from '../rollup'; | ||
import type { LogHandler } from '../rollup'; | ||
import type { Plugin } from '../plugin'; | ||
import { type LogLevelOption } from './logging'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
export interface PluginContextMeta { | ||
rollupVersion: string; | ||
rolldownVersion: string; | ||
watchMode: boolean; | ||
} | ||
export declare class MinimalPluginContext { | ||
debug: LoggingFunction; | ||
info: LoggingFunction; | ||
meta: PluginContextMeta; | ||
warn: LoggingFunction; | ||
readonly error: (error: RollupError | string) => never; | ||
constructor(options: NormalizedInputOptions, plugin: Plugin); | ||
} | ||
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"]; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler; |
@@ -1,7 +0,10 @@ | ||
import { z } from 'zod'; | ||
export declare const LogLevelSchema: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>; | ||
export declare const LogLevelWithErrorSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>; | ||
export type LogLevel = z.infer<typeof LogLevelSchema>; | ||
export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>; | ||
export type LogLevelOption = z.infer<typeof LogLevelOptionSchema>; | ||
import type Z from 'zod'; | ||
export type LogLevel = 'info' | 'debug' | 'warn'; | ||
export type LogLevelOption = LogLevel | 'silent'; | ||
export type LogLevelWithError = LogLevel | 'error'; | ||
export type RollupLog = any; | ||
export type RollupLogWithString = RollupLog | string; | ||
export declare const LogLevelSchema: Z.ZodType<LogLevel>; | ||
export declare const LogLevelOptionSchema: Z.ZodType<LogLevelOption>; | ||
export declare const LogLevelWithErrorSchema: Z.ZodType<LogLevelWithError>; | ||
export declare const LOG_LEVEL_SILENT: LogLevelOption; | ||
@@ -13,3 +16,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]>; |
import type { RollupLog } from '../rollup'; | ||
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'> & { | ||
@@ -4,0 +7,0 @@ code?: unknown; |
@@ -1,429 +0,80 @@ | ||
import type { RolldownPluginRec } from '../plugin'; | ||
import { z } from 'zod'; | ||
import { RolldownPluginOption } from '../plugin'; | ||
import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging'; | ||
import { TreeshakingOptions } from '../treeshake'; | ||
declare const inputOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>; | ||
declare const externalSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>; | ||
declare const jsxOptionsSchema: 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, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
}, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
}>; | ||
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.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
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, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: 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.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>; | ||
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>; | ||
}, "strict", z.ZodTypeAny, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
}, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: 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, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
}, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | 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, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, "strict", z.ZodTypeAny, { | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
import { NullValue, StringOrRegExp } from '../types/utils'; | ||
export type InputOption = string | string[] | Record<string, string>; | ||
export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>); | ||
export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>; | ||
export interface JsxOptions { | ||
mode?: 'classic' | 'automatic'; | ||
factory?: string; | ||
fragment?: string; | ||
importSource?: string; | ||
jsxImportSource?: string; | ||
refresh?: boolean; | ||
development?: boolean; | ||
} | ||
export interface WatchOptions { | ||
skipWrite?: boolean; | ||
notify?: { | ||
pollInterval?: number; | ||
compareContents?: boolean; | ||
}; | ||
include?: StringOrRegExp | StringOrRegExp[]; | ||
exclude?: StringOrRegExp | StringOrRegExp[]; | ||
chokidar?: any; | ||
} | ||
export interface ChecksOptions { | ||
/** | ||
* Wether to emit warnings when detecting circular dependencies. | ||
* @default false | ||
*/ | ||
circularDependency?: boolean; | ||
} | ||
export interface InputOptions { | ||
input?: InputOption; | ||
plugins?: RolldownPluginOption; | ||
external?: ExternalOption; | ||
resolve?: { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
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[]>; | ||
exportsFields?: string[][]; | ||
extensions?: string[]; | ||
mainFields?: string[]; | ||
mainFiles?: string[]; | ||
modules?: string[]; | ||
symlinks?: boolean; | ||
tsconfigFilename?: string; | ||
}; | ||
cwd?: string; | ||
/** | ||
* Expected platform where the code run. | ||
* | ||
* @default | ||
* - 'node' if the format is 'cjs' | ||
* - 'browser' for other formats | ||
*/ | ||
platform?: 'node' | 'browser' | 'neutral'; | ||
shimMissingExports?: boolean; | ||
treeshake?: boolean | TreeshakingOptions; | ||
logLevel?: LogLevelOption; | ||
onLog?: (level: LogLevel, log: RollupLog, defaultHandler: (level: LogLevelWithError, log: RollupLogWithString) => void) => void; | ||
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void; | ||
moduleTypes?: ModuleTypes; | ||
experimental?: { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
watch?: false | { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
}, { | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
resolve?: { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | TreeshakingOptions | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
watch?: false | { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
} | 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.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
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, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
alias?: Record<string, string> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
modules?: 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.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>; | ||
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>; | ||
}, "strict", z.ZodTypeAny, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
}, { | ||
enableComposingJsPlugins?: boolean | undefined; | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: 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, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
}, { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | 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, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}, { | ||
skipWrite?: boolean | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">, "strict", z.ZodTypeAny, { | ||
external?: string[] | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
treeshake?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
jsx?: { | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
refresh?: boolean | undefined; | ||
development?: boolean | undefined; | ||
} | undefined; | ||
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
}>; | ||
type RawInputOptions = z.infer<typeof inputOptionsSchema>; | ||
interface OverwriteInputOptionsWithDoc { | ||
enableComposingJsPlugins?: boolean; | ||
strictExecutionOrder?: boolean; | ||
disableLiveBindings?: boolean; | ||
viteMode?: boolean; | ||
resolveNewUrlToAsset?: boolean; | ||
}; | ||
define?: Record<string, string>; | ||
/** | ||
@@ -452,8 +103,16 @@ * Inject import statements on demand. | ||
*/ | ||
inject?: RawInputOptions['inject']; | ||
inject?: Record<string, string | [string, string]>; | ||
profilerNames?: boolean; | ||
jsx?: JsxOptions; | ||
watch?: WatchOptions | false; | ||
dropLabels?: string[]; | ||
keepNames?: boolean; | ||
checks?: ChecksOptions; | ||
} | ||
export type InputOption = z.infer<typeof inputOptionSchema>; | ||
export type InputOptions = Omit<RawInputOptions, keyof OverwriteInputOptionsWithDoc> & OverwriteInputOptionsWithDoc; | ||
export type ExternalOption = z.infer<typeof externalSchema>; | ||
export type JsxOptions = z.infer<typeof jsxOptionsSchema>; | ||
interface OverwriteInputOptionsForCli { | ||
external?: string[]; | ||
inject?: Record<string, string>; | ||
treeshake?: boolean; | ||
} | ||
export type InputCliOptions = Omit<InputOptions, keyof OverwriteInputOptionsForCli | 'input' | 'plugins' | 'onwarn' | 'onLog' | 'resolve' | 'experimental' | 'profilerNames' | 'watch'> & OverwriteInputOptionsForCli; | ||
export {}; |
@@ -1,12 +0,18 @@ | ||
import type { LogLevelOption, RollupLog, NormalizedInputOptions as RollupNormalizedInputOptions } from '../rollup'; | ||
import type { InputOptions } from './input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { LogLevel } from '../log/logging'; | ||
import { NormalizedTreeshakingOptions } from '../treeshake'; | ||
export interface NormalizedInputOptions extends Omit<InputOptions, 'treeshake'> { | ||
input: RollupNormalizedInputOptions['input']; | ||
plugins: RolldownPlugin[]; | ||
onLog: (level: LogLevel, log: RollupLog) => void; | ||
logLevel: LogLevelOption; | ||
treeshake?: NormalizedTreeshakingOptions; | ||
import type { LogHandler } from '../rollup'; | ||
import { BindingNormalizedOptions } from '../binding'; | ||
import { InputOptions } from '..'; | ||
export interface NormalizedInputOptions { | ||
input: string[] | Record<string, string>; | ||
cwd: string | undefined; | ||
platform: InputOptions['platform']; | ||
shimMissingExports: boolean; | ||
} | ||
export declare class NormalizedInputOptionsImpl implements NormalizedInputOptions { | ||
onLog: LogHandler; | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions, onLog: LogHandler); | ||
get shimMissingExports(): boolean; | ||
get input(): string[] | Record<string, string>; | ||
get cwd(): string | undefined; | ||
get platform(): 'browser' | 'node' | 'neutral'; | ||
} |
@@ -0,27 +1,66 @@ | ||
import { type UnsupportedFnRet } from '../utils/misc'; | ||
import type { BindingNormalizedOptions } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import type { OutputOptions } from './output-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { PreRenderedChunk, RenderedChunk } from '../binding'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd'; | ||
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>; | ||
type ChunkFileNamesOption = string | ((chunk: PreRenderedChunk) => string) | undefined; | ||
export interface NormalizedOutputOptions extends OutputOptions { | ||
plugins: RolldownPlugin[]; | ||
import type { ChunkFileNamesFunction, GlobalsFunction, OutputOptions } from './output-options'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd' | 'app'; | ||
export interface NormalizedOutputOptions { | ||
name: string | undefined; | ||
file: string | undefined; | ||
dir: string | undefined; | ||
entryFileNames: string | ChunkFileNamesFunction; | ||
chunkFileNames: string | ChunkFileNamesFunction; | ||
assetFileNames: string; | ||
format: InternalModuleFormat; | ||
exports: 'auto' | 'named' | 'default' | 'none'; | ||
exports: NonNullable<OutputOptions['exports']>; | ||
sourcemap: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption; | ||
cssEntryFileNames: string | ChunkFileNamesFunction; | ||
cssChunkFileNames: string | ChunkFileNamesFunction; | ||
inlineDynamicImports: boolean; | ||
externalLiveBindings: boolean; | ||
banner: OutputOptions['banner']; | ||
footer: OutputOptions['footer']; | ||
intro: OutputOptions['intro']; | ||
outro: OutputOptions['outro']; | ||
esModule: boolean | 'if-default-prop'; | ||
extend: boolean; | ||
globals: Record<string, string> | GlobalsFunction; | ||
hashCharacters: 'base64' | 'base36' | 'hex'; | ||
sourcemapDebugIds: boolean; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform: SourcemapPathTransformOption | undefined; | ||
banner: AddonFunction; | ||
footer: AddonFunction; | ||
intro: AddonFunction; | ||
outro: AddonFunction; | ||
esModule: boolean | 'if-default-prop'; | ||
entryFileNames: ChunkFileNamesOption; | ||
chunkFileNames: ChunkFileNamesOption; | ||
assetFileNames: string; | ||
name: string | undefined; | ||
inlineDynamicImports: boolean; | ||
minify: boolean; | ||
comments: 'none' | 'preserve-legal'; | ||
polyfillRequire: boolean; | ||
} | ||
export {}; | ||
export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions { | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions); | ||
get dir(): string | undefined; | ||
get entryFileNames(): string | UnsupportedFnRet; | ||
get chunkFileNames(): string | UnsupportedFnRet; | ||
get assetFileNames(): string; | ||
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; | ||
get name(): string | undefined; | ||
get file(): string | undefined; | ||
get inlineDynamicImports(): boolean; | ||
get externalLiveBindings(): boolean; | ||
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> | UnsupportedFnRet; | ||
get hashCharacters(): 'base64' | 'base36' | 'hex'; | ||
get sourcemapDebugIds(): boolean; | ||
get sourcemapIgnoreList(): UnsupportedFnRet | undefined; | ||
get sourcemapPathTransform(): UnsupportedFnRet | undefined; | ||
get minify(): boolean; | ||
get comments(): 'none' | 'preserve-legal'; | ||
get polyfillRequire(): boolean; | ||
} |
@@ -1,270 +0,78 @@ | ||
import type { PreRenderedChunk, RenderedChunk } from '../binding'; | ||
import { z } from 'zod'; | ||
declare const ModuleFormatSchema: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
declare const outputOptionsSchema: z.ZodObject<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.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<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
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; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
}, "strict", z.ZodTypeAny, { | ||
footer?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
banner?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
intro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
outro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform?: SourcemapPathTransformOption | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | "if-default-prop" | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
import type { StringOrRegExp } from '../types/utils'; | ||
import type { PreRenderedChunk } from '../binding'; | ||
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import { RolldownOutputPluginOption } from '../plugin'; | ||
import { RolldownRenderedChunk } 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 ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string; | ||
export type GlobalsFunction = (name: string) => string; | ||
export interface OutputOptions { | ||
dir?: string; | ||
file?: string; | ||
exports?: 'auto' | 'named' | 'default' | 'none'; | ||
hashCharacters?: 'base64' | 'base36' | 'hex'; | ||
/** | ||
* Expected format of generated code. | ||
* - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module. | ||
* - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module. | ||
* - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE). | ||
* - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd). | ||
* | ||
* @default 'esm' | ||
*/ | ||
format?: ModuleFormat; | ||
sourcemap?: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption; | ||
sourcemapPathTransform?: SourcemapPathTransformOption; | ||
banner?: string | AddonFunction; | ||
footer?: string | AddonFunction; | ||
intro?: string | AddonFunction; | ||
outro?: string | AddonFunction; | ||
extend?: boolean; | ||
esModule?: boolean | 'if-default-prop'; | ||
assetFileNames?: string; | ||
entryFileNames?: string | ChunkFileNamesFunction; | ||
chunkFileNames?: string | ChunkFileNamesFunction; | ||
cssEntryFileNames?: string | ChunkFileNamesFunction; | ||
cssChunkFileNames?: string | ChunkFileNamesFunction; | ||
minify?: boolean; | ||
name?: string; | ||
globals?: Record<string, string> | GlobalsFunction; | ||
externalLiveBindings?: boolean; | ||
inlineDynamicImports?: boolean; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
minSize?: number; | ||
minShareCount?: number; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}, { | ||
footer?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
banner?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
intro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
outro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform?: SourcemapPathTransformOption | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | "if-default-prop" | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
test?: StringOrRegExp; | ||
priority?: number; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}[]; | ||
}; | ||
/** | ||
* Control comments in the output. | ||
* | ||
* - `none`: no comments | ||
* - `preserve-legal`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!` | ||
*/ | ||
comments?: 'none' | 'preserve-legal'; | ||
plugins?: RolldownOutputPluginOption; | ||
polyfillRequire?: boolean; | ||
} | ||
interface OverwriteOutputOptionsForCli { | ||
banner?: string; | ||
footer?: string; | ||
intro?: string; | ||
outro?: string; | ||
esModule?: boolean; | ||
globals?: Record<string, string>; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
} | undefined; | ||
}>; | ||
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.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<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
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; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
test?: string | RegExp | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
}, { | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
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, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
}, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
dir?: string | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
esModule?: boolean | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
assetFileNames?: string | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
}>; | ||
export type OutputOptions = z.infer<typeof outputOptionsSchema>; | ||
export type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean; | ||
export type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string; | ||
export type ModuleFormat = z.infer<typeof ModuleFormatSchema>; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}; | ||
} | ||
export type OutputCliOptions = Omit<OutputOptions, keyof OverwriteOutputOptionsForCli | 'sourcemapIgnoreList' | 'sourcemapPathTransform'> & OverwriteOutputOptionsForCli; | ||
export {}; |
@@ -1,12 +0,10 @@ | ||
import type { BindingPluginOptions } from '../binding'; | ||
import type { hookFilterExtension, Plugin } from './index'; | ||
import { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import type { BindingGeneralHookFilter, BindingPluginOptions, BindingTransformHookFilter } from '../binding'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyBuildStart(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['buildStart']>; | ||
export declare function bindingifyBuildEnd(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['buildEnd']>; | ||
export declare function bindingifyResolveId(plugin: Plugin, normalizedOptions: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['resolveId'], hookFilterExtension<'transform'>>; | ||
export declare function bindingifyResolveDynamicImport(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['resolveDynamicImport']>; | ||
export declare function bindingifyTransform(plugin: Plugin, normalizedOptions: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['transform']>; | ||
export declare function bindingifyLoad(plugin: Plugin, normalized_options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['load']>; | ||
export declare function bindingifyModuleParsed(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['moduleParsed']>; | ||
import type { BindingifyPluginArgs } from './bindingify-plugin'; | ||
export declare function bindingifyBuildStart(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['buildStart']>; | ||
export declare function bindingifyBuildEnd(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['buildEnd']>; | ||
export declare function bindingifyResolveId(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['resolveId'], BindingGeneralHookFilter | undefined>; | ||
export declare function bindingifyResolveDynamicImport(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['resolveDynamicImport']>; | ||
export declare function bindingifyTransform(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['transform'], BindingTransformHookFilter | undefined>; | ||
export declare function bindingifyLoad(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['load'], BindingGeneralHookFilter | undefined>; | ||
export declare function bindingifyModuleParsed(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['moduleParsed']>; |
@@ -1,7 +0,7 @@ | ||
import { BindingGeneralHookFilter, BindingTransformHookFilter } from '../binding.d'; | ||
import { hookFilterExtension } from '.'; | ||
import type { StringFilter } from './hook-filter'; | ||
import type { HookFilterExtension } from '.'; | ||
import type { BindingGeneralHookFilter, BindingTransformHookFilter } from '../binding.d'; | ||
export declare function bindingifyStringFilter(matcher: StringFilter): BindingGeneralHookFilter; | ||
export declare function bindingifyResolveIdFilter(filterOption?: hookFilterExtension<'resolveId'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyLoadFilter(filterOption?: hookFilterExtension<'load'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyTransformFilter(filterOption?: hookFilterExtension<'transform'>['filter']): BindingTransformHookFilter | undefined; | ||
export declare function bindingifyResolveIdFilter(filterOption?: HookFilterExtension<'resolveId'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyLoadFilter(filterOption?: HookFilterExtension<'load'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyTransformFilter(filterOption?: HookFilterExtension<'transform'>['filter']): BindingTransformHookFilter | undefined; |
@@ -0,17 +1,14 @@ | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
import type { BindingifyPluginArgs } from './bindingify-plugin'; | ||
import type { BindingPluginOptions } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { Plugin } from './index'; | ||
import { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyRenderStart(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderStart']>; | ||
export declare function bindingifyRenderChunk(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderChunk']>; | ||
export declare function bindingifyAugmentChunkHash(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['augmentChunkHash']>; | ||
export declare function bindingifyRenderError(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderError']>; | ||
export declare function bindingifyGenerateBundle(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['generateBundle']>; | ||
export declare function bindingifyWriteBundle(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['writeBundle']>; | ||
export declare function bindingifyCloseBundle(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['closeBundle']>; | ||
export declare function bindingifyBanner(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['banner']>; | ||
export declare function bindingifyFooter(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['footer']>; | ||
export declare function bindingifyIntro(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['intro']>; | ||
export declare function bindingifyOutro(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['outro']>; | ||
export declare function bindingifyRenderStart(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderStart']>; | ||
export declare function bindingifyRenderChunk(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderChunk']>; | ||
export declare function bindingifyAugmentChunkHash(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['augmentChunkHash']>; | ||
export declare function bindingifyRenderError(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderError']>; | ||
export declare function bindingifyGenerateBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['generateBundle']>; | ||
export declare function bindingifyWriteBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['writeBundle']>; | ||
export declare function bindingifyCloseBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['closeBundle']>; | ||
export declare function bindingifyBanner(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['banner']>; | ||
export declare function bindingifyFooter(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['footer']>; | ||
export declare function bindingifyIntro(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['intro']>; | ||
export declare function bindingifyOutro(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['outro']>; |
import type { BindingPluginOptions } from '../binding'; | ||
import type { Plugin } from './index'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
export declare function bindingifyPlugin(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): BindingPluginOptions; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
import type { InputOptions } from '../options/input-options'; | ||
export interface BindingifyPluginArgs { | ||
plugin: Plugin; | ||
options: InputOptions; | ||
outputOptions: OutputOptions; | ||
pluginContextData: PluginContextData; | ||
onLog: LogHandler; | ||
logLevel: LogLevelOption; | ||
} | ||
export declare function bindingifyPlugin(plugin: Plugin, options: InputOptions, outputOptions: OutputOptions, pluginContextData: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption): BindingPluginOptions; |
import type { BindingPluginOptions } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { Plugin } from './index'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyWatchChange(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['watchChange']>; | ||
export declare function bindingifyCloseWatcher(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['closeWatcher']>; | ||
import { BindingifyPluginArgs } from './bindingify-plugin'; | ||
export declare function bindingifyWatchChange(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['watchChange']>; | ||
export declare function bindingifyCloseWatcher(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['closeWatcher']>; |
import type { MaybeArray } from '../types/utils'; | ||
import type { StringOrRegExp } from '../constants/types'; | ||
import type { StringOrRegExp } from '../types/utils'; | ||
import type { ModuleType } from '../index'; | ||
@@ -4,0 +4,0 @@ export type StringFilter = MaybeArray<StringOrRegExp> | { |
@@ -1,2 +0,2 @@ | ||
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs, RenderedChunk } from '../binding'; | ||
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
@@ -7,3 +7,3 @@ import type { NullValue, MaybePromise, PartialNull, MakeAsync } from '../types/utils'; | ||
import type { OutputBundle } from '../types/output-bundle'; | ||
import { PluginContext } from './plugin-context'; | ||
import type { PluginContext } from './plugin-context'; | ||
import type { TransformPluginContext } from './transform-plugin-context'; | ||
@@ -13,10 +13,11 @@ import type { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import type { RollupLog } from '../rollup'; | ||
import type { MinimalPluginContext } from '../log/logger'; | ||
import { InputOptions, OutputOptions } from '..'; | ||
import { BuiltinPlugin } from './builtin-plugin'; | ||
import { ParallelPlugin } from './parallel-plugin'; | ||
import type { MinimalPluginContext } from './minimal-plugin-context'; | ||
import type { InputOptions, OutputOptions } from '..'; | ||
import type { BuiltinPlugin } from '../builtin-plugin/constructors'; | ||
import type { ParallelPlugin } from './parallel-plugin'; | ||
import type { DefinedHookNames } from '../constants/plugin'; | ||
import { DEFINED_HOOK_NAMES } from '../constants/plugin'; | ||
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import { HookFilter } from './hook-filter'; | ||
import type { DEFINED_HOOK_NAMES } from '../constants/plugin'; | ||
import type { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import type { HookFilter } from './hook-filter'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
export type ModuleSideEffects = boolean | 'no-treeshake' | null; | ||
@@ -74,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: RenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
code: string; | ||
map?: SourceMapInput; | ||
}; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void; | ||
@@ -91,8 +92,8 @@ [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void; | ||
export type PluginOrder = 'pre' | 'post' | null; | ||
export type ObjectHookMeta<O = {}> = { | ||
export type ObjectHookMeta = { | ||
order?: PluginOrder; | ||
} & O; | ||
}; | ||
export type ObjectHook<T, O = {}> = T | ({ | ||
handler: T; | ||
} & ObjectHookMeta<O>); | ||
} & ObjectHookMeta & O); | ||
export type SyncPluginHooks = DefinedHookNames['augmentChunkHash' | 'onLog' | 'outputOptions']; | ||
@@ -105,3 +106,3 @@ export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>; | ||
export type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>; | ||
export type hookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? { | ||
export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? { | ||
filter?: HookFilter; | ||
@@ -112,5 +113,5 @@ } : K extends 'load' | 'resolveId' ? { | ||
export type PluginHooks = { | ||
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], hookFilterExtension<K>>; | ||
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K>>; | ||
}; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>; | ||
export type AddonHook = string | AddonHookFunction; | ||
@@ -128,3 +129,5 @@ export interface OutputPlugin extends Partial<{ | ||
export type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin; | ||
export type RolldownPluginRec<A = any> = RolldownPlugin<A> | RolldownPlugin<A>[]; | ||
export type RolldownPluginOption<A = any> = MaybePromise<NullValue<RolldownPlugin<A>> | false | RolldownPluginOption[]>; | ||
export type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin; | ||
export type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> | false | RolldownOutputPluginOption[]>; | ||
export {}; |
import { BindingPluginContext } from '../binding'; | ||
import { ModuleInfo, ModuleOptions } from '..'; | ||
import { ModuleOptions } from '..'; | ||
import { PluginContextResolveOptions } from './plugin-context'; | ||
import type { ModuleInfo } from '../types/module-info'; | ||
export declare class PluginContextData { | ||
modules: Map<string, ModuleInfo>; | ||
moduleIds: Array<string> | null; | ||
moduleOptionMap: Map<string, ModuleOptions>; | ||
resolveOptionsMap: Map<number, PluginContextResolveOptions>; | ||
loadModulePromiseMap: Map<string, Promise<void>>; | ||
updateModuleOption(id: string, option: ModuleOptions): void; | ||
getModuleOption(id: string): ModuleOptions | undefined; | ||
getModuleOption(id: string): ModuleOptions; | ||
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null; | ||
@@ -12,0 +12,0 @@ getModuleIds(context: BindingPluginContext): ArrayIterator<string>; |
import type { BindingPluginContext } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { CustomPluginOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../log/logger'; | ||
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../plugin/minimal-plugin-context'; | ||
import { AssetSource } from '../utils/asset-source'; | ||
@@ -9,2 +8,4 @@ import { ModuleInfo } from '../types/module-info'; | ||
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import { PartialNull } from '../types/utils'; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
export interface EmittedAsset { | ||
@@ -26,2 +27,6 @@ type: 'asset'; | ||
export declare class PluginContext extends MinimalPluginContext { | ||
readonly load: (options: { | ||
id: string; | ||
resolveDependencies?: boolean; | ||
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>; | ||
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>; | ||
@@ -37,3 +42,3 @@ readonly emitFile: (file: EmittedAsset) => string; | ||
readonly parse: (input: string, options?: any) => any; | ||
constructor(options: NormalizedInputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData); | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string); | ||
} |
@@ -1,9 +0,8 @@ | ||
import { Plugin, RolldownPluginRec } from './'; | ||
import { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import { InputOptions, OutputOptions } from '..'; | ||
import { Plugin } from './'; | ||
import { InputOptions, OutputOptions, RolldownPlugin } from '..'; | ||
export declare class PluginDriver { | ||
callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>; | ||
callOutputOptionsHook(inputOptions: NormalizedInputOptions, outputOptions: OutputOptions): OutputOptions; | ||
callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions; | ||
} | ||
export declare function getObjectPlugins(plugins: RolldownPluginRec[]): Plugin[]; | ||
export declare function getObjectPlugins(plugins: RolldownPlugin[]): Plugin[]; | ||
export declare function getSortedPlugins(hookName: 'options' | 'outputOptions' | 'onLog', plugins: readonly Plugin[]): Plugin[]; |
import type { BindingPluginContext, BindingTransformPluginContext } from '../binding'; | ||
import type { RollupError } from '../rollup'; | ||
import type { LogHandler, LogLevelOption, RollupError } from '../rollup'; | ||
import { PluginContext } from './plugin-context'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { NormalizedInputOptions } from '..'; | ||
import type { Plugin } from './index'; | ||
import { SourceMap } from '../types/rolldown-output'; | ||
export declare class TransformPluginContext extends PluginContext { | ||
@@ -12,3 +12,4 @@ error: (error: RollupError | string, pos?: number | { | ||
}) => never; | ||
constructor(options: NormalizedInputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string); | ||
getCombinedSourcemap: () => SourceMap; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption); | ||
} |
@@ -1,1 +0,1 @@ | ||
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, } from './rollup'; | ||
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, RenderedChunk, } from './rollup'; |
@@ -909,4 +909,8 @@ // utils | ||
export interface PreRenderedAsset { | ||
/** @deprecated Use "names" instead. */ | ||
name: string | undefined | ||
names: string[] | ||
/** @deprecated Use "originalFileNames" instead. */ | ||
originalFileName: string | null | ||
originalFileNames: string[] | ||
source: string | Uint8Array | ||
@@ -913,0 +917,0 @@ type: 'asset' |
@@ -1,13 +0,1 @@ | ||
export declare const TreeshakingOptionsSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<{ | ||
moduleSideEffects: import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>; | ||
}, { | ||
moduleSideEffects: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>>; | ||
}>, "strict", import("zod").ZodTypeAny, { | ||
moduleSideEffects?: string | boolean | undefined; | ||
}, { | ||
moduleSideEffects?: string | boolean | undefined; | ||
}>; | ||
export interface TreeshakingOptions { | ||
moduleSideEffects?: boolean | RegExp; | ||
} | ||
export * from './module-side-effects'; |
@@ -1,15 +0,14 @@ | ||
import { z } from 'zod'; | ||
export declare const HasModuleSideEffectsSchema: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodBoolean>; | ||
export type HasModuleSideEffects = z.infer<typeof HasModuleSideEffectsSchema>; | ||
export type ModuleSideEffectsOption = z.infer<typeof ModuleSideEffectsOptionSchema>; | ||
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodBoolean, z.ZodString]>; | ||
export declare const NormalizedTreeshakingOptionsSchema: z.ZodObject<{ | ||
moduleSideEffects: z.ZodUnion<[z.ZodBoolean, z.ZodString]>; | ||
}, "strict", z.ZodTypeAny, { | ||
moduleSideEffects: string | boolean; | ||
}, { | ||
moduleSideEffects: string | boolean; | ||
}>; | ||
export type NormalizedTreeshakingOptions = { | ||
moduleSideEffects: string; | ||
}; | ||
import type Z from 'zod'; | ||
export interface ModuleSideEffectsRule { | ||
test?: RegExp; | ||
external?: boolean; | ||
sideEffects: boolean; | ||
} | ||
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>; |
import { AssetSource } from '../utils/asset-source'; | ||
import type { RenderedModule } from './rendered-module'; | ||
import type { RenderedChunk } from '../binding'; | ||
export interface RolldownOutputAsset { | ||
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,3 +21,14 @@ export interface SourceMap { | ||
version: number; | ||
toString(): string; | ||
toUrl(): string; | ||
} | ||
export interface RolldownRenderedModule { | ||
readonly code: string | null; | ||
renderedLength: number; | ||
} | ||
export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> { | ||
modules: { | ||
[id: string]: RolldownRenderedModule; | ||
}; | ||
} | ||
export interface RolldownOutputChunk { | ||
@@ -27,3 +42,3 @@ type: 'chunk'; | ||
modules: { | ||
[id: string]: RenderedModule; | ||
[id: string]: RolldownRenderedModule; | ||
}; | ||
@@ -30,0 +45,0 @@ imports: string[]; |
@@ -13,1 +13,2 @@ export type MaybePromise<T> = T | Promise<T>; | ||
export type MaybeArray<T> = T | T[]; | ||
export type StringOrRegExp = string | RegExp; |
@@ -0,2 +1,5 @@ | ||
import type { RolldownOptions } from '../types/rolldown-options'; | ||
import type { ConfigExport } from '../types/config-export'; | ||
export declare function defineConfig(config: RolldownOptions): RolldownOptions; | ||
export declare function defineConfig(config: RolldownOptions[]): RolldownOptions[]; | ||
export declare function defineConfig(config: ConfigExport): ConfigExport; |
@@ -6,2 +6,3 @@ export declare function arraify<T>(value: T | T[]): T[]; | ||
export declare function unsupported(info: string): () => never; | ||
export type UnsupportedFnRet = ReturnType<typeof unsupported>; | ||
export declare function noop(..._args: any[]): void; |
import { AnyFn } from '../types/utils'; | ||
import type { ObjectHook, ObjectHookMeta } from '../plugin'; | ||
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? { | ||
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? Hook extends RawHook ? never : { | ||
handler: RawHook; | ||
@@ -5,0 +5,0 @@ options: CustomOptions; |
@@ -1,8 +0,13 @@ | ||
import type { OutputOptions, OutputPlugin } from '../rollup-types'; | ||
import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import { LogHandler } from '../rollup'; | ||
export declare const normalizePluginOption: { | ||
(plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<RolldownOutputPlugin[]>; | ||
(plugins: unknown): Promise<any[]>; | ||
}; | ||
export declare function checkOutputPluginOption(plugins: RolldownOutputPlugin[], onLog: LogHandler): RolldownOutputPlugin[]; | ||
export declare function normalizePlugins<T extends RolldownPlugin>(plugins: T[], anonymousPrefix: string): T[]; | ||
export declare const ANONYMOUS_PLUGIN_PREFIX = "at position "; | ||
export declare const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position "; |
@@ -0,1 +1,3 @@ | ||
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; |
@@ -5,2 +5,3 @@ import type { RolldownOutput } from '../types/rolldown-output'; | ||
export declare function transformToRollupOutput(output: BindingOutputs, changed?: ChangedOutputs): RolldownOutput; | ||
export declare function handleOutputErrors(output: BindingOutputs): void; | ||
export declare function transformToOutputBundle(output: BindingOutputs, changed: ChangedOutputs): OutputBundle; | ||
@@ -7,0 +8,0 @@ export interface ChangedOutputs { |
@@ -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.14.0", | ||
"version": "0.15.0-commit.1265c2c", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -47,3 +47,2 @@ "homepage": "https://rolldown.rs/", | ||
}, | ||
"./watcher-worker": "./dist/shared/watcher-worker.js", | ||
"./package.json": "./package.json" | ||
@@ -86,9 +85,18 @@ }, | ||
}, | ||
"peerDependencies": { | ||
"@babel/runtime": ">=7" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@babel/runtime": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
"@jridgewell/sourcemap-codec": "^1.5.0", | ||
"@napi-rs/cli": "^3.0.0-alpha.60", | ||
"@napi-rs/wasm-runtime": "^0.2.4", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/lodash-es": "^4.17.12", | ||
"colorette": "^2.0.20", | ||
"consola": "^3.2.3", | ||
"cross-env": "^7.0.3", | ||
"emnapi": "^1.2.0", | ||
@@ -103,24 +111,24 @@ "execa": "^9.2.0", | ||
"signal-exit": "4.1.0", | ||
"source-map": "^0.7.4", | ||
"tsx": "^4.19.2", | ||
"type-fest": "^4.20.0", | ||
"unbuild": "^2.0.0", | ||
"vite": "^5.2.13", | ||
"vitest": "^2.0.0", | ||
"why-is-node-running": "^3.0.0", | ||
"zod-to-json-schema": "^3.23.2", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "0.14.0" | ||
"rolldown": "0.15.0-commit.1265c2c" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-arm64": "0.14.0", | ||
"@rolldown/binding-darwin-x64": "0.14.0", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0", | ||
"@rolldown/binding-freebsd-x64": "0.14.0", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0" | ||
"@rolldown/binding-darwin-arm64": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-darwin-x64": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-freebsd-x64": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-linux-arm64-gnu": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-linux-arm64-musl": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-linux-x64-musl": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-wasm32-wasi": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-linux-x64-gnu": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-win32-ia32-msvc": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-win32-arm64-msvc": "0.15.0-commit.1265c2c", | ||
"@rolldown/binding-win32-x64-msvc": "0.15.0-commit.1265c2c" | ||
}, | ||
@@ -136,3 +144,3 @@ "scripts": { | ||
"bak_build-node": "unbuild", | ||
"build-node": "node ../../node_modules/npm-rolldown/bin/cli.js -c ./rolldown.config.mjs", | ||
"build-node": "tsx ./build.ts", | ||
"build-types": "tsc -p ./tsconfig.dts.json", | ||
@@ -142,6 +150,6 @@ "build-types-check": "tsc -p ./tsconfig.check.json", | ||
"build-native:release": "run-s build-binding:release build-types build-node build-types-check", | ||
"build-wasi:debug": "run-s build-binding:wasi build-node", | ||
"build-wasi:release": "run-s build-binding:wasi:release build-node", | ||
"build-wasi:debug": "run-s build-binding build-binding:wasi build-node", | ||
"build-wasi:release": "run-s build-binding build-binding:wasi:release build-node", | ||
"# Scrips for checking #": "_", | ||
"test": "cross-env RUST_BACKTRACE=1 ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests", | ||
"test": "pnpm run --filter rolldown-tests go", | ||
"test:update": "vitest run -u", | ||
@@ -148,0 +156,0 @@ "type-check": "tsc" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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 2 instances in 1 package
797822
112
27
325
14
24
16555