Comparing version 1.0.0-beta.1-commit.f90856a to 1.0.0-beta.2-commit.afd0727
@@ -87,3 +87,3 @@ type MaybePromise<T> = T | Promise<T> | ||
get fileName(): string | ||
get modules(): Record<string, BindingRenderedModule> | ||
get modules(): BindingModules | ||
get imports(): Array<string> | ||
@@ -108,2 +108,3 @@ get dynamicImports(): Array<string> | ||
emitFile(file: BindingEmittedAsset): string | ||
emitChunk(file: BindingEmittedChunk): string | ||
getFileName(referenceId: string): string | ||
@@ -152,2 +153,37 @@ getModuleInfo(moduleId: string): BindingModuleInfo | null | ||
export declare class MagicString { | ||
/** Get source text from utf8 offset. */ | ||
getSourceText(start: number, end: number): string | ||
/** Get 0-based line and column number from utf8 offset. */ | ||
getLineColumnNumber(offset: number): LineColumn | ||
/** Get UTF16 byte offset from UTF8 byte offset. */ | ||
getUtf16ByteOffset(offset: number): number | ||
length(): number | ||
toString(): string | ||
hasChanged(): boolean | ||
append(input: string): this | ||
appendLeft(index: number, input: string): this | ||
appendRight(index: number, input: string): this | ||
indent(): this | ||
prepend(input: string): this | ||
prependLeft(index: number, input: string): this | ||
prependRight(index: number, input: string): this | ||
relocate(start: number, end: number, to: number): this | ||
remove(start: number, end: number): this | ||
generateMap(options?: Partial<GenerateDecodedMapOptions>): { | ||
toString: () => string; | ||
toUrl: () => string; | ||
toMap: () => { | ||
file?: string | ||
mappings: string | ||
names: Array<string> | ||
sourceRoot?: string | ||
sources: Array<string> | ||
sourcesContent?: Array<string> | ||
version: number | ||
x_google_ignoreList?: Array<number> | ||
} | ||
} | ||
} | ||
export declare class ParallelJsPluginRegistry { | ||
@@ -159,2 +195,23 @@ id: number | ||
export declare class ParseResult { | ||
get program(): import("@oxc-project/types").Program | ||
get module(): EcmaScriptModule | ||
get comments(): Array<Comment> | ||
get errors(): Array<OxcError> | ||
get magicString(): MagicString | ||
} | ||
export declare class RenderedChunk { | ||
get name(): string | ||
get isEntry(): boolean | ||
get isDynamicEntry(): boolean | ||
get facadeModuleId(): string | null | ||
get moduleIds(): Array<string> | ||
get exports(): Array<string> | ||
get fileName(): string | ||
get modules(): BindingModules | ||
get imports(): Array<string> | ||
get dynamicImports(): Array<string> | ||
} | ||
export interface AliasItem { | ||
@@ -181,2 +238,5 @@ find: string | ||
groups?: Array<BindingMatchGroup> | ||
maxSize?: number | ||
minModuleSize?: number | ||
maxModuleSize?: number | ||
} | ||
@@ -222,3 +282,4 @@ | ||
'builtin:replace'| | ||
'builtin:vite-resolve'; | ||
'builtin:vite-resolve'| | ||
'builtin:module-federation'; | ||
@@ -242,2 +303,9 @@ export interface BindingBundlerOptions { | ||
export interface BindingEmittedChunk { | ||
name?: string | ||
fileName?: string | ||
id: string | ||
importer?: string | ||
} | ||
export interface BindingExperimentalOptions { | ||
@@ -399,4 +467,15 @@ strictExecutionOrder?: boolean | ||
minShareCount?: number | ||
minModuleSize?: number | ||
maxModuleSize?: number | ||
maxSize?: number | ||
} | ||
export interface BindingModuleFederationPluginOption { | ||
name: string | ||
filename?: string | ||
exposes?: Record<string, string> | ||
remotes?: Array<BindingRemote> | ||
shared?: Record<string, BindingShared> | ||
} | ||
export interface BindingModulePreloadPolyfillPluginConfig { | ||
@@ -406,2 +485,7 @@ skip?: boolean | ||
export interface BindingModules { | ||
value: Array<BindingRenderedModule> | ||
idToIndex: Record<string, number> | ||
} | ||
export interface BindingModuleSideEffectsRule { | ||
@@ -448,2 +532,3 @@ test?: RegExp | undefined | ||
polyfillRequire?: boolean | ||
target?: string | ||
} | ||
@@ -523,2 +608,10 @@ | ||
export interface BindingRemote { | ||
type?: string | ||
entry: string | ||
name: string | ||
entryGlobalName?: string | ||
shareScope?: string | ||
} | ||
export interface BindingReplacePluginConfig { | ||
@@ -546,2 +639,10 @@ values: Record<string, string> | ||
export interface BindingShared { | ||
version?: string | ||
shareScope?: string | ||
singleton?: boolean | ||
requiredVersion?: string | ||
strictVersion?: boolean | ||
} | ||
export interface BindingSourcemap { | ||
@@ -610,2 +711,9 @@ inner: string | BindingJsonSourcemap | ||
export interface Comment { | ||
type: 'Line' | 'Block' | ||
value: string | ||
start: number | ||
end: number | ||
} | ||
export interface CompilerAssumptions { | ||
@@ -619,2 +727,27 @@ ignoreFunctionLength?: boolean | ||
export interface DynamicImport { | ||
start: number | ||
end: number | ||
moduleRequest: Span | ||
} | ||
export interface EcmaScriptModule { | ||
/** | ||
* Has ESM syntax. | ||
* | ||
* i.e. `import` and `export` statements, and `import.meta`. | ||
* | ||
* Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files. | ||
*/ | ||
hasModuleSyntax: boolean | ||
/** Import statements. */ | ||
staticImports: Array<StaticImport> | ||
/** Export statements. */ | ||
staticExports: Array<StaticExport> | ||
/** Dynamic import expressions. */ | ||
dynamicImports: Array<DynamicImport> | ||
/** Span positions` of `import.meta` */ | ||
importMetas: Array<Span> | ||
} | ||
export interface ErrorLabel { | ||
@@ -631,2 +764,49 @@ message?: string | ||
export interface ExportExportName { | ||
kind: ExportExportNameKind | ||
name?: string | ||
start?: number | ||
end?: number | ||
} | ||
export type ExportExportNameKind = /** `export { name } */ | ||
'Name'| | ||
/** `export default expression` */ | ||
'Default'| | ||
/** `export * from "mod" */ | ||
'None'; | ||
export interface ExportImportName { | ||
kind: ExportImportNameKind | ||
name?: string | ||
start?: number | ||
end?: number | ||
} | ||
export type ExportImportNameKind = /** `export { name } */ | ||
'Name'| | ||
/** `export * as ns from "mod"` */ | ||
'All'| | ||
/** `export * from "mod"` */ | ||
'AllButDefault'| | ||
/** Does not have a specifier. */ | ||
'None'; | ||
export interface ExportLocalName { | ||
kind: ExportLocalNameKind | ||
name?: string | ||
start?: number | ||
end?: number | ||
} | ||
export type ExportLocalNameKind = /** `export { name } */ | ||
'Name'| | ||
/** `export default expression` */ | ||
'Default'| | ||
/** | ||
* If the exported value is not locally accessible from within the module. | ||
* `export default function () {}` | ||
*/ | ||
'None'; | ||
export interface ExtensionAliasItem { | ||
@@ -637,2 +817,11 @@ target: string | ||
export interface GenerateDecodedMapOptions { | ||
/** The filename of the file containing the original source. */ | ||
source?: string | ||
/** Whether to include the original content in the map's `sourcesContent` array. */ | ||
includeContent: boolean | ||
/** Whether the mapping should be high-resolution. */ | ||
hires: boolean | 'boundary' | ||
} | ||
export type HelperMode = /** | ||
@@ -664,2 +853,16 @@ * Runtime mode (default): Helper functions are imported from a runtime package. | ||
export interface ImportName { | ||
kind: ImportNameKind | ||
name?: string | ||
start?: number | ||
end?: number | ||
} | ||
export type ImportNameKind = /** `import { x } from "mod"` */ | ||
'Name'| | ||
/** `import * as ns from "mod"` */ | ||
'NamespaceObject'| | ||
/** `import defaultExport from "mod"` */ | ||
'Default'; | ||
/** TypeScript Isolated Declarations for Standalone DTS Emit */ | ||
@@ -812,2 +1015,11 @@ export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult | ||
export interface LineColumn { | ||
line: number | ||
column: number | ||
} | ||
export interface OverwriteOptions { | ||
contentOnly: boolean | ||
} | ||
export interface OxcError { | ||
@@ -820,2 +1032,35 @@ severity: Severity | ||
/** | ||
* Parse asynchronously. | ||
* | ||
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread. | ||
*/ | ||
export declare function parseAsync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult> | ||
export interface ParserOptions { | ||
sourceType?: 'script' | 'module' | 'unambiguous' | undefined | ||
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */ | ||
lang?: 'js' | 'jsx' | 'ts' | 'tsx' | ||
/** | ||
* Emit `ParenthesizedExpression` in AST. | ||
* | ||
* If this option is true, parenthesized expressions are represented by | ||
* (non-standard) `ParenthesizedExpression` nodes that have a single `expression` property | ||
* containing the expression inside parentheses. | ||
* | ||
* Default: true | ||
*/ | ||
preserveParens?: boolean | ||
} | ||
/** Parse synchronously. */ | ||
export declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): ParseResult | ||
/** | ||
* Parse without returning anything. | ||
* | ||
* This is for benchmark purposes such as measuring napi communication overhead. | ||
*/ | ||
export declare function parseWithoutReturn(filename: string, sourceText: string, options?: ParserOptions | undefined | null): void | ||
export interface PreRenderedChunk { | ||
@@ -848,15 +1093,2 @@ name: string | ||
export interface RenderedChunk { | ||
name: string | ||
isEntry: boolean | ||
isDynamicEntry: boolean | ||
facadeModuleId?: string | ||
moduleIds: Array<string> | ||
exports: Array<string> | ||
fileName: string | ||
modules: Record<string, BindingRenderedModule> | ||
imports: Array<string> | ||
dynamicImports: Array<string> | ||
} | ||
export type Severity = 'Error'| | ||
@@ -877,2 +1109,87 @@ 'Warning'| | ||
export interface SourceMapOptions { | ||
includeContent?: boolean | ||
source?: string | ||
hires?: boolean | ||
} | ||
export interface Span { | ||
start: number | ||
end: number | ||
} | ||
export interface StaticExport { | ||
start: number | ||
end: number | ||
entries: Array<StaticExportEntry> | ||
} | ||
export interface StaticExportEntry { | ||
start: number | ||
end: number | ||
moduleRequest?: ValueSpan | ||
/** The name under which the desired binding is exported by the module`. */ | ||
importName: ExportImportName | ||
/** The name used to export this binding by this module. */ | ||
exportName: ExportExportName | ||
/** The name that is used to locally access the exported value from within the importing module. */ | ||
localName: ExportLocalName | ||
} | ||
export interface StaticImport { | ||
/** Start of import statement. */ | ||
start: number | ||
/** End of import statement. */ | ||
end: number | ||
/** | ||
* Import source. | ||
* | ||
* ```js | ||
* import { foo } from "mod"; | ||
* // ^^^ | ||
* ``` | ||
*/ | ||
moduleRequest: ValueSpan | ||
/** | ||
* Import specifiers. | ||
* | ||
* Empty for `import "mod"`. | ||
*/ | ||
entries: Array<StaticImportEntry> | ||
} | ||
export interface StaticImportEntry { | ||
/** | ||
* The name under which the desired binding is exported by the module. | ||
* | ||
* ```js | ||
* import { foo } from "mod"; | ||
* // ^^^ | ||
* import { foo as bar } from "mod"; | ||
* // ^^^ | ||
* ``` | ||
*/ | ||
importName: ImportName | ||
/** | ||
* The name that is used to locally access the imported value from within the importing module. | ||
* ```js | ||
* import { foo } from "mod"; | ||
* // ^^^ | ||
* import { foo as bar } from "mod"; | ||
* // ^^^ | ||
* ``` | ||
*/ | ||
localName: ValueSpan | ||
/** | ||
* Whether this binding is for a TypeScript type-only import. | ||
* | ||
* `true` for the following imports: | ||
* ```ts | ||
* import type { foo } from "mod"; | ||
* import { type foo } from "mod"; | ||
* ``` | ||
*/ | ||
isType: boolean | ||
} | ||
/** | ||
@@ -1025,1 +1342,7 @@ * Transpile a JavaScript or TypeScript into a target ECMAScript version. | ||
} | ||
export interface ValueSpan { | ||
value: string | ||
start: number | ||
end: number | ||
} |
@@ -1,6 +0,6 @@ | ||
import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig } from '../binding'; | ||
import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig, BindingModuleFederationPluginOption, BindingRemote } from '../binding'; | ||
export declare class BuiltinPlugin { | ||
name: BindingBuiltinPluginName; | ||
_options?: unknown; | ||
constructor(name: BindingBuiltinPluginName, _options?: unknown); | ||
_options?: unknown | undefined; | ||
constructor(name: BindingBuiltinPluginName, _options?: unknown | undefined); | ||
} | ||
@@ -17,1 +17,5 @@ export declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin; | ||
export declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, 'runtime'>): BuiltinPlugin; | ||
export type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, 'remotes'> & { | ||
remotes?: Record<string, string | BindingRemote>; | ||
}; | ||
export declare function moduleFederationPlugin(config: ModuleFederationPluginOption): BuiltinPlugin; |
@@ -1,2 +0,9 @@ | ||
import { CliOptions } from './schema'; | ||
import type { InputCliOptions } from '../../options/input-options'; | ||
import type { OutputCliOptions } from '../../options/output-options'; | ||
export interface CliOptions extends InputCliOptions, OutputCliOptions { | ||
config?: string | boolean; | ||
help?: boolean; | ||
version?: boolean; | ||
watch?: boolean; | ||
} | ||
export interface OptionConfig { | ||
@@ -3,0 +10,0 @@ abbreviation?: string; |
import { type NormalizedCliOptions } from './normalize'; | ||
import type { Schema } from './types'; | ||
import type { Schema } from '../../types/schema'; | ||
export declare const flattenedSchema: Record<string, Schema>; | ||
@@ -4,0 +4,0 @@ export declare const options: { |
@@ -1,2 +0,2 @@ | ||
import { CliOptions } from './schema'; | ||
import type { CliOptions } from './alias'; | ||
import type { InputOptions } from '../../options/input-options'; | ||
@@ -3,0 +3,0 @@ import type { OutputOptions } from '../../options/output-options'; |
@@ -1,3 +0,4 @@ | ||
import type { Schema } from './types'; | ||
export declare function getSchemaType(schema: Schema): 'string' | 'boolean' | 'object' | 'number' | 'array'; | ||
import type { Schema } from '../../types/schema'; | ||
type SchemaType = 'string' | 'boolean' | 'object' | 'number' | 'array'; | ||
export declare function getSchemaType(schema: Schema): SchemaType; | ||
export declare function flattenSchema(schema: Record<string, Schema>, base?: Record<string, Schema>, parent?: string): Record<string, Schema>; | ||
@@ -7,1 +8,2 @@ export declare function setNestedProperty<T extends object, K>(obj: T, path: string, value: K): void; | ||
export declare function kebabCaseToCamelCase(str: string): string; | ||
export {}; |
@@ -6,5 +6,5 @@ export { defineParallelPlugin } from './plugin/parallel-plugin'; | ||
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, } from './builtin-plugin/constructors'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, moduleFederationPlugin, } 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'; |
@@ -5,3 +5,3 @@ import { RolldownOutput, OutputAsset, OutputChunk, RenderedChunk, SourceMap } from './types/rolldown-output'; | ||
import type { RolldownOptions } from './types/rolldown-options'; | ||
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, RolldownPluginOption, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import { DefineParallelPluginResult } from './plugin/parallel-plugin'; | ||
@@ -28,3 +28,3 @@ import { defineConfig } from './utils/define-config'; | ||
export declare const VERSION: string; | ||
export type { OutputAsset, OutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedChunk, }; | ||
export type { OutputAsset, OutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, RolldownPluginOption, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedChunk, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './types/misc'; |
@@ -1,2 +0,1 @@ | ||
import type Z from 'zod'; | ||
export type LogLevel = 'info' | 'debug' | 'warn'; | ||
@@ -7,5 +6,2 @@ export type LogLevelOption = LogLevel | 'silent'; | ||
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; | ||
@@ -17,3 +13,1 @@ 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]>; |
import type { RollupLog } from '../types/misc'; | ||
export declare function logParseError(message: string): RollupLog; | ||
export declare function logMinifyWarning(): RollupLog; | ||
@@ -3,0 +4,0 @@ export declare function logInvalidLogPosition(pluginName: string): RollupLog; |
@@ -1,5 +0,5 @@ | ||
import { RolldownPluginOption } from '../plugin'; | ||
import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging'; | ||
import { TreeshakingOptions } from '../treeshake'; | ||
import { NullValue, StringOrRegExp } from '../types/utils'; | ||
import type { RolldownPluginOption } from '../plugin'; | ||
import type { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging'; | ||
import type { NullValue, StringOrRegExp } from '../types/utils'; | ||
import type { TreeshakingOptions } from '../types/module-side-effects'; | ||
export type InputOption = string | string[] | Record<string, string>; | ||
@@ -29,3 +29,3 @@ export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>); | ||
/** | ||
* Wether to emit warnings when detecting circular dependencies. | ||
* Whether to emit warnings when detecting circular dependencies. | ||
* @default false | ||
@@ -80,2 +80,48 @@ */ | ||
}; | ||
/** | ||
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values. | ||
* | ||
* # Examples | ||
* | ||
* - Replace the global variable `IS_PROD` with `true` | ||
* | ||
* ```js rolldown.config.js | ||
* export default defineConfig({ define: { IS_PROD: 'true' // or JSON.stringify(true) } }) | ||
* ``` | ||
* | ||
* Result: | ||
* | ||
* ```js | ||
* // Input | ||
* if (IS_PROD) { | ||
* console.log('Production mode') | ||
* } | ||
* | ||
* // After bundling | ||
* if (true) { | ||
* console.log('Production mode') | ||
* } | ||
*``` | ||
* | ||
* - Replace the property accessor `process.env.NODE_ENV` with `'production'` | ||
* | ||
* ```js rolldown.config.js | ||
* export default defineConfig({ define: { 'process.env.NODE_ENV': "'production'" } }) | ||
* ``` | ||
* | ||
* Result: | ||
* | ||
* ```js | ||
* // Input | ||
* if (process.env.NODE_ENV === 'production') { | ||
* console.log('Production mode') | ||
* } | ||
* | ||
* // After bundling | ||
* if ('production' === 'production') { | ||
* console.log('Production mode') | ||
* } | ||
* | ||
* ``` | ||
*/ | ||
define?: Record<string, string>; | ||
@@ -108,3 +154,2 @@ /** | ||
/** | ||
* JSX options. | ||
* The `false` is disabled jsx parser, it will give you a syntax error if you use jsx syntax | ||
@@ -111,0 +156,0 @@ * The `mode: preserve` is disabled jsx transformer, it perverse original jsx syntax in the output. |
@@ -10,2 +10,3 @@ import type { StringOrRegExp } from '../types/utils'; | ||
export type GlobalsFunction = (name: string) => string; | ||
export type ESTarget = 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'esnext'; | ||
export interface OutputOptions { | ||
@@ -47,2 +48,5 @@ dir?: string; | ||
minSize?: number; | ||
maxSize?: number; | ||
maxModuleSize?: number; | ||
minModuleSize?: number; | ||
minShareCount?: number; | ||
@@ -55,2 +59,5 @@ groups?: { | ||
minShareCount?: number; | ||
maxSize?: number; | ||
maxModuleSize?: number; | ||
minModuleSize?: number; | ||
}[]; | ||
@@ -67,2 +74,3 @@ }; | ||
polyfillRequire?: boolean; | ||
target?: ESTarget; | ||
} | ||
@@ -69,0 +77,0 @@ interface OverwriteOutputOptionsForCli { |
@@ -17,2 +17,9 @@ import type { BindingPluginContext } from '../binding'; | ||
} | ||
export interface EmittedChunk { | ||
type: 'chunk'; | ||
name?: string; | ||
fileName?: string; | ||
id: string; | ||
importer?: string; | ||
} | ||
export type EmittedFile = EmittedAsset; | ||
@@ -37,3 +44,3 @@ export interface PluginContextResolveOptions { | ||
resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>; | ||
emitFile(file: EmittedAsset): string; | ||
emitFile(file: EmittedAsset | EmittedChunk): string; | ||
getFileName(referenceId: string): string; | ||
@@ -40,0 +47,0 @@ getModuleInfo(id: string): ModuleInfo | null; |
import { Plugin } from './'; | ||
import { InputOptions, OutputOptions, RolldownPlugin } from '..'; | ||
export declare class PluginDriver { | ||
callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>; | ||
callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions; | ||
static callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>; | ||
static callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions; | ||
} | ||
export declare function getObjectPlugins(plugins: RolldownPlugin[]): Plugin[]; | ||
export declare function getSortedPlugins(hookName: 'options' | 'outputOptions' | 'onLog', plugins: readonly Plugin[]): Plugin[]; |
@@ -32,2 +32,11 @@ import { AssetSource } from '../utils/asset-source'; | ||
}; | ||
name: string; | ||
isEntry: boolean; | ||
isDynamicEntry: boolean; | ||
facadeModuleId: string | null; | ||
moduleIds: Array<string>; | ||
exports: Array<string>; | ||
fileName: string; | ||
imports: Array<string>; | ||
dynamicImports: Array<string>; | ||
} | ||
@@ -34,0 +43,0 @@ export interface OutputChunk { |
{ | ||
"name": "rolldown", | ||
"version": "1.0.0-beta.1-commit.f90856a", | ||
"version": "1.0.0-beta.2-commit.afd0727", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -29,2 +29,3 @@ "homepage": "https://rolldown.rs/", | ||
}, | ||
"type": "module", | ||
"main": "./dist/cjs/index.cjs", | ||
@@ -48,2 +49,7 @@ "types": "./dist/types/index.d.ts", | ||
}, | ||
"./parseAst": { | ||
"types": "./dist/types/parse-ast-index.d.ts", | ||
"require": "./dist/cjs/parse-ast-index.cjs", | ||
"import": "./dist/esm/parse-ast-index.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -84,3 +90,5 @@ }, | ||
"dependencies": { | ||
"zod": "^3.23.8" | ||
"@oxc-project/types": "0.46.0", | ||
"@valibot/to-json-schema": "1.0.0-beta.4", | ||
"valibot": "1.0.0-beta.12" | ||
}, | ||
@@ -99,2 +107,3 @@ "peerDependencies": { | ||
"@napi-rs/wasm-runtime": "^0.2.4", | ||
"@oxc-node/core": "^0.0.17", | ||
"@types/fs-extra": "^11.0.4", | ||
@@ -116,21 +125,22 @@ "@types/lodash-es": "^4.17.12", | ||
"type-fest": "^4.20.0", | ||
"typedoc": "^0.27.6", | ||
"typescript": "^5.7.3", | ||
"unbuild": "^3.0.0", | ||
"why-is-node-running": "^3.0.0", | ||
"zod-to-json-schema": "^3.23.2", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "1.0.0-beta.1-commit.f90856a" | ||
"rolldown": "1.0.0-beta.2-commit.afd0727" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-x64": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-freebsd-x64": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-darwin-arm64": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.1-commit.f90856a", | ||
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.1-commit.f90856a" | ||
"@rolldown/binding-darwin-arm64": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-darwin-x64": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-freebsd-x64": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.2-commit.afd0727", | ||
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.2-commit.afd0727" | ||
}, | ||
@@ -140,3 +150,3 @@ "scripts": { | ||
"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 --no-const-enum", | ||
"build-binding": "napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.cjs --dts binding.d.ts --no-const-enum", | ||
"build-binding:release": "pnpm build-binding --release", | ||
@@ -147,14 +157,11 @@ "build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads", | ||
"bak_build-node": "unbuild", | ||
"build-node": "tsx ./build.ts", | ||
"build-types": "tsc -p ./tsconfig.dts.json", | ||
"build-types-check": "tsc -p ./tsconfig.check.json", | ||
"build-native:debug": "run-s build-binding build-types build-node build-types-check", | ||
"build-native:release": "run-s build-binding:release build-types build-node build-types-check", | ||
"build-node": "node --import @oxc-node/core/register ./build.ts", | ||
"build-types": "tsc -p ./tsconfig.json", | ||
"build-native:debug": "run-s build-binding build-types build-node", | ||
"build-native:release": "run-s build-binding:release build-types 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": "pnpm run --filter rolldown-tests go", | ||
"test:update": "vitest run -u", | ||
"type-check": "tsc" | ||
"# Scrips for docs #": "_", | ||
"extract-options-doc": "typedoc" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
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
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
197
19283
21
Yes
763488
16
26
2
+ Added@oxc-project/types@0.46.0
+ Addedvalibot@1.0.0-beta.12
+ Added@oxc-project/types@0.46.0(transitive)
+ Added@rolldown/binding-darwin-arm64@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-darwin-x64@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-freebsd-x64@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-linux-arm64-gnu@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-linux-arm64-musl@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-linux-x64-gnu@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-linux-x64-musl@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-wasm32-wasi@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-win32-arm64-msvc@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-win32-ia32-msvc@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@rolldown/binding-win32-x64-msvc@1.0.0-beta.2-commit.afd0727(transitive)
+ Added@valibot/to-json-schema@1.0.0-beta.4(transitive)
+ Addedvalibot@1.0.0-beta.12(transitive)
- Removedzod@^3.23.8
- Removed@rolldown/binding-darwin-arm64@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-darwin-x64@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-freebsd-x64@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-linux-arm64-gnu@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-linux-arm64-musl@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-linux-x64-gnu@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-linux-x64-musl@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-wasm32-wasi@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-win32-arm64-msvc@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-win32-ia32-msvc@1.0.0-beta.1-commit.f90856a(transitive)
- Removed@rolldown/binding-win32-x64-msvc@1.0.0-beta.1-commit.f90856a(transitive)
- Removedzod@3.24.1(transitive)