Comparing version 0.10.1 to 0.10.2
1109
dist/index.d.ts
@@ -1,2 +0,5 @@ | ||
interface RenderedModule$1 { | ||
import { I as InputOptions, O as OutputOptions } from './shared/rolldown.1ea1dc1e.js'; | ||
export { D as DefineParallelPluginResult, P as Plugin, d as defineParallelPlugin } from './shared/rolldown.1ea1dc1e.js'; | ||
interface RenderedModule { | ||
} | ||
@@ -9,3 +12,3 @@ | ||
} | ||
interface SourceMap$1 { | ||
interface SourceMap { | ||
file: string; | ||
@@ -15,3 +18,3 @@ mappings: string; | ||
sources: string[]; | ||
sourcesContent: (string | null)[]; | ||
sourcesContent: string[]; | ||
version: number; | ||
@@ -26,3 +29,3 @@ } | ||
modules: { | ||
[id: string]: RenderedModule$1; | ||
[id: string]: RenderedModule; | ||
}; | ||
@@ -32,3 +35,3 @@ facadeModuleId: string | null; | ||
moduleIds: string[]; | ||
map: SourceMap$1 | null; | ||
map: SourceMap | null; | ||
sourcemapFileName: string | null; | ||
@@ -43,1095 +46,2 @@ } | ||
// utils | ||
type NullValue$1 = null | undefined | void | ||
type MaybePromise$1<T> = T | Promise<T> | ||
type PartialNull<T> = { | ||
[P in keyof T]: T[P] | null | ||
} | ||
interface RollupError extends RollupLog { | ||
name?: string | ||
stack?: string | ||
watchFiles?: string[] | ||
} | ||
interface RollupLog { | ||
binding?: string | ||
cause?: unknown | ||
code?: string | ||
exporter?: string | ||
frame?: string | ||
hook?: string | ||
id?: string | ||
ids?: string[] | ||
loc?: { | ||
column: number | ||
file?: string | ||
line: number | ||
} | ||
message: string | ||
meta?: any | ||
names?: string[] | ||
plugin?: string | ||
pluginCode?: unknown | ||
pos?: number | ||
reexporter?: string | ||
stack?: string | ||
url?: string | ||
} | ||
type LogLevel = 'warn' | 'info' | 'debug' | ||
type LogLevelOption = LogLevel | 'silent' | ||
type SourceMapSegment = | ||
| [number] | ||
| [number, number, number, number] | ||
| [number, number, number, number, number] | ||
interface ExistingDecodedSourceMap { | ||
file?: string | ||
readonly mappings: SourceMapSegment[][] | ||
names: string[] | ||
sourceRoot?: string | ||
sources: string[] | ||
sourcesContent?: (string | null)[] | ||
version: number | ||
x_google_ignoreList?: number[] | ||
} | ||
interface ExistingRawSourceMap { | ||
file?: string | ||
mappings: string | ||
names: string[] | ||
sourceRoot?: string | ||
sources: string[] | ||
sourcesContent?: (string | null)[] | ||
version: number | ||
x_google_ignoreList?: number[] | ||
} | ||
type DecodedSourceMapOrMissing = | ||
| { | ||
missing: true | ||
plugin: string | ||
} | ||
| (ExistingDecodedSourceMap & { missing?: false }) | ||
interface SourceMap { | ||
file: string | ||
mappings: string | ||
names: string[] | ||
sources: string[] | ||
sourcesContent: (string | null)[] | ||
version: number | ||
toString(): string | ||
toUrl(): string | ||
} | ||
type SourceMapInput = | ||
| ExistingRawSourceMap | ||
| string | ||
| null | ||
| { mappings: '' } | ||
interface ModuleOptions { | ||
assertions: Record<string, string> | ||
meta: CustomPluginOptions | ||
moduleSideEffects: boolean | 'no-treeshake' | ||
syntheticNamedExports: boolean | string | ||
} | ||
interface SourceDescription extends Partial<PartialNull<ModuleOptions>> { | ||
ast?: AcornNode | ||
code: string | ||
map?: SourceMapInput | ||
} | ||
interface TransformModuleJSON { | ||
ast?: AcornNode | ||
code: string | ||
// note if plugins use new this.cache to opt-out auto transform cache | ||
customTransformCache: boolean | ||
originalCode: string | ||
originalSourcemap: ExistingDecodedSourceMap | null | ||
sourcemapChain: DecodedSourceMapOrMissing[] | ||
transformDependencies: string[] | ||
} | ||
interface ModuleJSON extends TransformModuleJSON, ModuleOptions { | ||
ast: AcornNode | ||
dependencies: string[] | ||
id: string | ||
resolvedIds: ResolvedIdMap | ||
transformFiles: EmittedFile[] | undefined | ||
} | ||
interface PluginCache { | ||
delete(id: string): boolean | ||
get<T = any>(id: string): T | ||
has(id: string): boolean | ||
set<T = any>(id: string, value: T): void | ||
} | ||
type LoggingFunction = ( | ||
log: RollupLog | string | (() => RollupLog | string), | ||
) => void | ||
interface MinimalPluginContext { | ||
debug: LoggingFunction | ||
error: (error: RollupError | string) => never | ||
info: LoggingFunction | ||
meta: PluginContextMeta | ||
warn: LoggingFunction | ||
} | ||
interface EmittedAsset { | ||
fileName?: string | ||
name?: string | ||
needsCodeReference?: boolean | ||
source?: string | Uint8Array | ||
type: 'asset' | ||
} | ||
interface EmittedChunk { | ||
fileName?: string | ||
id: string | ||
implicitlyLoadedAfterOneOf?: string[] | ||
importer?: string | ||
name?: string | ||
preserveSignature?: PreserveEntrySignaturesOption | ||
type: 'chunk' | ||
} | ||
interface EmittedPrebuiltChunk { | ||
code: string | ||
exports?: string[] | ||
fileName: string | ||
map?: SourceMap | ||
sourcemapFileName?: string | ||
type: 'prebuilt-chunk' | ||
} | ||
type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk | ||
type EmitFile = (emittedFile: EmittedFile) => string | ||
interface ModuleInfo extends ModuleOptions { | ||
ast: AcornNode | null | ||
code: string | null | ||
dynamicImporters: readonly string[] | ||
dynamicallyImportedIdResolutions: readonly ResolvedId[] | ||
dynamicallyImportedIds: readonly string[] | ||
exportedBindings: Record<string, string[]> | null | ||
exports: string[] | null | ||
hasDefaultExport: boolean | null | ||
/** @deprecated Use `moduleSideEffects` instead */ | ||
hasModuleSideEffects: boolean | 'no-treeshake' | ||
id: string | ||
implicitlyLoadedAfterOneOf: readonly string[] | ||
implicitlyLoadedBefore: readonly string[] | ||
importedIdResolutions: readonly ResolvedId[] | ||
importedIds: readonly string[] | ||
importers: readonly string[] | ||
isEntry: boolean | ||
isExternal: boolean | ||
isIncluded: boolean | null | ||
} | ||
type GetModuleInfo = (moduleId: string) => ModuleInfo | null | ||
interface CustomPluginOptions { | ||
[plugin: string]: any | ||
} | ||
type LoggingFunctionWithPosition = ( | ||
log: RollupLog | string | (() => RollupLog | string), | ||
pos?: number | { column: number; line: number }, | ||
) => void | ||
interface PluginContext$1 extends MinimalPluginContext { | ||
addWatchFile: (id: string) => void | ||
cache: PluginCache | ||
debug: LoggingFunction | ||
emitFile: EmitFile | ||
error: (error: RollupError | string) => never | ||
getFileName: (fileReferenceId: string) => string | ||
getModuleIds: () => IterableIterator<string> | ||
getModuleInfo: GetModuleInfo | ||
getWatchFiles: () => string[] | ||
info: LoggingFunction | ||
load: ( | ||
options: { id: string; resolveDependencies?: boolean } & Partial< | ||
PartialNull<ModuleOptions> | ||
>, | ||
) => Promise<ModuleInfo> | ||
/** @deprecated Use `this.getModuleIds` instead */ | ||
moduleIds: IterableIterator<string> | ||
parse: (input: string, options?: any) => AcornNode | ||
resolve: ( | ||
source: string, | ||
importer?: string, | ||
options?: { | ||
assertions?: Record<string, string> | ||
custom?: CustomPluginOptions | ||
isEntry?: boolean | ||
skipSelf?: boolean | ||
}, | ||
) => Promise<ResolvedId | null> | ||
setAssetSource: ( | ||
assetReferenceId: string, | ||
source: string | Uint8Array, | ||
) => void | ||
warn: LoggingFunction | ||
} | ||
interface PluginContextMeta { | ||
rollupVersion: string | ||
watchMode: boolean | ||
} | ||
interface ResolvedId extends ModuleOptions { | ||
external: boolean | 'absolute' | ||
id: string | ||
resolvedBy: string | ||
} | ||
interface ResolvedIdMap { | ||
[key: string]: ResolvedId | ||
} | ||
interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> { | ||
external?: boolean | 'absolute' | 'relative' | ||
id: string | ||
resolvedBy?: string | ||
} | ||
type ResolveIdResult = string | NullValue$1 | false | PartialResolvedId | ||
type ResolveIdHook = ( | ||
this: PluginContext$1, | ||
source: string, | ||
importer: string | undefined, | ||
options: { | ||
assertions: Record<string, string> | ||
custom?: CustomPluginOptions | ||
isEntry: boolean | ||
}, | ||
) => ResolveIdResult | ||
type ShouldTransformCachedModuleHook = ( | ||
this: PluginContext$1, | ||
options: { | ||
ast: AcornNode | ||
code: string | ||
id: string | ||
meta: CustomPluginOptions | ||
moduleSideEffects: boolean | 'no-treeshake' | ||
resolvedSources: ResolvedIdMap | ||
syntheticNamedExports: boolean | string | ||
}, | ||
) => boolean | NullValue$1 | ||
type IsExternal = ( | ||
source: string, | ||
importer: string | undefined, | ||
isResolved: boolean, | ||
) => boolean | ||
type HasModuleSideEffects = (id: string, external: boolean) => boolean | ||
type LoadResult = SourceDescription | string | NullValue$1 | ||
type LoadHook = (this: PluginContext$1, id: string) => LoadResult | ||
interface TransformPluginContext extends PluginContext$1 { | ||
debug: LoggingFunctionWithPosition | ||
error: ( | ||
error: RollupError | string, | ||
pos?: number | { column: number; line: number }, | ||
) => never | ||
getCombinedSourcemap: () => SourceMap | ||
info: LoggingFunctionWithPosition | ||
warn: LoggingFunctionWithPosition | ||
} | ||
type TransformResult = string | NullValue$1 | Partial<SourceDescription> | ||
type TransformHook = ( | ||
this: TransformPluginContext, | ||
code: string, | ||
id: string, | ||
) => TransformResult | ||
type ModuleParsedHook = (this: PluginContext$1, info: ModuleInfo) => void | ||
type RenderChunkHook = ( | ||
this: PluginContext$1, | ||
code: string, | ||
chunk: RenderedChunk$1, | ||
options: NormalizedOutputOptions, | ||
meta: { chunks: Record<string, RenderedChunk$1> }, | ||
) => { code: string; map?: SourceMapInput } | string | NullValue$1 | ||
type ResolveDynamicImportHook = ( | ||
this: PluginContext$1, | ||
specifier: string | AcornNode, | ||
importer: string, | ||
options: { assertions: Record<string, string> }, | ||
) => ResolveIdResult | ||
type ResolveImportMetaHook = ( | ||
this: PluginContext$1, | ||
property: string | null, | ||
options: { chunkId: string; format: InternalModuleFormat; moduleId: string }, | ||
) => string | NullValue$1 | ||
type ResolveFileUrlHook = ( | ||
this: PluginContext$1, | ||
options: { | ||
chunkId: string | ||
fileName: string | ||
format: InternalModuleFormat | ||
moduleId: string | ||
referenceId: string | ||
relativePath: string | ||
}, | ||
) => string | NullValue$1 | ||
type AddonHookFunction = ( | ||
this: PluginContext$1, | ||
chunk: RenderedChunk$1, | ||
) => string | Promise<string> | ||
type AddonHook = string | AddonHookFunction | ||
type ChangeEvent = 'create' | 'update' | 'delete' | ||
type WatchChangeHook = ( | ||
this: PluginContext$1, | ||
id: string, | ||
change: { event: ChangeEvent }, | ||
) => void | ||
interface OutputBundle { | ||
[fileName: string]: OutputAsset | OutputChunk | ||
} | ||
interface FunctionPluginHooks { | ||
augmentChunkHash: (this: PluginContext$1, chunk: RenderedChunk$1) => string | void | ||
buildEnd: (this: PluginContext$1, error?: Error) => void | ||
buildStart: (this: PluginContext$1, options: NormalizedInputOptions) => void | ||
closeBundle: (this: PluginContext$1) => void | ||
closeWatcher: (this: PluginContext$1) => void | ||
generateBundle: ( | ||
this: PluginContext$1, | ||
options: NormalizedOutputOptions, | ||
bundle: OutputBundle, | ||
isWrite: boolean, | ||
) => void | ||
load: LoadHook | ||
moduleParsed: ModuleParsedHook | ||
onLog: ( | ||
this: MinimalPluginContext, | ||
level: LogLevel, | ||
log: RollupLog, | ||
) => boolean | NullValue$1 | ||
options: ( | ||
this: MinimalPluginContext, | ||
options: InputOptions$1, | ||
) => InputOptions$1 | NullValue$1 | ||
outputOptions: ( | ||
this: PluginContext$1, | ||
options: OutputOptions$1, | ||
) => OutputOptions$1 | NullValue$1 | ||
renderChunk: RenderChunkHook | ||
renderDynamicImport: ( | ||
this: PluginContext$1, | ||
options: { | ||
customResolution: string | null | ||
format: InternalModuleFormat | ||
moduleId: string | ||
targetModuleId: string | null | ||
}, | ||
) => { left: string; right: string } | NullValue$1 | ||
renderError: (this: PluginContext$1, error?: Error) => void | ||
renderStart: ( | ||
this: PluginContext$1, | ||
outputOptions: NormalizedOutputOptions, | ||
inputOptions: NormalizedInputOptions, | ||
) => void | ||
resolveDynamicImport: ResolveDynamicImportHook | ||
resolveFileUrl: ResolveFileUrlHook | ||
resolveId: ResolveIdHook | ||
resolveImportMeta: ResolveImportMetaHook | ||
shouldTransformCachedModule: ShouldTransformCachedModuleHook | ||
transform: TransformHook | ||
watchChange: WatchChangeHook | ||
writeBundle: ( | ||
this: PluginContext$1, | ||
options: NormalizedOutputOptions, | ||
bundle: OutputBundle, | ||
) => void | ||
} | ||
type OutputPluginHooks = | ||
| 'augmentChunkHash' | ||
| 'generateBundle' | ||
| 'outputOptions' | ||
| 'renderChunk' | ||
| 'renderDynamicImport' | ||
| 'renderError' | ||
| 'renderStart' | ||
| 'resolveFileUrl' | ||
| 'resolveImportMeta' | ||
| 'writeBundle' | ||
type SyncPluginHooks = | ||
| 'augmentChunkHash' | ||
| 'onLog' | ||
| 'outputOptions' | ||
| 'renderDynamicImport' | ||
| 'resolveFileUrl' | ||
| 'resolveImportMeta' | ||
type AsyncPluginHooks = Exclude< | ||
keyof FunctionPluginHooks, | ||
SyncPluginHooks | ||
> | ||
type FirstPluginHooks = | ||
| 'load' | ||
| 'renderDynamicImport' | ||
| 'resolveDynamicImport' | ||
| 'resolveFileUrl' | ||
| 'resolveId' | ||
| 'resolveImportMeta' | ||
| 'shouldTransformCachedModule' | ||
type SequentialPluginHooks = | ||
| 'augmentChunkHash' | ||
| 'generateBundle' | ||
| 'onLog' | ||
| 'options' | ||
| 'outputOptions' | ||
| 'renderChunk' | ||
| 'transform' | ||
type ParallelPluginHooks = Exclude< | ||
keyof FunctionPluginHooks | AddonHooks, | ||
FirstPluginHooks | SequentialPluginHooks | ||
> | ||
type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro' | ||
type MakeAsync<Function_> = Function_ extends ( | ||
this: infer This, | ||
...parameters: infer Arguments | ||
) => infer Return | ||
? (this: This, ...parameters: Arguments) => Return | Promise<Return> | ||
: never | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
type ObjectHook<T, O = {}> = | ||
| T | ||
| ({ handler: T; order?: 'pre' | 'post' | null } & O) | ||
type PluginHooks = { | ||
[K in keyof FunctionPluginHooks]: ObjectHook< | ||
K extends AsyncPluginHooks | ||
? MakeAsync<FunctionPluginHooks[K]> | ||
: FunctionPluginHooks[K], | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
K extends ParallelPluginHooks ? { sequential?: boolean } : {} | ||
> | ||
} | ||
interface OutputPlugin | ||
extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, | ||
Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> { | ||
cacheKey?: string | ||
name: string | ||
version?: string | ||
} | ||
interface Plugin$1<A = any> extends OutputPlugin, Partial<PluginHooks> { | ||
// for inter-plugin communication | ||
api?: A | ||
} | ||
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended' | ||
interface NormalizedTreeshakingOptions { | ||
annotations: boolean | ||
correctVarValueBeforeDeclaration: boolean | ||
manualPureFunctions: readonly string[] | ||
moduleSideEffects: HasModuleSideEffects | ||
propertyReadSideEffects: boolean | 'always' | ||
tryCatchDeoptimization: boolean | ||
unknownGlobalSideEffects: boolean | ||
} | ||
interface TreeshakingOptions | ||
extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> { | ||
moduleSideEffects?: ModuleSideEffectsOption | ||
preset?: TreeshakingPreset | ||
} | ||
interface ManualChunkMeta { | ||
getModuleIds: () => IterableIterator<string> | ||
getModuleInfo: GetModuleInfo | ||
} | ||
type GetManualChunk = ( | ||
id: string, | ||
meta: ManualChunkMeta, | ||
) => string | NullValue$1 | ||
type ExternalOption = | ||
| (string | RegExp)[] | ||
| string | ||
| RegExp | ||
| (( | ||
source: string, | ||
importer: string | undefined, | ||
isResolved: boolean, | ||
) => boolean | NullValue$1) | ||
type GlobalsOption = | ||
| { [name: string]: string } | ||
| ((name: string) => string) | ||
type InputOption = string | string[] | { [entryAlias: string]: string } | ||
type ManualChunksOption = | ||
| { [chunkAlias: string]: string[] } | ||
| GetManualChunk | ||
type LogHandlerWithDefault = ( | ||
level: LogLevel, | ||
log: RollupLog, | ||
defaultHandler: LogOrStringHandler, | ||
) => void | ||
type LogOrStringHandler = ( | ||
level: LogLevel | 'error', | ||
log: RollupLog | string, | ||
) => void | ||
type LogHandler = (level: LogLevel, log: RollupLog) => void | ||
type ModuleSideEffectsOption = | ||
| boolean | ||
| 'no-external' | ||
| string[] | ||
| HasModuleSideEffects | ||
type PreserveEntrySignaturesOption = | ||
| false | ||
| 'strict' | ||
| 'allow-extension' | ||
| 'exports-only' | ||
type SourcemapPathTransformOption = ( | ||
relativeSourcePath: string, | ||
sourcemapPath: string, | ||
) => string | ||
type SourcemapIgnoreListOption = ( | ||
relativeSourcePath: string, | ||
sourcemapPath: string, | ||
) => boolean | ||
type InputPluginOption = MaybePromise$1< | ||
Plugin$1 | NullValue$1 | false | InputPluginOption[] | ||
> | ||
interface InputOptions$1 { | ||
acorn?: Record<string, unknown> | ||
acornInjectPlugins?: | ||
| ((...arguments_: any[]) => unknown)[] | ||
| ((...arguments_: any[]) => unknown) | ||
cache?: boolean | RollupCache | ||
context?: string | ||
experimentalCacheExpiry?: number | ||
experimentalLogSideEffects?: boolean | ||
external?: ExternalOption | ||
/** @deprecated Use the "inlineDynamicImports" output option instead. */ | ||
inlineDynamicImports?: boolean | ||
input?: InputOption | ||
logLevel?: LogLevelOption | ||
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource' | ||
/** @deprecated Use the "manualChunks" output option instead. */ | ||
manualChunks?: ManualChunksOption | ||
maxParallelFileOps?: number | ||
/** @deprecated Use the "maxParallelFileOps" option instead. */ | ||
maxParallelFileReads?: number | ||
moduleContext?: | ||
| ((id: string) => string | NullValue$1) | ||
| { [id: string]: string } | ||
onLog?: LogHandlerWithDefault | ||
onwarn?: WarningHandlerWithDefault | ||
perf?: boolean | ||
plugins?: InputPluginOption | ||
preserveEntrySignatures?: PreserveEntrySignaturesOption | ||
/** @deprecated Use the "preserveModules" output option instead. */ | ||
preserveModules?: boolean | ||
preserveSymlinks?: boolean | ||
shimMissingExports?: boolean | ||
strictDeprecations?: boolean | ||
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions | ||
watch?: WatcherOptions | false | ||
} | ||
interface NormalizedInputOptions { | ||
acorn: Record<string, unknown> | ||
acornInjectPlugins: (() => unknown)[] | ||
cache: false | undefined | RollupCache | ||
context: string | ||
experimentalCacheExpiry: number | ||
experimentalLogSideEffects: boolean | ||
external: IsExternal | ||
/** @deprecated Use the "inlineDynamicImports" output option instead. */ | ||
inlineDynamicImports: boolean | undefined | ||
input: string[] | { [entryAlias: string]: string } | ||
logLevel: LogLevelOption | ||
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource' | ||
/** @deprecated Use the "manualChunks" output option instead. */ | ||
manualChunks: ManualChunksOption | undefined | ||
maxParallelFileOps: number | ||
/** @deprecated Use the "maxParallelFileOps" option instead. */ | ||
maxParallelFileReads: number | ||
moduleContext: (id: string) => string | ||
onLog: LogHandler | ||
onwarn: (warning: RollupLog) => void | ||
perf: boolean | ||
plugins: Plugin$1[] | ||
preserveEntrySignatures: PreserveEntrySignaturesOption | ||
/** @deprecated Use the "preserveModules" output option instead. */ | ||
preserveModules: boolean | undefined | ||
preserveSymlinks: boolean | ||
shimMissingExports: boolean | ||
strictDeprecations: boolean | ||
treeshake: false | NormalizedTreeshakingOptions | ||
} | ||
type InternalModuleFormat = | ||
| 'amd' | ||
| 'cjs' | ||
| 'es' | ||
| 'iife' | ||
| 'system' | ||
| 'umd' | ||
type ModuleFormat = | ||
| InternalModuleFormat | ||
| 'commonjs' | ||
| 'esm' | ||
| 'module' | ||
| 'systemjs' | ||
type GeneratedCodePreset = 'es5' | 'es2015' | ||
interface NormalizedGeneratedCodeOptions { | ||
arrowFunctions: boolean | ||
constBindings: boolean | ||
objectShorthand: boolean | ||
reservedNamesAsProps: boolean | ||
symbols: boolean | ||
} | ||
interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> { | ||
preset?: GeneratedCodePreset | ||
} | ||
type OptionsPaths = Record<string, string> | ((id: string) => string) | ||
type InteropType = | ||
| 'compat' | ||
| 'auto' | ||
| 'esModule' | ||
| 'default' | ||
| 'defaultOnly' | ||
type GetInterop = (id: string | null) => InteropType | ||
type AmdOptions = ( | ||
| { | ||
autoId?: false | ||
id: string | ||
} | ||
| { | ||
autoId: true | ||
basePath?: string | ||
id?: undefined | ||
} | ||
| { | ||
autoId?: false | ||
id?: undefined | ||
} | ||
) & { | ||
define?: string | ||
forceJsExtensionForImports?: boolean | ||
} | ||
type NormalizedAmdOptions = ( | ||
| { | ||
autoId: false | ||
id?: string | ||
} | ||
| { | ||
autoId: true | ||
basePath: string | ||
} | ||
) & { | ||
define: string | ||
forceJsExtensionForImports: boolean | ||
} | ||
type AddonFunction = (chunk: RenderedChunk$1) => string | Promise<string> | ||
type OutputPluginOption = MaybePromise$1< | ||
OutputPlugin | NullValue$1 | false | OutputPluginOption[] | ||
> | ||
interface OutputOptions$1 { | ||
amd?: AmdOptions | ||
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string) | ||
banner?: string | AddonFunction | ||
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | ||
compact?: boolean | ||
// only required for bundle.write | ||
dir?: string | ||
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */ | ||
dynamicImportFunction?: string | ||
dynamicImportInCjs?: boolean | ||
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | ||
esModule?: boolean | 'if-default-prop' | ||
/** @deprecated This option is no longer needed and ignored. */ | ||
experimentalDeepDynamicChunkOptimization?: boolean | ||
experimentalMinChunkSize?: number | ||
exports?: 'default' | 'named' | 'none' | 'auto' | ||
extend?: boolean | ||
externalImportAssertions?: boolean | ||
externalLiveBindings?: boolean | ||
// only required for bundle.write | ||
file?: string | ||
footer?: string | AddonFunction | ||
format?: ModuleFormat | ||
freeze?: boolean | ||
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions | ||
globals?: GlobalsOption | ||
hoistTransitiveImports?: boolean | ||
indent?: string | boolean | ||
inlineDynamicImports?: boolean | ||
interop?: InteropType | GetInterop | ||
intro?: string | AddonFunction | ||
manualChunks?: ManualChunksOption | ||
minifyInternalExports?: boolean | ||
name?: string | ||
/** @deprecated Use "generatedCode.symbols" instead. */ | ||
namespaceToStringTag?: boolean | ||
noConflict?: boolean | ||
outro?: string | AddonFunction | ||
paths?: OptionsPaths | ||
plugins?: OutputPluginOption | ||
/** @deprecated Use "generatedCode.constBindings" instead. */ | ||
preferConst?: boolean | ||
preserveModules?: boolean | ||
preserveModulesRoot?: string | ||
sanitizeFileName?: boolean | ((fileName: string) => string) | ||
sourcemap?: boolean | 'inline' | 'hidden' | ||
sourcemapBaseUrl?: string | ||
sourcemapExcludeSources?: boolean | ||
sourcemapFile?: string | ||
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | ||
sourcemapPathTransform?: SourcemapPathTransformOption | ||
strict?: boolean | ||
systemNullSetters?: boolean | ||
validate?: boolean | ||
} | ||
interface NormalizedOutputOptions { | ||
amd: NormalizedAmdOptions | ||
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string) | ||
banner: AddonFunction | ||
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | ||
compact: boolean | ||
dir: string | undefined | ||
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */ | ||
dynamicImportFunction: string | undefined | ||
dynamicImportInCjs: boolean | ||
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | ||
esModule: boolean | 'if-default-prop' | ||
/** @deprecated This option is no longer needed and ignored. */ | ||
experimentalDeepDynamicChunkOptimization: boolean | ||
experimentalMinChunkSize: number | ||
exports: 'default' | 'named' | 'none' | 'auto' | ||
extend: boolean | ||
externalImportAssertions: boolean | ||
externalLiveBindings: boolean | ||
file: string | undefined | ||
footer: AddonFunction | ||
format: InternalModuleFormat | ||
freeze: boolean | ||
generatedCode: NormalizedGeneratedCodeOptions | ||
globals: GlobalsOption | ||
hoistTransitiveImports: boolean | ||
indent: true | string | ||
inlineDynamicImports: boolean | ||
interop: GetInterop | ||
intro: AddonFunction | ||
manualChunks: ManualChunksOption | ||
minifyInternalExports: boolean | ||
name: string | undefined | ||
/** @deprecated Use "generatedCode.symbols" instead. */ | ||
namespaceToStringTag: boolean | ||
noConflict: boolean | ||
outro: AddonFunction | ||
paths: OptionsPaths | ||
plugins: OutputPlugin[] | ||
/** @deprecated Use "generatedCode.constBindings" instead. */ | ||
preferConst: boolean | ||
preserveModules: boolean | ||
preserveModulesRoot: string | undefined | ||
sanitizeFileName: (fileName: string) => string | ||
sourcemap: boolean | 'inline' | 'hidden' | ||
sourcemapBaseUrl: string | undefined | ||
sourcemapExcludeSources: boolean | ||
sourcemapFile: string | undefined | ||
sourcemapFileNames: | ||
| string | ||
| ((chunkInfo: PreRenderedChunk) => string) | ||
| undefined | ||
sourcemapIgnoreList: SourcemapIgnoreListOption | ||
sourcemapPathTransform: SourcemapPathTransformOption | undefined | ||
strict: boolean | ||
systemNullSetters: boolean | ||
validate: boolean | ||
} | ||
type WarningHandlerWithDefault = ( | ||
warning: RollupLog, | ||
defaultHandler: LoggingFunction, | ||
) => void | ||
interface PreRenderedAsset { | ||
name: string | undefined | ||
source: string | Uint8Array | ||
type: 'asset' | ||
} | ||
interface OutputAsset extends PreRenderedAsset { | ||
fileName: string | ||
needsCodeReference: boolean | ||
} | ||
interface RenderedModule { | ||
readonly code: string | null | ||
originalLength: number | ||
removedExports: string[] | ||
renderedExports: string[] | ||
renderedLength: number | ||
} | ||
interface PreRenderedChunk { | ||
exports: string[] | ||
facadeModuleId: string | null | ||
isDynamicEntry: boolean | ||
isEntry: boolean | ||
isImplicitEntry: boolean | ||
moduleIds: string[] | ||
name: string | ||
type: 'chunk' | ||
} | ||
interface RenderedChunk$1 extends PreRenderedChunk { | ||
dynamicImports: string[] | ||
fileName: string | ||
implicitlyLoadedBefore: string[] | ||
importedBindings: { | ||
[imported: string]: string[] | ||
} | ||
imports: string[] | ||
modules: { | ||
[id: string]: RenderedModule | ||
} | ||
referencedFiles: string[] | ||
} | ||
interface OutputChunk extends RenderedChunk$1 { | ||
code: string | ||
map: SourceMap | null | ||
sourcemapFileName: string | null | ||
preliminaryFileName: string | ||
} | ||
interface SerializablePluginCache { | ||
[key: string]: [number, any] | ||
} | ||
interface RollupCache { | ||
modules: ModuleJSON[] | ||
plugins?: Record<string, SerializablePluginCache> | ||
} | ||
interface ChokidarOptions { | ||
alwaysStat?: boolean | ||
atomic?: boolean | number | ||
awaitWriteFinish?: | ||
| { | ||
pollInterval?: number | ||
stabilityThreshold?: number | ||
} | ||
| boolean | ||
binaryInterval?: number | ||
cwd?: string | ||
depth?: number | ||
disableGlobbing?: boolean | ||
followSymlinks?: boolean | ||
ignoreInitial?: boolean | ||
ignorePermissionErrors?: boolean | ||
ignored?: any | ||
interval?: number | ||
persistent?: boolean | ||
useFsEvents?: boolean | ||
usePolling?: boolean | ||
} | ||
interface WatcherOptions { | ||
buildDelay?: number | ||
chokidar?: ChokidarOptions | ||
clearScreen?: boolean | ||
exclude?: string | RegExp | (string | RegExp)[] | ||
include?: string | RegExp | (string | RegExp)[] | ||
skipWrite?: boolean | ||
} | ||
interface AcornNode { | ||
end: number | ||
start: number | ||
type: string | ||
} | ||
declare class BindingOutputAsset { | ||
get fileName(): string | ||
get source(): string | ||
} | ||
declare class BindingOutputChunk { | ||
get isEntry(): boolean | ||
get isDynamicEntry(): boolean | ||
get facadeModuleId(): string | null | ||
get moduleIds(): Array<string> | ||
get exports(): Array<string> | ||
get fileName(): string | ||
get modules(): Record<string, BindingRenderedModule> | ||
get code(): string | ||
get map(): string | null | ||
get sourcemapFileName(): string | null | ||
} | ||
declare class BindingOutputs { | ||
get chunks(): Array<BindingOutputChunk> | ||
get assets(): Array<BindingOutputAsset> | ||
} | ||
declare class BindingPluginContext { | ||
resolve( | ||
specifier: string, | ||
importer: string | undefined | null, | ||
extraOptions: BindingPluginContextResolveOptions, | ||
): void | ||
} | ||
interface BindingHookResolveIdExtraOptions { | ||
isEntry: boolean | ||
kind: string | ||
} | ||
interface BindingPluginContextResolveOptions { | ||
importKind: string | ||
} | ||
interface BindingRenderedModule { | ||
code?: string | ||
} | ||
interface BindingResolveOptions { | ||
alias?: Record<string, Array<string>> | ||
aliasFields?: Array<Array<string>> | ||
conditionNames?: Array<string> | ||
exportsFields?: Array<Array<string>> | ||
extensions?: Array<string> | ||
mainFields?: Array<string> | ||
mainFiles?: Array<string> | ||
modules?: Array<string> | ||
symlinks?: boolean | ||
} | ||
interface RenderedChunk { | ||
isEntry: boolean | ||
isDynamicEntry: boolean | ||
facadeModuleId?: string | ||
moduleIds: Array<string> | ||
exports: Array<string> | ||
fileName: string | ||
modules: Record<string, BindingRenderedModule> | ||
} | ||
interface AnyFn { | ||
(...args: any[]): any; | ||
} | ||
interface AnyObj { | ||
} | ||
type NullValue<T = void> = T | undefined | null | void; | ||
type MaybePromise<T> = T | Promise<T>; | ||
type PluginContext = BindingPluginContext; | ||
type FormalHook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> = { | ||
handler: Handler; | ||
} & HookOptions; | ||
type Hook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> = FormalHook<Handler, HookOptions> | Handler; | ||
interface Plugin { | ||
name?: string; | ||
buildStart?: Hook<(this: PluginContext, options: RolldownNormalizedInputOptions) => MaybePromise<NullValue>>; | ||
resolveId?: Hook<(this: null, source: string, importer: string | undefined, extraOptions: BindingHookResolveIdExtraOptions) => MaybePromise<string | NullValue | false | { | ||
id: string; | ||
external?: boolean; | ||
}>>; | ||
load?: Hook<(this: null, id: string) => MaybePromise<NullValue | string | { | ||
code: string; | ||
map?: string | null; | ||
}>>; | ||
transform?: Hook<(this: null, code: string, id: string) => MaybePromise<NullValue | string | { | ||
code: string; | ||
map?: string | null; | ||
}>>; | ||
renderChunk?: Hook<(this: null, code: string, chunk: RenderedChunk) => MaybePromise<NullValue | string>>; | ||
buildEnd?: Hook<(this: null, err?: string) => MaybePromise<NullValue>>; | ||
generateBundle?: Hook<(bundle: BindingOutputs, isWrite: boolean) => MaybePromise<NullValue>>; | ||
writeBundle?: Hook<(bundle: BindingOutputs) => MaybePromise<NullValue>>; | ||
} | ||
interface InputOptions { | ||
input?: InputOptions$1['input']; | ||
plugins?: Plugin[]; | ||
external?: InputOptions$1['external']; | ||
resolve?: RolldownResolveOptions; | ||
cwd?: string; | ||
} | ||
type RolldownResolveOptions = Omit<BindingResolveOptions, 'alias'> & { | ||
alias?: Record<string, string>; | ||
}; | ||
type RolldownNormalizedInputOptions = NormalizedInputOptions & { | ||
resolve?: BindingResolveOptions; | ||
}; | ||
interface OutputOptions { | ||
dir?: OutputOptions$1['dir']; | ||
format?: 'es'; | ||
exports?: OutputOptions$1['exports']; | ||
sourcemap?: OutputOptions$1['sourcemap']; | ||
banner?: OutputOptions$1['banner']; | ||
footer?: OutputOptions$1['footer']; | ||
} | ||
interface RolldownOptions extends InputOptions { | ||
@@ -1150,2 +60,3 @@ output?: OutputOptions; | ||
write(outputOptions?: OutputOptions): Promise<RolldownOutput>; | ||
destroy(): Promise<void>; | ||
} | ||
@@ -1161,2 +72,2 @@ | ||
export { type InputOptions, type OutputOptions, type Plugin, type RolldownOptions, type RolldownOutput, type RolldownOutputChunk, type RolldownOptions as RollupOptions, type RolldownOutput as RollupOutput, defineConfig, experimental_scan, rolldown }; | ||
export { InputOptions, OutputOptions, type RolldownOptions, type RolldownOutput, type RolldownOutputChunk, type RolldownOptions as RollupOptions, type RolldownOutput as RollupOutput, defineConfig, experimental_scan, rolldown }; |
{ | ||
"name": "rolldown", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -36,4 +36,12 @@ "homepage": "https://rolldown.rs/", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./parallel-plugin": { | ||
"types": "./dist/parallel-plugin.d.mts", | ||
"require": "./dist/parallel-plugin.cjs", | ||
"import": "./dist/parallel-plugin.mjs" | ||
} | ||
}, | ||
"imports": { | ||
"#parallel-plugin-worker": "./dist/parallel-plugin-worker.mjs" | ||
}, | ||
"publishConfig": { | ||
@@ -56,11 +64,19 @@ "registry": "https://registry.npmjs.org/", | ||
"aarch64-unknown-linux-musl", | ||
"aarch64-pc-windows-msvc" | ||
] | ||
"aarch64-pc-windows-msvc", | ||
"wasm32-wasi-preview1-threads" | ||
], | ||
"wasm": { | ||
"initialMemory": 16384 | ||
}, | ||
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\n" | ||
}, | ||
"devDependencies": { | ||
"@napi-rs/cli": "^3.0.0-alpha.43", | ||
"@napi-rs/cli": "^3.0.0-alpha.49", | ||
"@napi-rs/wasm-runtime": "^0.1.2", | ||
"citty": "^0.1.6", | ||
"colorette": "^2.0.20", | ||
"consola": "^3.2.3", | ||
"emnapi": "^1.1.1", | ||
"glob": "^10.3.10", | ||
"npm-run-all2": "^6.1.2", | ||
"rollup": "^4.12.1", | ||
@@ -71,26 +87,30 @@ "type-fest": "^4.12.0", | ||
"vitest": "^1.3.1", | ||
"rolldown": "0.10.1" | ||
"rolldown": "0.10.2" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-arm64": "0.10.1", | ||
"@rolldown/binding-darwin-x64": "0.10.1", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.10.1", | ||
"@rolldown/binding-linux-x64-gnu": "0.10.1", | ||
"@rolldown/binding-linux-x64-musl": "0.10.1", | ||
"@rolldown/binding-linux-arm64-musl": "0.10.1", | ||
"@rolldown/binding-linux-arm64-gnu": "0.10.1", | ||
"@rolldown/binding-win32-arm64-msvc": "0.10.1", | ||
"@rolldown/binding-win32-ia32-msvc": "0.10.1", | ||
"@rolldown/binding-win32-x64-msvc": "0.10.1" | ||
"@rolldown/binding-darwin-arm64": "0.10.2", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.10.2", | ||
"@rolldown/binding-linux-arm64-gnu": "0.10.2", | ||
"@rolldown/binding-darwin-x64": "0.10.2", | ||
"@rolldown/binding-linux-arm64-musl": "0.10.2", | ||
"@rolldown/binding-wasm32-wasi": "0.10.2", | ||
"@rolldown/binding-linux-x64-musl": "0.10.2", | ||
"@rolldown/binding-linux-x64-gnu": "0.10.2", | ||
"@rolldown/binding-win32-arm64-msvc": "0.10.2", | ||
"@rolldown/binding-win32-x64-msvc": "0.10.2", | ||
"@rolldown/binding-win32-ia32-msvc": "0.10.2" | ||
}, | ||
"scripts": { | ||
"# Scrips for binding #": "_", | ||
"artifacts": "napi artifacts -o=./artifacts --npm-dir ./npm", | ||
"format-generated-binding-files": "prettier --write src/binding.js src/binding.d.ts", | ||
"build-binding": "napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header \"type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\"", | ||
"build-binding:release": "napi build -o=./src --release --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header \"type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\"", | ||
"artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm", | ||
"build-binding": "napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts", | ||
"build-binding:release": "pnpm build-binding --release", | ||
"build-binding:wasi": "pnpm build-binding --target wasm32-wasi-preview1-threads", | ||
"build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasi-preview1-threads", | ||
"# Scrips for node #": "_", | ||
"build-node": "unbuild", | ||
"build": "pnpm build-binding && pnpm build-node && pnpm format-generated-binding-files", | ||
"build:release": "pnpm build-binding:release && pnpm build-node && pnpm format-generated-binding-files", | ||
"build-native:debug": "run-s build-binding build-node", | ||
"build-native:release": "run-s build-binding:release build-node", | ||
"build-wasi:debug": "run-s build-binding:wasi build-node", | ||
"build-wasi:release": "run-s build-binding:wasi:release build-node", | ||
"# Scrips for checking #": "_", | ||
@@ -97,0 +117,0 @@ "test": "vitest run --reporter verbose --hideSkippedTests", |
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
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
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
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
1028113
49
8076
11
14
39
3