@ohos-ports/rspack-core 1.1.8-beta.1

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 (243) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +25 -0
  3. package/compiled/@swc/types/index.d.ts +1962 -0
  4. package/compiled/@swc/types/index.js +19 -0
  5. package/compiled/@swc/types/license +201 -0
  6. package/compiled/@swc/types/package.json +1 -0
  7. package/compiled/browserslist/index.d.ts +1 -0
  8. package/compiled/browserslist/index.js +2053 -0
  9. package/compiled/browserslist/license +20 -0
  10. package/compiled/browserslist/package.json +1 -0
  11. package/compiled/enhanced-resolve/CachedInputFileSystem.js +664 -0
  12. package/compiled/enhanced-resolve/index.d.ts +1123 -0
  13. package/compiled/enhanced-resolve/license +20 -0
  14. package/compiled/enhanced-resolve/package.json +1 -0
  15. package/compiled/graceful-fs/index.d.ts +13 -0
  16. package/compiled/graceful-fs/index.js +1063 -0
  17. package/compiled/graceful-fs/license +15 -0
  18. package/compiled/graceful-fs/package.json +1 -0
  19. package/compiled/watchpack/index.d.ts +216 -0
  20. package/compiled/watchpack/index.js +2075 -0
  21. package/compiled/watchpack/license +20 -0
  22. package/compiled/watchpack/package.json +1 -0
  23. package/compiled/webpack-sources/index.d.ts +130 -0
  24. package/compiled/webpack-sources/index.js +3520 -0
  25. package/compiled/webpack-sources/license +21 -0
  26. package/compiled/webpack-sources/package.json +1 -0
  27. package/compiled/zod/index.d.ts +1733 -0
  28. package/compiled/zod/index.js +4405 -0
  29. package/compiled/zod/license +21 -0
  30. package/compiled/zod/package.json +1 -0
  31. package/dist/Chunk.d.ts +40 -0
  32. package/dist/ChunkGraph.d.ts +12 -0
  33. package/dist/ChunkGroup.d.ts +26 -0
  34. package/dist/Compilation.d.ts +421 -0
  35. package/dist/Compiler.d.ts +154 -0
  36. package/dist/ContextModuleFactory.d.ts +13 -0
  37. package/dist/DependenciesBlock.d.ts +10 -0
  38. package/dist/Dependency.d.ts +11 -0
  39. package/dist/Entrypoint.d.ts +8 -0
  40. package/dist/ErrorHelpers.d.ts +16 -0
  41. package/dist/ExecuteModulePlugin.d.ts +4 -0
  42. package/dist/FileSystem.d.ts +29 -0
  43. package/dist/FileSystemInfo.d.ts +5 -0
  44. package/dist/Module.d.ts +93 -0
  45. package/dist/ModuleGraph.d.ts +10 -0
  46. package/dist/ModuleTypeConstants.d.ts +93 -0
  47. package/dist/MultiCompiler.d.ts +68 -0
  48. package/dist/MultiStats.d.ts +22 -0
  49. package/dist/MultiWatching.d.ts +26 -0
  50. package/dist/NormalModule.d.ts +12 -0
  51. package/dist/NormalModuleFactory.d.ts +20 -0
  52. package/dist/Resolver.d.ts +16 -0
  53. package/dist/ResolverFactory.d.ts +14 -0
  54. package/dist/RspackError.d.ts +8 -0
  55. package/dist/RuleSetCompiler.d.ts +9 -0
  56. package/dist/RuntimeGlobals.d.ts +324 -0
  57. package/dist/RuntimeModule.d.ts +32 -0
  58. package/dist/Stats.d.ts +17 -0
  59. package/dist/Template.d.ts +77 -0
  60. package/dist/Watching.d.ts +35 -0
  61. package/dist/builtin-loader/index.d.ts +1 -0
  62. package/dist/builtin-loader/lightningcss/index.d.ts +95 -0
  63. package/dist/builtin-loader/swc/index.d.ts +3 -0
  64. package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
  65. package/dist/builtin-loader/swc/types.d.ts +19 -0
  66. package/dist/builtin-plugin/APIPlugin.d.ts +10 -0
  67. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +10 -0
  68. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +10 -0
  69. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +10 -0
  70. package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
  71. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +15 -0
  72. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +10 -0
  73. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +10 -0
  74. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +10 -0
  75. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +15 -0
  76. package/dist/builtin-plugin/CssModulesPlugin.d.ts +10 -0
  77. package/dist/builtin-plugin/DataUriPlugin.d.ts +10 -0
  78. package/dist/builtin-plugin/DefinePlugin.d.ts +17 -0
  79. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +10 -0
  80. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +8 -0
  81. package/dist/builtin-plugin/DllEntryPlugin.d.ts +13 -0
  82. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  83. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
  84. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +10 -0
  85. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +10 -0
  86. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
  87. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +10 -0
  88. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +10 -0
  89. package/dist/builtin-plugin/EntryPlugin.d.ts +27 -0
  90. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
  91. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
  92. package/dist/builtin-plugin/ExternalsPlugin.d.ts +10 -0
  93. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +10 -0
  94. package/dist/builtin-plugin/FileUriPlugin.d.ts +10 -0
  95. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +10 -0
  96. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +10 -0
  97. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +10 -0
  98. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
  99. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +112 -0
  100. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +10 -0
  101. package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
  102. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +10 -0
  103. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
  104. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +11 -0
  105. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +10 -0
  106. package/dist/builtin-plugin/LibManifestPlugin.d.ts +18 -0
  107. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +33 -0
  108. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +15 -0
  109. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +10 -0
  110. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +10 -0
  111. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +10 -0
  112. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +8 -0
  113. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +10 -0
  114. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +10 -0
  115. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +10 -0
  116. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +8 -0
  117. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +10 -0
  118. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +10 -0
  119. package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
  120. package/dist/builtin-plugin/ProvidePlugin.d.ts +11 -0
  121. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +10 -0
  122. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +10 -0
  123. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +10 -0
  124. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
  125. package/dist/builtin-plugin/RuntimePlugin.d.ts +10 -0
  126. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +10 -0
  127. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +20 -0
  128. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
  129. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
  130. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +213 -0
  131. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +10 -0
  132. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
  133. package/dist/builtin-plugin/WorkerPlugin.d.ts +13 -0
  134. package/dist/builtin-plugin/base.d.ts +22 -0
  135. package/dist/builtin-plugin/css-extract/index.d.ts +23 -0
  136. package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
  137. package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
  138. package/dist/builtin-plugin/index.d.ts +71 -0
  139. package/dist/builtin-plugin/lazy-compilation/backend.d.ts +46 -0
  140. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +24 -0
  141. package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +13 -0
  142. package/dist/config/adapter.d.ts +10 -0
  143. package/dist/config/adapterRuleUse.d.ts +157 -0
  144. package/dist/config/browserslistTargetHandler.d.ts +21 -0
  145. package/dist/config/defaults.d.ts +12 -0
  146. package/dist/config/index.d.ts +5 -0
  147. package/dist/config/normalization.d.ts +128 -0
  148. package/dist/config/target.d.ts +89 -0
  149. package/dist/config/types.d.ts +2136 -0
  150. package/dist/config/utils.d.ts +16 -0
  151. package/dist/config/zod.d.ts +4090 -0
  152. package/dist/container/ContainerPlugin.d.ts +40 -0
  153. package/dist/container/ContainerReferencePlugin.d.ts +33 -0
  154. package/dist/container/ModuleFederationPlugin.d.ts +13 -0
  155. package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
  156. package/dist/container/ModuleFederationRuntimePlugin.d.ts +10 -0
  157. package/dist/container/options.d.ts +3 -0
  158. package/dist/cssExtractHmr.js +224 -0
  159. package/dist/cssExtractLoader.js +278 -0
  160. package/dist/error/ConcurrentCompilationError.d.ts +14 -0
  161. package/dist/exports.d.ts +167 -0
  162. package/dist/index.d.ts +10 -0
  163. package/dist/index.js +20251 -0
  164. package/dist/lib/AbstractMethodError.d.ts +24 -0
  165. package/dist/lib/Cache.d.ts +65 -0
  166. package/dist/lib/CacheFacade.d.ts +167 -0
  167. package/dist/lib/DllPlugin.d.ts +42 -0
  168. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  169. package/dist/lib/EntryOptionPlugin.d.ts +33 -0
  170. package/dist/lib/EnvironmentPlugin.d.ts +22 -0
  171. package/dist/lib/HookWebpackError.d.ts +40 -0
  172. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  173. package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
  174. package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
  175. package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
  176. package/dist/lib/NormalModuleReplacementPlugin.d.ts +29 -0
  177. package/dist/lib/WebpackError.d.ts +23 -0
  178. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  179. package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
  180. package/dist/lib/cache/mergeEtags.d.ts +17 -0
  181. package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
  182. package/dist/loader-runner/index.d.ts +40 -0
  183. package/dist/loader-runner/loadLoader.d.ts +11 -0
  184. package/dist/logging/Logger.d.ts +61 -0
  185. package/dist/logging/createConsoleLogger.d.ts +35 -0
  186. package/dist/logging/truncateArgs.d.ts +16 -0
  187. package/dist/moduleFederationDefaultRuntime.js +1 -0
  188. package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
  189. package/dist/node/NodeTemplatePlugin.d.ts +18 -0
  190. package/dist/node/NodeWatchFileSystem.d.ts +18 -0
  191. package/dist/node/nodeConsole.d.ts +15 -0
  192. package/dist/rspack.d.ts +16 -0
  193. package/dist/rspackOptionsApply.d.ts +4 -0
  194. package/dist/runtime/cssExtractHmr.d.ts +4 -0
  195. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
  196. package/dist/sharing/ConsumeSharedPlugin.d.ts +41 -0
  197. package/dist/sharing/ProvideSharedPlugin.d.ts +34 -0
  198. package/dist/sharing/SharePlugin.d.ts +51 -0
  199. package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
  200. package/dist/sharing/utils.d.ts +1 -0
  201. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +4 -0
  202. package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
  203. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
  204. package/dist/stats/StatsFactory.d.ts +57 -0
  205. package/dist/stats/StatsPrinter.d.ts +57 -0
  206. package/dist/stats/statsFactoryUtils.d.ts +295 -0
  207. package/dist/util/ArrayQueue.d.ts +45 -0
  208. package/dist/util/AssetInfo.d.ts +7 -0
  209. package/dist/util/MergeCaller.d.ts +9 -0
  210. package/dist/util/SizeFormatHelpers.d.ts +10 -0
  211. package/dist/util/SplitChunkSize.d.ts +5 -0
  212. package/dist/util/assertNotNil.d.ts +1 -0
  213. package/dist/util/assetCondition.d.ts +2 -0
  214. package/dist/util/asyncLib.d.ts +54 -0
  215. package/dist/util/bindingVersionCheck.d.ts +5 -0
  216. package/dist/util/cleverMerge.d.ts +54 -0
  217. package/dist/util/comparators.d.ts +20 -0
  218. package/dist/util/createHash.d.ts +16 -0
  219. package/dist/util/createReadonlyMap.d.ts +1 -0
  220. package/dist/util/fake.d.ts +9 -0
  221. package/dist/util/fs.d.ts +342 -0
  222. package/dist/util/hash/BatchedHash.d.ts +29 -0
  223. package/dist/util/hash/index.d.ts +17 -0
  224. package/dist/util/hash/md4.d.ts +11 -0
  225. package/dist/util/hash/wasm-hash.d.ts +52 -0
  226. package/dist/util/hash/xxhash64.d.ts +11 -0
  227. package/dist/util/identifier.d.ts +79 -0
  228. package/dist/util/index.d.ts +19 -0
  229. package/dist/util/memoize.d.ts +3 -0
  230. package/dist/util/smartGrouping.d.ts +21 -0
  231. package/dist/util/source.d.ts +7 -0
  232. package/dist/util/validate.d.ts +6 -0
  233. package/hot/dev-server.js +75 -0
  234. package/hot/emitter.js +21 -0
  235. package/hot/lazy-compilation-node.js +50 -0
  236. package/hot/lazy-compilation-web.js +83 -0
  237. package/hot/log-apply-result.js +49 -0
  238. package/hot/log.js +79 -0
  239. package/hot/only-dev-server.js +103 -0
  240. package/hot/poll.js +40 -0
  241. package/hot/signal.js +66 -0
  242. package/module.d.ts +244 -0
  243. package/package.json +55 -0
@@ -0,0 +1,57 @@
1
+ import { HookMap, SyncBailHook, SyncWaterfallHook } from "@rspack/lite-tapable";
2
+ import type { StatsAsset, StatsChunk, StatsChunkGroup, StatsCompilation, StatsModule, StatsModuleReason } from "./statsFactoryUtils";
3
+ type PrintedElement = {
4
+ element: string;
5
+ content: string;
6
+ };
7
+ type KnownStatsPrinterContext = {
8
+ type?: string;
9
+ compilation?: StatsCompilation;
10
+ chunkGroup?: StatsChunkGroup;
11
+ asset?: StatsAsset;
12
+ module?: StatsModule;
13
+ chunk?: StatsChunk;
14
+ moduleReason?: StatsModuleReason;
15
+ bold?: (str: string) => string;
16
+ yellow?: (str: string) => string;
17
+ red?: (str: string) => string;
18
+ green?: (str: string) => string;
19
+ magenta?: (str: string) => string;
20
+ cyan?: (str: string) => string;
21
+ formatFilename?: (file: string, oversize?: boolean) => string;
22
+ formatModuleId?: (id: string) => string;
23
+ formatChunkId?: ((id: string, direction?: "parent" | "child" | "sibling") => string) | undefined;
24
+ formatSize?: (size: number) => string;
25
+ formatDateTime?: (dateTime: number) => string;
26
+ formatFlag?: (flag: string) => string;
27
+ formatTime?: (time: number, boldQuantity?: boolean) => string;
28
+ chunkGroupKind?: string;
29
+ };
30
+ export type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
31
+ export declare class StatsPrinter {
32
+ private _levelHookCache;
33
+ private _inPrint;
34
+ hooks: Readonly<{
35
+ sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true | void>>;
36
+ printElements: HookMap<SyncBailHook<[PrintedElement[], StatsPrinterContext], string>>;
37
+ sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
38
+ getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
39
+ printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
40
+ print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
41
+ result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
42
+ }>;
43
+ constructor();
44
+ /**
45
+ * get all level hooks
46
+ */
47
+ private _getAllLevelHooks;
48
+ private _forEachLevel;
49
+ private _forEachLevelWaterfall;
50
+ print(type: string, object: {
51
+ [key: string]: any;
52
+ }, baseContext?: {
53
+ [key: string]: any;
54
+ }): string;
55
+ private _print;
56
+ }
57
+ export {};
@@ -0,0 +1,295 @@
1
+ import type * as binding from "@rspack/binding";
2
+ import type { JsOriginRecord } from "@rspack/binding";
3
+ import type { Compilation } from "../Compilation";
4
+ import type { StatsOptions } from "../config";
5
+ import { type Comparator } from "../util/comparators";
6
+ import type { StatsFactory, StatsFactoryContext } from "./StatsFactory";
7
+ export type KnownStatsChunkGroup = {
8
+ name?: string;
9
+ chunks?: (string | number)[];
10
+ assets?: {
11
+ name: string;
12
+ size?: number;
13
+ }[];
14
+ filteredAssets?: number;
15
+ assetsSize?: number;
16
+ auxiliaryAssets?: {
17
+ name: string;
18
+ size?: number;
19
+ }[];
20
+ filteredAuxiliaryAssets?: number;
21
+ auxiliaryAssetsSize?: number;
22
+ children?: {
23
+ preload?: StatsChunkGroup[];
24
+ prefetch?: StatsChunkGroup[];
25
+ };
26
+ childAssets?: {
27
+ preload?: string[];
28
+ prefetch?: string[];
29
+ };
30
+ isOverSizeLimit?: boolean;
31
+ };
32
+ export type KnownStatsChunk = {
33
+ type: string;
34
+ rendered: boolean;
35
+ initial: boolean;
36
+ entry: boolean;
37
+ reason?: string;
38
+ size: number;
39
+ sizes?: Record<string, number>;
40
+ names?: string[];
41
+ idHints?: string[];
42
+ runtime?: string[];
43
+ files?: string[];
44
+ auxiliaryFiles?: string[];
45
+ hash?: string;
46
+ childrenByOrder?: Record<string, (string | number)[]>;
47
+ id?: string | number;
48
+ siblings?: (string | number)[];
49
+ parents?: (string | number)[];
50
+ children?: (string | number)[];
51
+ modules?: StatsModule[];
52
+ filteredModules?: number;
53
+ origins?: StatsChunkOrigin[];
54
+ };
55
+ export type KnownAssetInfo = {
56
+ immutable?: boolean;
57
+ minimized?: boolean;
58
+ fullhash?: string | string[];
59
+ chunkhash?: string | string[];
60
+ contenthash?: string | string[];
61
+ sourceFilename?: string;
62
+ copied?: boolean;
63
+ size?: number;
64
+ development?: boolean;
65
+ hotModuleReplacement?: boolean;
66
+ javascriptModule?: boolean;
67
+ related?: Record<string, string | string[]>;
68
+ };
69
+ export type AssetInfo = KnownAssetInfo & Record<string, any>;
70
+ export type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
71
+ export type KnownStatsAsset = {
72
+ type: string;
73
+ name: string;
74
+ info: AssetInfo;
75
+ size: number;
76
+ emitted: boolean;
77
+ cached: boolean;
78
+ related?: StatsAsset[];
79
+ chunkNames?: (string | number)[];
80
+ chunkIdHints?: (string | number)[];
81
+ chunks?: (string | null | undefined)[];
82
+ auxiliaryChunkNames?: (string | number)[];
83
+ auxiliaryChunks?: (string | null | undefined)[];
84
+ auxiliaryChunkIdHints?: (string | number)[];
85
+ filteredRelated?: number;
86
+ isOverSizeLimit?: boolean;
87
+ };
88
+ export type StatsAsset = KnownStatsAsset & Record<string, any>;
89
+ export type StatsChunk = KnownStatsChunk & Record<string, any>;
90
+ export type KnownStatsModule = {
91
+ type: string;
92
+ moduleType: string;
93
+ layer?: string;
94
+ identifier?: string;
95
+ name?: string;
96
+ nameForCondition?: string;
97
+ index?: number;
98
+ index2?: number;
99
+ preOrderIndex?: number;
100
+ postOrderIndex?: number;
101
+ size: number;
102
+ sizes: Record<string, number>;
103
+ cacheable?: boolean;
104
+ built: boolean;
105
+ codeGenerated: boolean;
106
+ buildTimeExecuted: boolean;
107
+ cached: boolean;
108
+ optional?: boolean;
109
+ orphan?: boolean;
110
+ id?: string;
111
+ issuerId?: string;
112
+ chunks?: string[];
113
+ assets?: string[];
114
+ dependent?: boolean;
115
+ issuer?: string;
116
+ issuerName?: string;
117
+ issuerPath?: StatsModuleIssuer[];
118
+ failed?: boolean;
119
+ errors?: number;
120
+ warnings?: number;
121
+ profile?: StatsProfile;
122
+ reasons?: StatsModuleReason[];
123
+ usedExports?: boolean | string[] | null;
124
+ providedExports?: string[] | null;
125
+ optimizationBailout?: string[] | null;
126
+ depth?: number;
127
+ modules?: StatsModule[];
128
+ filteredModules?: number;
129
+ source?: string | Buffer;
130
+ };
131
+ export type StatsProfile = KnownStatsProfile & Record<string, any>;
132
+ export type KnownStatsProfile = {
133
+ total: number;
134
+ resolving: number;
135
+ building: number;
136
+ };
137
+ export type StatsModule = KnownStatsModule & Record<string, any>;
138
+ export type KnownStatsModuleIssuer = {
139
+ identifier?: string;
140
+ name?: string;
141
+ id?: string | number;
142
+ };
143
+ export type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
144
+ export type KnownStatsError = {
145
+ message: string;
146
+ chunkName?: string;
147
+ chunkEntry?: boolean;
148
+ chunkInitial?: boolean;
149
+ file?: string;
150
+ moduleIdentifier?: string;
151
+ moduleName?: string;
152
+ loc?: string;
153
+ chunkId?: string | number;
154
+ moduleId?: string | number;
155
+ moduleTrace?: StatsModuleTraceItem[];
156
+ details?: any;
157
+ stack?: string;
158
+ };
159
+ export type StatsError = KnownStatsError & Record<string, any>;
160
+ export type StatsModuleTraceItem = {
161
+ originIdentifier?: string;
162
+ originName?: string;
163
+ moduleIdentifier?: string;
164
+ moduleName?: string;
165
+ originId?: string;
166
+ moduleId?: string;
167
+ };
168
+ export type KnownStatsModuleReason = {
169
+ moduleIdentifier?: string;
170
+ module?: string;
171
+ moduleName?: string;
172
+ resolvedModuleIdentifier?: string;
173
+ resolvedModule?: string;
174
+ type?: string;
175
+ userRequest?: string;
176
+ moduleId?: string | null;
177
+ resolvedModuleId?: string | number | null;
178
+ };
179
+ export type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
180
+ export type KnownStatsChunkOrigin = {
181
+ module: string;
182
+ moduleIdentifier: string;
183
+ moduleName: string;
184
+ loc: string;
185
+ request: string;
186
+ moduleId?: string;
187
+ };
188
+ export type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
189
+ export type KnownStatsCompilation = {
190
+ /**
191
+ * webpack version.
192
+ * this is a hack to be compatible with plugin which detect webpack's version
193
+ */
194
+ version?: string;
195
+ /** rspack version */
196
+ rspackVersion?: string;
197
+ name?: string;
198
+ hash?: string;
199
+ time?: number;
200
+ builtAt?: number;
201
+ publicPath?: string;
202
+ outputPath?: string;
203
+ assets?: StatsAsset[];
204
+ assetsByChunkName?: Record<string, string[]>;
205
+ chunks?: StatsChunk[];
206
+ modules?: StatsModule[];
207
+ entrypoints?: Record<string, StatsChunkGroup>;
208
+ namedChunkGroups?: Record<string, StatsChunkGroup>;
209
+ errors?: StatsError[];
210
+ errorsCount?: number;
211
+ warnings?: StatsError[];
212
+ warningsCount?: number;
213
+ filteredModules?: number;
214
+ children?: StatsCompilation[];
215
+ logging?: Record<string, StatsLogging>;
216
+ };
217
+ export type StatsCompilation = KnownStatsCompilation & Record<string, any>;
218
+ export type StatsLogging = KnownStatsLogging & Record<string, any>;
219
+ export type KnownStatsLogging = {
220
+ entries: StatsLoggingEntry[];
221
+ filteredEntries: number;
222
+ debug: boolean;
223
+ };
224
+ export type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
225
+ export type KnownStatsLoggingEntry = {
226
+ type: string;
227
+ message: string;
228
+ trace?: string[] | undefined;
229
+ children?: StatsLoggingEntry[] | undefined;
230
+ args?: any[] | undefined;
231
+ time?: number | undefined;
232
+ };
233
+ type ExtractorsByOption<T, O> = {
234
+ [x: string]: (object: O, data: T, context: StatsFactoryContext, options: any, factory: StatsFactory) => void;
235
+ };
236
+ export type PreprocessedAsset = binding.JsStatsAsset & {
237
+ type: string;
238
+ related: PreprocessedAsset[];
239
+ info: binding.JsStatsAssetInfo;
240
+ };
241
+ export type SimpleExtractors = {
242
+ compilation: ExtractorsByOption<Compilation, StatsCompilation>;
243
+ asset$visible: ExtractorsByOption<PreprocessedAsset, StatsAsset>;
244
+ asset: ExtractorsByOption<PreprocessedAsset, StatsAsset>;
245
+ chunkGroup: ExtractorsByOption<{
246
+ name: string;
247
+ chunkGroup: binding.JsStatsChunkGroup;
248
+ }, StatsChunkGroup>;
249
+ module: ExtractorsByOption<binding.JsStatsModule, StatsModule>;
250
+ module$visible: ExtractorsByOption<binding.JsStatsModule, StatsModule>;
251
+ moduleIssuer: ExtractorsByOption<binding.JsStatsModuleIssuer, StatsModuleIssuer>;
252
+ profile: ExtractorsByOption<binding.JsStatsModuleProfile, StatsProfile>;
253
+ moduleReason: ExtractorsByOption<binding.JsStatsModuleReason, StatsModuleReason>;
254
+ chunk: ExtractorsByOption<binding.JsStatsChunk, KnownStatsChunk>;
255
+ chunkOrigin: ExtractorsByOption<JsOriginRecord, StatsChunkOrigin>;
256
+ error: ExtractorsByOption<binding.JsStatsError, StatsError>;
257
+ warning: ExtractorsByOption<binding.JsStatsWarning, StatsError>;
258
+ moduleTraceItem: ExtractorsByOption<binding.JsStatsModuleTrace, StatsModuleTraceItem>;
259
+ };
260
+ export declare const uniqueArray: <T, I>(items: Iterable<T>, selector: (arg: T) => Iterable<I>) => I[];
261
+ export declare const uniqueOrderedArray: <T, I>(items: Iterable<T>, selector: (arg: T) => Iterable<I>, comparator: Comparator) => I[];
262
+ export declare const iterateConfig: (config: Record<string, Record<string, Function>>, options: StatsOptions, fn: (a1: string, a2: Function) => void) => void;
263
+ type Child = {
264
+ children?: ItemChildren;
265
+ filteredChildren?: number;
266
+ };
267
+ type ItemChildren = Child[];
268
+ export declare const getTotalItems: (children: ItemChildren) => number;
269
+ export declare const collapse: (children: ItemChildren) => Child[];
270
+ export declare const spaceLimited: (itemsAndGroups: ItemChildren, max: number, filteredChildrenLineReserved?: boolean) => {
271
+ children: any;
272
+ filteredChildren: any;
273
+ };
274
+ export declare const countWithChildren: (compilation: Compilation, getItems: (compilation: Compilation, key: string) => any[]) => number;
275
+ export declare const sortByField: (field: string) => ((a1: Object, a2: Object) => number);
276
+ export declare const assetGroup: (children: StatsAsset[]) => {
277
+ size: number;
278
+ };
279
+ export declare const moduleGroup: (children: {
280
+ size: number;
281
+ sizes: Record<string, number>;
282
+ }[]) => {
283
+ size: number;
284
+ sizes: Record<string, number>;
285
+ };
286
+ export declare const mergeToObject: (items: {
287
+ [key: string]: any;
288
+ name: string;
289
+ }[]) => Object;
290
+ export declare function resolveStatsMillisecond(s: binding.JsStatsMillisecond): number;
291
+ export declare const errorsSpaceLimit: (errors: StatsError[], max: number) => {
292
+ errors: StatsError[];
293
+ filtered: number;
294
+ };
295
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/ArrayQueue.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ /**
11
+ * @template T
12
+ */
13
+ declare class ArrayQueue<T> {
14
+ _list: Array<T>;
15
+ _listReversed: Array<T>;
16
+ constructor(items?: T[]);
17
+ /**
18
+ * Returns the number of elements in this queue.
19
+ * @returns {number} The number of elements in this queue.
20
+ */
21
+ get length(): number;
22
+ /**
23
+ * Empties the queue.
24
+ */
25
+ clear(): void;
26
+ /**
27
+ * Appends the specified element to this queue.
28
+ * @param {T} item The element to add.
29
+ * @returns {void}
30
+ */
31
+ enqueue(item: T): void;
32
+ /**
33
+ * Retrieves and removes the head of this queue.
34
+ * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty.
35
+ */
36
+ dequeue(): T | undefined;
37
+ /**
38
+ * Finds and removes an item
39
+ * @param {T} item the item
40
+ * @returns {void}
41
+ */
42
+ delete(item: T): void;
43
+ [Symbol.iterator](): Generator<T, void, unknown>;
44
+ }
45
+ export default ArrayQueue;
@@ -0,0 +1,7 @@
1
+ import type { JsAssetInfo as JsAssetInfoBinding } from "@rspack/binding";
2
+ export type AssetInfo = Partial<Omit<JsAssetInfoBinding, "extras">> & Record<string, any>;
3
+ declare class JsAssetInfo {
4
+ static __from_binding(jsAssetInfo: JsAssetInfoBinding): AssetInfo;
5
+ static __to_binding(assetInfo?: AssetInfo): JsAssetInfoBinding;
6
+ }
7
+ export { JsAssetInfo };
@@ -0,0 +1,9 @@
1
+ type CallFn<D> = (args: D[]) => void;
2
+ export default class MergeCaller<D> {
3
+ private callArgs;
4
+ private callFn;
5
+ constructor(fn: CallFn<D>);
6
+ private finalCall;
7
+ push(...data: D[]): void;
8
+ }
9
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ export declare const formatSize: (size: unknown) => string;
@@ -0,0 +1,5 @@
1
+ import type { RawSplitChunkSizes } from "@rspack/binding";
2
+ declare class JsSplitChunkSizes {
3
+ static __to_binding(sizes?: number | Record<string, number>): number | RawSplitChunkSizes | undefined;
4
+ }
5
+ export { JsSplitChunkSizes };
@@ -0,0 +1 @@
1
+ export declare function assertNotNill(value: unknown): asserts value;
@@ -0,0 +1,2 @@
1
+ export type AssetCondition = string | RegExp;
2
+ export type AssetConditions = AssetCondition | AssetCondition[];
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/suguru03/neo-async/blob/master/lib/async.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Suguru Motegi
7
+ * Copyright (c) 2014-2018 Suguru Motegi
8
+ * https://github.com/suguru03/neo-async/blob/master/LICENSE
9
+ */
10
+ export interface Dictionary<T> {
11
+ [key: string]: T;
12
+ }
13
+ export type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
14
+ export type ErrorCallback<E = Error> = (err?: E | null) => void;
15
+ export type AsyncIterator<T, E = Error> = (item: T, callback: ErrorCallback<E>) => void;
16
+ /**
17
+ * @example
18
+ *
19
+ * // array
20
+ * var order = [];
21
+ * var array = [1, 3, 2];
22
+ * var iterator = function(num, done) {
23
+ * setTimeout(function() {
24
+ * order.push(num);
25
+ * done();
26
+ * }, num * 10);
27
+ * };
28
+ * asyncLib.each(array, iterator, function(err, res) {
29
+ * console.log(res); // undefined
30
+ * console.log(order); // [1, 2, 3]
31
+ * });
32
+ *
33
+ * @example
34
+ *
35
+ * // break
36
+ * var order = [];
37
+ * var array = [1, 3, 2];
38
+ * var iterator = function(num, done) {
39
+ * setTimeout(function() {
40
+ * order.push(num);
41
+ * done(null, num !== 2);
42
+ * }, num * 10);
43
+ * };
44
+ * asyncLib.each(array, iterator, function(err, res) {
45
+ * console.log(res); // undefined
46
+ * console.log(order); // [1, 2]
47
+ * });
48
+ *
49
+ */
50
+ declare function each<T, E = Error>(collection: IterableCollection<T>, iterator: AsyncIterator<T, E>, originalCallback: ErrorCallback<E>): void;
51
+ declare const _default: {
52
+ each: typeof each;
53
+ };
54
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Check if these version matches:
3
+ * `@rspack/core`, `@rspack/binding`, `@rspack/binding-<platform>-<arch>-<abi>`
4
+ */
5
+ export declare const checkVersion: () => Error | null;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/cleverMerge.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ type Obj = Record<PropertyKey, any>;
11
+ export declare const DELETE: unique symbol;
12
+ /**
13
+ * Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
14
+ * @example
15
+ * // performs cleverMerge(first, second), stores the result in WeakMap and returns result
16
+ * cachedCleverMerge({a: 1}, {a: 2})
17
+ * {a: 2}
18
+ * // when same arguments passed, gets the result from WeakMap and returns it.
19
+ * cachedCleverMerge({a: 1}, {a: 2})
20
+ * {a: 2}
21
+ * @param first first object
22
+ * @param second second object
23
+ * @returns merged object of first and second object
24
+ */
25
+ export declare const cachedCleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
26
+ /**
27
+ * @param obj object
28
+ * @param property property
29
+ * @param value assignment value
30
+ * @returns new object
31
+ */
32
+ export declare const cachedSetProperty: (obj: Obj, property: string, value: string | number | boolean) => Obj;
33
+ /**
34
+ * Merges two objects. Objects are deeply clever merged.
35
+ * Arrays might reference the old value with "...".
36
+ * Non-object values take preference over object values.
37
+ * @param first first object
38
+ * @param second second object
39
+ * @returns merged object of first and second object
40
+ */
41
+ export declare const cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
42
+ /**
43
+ * @param obj the object
44
+ * @returns the object without operations like "..." or DELETE
45
+ */
46
+ export declare const removeOperations: <O extends Obj>(obj: O) => O;
47
+ /**
48
+ * @param obj the object
49
+ * @param byProperty the by description
50
+ * @param values values
51
+ * @returns object with merged byProperty
52
+ */
53
+ export declare const resolveByProperty: <O extends Obj | null, P extends PropertyKey>(obj: O, byProperty: P, ...values: any[]) => Omit<O, P> | undefined;
54
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import type { JsStatsChunk as Chunk } from "@rspack/binding";
11
+ import type { ChunkGroup } from "../ChunkGroup";
12
+ export type Comparator = <T>(arg0: T, arg1: T) => -1 | 0 | 1;
13
+ type Selector<A, B> = (input: A) => B;
14
+ export declare const concatComparators: (...comps: Array<Comparator>) => Comparator;
15
+ export declare const compareIds: <T = string | number>(a: T, b: T) => -1 | 0 | 1;
16
+ export declare const compareChunksById: (a: Chunk, b: Chunk) => -1 | 0 | 1;
17
+ export declare const compareChunkGroupsByIndex: (a: ChunkGroup, b: ChunkGroup) => -1 | 0 | 1;
18
+ export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
19
+ export declare const compareNumbers: (a: number, b: number) => 0 | 1 | -1;
20
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/createHash.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import Hash from "./hash";
11
+ /**
12
+ * Creates a hash by name or function
13
+ * @param algorithm the algorithm name or a constructor creating a hash
14
+ * @returns the hash
15
+ */
16
+ export declare const createHash: (algorithm: "debug" | "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
@@ -0,0 +1 @@
1
+ export declare function createReadonlyMap<T>(obj: Pick<ReadonlyMap<string, T>, "get" | "keys">): ReadonlyMap<string, Readonly<T>>;
@@ -0,0 +1,9 @@
1
+ export type FakeHook<T> = T & {
2
+ _fakeHook: true;
3
+ };
4
+ export declare function createFakeCompilationDependencies(getDeps: () => string[], addDeps: (deps: string[]) => void): {
5
+ [Symbol.iterator](): Generator<string, void, unknown>;
6
+ has(dep: string): boolean;
7
+ add: (dep: string) => void;
8
+ addAll: (deps: Iterable<string>) => void;
9
+ };