rolldown 1.0.0-beta.8-commit.852c603 → 1.0.0-beta.8-commit.a720367

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cli.cjs +6 -6
  2. package/dist/cli.mjs +2 -2
  3. package/dist/experimental-index.cjs +2 -2
  4. package/dist/experimental-index.d.cts +2 -2
  5. package/dist/experimental-index.d.mts +2 -2
  6. package/dist/experimental-index.mjs +2 -2
  7. package/dist/filter-index.cjs +12 -0
  8. package/dist/{filter-expression-index.d.cts → filter-index.d.cts} +3 -3
  9. package/dist/{filter-expression-index.d.mts → filter-index.d.mts} +3 -3
  10. package/dist/filter-index.mjs +4 -0
  11. package/dist/index.cjs +3 -4
  12. package/dist/index.d.cts +3 -3
  13. package/dist/index.d.mts +3 -3
  14. package/dist/index.mjs +3 -3
  15. package/dist/parallel-plugin-worker.cjs +2 -2
  16. package/dist/parallel-plugin-worker.mjs +2 -2
  17. package/dist/parallel-plugin.d.cts +2 -2
  18. package/dist/parallel-plugin.d.mts +2 -2
  19. package/dist/parse-ast-index.d.cts +1 -1
  20. package/dist/parse-ast-index.d.mts +1 -1
  21. package/dist/shared/{binding.d-BaNmLM9c.d.mts → binding.d-BqY7GV3f.d.cts} +3 -0
  22. package/dist/shared/{binding.d-y7dWnUxd.d.cts → binding.d-DE0X2d5U.d.mts} +3 -0
  23. package/dist/shared/filter-index-DblXSw9s.cjs +255 -0
  24. package/dist/shared/filter-index-hnEzlqRW.mjs +174 -0
  25. package/dist/shared/{input-options.d-CN-JV5dt.d.mts → input-options.d-B9XQg_yc.d.mts} +23 -25
  26. package/dist/shared/{input-options.d-BHwth6VM.d.cts → input-options.d-BP-ZTUFR.d.cts} +23 -25
  27. package/dist/shared/{src-CaxK4-gB.mjs → src-B7fgzJrI.mjs} +1753 -510
  28. package/dist/shared/{src-B4f_CmD8.cjs → src-N-rxJtKK.cjs} +1754 -517
  29. package/package.json +21 -21
  30. package/dist/filter-expression-index.cjs +0 -11
  31. package/dist/filter-expression-index.mjs +0 -4
  32. package/dist/shared/filter-expression-index-BKmgnKlV.mjs +0 -69
  33. package/dist/shared/filter-expression-index-CRtoeipP.cjs +0 -119
@@ -0,0 +1,174 @@
1
+ import { __esm } from "./chunk-DUYDk_2O.mjs";
2
+
3
+ //#region src/utils/misc.ts
4
+ function arraify(value) {
5
+ return Array.isArray(value) ? value : [value];
6
+ }
7
+ function isNullish(value) {
8
+ return value === null || value === void 0;
9
+ }
10
+ function isPromiseLike(value) {
11
+ return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
12
+ }
13
+ function unimplemented(info) {
14
+ if (info) throw new Error(`unimplemented: ${info}`);
15
+ throw new Error("unimplemented");
16
+ }
17
+ function unreachable(info) {
18
+ if (info) throw new Error(`unreachable: ${info}`);
19
+ throw new Error("unreachable");
20
+ }
21
+ function unsupported(info) {
22
+ throw new Error(`UNSUPPORTED: ${info}`);
23
+ }
24
+ function noop(..._args) {}
25
+ var init_misc = __esm({ "src/utils/misc.ts"() {} });
26
+
27
+ //#endregion
28
+ //#region src/plugin/with-filter.ts
29
+ function withFilterImpl(pluginOption, filterObjectList) {
30
+ if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
31
+ if (pluginOption == false || pluginOption == null) return pluginOption;
32
+ if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
33
+ let plugin = pluginOption;
34
+ let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
35
+ if (filterObjectIndex === -1) return plugin;
36
+ let filterObject = filterObjectList[filterObjectIndex];
37
+ Object.keys(plugin).forEach((key) => {
38
+ switch (key) {
39
+ case "transform":
40
+ case "resolveId":
41
+ case "load":
42
+ if (!plugin[key]) return;
43
+ if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
44
+ else plugin[key] = {
45
+ handler: plugin[key],
46
+ filter: filterObject[key]
47
+ };
48
+ break;
49
+ default: break;
50
+ }
51
+ });
52
+ return plugin;
53
+ }
54
+ function withFilter(pluginOption, filterObject) {
55
+ return withFilterImpl(pluginOption, arraify(filterObject));
56
+ }
57
+ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
58
+ if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
59
+ for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
60
+ let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
61
+ if (typeof pattern === "string" && pattern === pluginName) return i;
62
+ else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
63
+ }
64
+ return -1;
65
+ }
66
+ var init_with_filter = __esm({ "src/plugin/with-filter.ts"() {
67
+ init_misc();
68
+ } });
69
+
70
+ //#endregion
71
+ //#region src/plugin/index.ts
72
+ var init_plugin = __esm({ "src/plugin/index.ts"() {
73
+ init_with_filter();
74
+ } });
75
+
76
+ //#endregion
77
+ //#region src/filter-index.ts
78
+ function and(...args) {
79
+ return new And(...args);
80
+ }
81
+ function or(...args) {
82
+ return new Or(...args);
83
+ }
84
+ function not(expr) {
85
+ return new Not(expr);
86
+ }
87
+ function id(pattern) {
88
+ return new Id(pattern);
89
+ }
90
+ function moduleType(pattern) {
91
+ return new ModuleType(pattern);
92
+ }
93
+ function code(pattern) {
94
+ return new Code(pattern);
95
+ }
96
+ function include(expr) {
97
+ return new Include(expr);
98
+ }
99
+ function exclude(expr) {
100
+ return new Exclude(expr);
101
+ }
102
+ var And, Or, Not, Id, ModuleType, Code, Include, Exclude;
103
+ var init_filter_index = __esm({ "src/filter-index.ts"() {
104
+ init_plugin();
105
+ And = class {
106
+ kind;
107
+ args;
108
+ constructor(...args) {
109
+ if (args.length === 0) throw new Error("`And` expects at least one operand");
110
+ this.args = args;
111
+ this.kind = "and";
112
+ }
113
+ };
114
+ Or = class {
115
+ kind;
116
+ args;
117
+ constructor(...args) {
118
+ if (args.length === 0) throw new Error("`Or` expects at least one operand");
119
+ this.args = args;
120
+ this.kind = "or";
121
+ }
122
+ };
123
+ Not = class {
124
+ kind;
125
+ expr;
126
+ constructor(expr) {
127
+ this.expr = expr;
128
+ this.kind = "not";
129
+ }
130
+ };
131
+ Id = class {
132
+ kind;
133
+ pattern;
134
+ constructor(pattern) {
135
+ this.pattern = pattern;
136
+ this.kind = "id";
137
+ }
138
+ };
139
+ ModuleType = class {
140
+ kind;
141
+ pattern;
142
+ constructor(pattern) {
143
+ this.pattern = pattern;
144
+ this.kind = "moduleType";
145
+ }
146
+ };
147
+ Code = class {
148
+ kind;
149
+ pattern;
150
+ constructor(expr) {
151
+ this.pattern = expr;
152
+ this.kind = "code";
153
+ }
154
+ };
155
+ Include = class {
156
+ kind;
157
+ expr;
158
+ constructor(expr) {
159
+ this.expr = expr;
160
+ this.kind = "include";
161
+ }
162
+ };
163
+ Exclude = class {
164
+ kind;
165
+ expr;
166
+ constructor(expr) {
167
+ this.expr = expr;
168
+ this.kind = "exclude";
169
+ }
170
+ };
171
+ } });
172
+
173
+ //#endregion
174
+ export { And, and, arraify, code, exclude, id, include, init_filter_index, init_misc, isNullish, moduleType, noop, not, or, unimplemented, unreachable, unsupported, withFilter };
@@ -1,4 +1,4 @@
1
- import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding.d-BaNmLM9c.mjs";
1
+ import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding.d-DE0X2d5U.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/log/logging.d.ts
@@ -239,7 +239,7 @@ interface OutputOptions {
239
239
  * - Type: `number`
240
240
  * - Default: `0`
241
241
  *
242
- * Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will be ignored.s
242
+ * Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will be ignored.
243
243
  */
244
244
  minSize?: number
245
245
  /**
@@ -316,6 +316,7 @@ declare class RolldownBuild {
316
316
  close(): Promise<void>;
317
317
  [Symbol.asyncDispose](): Promise<void>;
318
318
  generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutput | undefined>;
319
+ hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutput | undefined>;
319
320
  get watchFiles(): string[];
320
321
  }
321
322
 
@@ -325,7 +326,7 @@ declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
325
326
 
326
327
  //#endregion
327
328
  //#region src/options/watch-options.d.ts
328
- interface WatchOptions$1 extends InputOptions {
329
+ interface WatchOptions extends InputOptions {
329
330
  output?: OutputOptions | OutputOptions[];
330
331
  }
331
332
 
@@ -333,7 +334,7 @@ interface WatchOptions$1 extends InputOptions {
333
334
  //#region src/api/watch/watch-emitter.d.ts
334
335
  type WatcherEvent = "close" | "event" | "restart" | "change";
335
336
  type ChangeEvent$1 = "create" | "update" | "delete";
336
- type RollupWatcherEvent = {
337
+ type RolldownWatcherEvent = {
337
338
  code: "START"
338
339
  } | {
339
340
  code: "BUNDLE_START"
@@ -354,7 +355,7 @@ declare class WatcherEmitter {
354
355
  on(event: "change", listener: (id: string, change: {
355
356
  event: ChangeEvent$1
356
357
  }) => MaybePromise<void>): this;
357
- on(event: "event", listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
358
+ on(event: "event", listener: (data: RolldownWatcherEvent) => MaybePromise<void>): this;
358
359
  on(event: "restart" | "close", listener: () => MaybePromise<void>): this;
359
360
  onEvent(event: BindingWatcherEvent): Promise<void>;
360
361
  close(): Promise<void>;
@@ -363,7 +364,7 @@ type RolldownWatcher = WatcherEmitter;
363
364
 
364
365
  //#endregion
365
366
  //#region src/api/watch/index.d.ts
366
- declare const watch: (input: WatchOptions$1 | WatchOptions$1[]) => RolldownWatcher;
367
+ declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
367
368
 
368
369
  //#endregion
369
370
  //#region src/log/log-handler.d.ts
@@ -418,21 +419,19 @@ interface NormalizedOutputOptions {
418
419
  }
419
420
 
420
421
  //#endregion
421
- //#region src/filter-expression-index.d.ts
422
+ //#region src/filter-index.d.ts
422
423
  type FilterExpressionKind = FilterExpression["kind"];
423
424
  type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
424
425
  type TopLevelFilterExpression = Include | Exclude$1;
425
426
  declare class And {
426
427
  kind: "and";
427
- left: FilterExpression;
428
- right: FilterExpression;
429
- constructor(left: FilterExpression, right: FilterExpression);
428
+ args: FilterExpression[];
429
+ constructor(...args: FilterExpression[]);
430
430
  }
431
431
  declare class Or {
432
432
  kind: "or";
433
- left: FilterExpression;
434
- right: FilterExpression;
435
- constructor(left: FilterExpression, right: FilterExpression);
433
+ args: FilterExpression[];
434
+ constructor(...args: FilterExpression[]);
436
435
  }
437
436
  declare class Not {
438
437
  kind: "not";
@@ -464,8 +463,8 @@ declare class Exclude$1 {
464
463
  expr: FilterExpression;
465
464
  constructor(expr: FilterExpression);
466
465
  }
467
- declare function and(left: FilterExpression, right: FilterExpression): And;
468
- declare function or(left: FilterExpression, right: FilterExpression): Or;
466
+ declare function and(...args: FilterExpression[]): And;
467
+ declare function or(...args: FilterExpression[]): Or;
469
468
  declare function not(expr: FilterExpression): Not;
470
469
  declare function id(pattern: StringOrRegExp): Id;
471
470
  declare function moduleType(pattern: ModuleType): ModuleType$1;
@@ -478,7 +477,6 @@ declare function exclude(expr: FilterExpression): Exclude$1;
478
477
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
479
478
  include?: MaybeArray<Value>
480
479
  exclude?: MaybeArray<Value>
481
- custom?: TopLevelFilterExpression[]
482
480
  };
483
481
  interface FormalModuleTypeFilter {
484
482
  include?: ModuleType[];
@@ -520,8 +518,8 @@ interface HookFilter {
520
518
  id?: GeneralHookFilter;
521
519
  moduleType?: ModuleTypeFilter;
522
520
  code?: GeneralHookFilter;
523
- custom?: TopLevelFilterExpression[];
524
521
  }
522
+ type TUnionWithTopLevelFilterExpressionArray<T> = T | TopLevelFilterExpression[];
525
523
 
526
524
  //#endregion
527
525
  //#region src/plugin/minimal-plugin-context.d.ts
@@ -860,15 +858,15 @@ type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
860
858
  type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
861
859
  type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
862
860
  type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends "transform" ? {
863
- filter?: HookFilter
861
+ filter?: TUnionWithTopLevelFilterExpressionArray<HookFilter>
864
862
  } : K extends "load" ? {
865
- filter?: Pick<HookFilter, "id" | "custom">
863
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "id">>
866
864
  } : K extends "resolveId" ? {
867
- filter?: {
865
+ filter?: TUnionWithTopLevelFilterExpressionArray<{
868
866
  id?: GeneralHookFilter<RegExp>
869
- } & Pick<HookFilter, "custom">
867
+ }>
870
868
  } : K extends "renderChunk" ? {
871
- filter?: Pick<HookFilter, "code">
869
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "code">>
872
870
  } : {};
873
871
  type PluginHooks = { [K in keyof FunctionPluginHooks] : ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
874
872
  /**
@@ -966,7 +964,7 @@ interface JsxOptions {
966
964
  refresh?: boolean;
967
965
  development?: boolean;
968
966
  }
969
- interface WatchOptions {
967
+ interface WatcherOptions {
970
968
  skipWrite?: boolean;
971
969
  buildDelay?: number;
972
970
  notify?: {
@@ -1116,7 +1114,7 @@ interface InputOptions {
1116
1114
  */
1117
1115
  jsx?: false | "react" | "react-jsx" | "preserve" | JsxOptions;
1118
1116
  transform?: OxcTransformOption;
1119
- watch?: WatchOptions | false;
1117
+ watch?: WatcherOptions | false;
1120
1118
  dropLabels?: string[];
1121
1119
  keepNames?: boolean;
1122
1120
  checks?: ChecksOptions;
@@ -1127,4 +1125,4 @@ interface InputOptions {
1127
1125
  }
1128
1126
 
1129
1127
  //#endregion
1130
- export { AddonFunction, And as And$1, AsyncPluginHooks, BuildOptions, BuiltinPlugin as BuiltinPlugin$1, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FilterExpression, FilterExpressionKind, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TopLevelFilterExpression, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION as VERSION$1, WarningHandlerWithDefault, WatchOptions$1 as WatchOptions, and as and$1, build as build$1, buildImportAnalysisPlugin as buildImportAnalysisPlugin$1, code as code$1, defineConfig as defineConfig$1, defineParallelPlugin, dynamicImportVarsPlugin as dynamicImportVarsPlugin$1, exclude as exclude$1, id as id$1, importGlobPlugin as importGlobPlugin$1, include as include$1, isolatedDeclarationPlugin as isolatedDeclarationPlugin$1, jsonPlugin as jsonPlugin$1, loadFallbackPlugin as loadFallbackPlugin$1, manifestPlugin as manifestPlugin$1, moduleFederationPlugin as moduleFederationPlugin$1, modulePreloadPolyfillPlugin as modulePreloadPolyfillPlugin$1, moduleType as moduleType$1, not as not$1, or as or$1, reportPlugin as reportPlugin$1, rolldown as rolldown$1, viteResolvePlugin as viteResolvePlugin$1, wasmFallbackPlugin as wasmFallbackPlugin$1, wasmHelperPlugin as wasmHelperPlugin$1, watch as watch$1, withFilter as withFilter$1 };
1128
+ export { AddonFunction, And as And$1, AsyncPluginHooks, BuildOptions, BuiltinPlugin as BuiltinPlugin$1, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FilterExpression, FilterExpressionKind, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TopLevelFilterExpression, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION as VERSION$1, WarningHandlerWithDefault, WatchOptions, WatcherOptions, and as and$1, build as build$1, buildImportAnalysisPlugin as buildImportAnalysisPlugin$1, code as code$1, defineConfig as defineConfig$1, defineParallelPlugin, dynamicImportVarsPlugin as dynamicImportVarsPlugin$1, exclude as exclude$1, id as id$1, importGlobPlugin as importGlobPlugin$1, include as include$1, isolatedDeclarationPlugin as isolatedDeclarationPlugin$1, jsonPlugin as jsonPlugin$1, loadFallbackPlugin as loadFallbackPlugin$1, manifestPlugin as manifestPlugin$1, moduleFederationPlugin as moduleFederationPlugin$1, modulePreloadPolyfillPlugin as modulePreloadPolyfillPlugin$1, moduleType as moduleType$1, not as not$1, or as or$1, reportPlugin as reportPlugin$1, rolldown as rolldown$1, viteResolvePlugin as viteResolvePlugin$1, wasmFallbackPlugin as wasmFallbackPlugin$1, wasmHelperPlugin as wasmHelperPlugin$1, watch as watch$1, withFilter as withFilter$1 };
@@ -1,4 +1,4 @@
1
- import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding.d-y7dWnUxd.cjs";
1
+ import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding.d-BqY7GV3f.cjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/log/logging.d.ts
@@ -239,7 +239,7 @@ interface OutputOptions {
239
239
  * - Type: `number`
240
240
  * - Default: `0`
241
241
  *
242
- * Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will be ignored.s
242
+ * Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will be ignored.
243
243
  */
244
244
  minSize?: number
245
245
  /**
@@ -316,6 +316,7 @@ declare class RolldownBuild {
316
316
  close(): Promise<void>;
317
317
  [Symbol.asyncDispose](): Promise<void>;
318
318
  generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutput | undefined>;
319
+ hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutput | undefined>;
319
320
  get watchFiles(): string[];
320
321
  }
321
322
 
@@ -325,7 +326,7 @@ declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
325
326
 
326
327
  //#endregion
327
328
  //#region src/options/watch-options.d.ts
328
- interface WatchOptions$1 extends InputOptions {
329
+ interface WatchOptions extends InputOptions {
329
330
  output?: OutputOptions | OutputOptions[];
330
331
  }
331
332
 
@@ -333,7 +334,7 @@ interface WatchOptions$1 extends InputOptions {
333
334
  //#region src/api/watch/watch-emitter.d.ts
334
335
  type WatcherEvent = "close" | "event" | "restart" | "change";
335
336
  type ChangeEvent$1 = "create" | "update" | "delete";
336
- type RollupWatcherEvent = {
337
+ type RolldownWatcherEvent = {
337
338
  code: "START"
338
339
  } | {
339
340
  code: "BUNDLE_START"
@@ -354,7 +355,7 @@ declare class WatcherEmitter {
354
355
  on(event: "change", listener: (id: string, change: {
355
356
  event: ChangeEvent$1
356
357
  }) => MaybePromise<void>): this;
357
- on(event: "event", listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
358
+ on(event: "event", listener: (data: RolldownWatcherEvent) => MaybePromise<void>): this;
358
359
  on(event: "restart" | "close", listener: () => MaybePromise<void>): this;
359
360
  onEvent(event: BindingWatcherEvent): Promise<void>;
360
361
  close(): Promise<void>;
@@ -363,7 +364,7 @@ type RolldownWatcher = WatcherEmitter;
363
364
 
364
365
  //#endregion
365
366
  //#region src/api/watch/index.d.ts
366
- declare const watch: (input: WatchOptions$1 | WatchOptions$1[]) => RolldownWatcher;
367
+ declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
367
368
 
368
369
  //#endregion
369
370
  //#region src/log/log-handler.d.ts
@@ -418,21 +419,19 @@ interface NormalizedOutputOptions {
418
419
  }
419
420
 
420
421
  //#endregion
421
- //#region src/filter-expression-index.d.ts
422
+ //#region src/filter-index.d.ts
422
423
  type FilterExpressionKind = FilterExpression["kind"];
423
424
  type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
424
425
  type TopLevelFilterExpression = Include | Exclude$1;
425
426
  declare class And {
426
427
  kind: "and";
427
- left: FilterExpression;
428
- right: FilterExpression;
429
- constructor(left: FilterExpression, right: FilterExpression);
428
+ args: FilterExpression[];
429
+ constructor(...args: FilterExpression[]);
430
430
  }
431
431
  declare class Or {
432
432
  kind: "or";
433
- left: FilterExpression;
434
- right: FilterExpression;
435
- constructor(left: FilterExpression, right: FilterExpression);
433
+ args: FilterExpression[];
434
+ constructor(...args: FilterExpression[]);
436
435
  }
437
436
  declare class Not {
438
437
  kind: "not";
@@ -464,8 +463,8 @@ declare class Exclude$1 {
464
463
  expr: FilterExpression;
465
464
  constructor(expr: FilterExpression);
466
465
  }
467
- declare function and(left: FilterExpression, right: FilterExpression): And;
468
- declare function or(left: FilterExpression, right: FilterExpression): Or;
466
+ declare function and(...args: FilterExpression[]): And;
467
+ declare function or(...args: FilterExpression[]): Or;
469
468
  declare function not(expr: FilterExpression): Not;
470
469
  declare function id(pattern: StringOrRegExp): Id;
471
470
  declare function moduleType(pattern: ModuleType): ModuleType$1;
@@ -478,7 +477,6 @@ declare function exclude(expr: FilterExpression): Exclude$1;
478
477
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
479
478
  include?: MaybeArray<Value>
480
479
  exclude?: MaybeArray<Value>
481
- custom?: TopLevelFilterExpression[]
482
480
  };
483
481
  interface FormalModuleTypeFilter {
484
482
  include?: ModuleType[];
@@ -520,8 +518,8 @@ interface HookFilter {
520
518
  id?: GeneralHookFilter;
521
519
  moduleType?: ModuleTypeFilter;
522
520
  code?: GeneralHookFilter;
523
- custom?: TopLevelFilterExpression[];
524
521
  }
522
+ type TUnionWithTopLevelFilterExpressionArray<T> = T | TopLevelFilterExpression[];
525
523
 
526
524
  //#endregion
527
525
  //#region src/plugin/minimal-plugin-context.d.ts
@@ -860,15 +858,15 @@ type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
860
858
  type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
861
859
  type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
862
860
  type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends "transform" ? {
863
- filter?: HookFilter
861
+ filter?: TUnionWithTopLevelFilterExpressionArray<HookFilter>
864
862
  } : K extends "load" ? {
865
- filter?: Pick<HookFilter, "id" | "custom">
863
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "id">>
866
864
  } : K extends "resolveId" ? {
867
- filter?: {
865
+ filter?: TUnionWithTopLevelFilterExpressionArray<{
868
866
  id?: GeneralHookFilter<RegExp>
869
- } & Pick<HookFilter, "custom">
867
+ }>
870
868
  } : K extends "renderChunk" ? {
871
- filter?: Pick<HookFilter, "code">
869
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "code">>
872
870
  } : {};
873
871
  type PluginHooks = { [K in keyof FunctionPluginHooks] : ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
874
872
  /**
@@ -966,7 +964,7 @@ interface JsxOptions {
966
964
  refresh?: boolean;
967
965
  development?: boolean;
968
966
  }
969
- interface WatchOptions {
967
+ interface WatcherOptions {
970
968
  skipWrite?: boolean;
971
969
  buildDelay?: number;
972
970
  notify?: {
@@ -1116,7 +1114,7 @@ interface InputOptions {
1116
1114
  */
1117
1115
  jsx?: false | "react" | "react-jsx" | "preserve" | JsxOptions;
1118
1116
  transform?: OxcTransformOption;
1119
- watch?: WatchOptions | false;
1117
+ watch?: WatcherOptions | false;
1120
1118
  dropLabels?: string[];
1121
1119
  keepNames?: boolean;
1122
1120
  checks?: ChecksOptions;
@@ -1127,4 +1125,4 @@ interface InputOptions {
1127
1125
  }
1128
1126
 
1129
1127
  //#endregion
1130
- export { AddonFunction, And, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FilterExpression, FilterExpressionKind, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TopLevelFilterExpression, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions$1 as WatchOptions, and, build, buildImportAnalysisPlugin, code, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, exclude, id, importGlobPlugin, include, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleType, not, or, reportPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, withFilter };
1128
+ export { AddonFunction, And, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FilterExpression, FilterExpressionKind, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TopLevelFilterExpression, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, and, build, buildImportAnalysisPlugin, code, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, exclude, id, importGlobPlugin, include, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleType, not, or, reportPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, withFilter };