@rspack/core 0.6.5-canary-6d6fcd3-20240514084813 → 0.6.5-canary-231c64e-20240515075232

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 (145) hide show
  1. package/dist/Chunk.d.ts +1 -1
  2. package/dist/Chunk.js +1 -1
  3. package/dist/ChunkGroup.d.ts +1 -1
  4. package/dist/ChunkGroup.js +3 -3
  5. package/dist/Compilation.d.ts +46 -65
  6. package/dist/Compilation.js +128 -222
  7. package/dist/Compiler.d.ts +75 -44
  8. package/dist/Compiler.js +325 -278
  9. package/dist/ContextModuleFactory.d.ts +7 -3
  10. package/dist/ContextModuleFactory.js +2 -2
  11. package/dist/Entrypoint.d.ts +1 -1
  12. package/dist/Entrypoint.js +1 -1
  13. package/dist/ExecuteModulePlugin.js +1 -1
  14. package/dist/Module.d.ts +11 -0
  15. package/dist/Module.js +2 -2
  16. package/dist/MultiCompiler.d.ts +10 -25
  17. package/dist/MultiCompiler.js +3 -3
  18. package/dist/MultiStats.d.ts +1 -1
  19. package/dist/NormalModuleFactory.d.ts +1 -1
  20. package/dist/Stats.d.ts +2 -2
  21. package/dist/Watching.d.ts +0 -9
  22. package/dist/Watching.js +12 -2
  23. package/dist/builtin-loader/swc/index.d.ts +6 -6
  24. package/dist/builtin-loader/swc/index.js +3 -3
  25. package/dist/builtin-loader/swc/types.d.ts +2 -2
  26. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  29. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
  31. package/dist/builtin-plugin/BannerPlugin.js +1 -1
  32. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/DynamicEntryPlugin.js +1 -1
  43. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/EntryPlugin.js +1 -1
  50. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
  53. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +2 -2
  57. package/dist/builtin-plugin/HtmlRspackPlugin.js +2 -2
  58. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  59. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/JsLoaderRspackPlugin.js +1 -1
  64. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  72. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  73. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  74. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  75. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  76. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  77. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  78. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  79. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  80. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  81. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  82. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -2
  83. package/dist/builtin-plugin/SplitChunksPlugin.js +4 -4
  84. package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
  85. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  86. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  87. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
  88. package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -2
  89. package/dist/builtin-plugin/base.d.ts +1 -1
  90. package/dist/builtin-plugin/css-extract/index.d.ts +5 -4
  91. package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
  92. package/dist/builtin-plugin/css-extract/loader.js +2 -2
  93. package/dist/builtin-plugin/index.d.ts +43 -43
  94. package/dist/builtin-plugin/index.js +43 -43
  95. package/dist/config/adapter.d.ts +2 -2
  96. package/dist/config/adapterRuleUse.d.ts +2 -1
  97. package/dist/config/adapterRuleUse.js +2 -2
  98. package/dist/config/defaults.js +3 -3
  99. package/dist/config/index.d.ts +2 -2
  100. package/dist/config/index.js +2 -2
  101. package/dist/config/normalization.d.ts +1 -1
  102. package/dist/config/zod.d.ts +169 -176
  103. package/dist/config/zod.js +2 -15
  104. package/dist/container/ContainerPlugin.d.ts +1 -1
  105. package/dist/container/ContainerReferencePlugin.d.ts +1 -1
  106. package/dist/container/ContainerReferencePlugin.js +1 -1
  107. package/dist/container/ModuleFederationPlugin.js +1 -1
  108. package/dist/container/ModuleFederationPluginV1.d.ts +1 -1
  109. package/dist/container/ModuleFederationPluginV1.js +1 -1
  110. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  111. package/dist/exports.d.ts +34 -30
  112. package/dist/exports.js +21 -18
  113. package/dist/fileSystem.d.ts +12 -8
  114. package/dist/fileSystem.js +25 -48
  115. package/dist/index.d.ts +1 -1
  116. package/dist/index.js +1 -1
  117. package/dist/lite-tapable/index.d.ts +6 -0
  118. package/dist/lite-tapable/index.js +107 -1
  119. package/dist/loader-runner/index.js +13 -13
  120. package/dist/logging/Logger.d.ts +1 -1
  121. package/dist/logging/createConsoleLogger.js +0 -14
  122. package/dist/node/NodeEnvironmentPlugin.d.ts +1 -1
  123. package/dist/node/NodeEnvironmentPlugin.js +1 -1
  124. package/dist/node/nodeConsole.js +0 -4
  125. package/dist/rspack.d.ts +4 -13
  126. package/dist/rspack.js +8 -8
  127. package/dist/rspackOptionsApply.d.ts +1 -10
  128. package/dist/rspackOptionsApply.js +14 -5
  129. package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
  130. package/dist/sharing/ConsumeSharedPlugin.js +1 -1
  131. package/dist/stats/DefaultStatsFactoryPlugin.js +2 -2
  132. package/dist/stats/StatsFactory.d.ts +2 -2
  133. package/dist/stats/StatsFactory.js +0 -9
  134. package/dist/stats/StatsPrinter.d.ts +1 -1
  135. package/dist/stats/statsFactoryUtils.d.ts +1 -1
  136. package/dist/util/comparators.d.ts +1 -1
  137. package/dist/util/fs.d.ts +64 -0
  138. package/dist/util/fs.js +122 -0
  139. package/dist/util/index.d.ts +2 -1
  140. package/dist/util/index.js +16 -11
  141. package/dist/util/source.d.ts +18 -0
  142. package/dist/util/source.js +66 -0
  143. package/package.json +4 -4
  144. package/dist/util/createSource.d.ts +0 -5
  145. package/dist/util/createSource.js +0 -65
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rspackOptions = exports.externalsType = void 0;
4
4
  const zod_1 = require("../../compiled/zod");
5
- const util_1 = require("../util");
6
- const Module_1 = require("../Module");
7
5
  const Chunk_1 = require("../Chunk");
6
+ const Module_1 = require("../Module");
7
+ const util_1 = require("../util");
8
8
  //#region Name
9
9
  const name = zod_1.z.string();
10
10
  //#endregion
@@ -220,19 +220,6 @@ const resolveTsconfig = zod_1.z.strictObject({
220
220
  });
221
221
  const baseResolveOptions = zod_1.z.strictObject({
222
222
  alias: resolveAlias.optional(),
223
- /**
224
- * This is `aliasField: ["browser"]` in webpack, because no one
225
- * uses aliasField other than "browser". ---@bvanjoi
226
- */
227
- browserField: zod_1.z
228
- .boolean()
229
- .optional()
230
- .refine(val => {
231
- if (val !== undefined) {
232
- (0, util_1.deprecatedWarn)(`'resolve.browserField' has been deprecated, and will be removed in 0.6.0. Please use 'resolve.aliasField' instead.`);
233
- }
234
- return true;
235
- }),
236
223
  conditionNames: zod_1.z.array(zod_1.z.string()).optional(),
237
224
  extensions: zod_1.z.array(zod_1.z.string()).optional(),
238
225
  fallback: resolveAlias.optional(),
@@ -1,7 +1,7 @@
1
1
  import { BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
2
2
  import { RspackBuiltinPlugin } from "../builtin-plugin/base";
3
- import { EntryRuntime, FilenameTemplate, LibraryOptions } from "../config";
4
3
  import { Compiler } from "../Compiler";
4
+ import { EntryRuntime, FilenameTemplate, LibraryOptions } from "../config";
5
5
  export type ContainerPluginOptions = {
6
6
  exposes: Exposes;
7
7
  filename?: FilenameTemplate;
@@ -21,7 +21,7 @@ export type RemotesConfig = {
21
21
  export declare class ContainerReferencePlugin extends RspackBuiltinPlugin {
22
22
  name: BuiltinPluginName;
23
23
  _options: {
24
- remoteType: "promise" | "jsonp" | "import" | "amd" | "commonjs" | "commonjs2" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd" | "umd2" | "system" | "script" | "node-commonjs";
24
+ remoteType: "promise" | "commonjs" | "umd" | "amd" | "module" | "global" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs";
25
25
  remotes: [string, {
26
26
  external: string[];
27
27
  shareScope: string;
@@ -4,8 +4,8 @@ exports.ContainerReferencePlugin = void 0;
4
4
  const binding_1 = require("@rspack/binding");
5
5
  const base_1 = require("../builtin-plugin/base");
6
6
  const ExternalsPlugin_1 = require("../builtin-plugin/ExternalsPlugin");
7
- const options_1 = require("./options");
8
7
  const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
8
+ const options_1 = require("./options");
9
9
  class ContainerReferencePlugin extends base_1.RspackBuiltinPlugin {
10
10
  constructor(options) {
11
11
  var _a;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModuleFederationPlugin = void 0;
4
4
  const config_1 = require("../config");
5
- const options_1 = require("./options");
6
5
  const validate_1 = require("../util/validate");
7
6
  const ModuleFederationRuntimePlugin_1 = require("./ModuleFederationRuntimePlugin");
7
+ const options_1 = require("./options");
8
8
  class ModuleFederationPlugin {
9
9
  constructor(_options) {
10
10
  this._options = _options;
@@ -1,5 +1,5 @@
1
1
  import { Compiler } from "../Compiler";
2
- import { LibraryOptions, EntryRuntime, ExternalsType } from "../config";
2
+ import { EntryRuntime, ExternalsType, LibraryOptions } from "../config";
3
3
  import { Shared } from "../sharing/SharePlugin";
4
4
  import { Exposes } from "./ContainerPlugin";
5
5
  import { Remotes } from "./ContainerReferencePlugin";
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModuleFederationPluginV1 = void 0;
4
4
  const config_1 = require("../config");
5
5
  const SharePlugin_1 = require("../sharing/SharePlugin");
6
+ const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
6
7
  const validate_1 = require("../util/validate");
7
8
  const ContainerPlugin_1 = require("./ContainerPlugin");
8
9
  const ContainerReferencePlugin_1 = require("./ContainerReferencePlugin");
9
- const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
10
10
  class ModuleFederationPluginV1 {
11
11
  constructor(_options) {
12
12
  this._options = _options;
@@ -3,7 +3,7 @@ export declare const ModuleFederationRuntimePlugin: {
3
3
  new (): {
4
4
  name: BuiltinPluginName;
5
5
  _options: void;
6
- affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
6
+ affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
7
  raw(): import("@rspack/binding").BuiltinPlugin;
8
8
  apply(compiler: import("../Compiler").Compiler): void;
9
9
  };
package/dist/exports.d.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  declare const rspackVersion: any, webpackVersion: any;
2
- export { webpackVersion as version, rspackVersion };
3
- export { Compiler } from "./Compiler";
2
+ export { rspackVersion, webpackVersion as version };
3
+ export type { Asset, AssetInfo, Assets, CompilationParams, LogEntry } from "./Compilation";
4
4
  export { Compilation } from "./Compilation";
5
- export type { Asset, AssetInfo, Assets, LogEntry, CompilationParams } from "./Compilation";
6
- export { MultiCompiler } from "./MultiCompiler";
5
+ export { Compiler } from "./Compiler";
7
6
  export type { MultiCompilerOptions, MultiRspackOptions } from "./MultiCompiler";
7
+ export { MultiCompiler } from "./MultiCompiler";
8
8
  import { RspackOptionsApply } from "./rspackOptionsApply";
9
9
  export { RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply };
10
- export { RuntimeGlobals } from "./RuntimeGlobals";
11
- export { Stats } from "./Stats";
12
- export type { StatsCompilation, StatsAsset, StatsChunk, StatsError, StatsModule, StatsWarnings } from "./Stats";
13
- export { MultiStats } from "./MultiStats";
14
10
  export type { Chunk } from "./Chunk";
15
11
  export type { ChunkGroup } from "./ChunkGroup";
16
- export type { NormalModuleFactory } from "./NormalModuleFactory";
17
12
  export type { Module } from "./Module";
13
+ export { MultiStats } from "./MultiStats";
18
14
  export { NormalModule } from "./NormalModule";
15
+ export type { NormalModuleFactory } from "./NormalModuleFactory";
16
+ export { RuntimeGlobals } from "./RuntimeGlobals";
17
+ export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule, StatsWarnings } from "./Stats";
18
+ export { Stats } from "./Stats";
19
19
  import * as ModuleFilenameHelpers from "./lib/ModuleFilenameHelpers";
20
20
  export { ModuleFilenameHelpers };
21
21
  import Template = require("./Template");
@@ -24,7 +24,7 @@ export declare const WebpackError: ErrorConstructor;
24
24
  export type { Watching } from "./Watching";
25
25
  declare const sources: any;
26
26
  export { sources };
27
- import { getNormalizedRspackOptions, applyRspackOptionsDefaults } from "./config";
27
+ import { applyRspackOptionsDefaults, getNormalizedRspackOptions } from "./config";
28
28
  type Config = {
29
29
  getNormalizedRspackOptions: typeof getNormalizedRspackOptions;
30
30
  applyRspackOptionsDefaults: typeof applyRspackOptionsDefaults;
@@ -37,31 +37,34 @@ export declare const util: {
37
37
  createHash: (algorithm: any) => any;
38
38
  cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
39
39
  };
40
- export { registerGlobalTrace as experimental_registerGlobalTrace, cleanupGlobalTrace as experimental_cleanupGlobalTrace } from "@rspack/binding";
41
40
  export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
42
- export { BannerPlugin } from "./builtin-plugin";
41
+ export { type OutputFileSystem } from "./util/fs";
42
+ export { cleanupGlobalTrace as experimental_cleanupGlobalTrace, registerGlobalTrace as experimental_registerGlobalTrace } from "@rspack/binding";
43
43
  export type { BannerPluginArgument } from "./builtin-plugin";
44
+ export type { ProvidePluginOptions } from "./builtin-plugin";
45
+ export type { DefinePluginOptions } from "./builtin-plugin";
46
+ export type { ProgressPluginArgument } from "./builtin-plugin";
47
+ export type { EntryOptions } from "./builtin-plugin";
48
+ export { BannerPlugin } from "./builtin-plugin";
44
49
  export { IgnorePlugin, type IgnorePluginOptions } from "./builtin-plugin";
45
50
  export { ProvidePlugin } from "./builtin-plugin";
46
- export type { ProvidePluginOptions } from "./builtin-plugin";
47
51
  export { DefinePlugin } from "./builtin-plugin";
48
- export type { DefinePluginOptions } from "./builtin-plugin";
49
52
  export { ProgressPlugin } from "./builtin-plugin";
50
- export type { ProgressPluginArgument } from "./builtin-plugin";
51
53
  export { EntryPlugin } from "./builtin-plugin";
52
- export type { EntryOptions } from "./builtin-plugin";
53
54
  export { DynamicEntryPlugin } from "./builtin-plugin";
54
55
  export { ExternalsPlugin } from "./builtin-plugin";
55
56
  export { HotModuleReplacementPlugin } from "./builtin-plugin";
57
+ export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
56
58
  export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
57
59
  export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
58
- export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
59
60
  export { NormalModuleReplacementPlugin } from "./lib/NormalModuleReplacementPlugin";
60
- import NodeTemplatePlugin from "./node/NodeTemplatePlugin";
61
61
  import { NodeTargetPlugin } from "./builtin-plugin";
62
+ import NodeEnvironmentPlugin from "./node/NodeEnvironmentPlugin";
63
+ import NodeTemplatePlugin from "./node/NodeTemplatePlugin";
62
64
  interface Node {
63
65
  NodeTargetPlugin: typeof NodeTargetPlugin;
64
66
  NodeTemplatePlugin: typeof NodeTemplatePlugin;
67
+ NodeEnvironmentPlugin: typeof NodeEnvironmentPlugin;
65
68
  }
66
69
  export declare const node: Node;
67
70
  import { ElectronTargetPlugin } from "./builtin-plugin";
@@ -104,36 +107,37 @@ import { ModuleFederationPluginV1 } from "./container/ModuleFederationPluginV1";
104
107
  export type { ModuleFederationPluginV1Options } from "./container/ModuleFederationPluginV1";
105
108
  import { ContainerPlugin } from "./container/ContainerPlugin";
106
109
  import { ContainerReferencePlugin } from "./container/ContainerReferencePlugin";
107
- export type { ContainerPluginOptions, Exposes, ExposesItem, ExposesItems, ExposesObject, ExposesConfig } from "./container/ContainerPlugin";
108
- export type { ContainerReferencePluginOptions, Remotes, RemotesItem, RemotesItems, RemotesObject, RemotesConfig } from "./container/ContainerReferencePlugin";
110
+ export type { ContainerPluginOptions, Exposes, ExposesConfig, ExposesItem, ExposesItems, ExposesObject } from "./container/ContainerPlugin";
111
+ export type { ContainerReferencePluginOptions, Remotes, RemotesConfig, RemotesItem, RemotesItems, RemotesObject } from "./container/ContainerReferencePlugin";
109
112
  export declare const container: {
110
113
  ContainerPlugin: typeof ContainerPlugin;
111
114
  ContainerReferencePlugin: typeof ContainerReferencePlugin;
112
115
  ModuleFederationPlugin: typeof ModuleFederationPlugin;
113
116
  ModuleFederationPluginV1: typeof ModuleFederationPluginV1;
114
117
  };
115
- import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
116
118
  import { ConsumeSharedPlugin } from "./sharing/ConsumeSharedPlugin";
119
+ import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
117
120
  import { SharePlugin } from "./sharing/SharePlugin";
118
- export type { ProvideSharedPluginOptions, Provides, ProvidesConfig, ProvidesItem, ProvidesObject } from "./sharing/ProvideSharedPlugin";
119
- export type { ConsumeSharedPluginOptions, Consumes, ConsumesConfig, ConsumesItem, ConsumesObject } from "./sharing/ConsumeSharedPlugin";
120
- export type { SharePluginOptions, Shared, SharedConfig, SharedItem, SharedObject } from "./sharing/SharePlugin";
121
+ export type { Consumes, ConsumesConfig, ConsumeSharedPluginOptions, ConsumesItem, ConsumesObject } from "./sharing/ConsumeSharedPlugin";
122
+ export type { Provides, ProvidesConfig, ProvideSharedPluginOptions, ProvidesItem, ProvidesObject } from "./sharing/ProvideSharedPlugin";
123
+ export type { Shared, SharedConfig, SharedItem, SharedObject, SharePluginOptions } from "./sharing/SharePlugin";
121
124
  export declare const sharing: {
122
125
  ProvideSharedPlugin: typeof ProvideSharedPlugin;
123
126
  ConsumeSharedPlugin: typeof ConsumeSharedPlugin;
124
127
  SharePlugin: typeof SharePlugin;
125
128
  };
126
- export { HtmlRspackPlugin } from "./builtin-plugin";
127
129
  export type { HtmlRspackPluginOptions } from "./builtin-plugin";
128
- export { SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
129
130
  export type { SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
131
+ export type { CopyRspackPluginOptions } from "./builtin-plugin";
132
+ export type { SourceMapDevToolPluginOptions } from "./builtin-plugin";
133
+ export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
134
+ export type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from "./builtin-plugin";
135
+ export { HtmlRspackPlugin } from "./builtin-plugin";
136
+ export { SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
130
137
  export { SwcCssMinimizerRspackPlugin } from "./builtin-plugin";
131
138
  export { CopyRspackPlugin } from "./builtin-plugin";
132
- export type { CopyRspackPluginOptions } from "./builtin-plugin";
133
139
  export { SourceMapDevToolPlugin } from "./builtin-plugin";
134
140
  export { EvalSourceMapDevToolPlugin } from "./builtin-plugin";
135
- export type { SourceMapDevToolPluginOptions } from "./builtin-plugin";
136
141
  export { EvalDevToolModulePlugin } from "./builtin-plugin";
137
- export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
138
142
  export { CssExtractRspackPlugin } from "./builtin-plugin";
139
- export type { SwcLoaderOptions, SwcLoaderEnvConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderParserConfig, SwcLoaderEsParserConfig, SwcLoaderTsParserConfig, SwcLoaderTransformConfig } from "./builtin-loader/swc/index";
143
+ export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
package/dist/exports.js CHANGED
@@ -26,27 +26,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.EnvironmentPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.experimental_cleanupGlobalTrace = exports.experimental_registerGlobalTrace = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.NormalModule = exports.MultiStats = exports.Stats = exports.RuntimeGlobals = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compilation = exports.Compiler = exports.rspackVersion = exports.version = void 0;
29
+ exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.experimental_registerGlobalTrace = exports.experimental_cleanupGlobalTrace = exports.EntryOptionPlugin = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.Stats = exports.RuntimeGlobals = exports.NormalModule = exports.MultiStats = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compiler = exports.Compilation = exports.version = exports.rspackVersion = void 0;
30
30
  const { version: rspackVersion, webpackVersion } = require("../package.json");
31
31
  exports.rspackVersion = rspackVersion;
32
32
  exports.version = webpackVersion;
33
- var Compiler_1 = require("./Compiler");
34
- Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
35
33
  var Compilation_1 = require("./Compilation");
36
34
  Object.defineProperty(exports, "Compilation", { enumerable: true, get: function () { return Compilation_1.Compilation; } });
35
+ var Compiler_1 = require("./Compiler");
36
+ Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
37
37
  var MultiCompiler_1 = require("./MultiCompiler");
38
38
  Object.defineProperty(exports, "MultiCompiler", { enumerable: true, get: function () { return MultiCompiler_1.MultiCompiler; } });
39
39
  const rspackOptionsApply_1 = require("./rspackOptionsApply");
40
40
  Object.defineProperty(exports, "RspackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
41
41
  Object.defineProperty(exports, "WebpackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
42
- var RuntimeGlobals_1 = require("./RuntimeGlobals");
43
- Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return RuntimeGlobals_1.RuntimeGlobals; } });
44
- var Stats_1 = require("./Stats");
45
- Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return Stats_1.Stats; } });
46
42
  var MultiStats_1 = require("./MultiStats");
47
43
  Object.defineProperty(exports, "MultiStats", { enumerable: true, get: function () { return MultiStats_1.MultiStats; } });
48
44
  var NormalModule_1 = require("./NormalModule");
49
45
  Object.defineProperty(exports, "NormalModule", { enumerable: true, get: function () { return NormalModule_1.NormalModule; } });
46
+ var RuntimeGlobals_1 = require("./RuntimeGlobals");
47
+ Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return RuntimeGlobals_1.RuntimeGlobals; } });
48
+ var Stats_1 = require("./Stats");
49
+ Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return Stats_1.Stats; } });
50
50
  // API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
51
51
  const ModuleFilenameHelpers = __importStar(require("./lib/ModuleFilenameHelpers"));
52
52
  exports.ModuleFilenameHelpers = ModuleFilenameHelpers;
@@ -63,15 +63,14 @@ exports.config = {
63
63
  getNormalizedWebpackOptions: config_1.getNormalizedRspackOptions,
64
64
  applyWebpackOptionsDefaults: config_1.applyRspackOptionsDefaults
65
65
  };
66
- const createHash_1 = require("./util/createHash");
67
66
  const cleverMerge_1 = require("./util/cleverMerge");
67
+ const createHash_1 = require("./util/createHash");
68
68
  exports.util = { createHash: createHash_1.createHash, cleverMerge: cleverMerge_1.cachedCleverMerge };
69
- var binding_1 = require("@rspack/binding");
70
- Object.defineProperty(exports, "experimental_registerGlobalTrace", { enumerable: true, get: function () { return binding_1.registerGlobalTrace; } });
71
- Object.defineProperty(exports, "experimental_cleanupGlobalTrace", { enumerable: true, get: function () { return binding_1.cleanupGlobalTrace; } });
72
69
  var EntryOptionPlugin_1 = require("./lib/EntryOptionPlugin");
73
70
  Object.defineProperty(exports, "EntryOptionPlugin", { enumerable: true, get: function () { return __importDefault(EntryOptionPlugin_1).default; } });
74
- ///// Internal Plugins /////
71
+ var binding_1 = require("@rspack/binding");
72
+ Object.defineProperty(exports, "experimental_cleanupGlobalTrace", { enumerable: true, get: function () { return binding_1.cleanupGlobalTrace; } });
73
+ Object.defineProperty(exports, "experimental_registerGlobalTrace", { enumerable: true, get: function () { return binding_1.registerGlobalTrace; } });
75
74
  var builtin_plugin_1 = require("./builtin-plugin");
76
75
  Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return builtin_plugin_1.BannerPlugin; } });
77
76
  var builtin_plugin_2 = require("./builtin-plugin");
@@ -90,17 +89,22 @@ var builtin_plugin_8 = require("./builtin-plugin");
90
89
  Object.defineProperty(exports, "ExternalsPlugin", { enumerable: true, get: function () { return builtin_plugin_8.ExternalsPlugin; } });
91
90
  var builtin_plugin_9 = require("./builtin-plugin");
92
91
  Object.defineProperty(exports, "HotModuleReplacementPlugin", { enumerable: true, get: function () { return builtin_plugin_9.HotModuleReplacementPlugin; } });
92
+ var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
93
+ Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
93
94
  var LoaderOptionsPlugin_1 = require("./lib/LoaderOptionsPlugin");
94
95
  Object.defineProperty(exports, "LoaderOptionsPlugin", { enumerable: true, get: function () { return LoaderOptionsPlugin_1.LoaderOptionsPlugin; } });
95
96
  var LoaderTargetPlugin_1 = require("./lib/LoaderTargetPlugin");
96
97
  Object.defineProperty(exports, "LoaderTargetPlugin", { enumerable: true, get: function () { return LoaderTargetPlugin_1.LoaderTargetPlugin; } });
97
- var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
98
- Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
99
98
  var NormalModuleReplacementPlugin_1 = require("./lib/NormalModuleReplacementPlugin");
100
99
  Object.defineProperty(exports, "NormalModuleReplacementPlugin", { enumerable: true, get: function () { return NormalModuleReplacementPlugin_1.NormalModuleReplacementPlugin; } });
101
- const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
102
100
  const builtin_plugin_10 = require("./builtin-plugin");
103
- exports.node = { NodeTargetPlugin: builtin_plugin_10.NodeTargetPlugin, NodeTemplatePlugin: NodeTemplatePlugin_1.default };
101
+ const NodeEnvironmentPlugin_1 = __importDefault(require("./node/NodeEnvironmentPlugin"));
102
+ const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
103
+ exports.node = {
104
+ NodeTargetPlugin: builtin_plugin_10.NodeTargetPlugin,
105
+ NodeTemplatePlugin: NodeTemplatePlugin_1.default,
106
+ NodeEnvironmentPlugin: NodeEnvironmentPlugin_1.default
107
+ };
104
108
  const builtin_plugin_11 = require("./builtin-plugin");
105
109
  exports.electron = { ElectronTargetPlugin: builtin_plugin_11.ElectronTargetPlugin };
106
110
  const builtin_plugin_12 = require("./builtin-plugin");
@@ -129,15 +133,14 @@ exports.container = {
129
133
  ModuleFederationPlugin: ModuleFederationPlugin_1.ModuleFederationPlugin,
130
134
  ModuleFederationPluginV1: ModuleFederationPluginV1_1.ModuleFederationPluginV1
131
135
  };
132
- const ProvideSharedPlugin_1 = require("./sharing/ProvideSharedPlugin");
133
136
  const ConsumeSharedPlugin_1 = require("./sharing/ConsumeSharedPlugin");
137
+ const ProvideSharedPlugin_1 = require("./sharing/ProvideSharedPlugin");
134
138
  const SharePlugin_1 = require("./sharing/SharePlugin");
135
139
  exports.sharing = {
136
140
  ProvideSharedPlugin: ProvideSharedPlugin_1.ProvideSharedPlugin,
137
141
  ConsumeSharedPlugin: ConsumeSharedPlugin_1.ConsumeSharedPlugin,
138
142
  SharePlugin: SharePlugin_1.SharePlugin
139
143
  };
140
- ///// Rspack Postfixed Internal Plugins /////
141
144
  var builtin_plugin_19 = require("./builtin-plugin");
142
145
  Object.defineProperty(exports, "HtmlRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_19.HtmlRspackPlugin; } });
143
146
  var builtin_plugin_20 = require("./builtin-plugin");
@@ -1,9 +1,13 @@
1
- export interface ThreadsafeWritableNodeFS {
2
- writeFile: (...args: any[]) => any;
3
- removeFile: (...args: any[]) => any;
4
- mkdir: (...args: any[]) => any;
5
- mkdirp: (...args: any[]) => any;
6
- removeDirAll: (...args: any[]) => any;
1
+ /// <reference types="node" />
2
+ import { ThreadsafeNodeFS } from "@rspack/binding";
3
+ import { OutputFileSystem } from "./util/fs";
4
+ declare class ThreadsafeWritableNodeFS implements ThreadsafeNodeFS {
5
+ writeFile: (name: string, content: Buffer) => Promise<void> | void;
6
+ removeFile: (name: string) => Promise<void> | void;
7
+ mkdir: (name: string) => Promise<void> | void;
8
+ mkdirp: (name: string) => Promise<string | void> | string | void;
9
+ removeDirAll: (name: string) => Promise<string | void> | string | void;
10
+ constructor(fs?: OutputFileSystem);
11
+ static __into_binding(fs?: OutputFileSystem): ThreadsafeWritableNodeFS;
7
12
  }
8
- declare function createThreadsafeNodeFSFromRaw(fs: typeof import("fs")): ThreadsafeWritableNodeFS;
9
- export { createThreadsafeNodeFSFromRaw };
13
+ export { ThreadsafeWritableNodeFS };
@@ -3,55 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createThreadsafeNodeFSFromRaw = void 0;
6
+ exports.ThreadsafeWritableNodeFS = void 0;
7
7
  const util_1 = __importDefault(require("util"));
8
- const path_1 = require("path");
8
+ const fs_1 = require("./util/fs");
9
9
  const memoize_1 = require("./util/memoize");
10
- function createThreadsafeNodeFSFromRaw(fs) {
11
- let writeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.writeFile.bind(fs)));
12
- let removeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.unlink.bind(fs)));
13
- let mkdir = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.mkdir.bind(fs)));
14
- return {
15
- writeFile,
16
- removeFile,
17
- mkdir,
18
- mkdirp: dir => {
19
- return mkdir(dir, {
20
- recursive: true
21
- });
22
- },
23
- removeDirAll: dir => {
24
- // memfs don't support rmSync
25
- return rmrfBuild(fs)(dir);
26
- }
27
- };
28
- }
29
- exports.createThreadsafeNodeFSFromRaw = createThreadsafeNodeFSFromRaw;
30
- const rmrfBuild = (fs) => {
31
- async function exists(path) {
32
- try {
33
- await util_1.default.promisify(fs.access.bind(fs))(path);
34
- return true;
35
- }
36
- catch (_a) {
37
- return false;
10
+ const NOOP_FILESYSTEM = {
11
+ writeFile() { },
12
+ removeFile() { },
13
+ mkdir() { },
14
+ mkdirp() { },
15
+ removeDirAll() { }
16
+ };
17
+ class ThreadsafeWritableNodeFS {
18
+ constructor(fs) {
19
+ if (!fs) {
20
+ // This happens when located in a child compiler.
21
+ Object.assign(this, NOOP_FILESYSTEM);
22
+ return;
38
23
  }
24
+ this.writeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.writeFile.bind(fs)));
25
+ this.removeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.unlink.bind(fs)));
26
+ this.mkdir = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.mkdir.bind(fs)));
27
+ this.mkdirp = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs_1.mkdirp.bind(null, fs)));
28
+ this.removeDirAll = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs_1.rmrf.bind(null, fs)));
39
29
  }
40
- const rmrf = async (dir) => {
41
- if (await exists(dir)) {
42
- const files = await util_1.default.promisify(fs.readdir.bind(fs))(dir);
43
- await Promise.all(files
44
- .map(f => (0, path_1.join)(dir, f))
45
- .map(async (filePath) => {
46
- if ((await util_1.default.promisify(fs.lstat.bind(fs))(filePath)).isDirectory()) {
47
- await rmrf(filePath);
48
- }
49
- else {
50
- await util_1.default.promisify(fs.unlink.bind(fs))(filePath);
51
- }
52
- }));
53
- await util_1.default.promisify(fs.rmdir.bind(fs))(dir);
54
- }
55
- };
56
- return rmrf;
57
- };
30
+ static __into_binding(fs) {
31
+ return new this(fs);
32
+ }
33
+ }
34
+ exports.ThreadsafeWritableNodeFS = ThreadsafeWritableNodeFS;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { rspack as rspackFn } from "./rspack";
2
1
  import * as rspackExports from "./exports";
2
+ import { rspack as rspackFn } from "./rspack";
3
3
  type Rspack = typeof rspackFn & typeof rspackExports & {
4
4
  rspack: Rspack;
5
5
  webpack: Rspack;
package/dist/index.js CHANGED
@@ -27,8 +27,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.rspack = void 0;
30
- const rspack_1 = require("./rspack");
31
30
  const rspackExports = __importStar(require("./exports"));
31
+ const rspack_1 = require("./rspack");
32
32
  const fn = Object.assign(rspack_1.rspack, rspackExports);
33
33
  fn.rspack = fn;
34
34
  fn.webpack = fn;
@@ -112,6 +112,12 @@ export declare class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAddition
112
112
  tapAsync(options: Options<AdditionalOptions>, fn: FnWithCallback<T, void>): void;
113
113
  tapPromise(options: Options<AdditionalOptions>, fn: Fn<T, void>): void;
114
114
  }
115
+ export declare class AsyncSeriesWaterfallHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
116
+ constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
117
+ callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
118
+ tapAsync(options: Options<AdditionalOptions>, fn: FnWithCallback<T, void>): void;
119
+ tapPromise(options: Options<AdditionalOptions>, fn: Fn<T, void>): void;
120
+ }
115
121
  export type HookMapKey = any;
116
122
  export type HookFactory<H> = (key: HookMapKey, hook?: H) => H;
117
123
  export interface HookMapInterceptor<H> {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueriedHookMap = exports.HookMap = exports.AsyncSeriesBailHook = exports.AsyncSeriesHook = exports.AsyncParallelHook = exports.SyncBailHook = exports.SyncHook = exports.QueriedHook = exports.safeStage = exports.maxStage = exports.minStage = exports.Hook = void 0;
3
+ exports.QueriedHookMap = exports.HookMap = exports.AsyncSeriesWaterfallHook = exports.AsyncSeriesBailHook = exports.AsyncSeriesHook = exports.AsyncParallelHook = exports.SyncBailHook = exports.SyncHook = exports.QueriedHook = exports.safeStage = exports.maxStage = exports.minStage = exports.Hook = void 0;
4
4
  class Hook {
5
5
  constructor(args, name) {
6
6
  this.args = args;
@@ -578,6 +578,112 @@ class AsyncSeriesBailHook extends Hook {
578
578
  }
579
579
  }
580
580
  exports.AsyncSeriesBailHook = AsyncSeriesBailHook;
581
+ class AsyncSeriesWaterfallHook extends Hook {
582
+ constructor(args, name) {
583
+ if (!(args === null || args === void 0 ? void 0 : args.length))
584
+ throw new Error("Waterfall hooks must have at least one argument");
585
+ super(args, name);
586
+ }
587
+ callAsyncStageRange(queried, ...args) {
588
+ const { stageRange: [from, to], tapsInRange } = queried;
589
+ let data = args[0];
590
+ const cb = args[1];
591
+ if (from === exports.minStage) {
592
+ this._runCallInterceptors(data);
593
+ }
594
+ const done = () => {
595
+ this._runDoneInterceptors();
596
+ cb(null, data);
597
+ };
598
+ const error = (e) => {
599
+ this._runErrorInterceptors(e);
600
+ cb(e);
601
+ };
602
+ if (tapsInRange.length === 0)
603
+ return done();
604
+ let index = 0;
605
+ const next = () => {
606
+ const tap = tapsInRange[index];
607
+ this._runTapInterceptors(tap);
608
+ if (tap.type === "promise") {
609
+ const promise = tap.fn(data);
610
+ if (!promise || !promise.then) {
611
+ throw new Error("Tap function (tapPromise) did not return promise (returned " +
612
+ promise +
613
+ ")");
614
+ }
615
+ promise.then((r) => {
616
+ index += 1;
617
+ if (r !== undefined) {
618
+ data = r;
619
+ }
620
+ if (index === tapsInRange.length) {
621
+ done();
622
+ }
623
+ else {
624
+ next();
625
+ }
626
+ }, (e) => {
627
+ index = tapsInRange.length;
628
+ error(e);
629
+ });
630
+ }
631
+ else if (tap.type === "async") {
632
+ tap.fn(data, (e, r) => {
633
+ if (e) {
634
+ index = tapsInRange.length;
635
+ error(e);
636
+ }
637
+ else {
638
+ index += 1;
639
+ if (r !== undefined) {
640
+ data = r;
641
+ }
642
+ if (index === tapsInRange.length) {
643
+ done();
644
+ }
645
+ else {
646
+ next();
647
+ }
648
+ }
649
+ });
650
+ }
651
+ else {
652
+ let hasError = false;
653
+ try {
654
+ const r = tap.fn(data);
655
+ if (r !== undefined) {
656
+ data = r;
657
+ }
658
+ }
659
+ catch (e) {
660
+ hasError = true;
661
+ index = tapsInRange.length;
662
+ error(e);
663
+ }
664
+ if (!hasError) {
665
+ index += 1;
666
+ if (index === tapsInRange.length) {
667
+ done();
668
+ }
669
+ else {
670
+ next();
671
+ }
672
+ }
673
+ }
674
+ if (index === tapsInRange.length)
675
+ return;
676
+ };
677
+ next();
678
+ }
679
+ tapAsync(options, fn) {
680
+ this._tap("async", options, fn);
681
+ }
682
+ tapPromise(options, fn) {
683
+ this._tap("promise", options, fn);
684
+ }
685
+ }
686
+ exports.AsyncSeriesWaterfallHook = AsyncSeriesWaterfallHook;
581
687
  const defaultFactory = (key, hook) => hook;
582
688
  class HookMap {
583
689
  constructor(factory, name) {