@rspack/core 1.3.11 → 1.3.13

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 (136) hide show
  1. package/README.md +2 -2
  2. package/compiled/browserslist-load-config/index.d.ts +10 -0
  3. package/compiled/browserslist-load-config/index.js +266 -0
  4. package/compiled/browserslist-load-config/license +21 -0
  5. package/compiled/browserslist-load-config/package.json +1 -0
  6. package/compiled/watchpack/index.js +61 -19
  7. package/compiled/watchpack/package.json +1 -1
  8. package/compiled/webpack-sources/index.js +1539 -339
  9. package/compiled/webpack-sources/package.json +1 -1
  10. package/compiled/webpack-sources/types.d.ts +320 -0
  11. package/compiled/zod/dist/types/index.d.ts +3 -0
  12. package/compiled/zod/{lib → dist/types/v3}/ZodError.d.ts +7 -7
  13. package/compiled/zod/{lib → dist/types/v3}/errors.d.ts +2 -2
  14. package/compiled/zod/dist/types/v3/external.d.ts +6 -0
  15. package/compiled/zod/{lib → dist/types/v3}/helpers/errorUtil.d.ts +1 -1
  16. package/compiled/zod/{lib → dist/types/v3}/helpers/parseUtil.d.ts +4 -4
  17. package/compiled/zod/{lib → dist/types/v3}/helpers/partialUtil.d.ts +1 -1
  18. package/compiled/zod/{lib → dist/types/v3}/helpers/util.d.ts +12 -9
  19. package/compiled/zod/dist/types/v3/index.d.ts +4 -0
  20. package/compiled/zod/{lib → dist/types/v3}/locales/en.d.ts +1 -1
  21. package/compiled/zod/{lib/__tests__ → dist/types/v3/tests}/Mocker.d.ts +6 -6
  22. package/compiled/zod/{lib → dist/types/v3}/types.d.ts +118 -149
  23. package/compiled/zod/dist/types/v4/classic/checks.d.ts +1 -0
  24. package/compiled/zod/dist/types/v4/classic/coerce.d.ts +17 -0
  25. package/compiled/zod/dist/types/v4/classic/compat.d.ts +48 -0
  26. package/compiled/zod/dist/types/v4/classic/errors.d.ts +30 -0
  27. package/compiled/zod/dist/types/v4/classic/external.d.ts +8 -0
  28. package/compiled/zod/dist/types/v4/classic/index.d.ts +4 -0
  29. package/compiled/zod/dist/types/v4/classic/iso.d.ts +22 -0
  30. package/compiled/zod/dist/types/v4/classic/parse.d.ts +23 -0
  31. package/compiled/zod/dist/types/v4/classic/schemas.d.ts +661 -0
  32. package/compiled/zod/dist/types/v4/core/api.d.ts +273 -0
  33. package/compiled/zod/dist/types/v4/core/checks.d.ts +277 -0
  34. package/compiled/zod/dist/types/v4/core/config.d.ts +9 -0
  35. package/compiled/zod/dist/types/v4/core/core.d.ts +43 -0
  36. package/compiled/zod/dist/types/v4/core/doc.d.ts +14 -0
  37. package/compiled/zod/dist/types/v4/core/errors.d.ts +205 -0
  38. package/compiled/zod/dist/types/v4/core/function.d.ts +47 -0
  39. package/compiled/zod/dist/types/v4/core/index.d.ts +15 -0
  40. package/compiled/zod/dist/types/v4/core/json-schema.d.ts +100 -0
  41. package/compiled/zod/dist/types/v4/core/parse.d.ts +25 -0
  42. package/compiled/zod/dist/types/v4/core/regexes.d.ts +63 -0
  43. package/compiled/zod/dist/types/v4/core/registries.d.ts +32 -0
  44. package/compiled/zod/dist/types/v4/core/schemas.d.ts +983 -0
  45. package/compiled/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
  46. package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
  47. package/compiled/zod/dist/types/v4/core/util.d.ts +186 -0
  48. package/compiled/zod/dist/types/v4/core/versions.d.ts +5 -0
  49. package/compiled/zod/dist/types/v4/core/zsf.d.ts +91 -0
  50. package/compiled/zod/dist/types/v4/index.d.ts +3 -0
  51. package/compiled/zod/dist/types/v4/locales/ar.d.ts +7 -0
  52. package/compiled/zod/dist/types/v4/locales/az.d.ts +7 -0
  53. package/compiled/zod/dist/types/v4/locales/be.d.ts +7 -0
  54. package/compiled/zod/dist/types/v4/locales/ca.d.ts +7 -0
  55. package/compiled/zod/dist/types/v4/locales/cs.d.ts +7 -0
  56. package/compiled/zod/dist/types/v4/locales/de.d.ts +7 -0
  57. package/compiled/zod/dist/types/v4/locales/en.d.ts +7 -0
  58. package/compiled/zod/dist/types/v4/locales/es.d.ts +7 -0
  59. package/compiled/zod/dist/types/v4/locales/fa.d.ts +7 -0
  60. package/compiled/zod/dist/types/v4/locales/fi.d.ts +7 -0
  61. package/compiled/zod/dist/types/v4/locales/fr.d.ts +7 -0
  62. package/compiled/zod/dist/types/v4/locales/frCA.d.ts +7 -0
  63. package/compiled/zod/dist/types/v4/locales/he.d.ts +7 -0
  64. package/compiled/zod/dist/types/v4/locales/hu.d.ts +7 -0
  65. package/compiled/zod/dist/types/v4/locales/id.d.ts +7 -0
  66. package/compiled/zod/dist/types/v4/locales/index.d.ts +34 -0
  67. package/compiled/zod/dist/types/v4/locales/it.d.ts +7 -0
  68. package/compiled/zod/dist/types/v4/locales/ja.d.ts +7 -0
  69. package/compiled/zod/dist/types/v4/locales/ko.d.ts +7 -0
  70. package/compiled/zod/dist/types/v4/locales/mk.d.ts +7 -0
  71. package/compiled/zod/dist/types/v4/locales/ms.d.ts +7 -0
  72. package/compiled/zod/dist/types/v4/locales/no.d.ts +7 -0
  73. package/compiled/zod/dist/types/v4/locales/ota.d.ts +7 -0
  74. package/compiled/zod/dist/types/v4/locales/pl.d.ts +7 -0
  75. package/compiled/zod/dist/types/v4/locales/pt.d.ts +7 -0
  76. package/compiled/zod/dist/types/v4/locales/ru.d.ts +7 -0
  77. package/compiled/zod/dist/types/v4/locales/sl.d.ts +7 -0
  78. package/compiled/zod/dist/types/v4/locales/ta.d.ts +7 -0
  79. package/compiled/zod/dist/types/v4/locales/th.d.ts +7 -0
  80. package/compiled/zod/dist/types/v4/locales/tr.d.ts +7 -0
  81. package/compiled/zod/dist/types/v4/locales/ua.d.ts +7 -0
  82. package/compiled/zod/dist/types/v4/locales/ur.d.ts +7 -0
  83. package/compiled/zod/dist/types/v4/locales/vi.d.ts +7 -0
  84. package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +7 -0
  85. package/compiled/zod/dist/types/v4/locales/zh-tw.d.ts +7 -0
  86. package/compiled/zod/dist/types/v4/mini/checks.d.ts +1 -0
  87. package/compiled/zod/dist/types/v4/mini/coerce.d.ts +7 -0
  88. package/compiled/zod/dist/types/v4/mini/external.d.ts +7 -0
  89. package/compiled/zod/dist/types/v4/mini/index.d.ts +3 -0
  90. package/compiled/zod/dist/types/v4/mini/iso.d.ts +22 -0
  91. package/compiled/zod/dist/types/v4/mini/parse.d.ts +1 -0
  92. package/compiled/zod/dist/types/v4/mini/schemas.d.ts +407 -0
  93. package/compiled/zod/index.js +555 -602
  94. package/compiled/zod/license +1 -1
  95. package/compiled/zod/package.json +1 -1
  96. package/compiled/zod/v3/index.d.ts +1 -0
  97. package/compiled/zod/v4/core/index.d.ts +1 -0
  98. package/compiled/zod/v4/index.d.ts +1 -0
  99. package/compiled/zod/v4/locales/en.d.ts +2 -0
  100. package/compiled/zod/v4/locales/index.d.ts +1 -0
  101. package/compiled/zod/v4-mini/index.d.ts +1 -0
  102. package/dist/Compilation.d.ts +2 -2
  103. package/dist/Compiler.d.ts +1 -1
  104. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -3
  105. package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
  106. package/dist/builtin-plugin/index.d.ts +1 -0
  107. package/dist/config/browserslistTargetHandler.d.ts +0 -6
  108. package/dist/exports.d.ts +2 -0
  109. package/dist/index.d.ts +0 -1
  110. package/dist/index.js +187 -254
  111. package/dist/node/NodeWatchFileSystem.d.ts +2 -2
  112. package/dist/stats/statsFactoryUtils.d.ts +24 -0
  113. package/dist/trace/index.d.ts +5 -0
  114. package/module.d.ts +53 -21
  115. package/package.json +12 -14
  116. package/compiled/browserslist/index.d.ts +0 -1
  117. package/compiled/browserslist/index.js +0 -2123
  118. package/compiled/browserslist/license +0 -20
  119. package/compiled/browserslist/package.json +0 -1
  120. package/compiled/webpack-sources/index.d.ts +0 -130
  121. package/compiled/zod/index.d.ts +0 -2
  122. package/compiled/zod/lib/external.d.ts +0 -6
  123. package/compiled/zod/lib/index.d.ts +0 -4
  124. package/dist/setupEnv.d.ts +0 -1
  125. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/datetime.d.ts +0 -0
  126. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/discriminatedUnion.d.ts +0 -0
  127. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/index.d.ts +0 -0
  128. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/ipv4.d.ts +0 -0
  129. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/object.d.ts +0 -0
  130. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/primitives.d.ts +0 -0
  131. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/realworld.d.ts +0 -0
  132. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/string.d.ts +0 -0
  133. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/union.d.ts +0 -0
  134. /package/compiled/zod/{lib → dist/types/v3}/helpers/enumUtil.d.ts +0 -0
  135. /package/compiled/zod/{lib → dist/types/v3}/helpers/typeAliases.d.ts +0 -0
  136. /package/compiled/zod/{lib → dist/types/v3}/standard-schema.d.ts +0 -0
@@ -7,12 +7,12 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import Watchpack from "../../compiled/watchpack";
10
+ import type Watchpack from "../../compiled/watchpack";
11
11
  import type { FileSystemInfoEntry, InputFileSystem, WatchFileSystem, Watcher } from "../util/fs";
12
12
  export default class NodeWatchFileSystem implements WatchFileSystem {
13
13
  inputFileSystem: InputFileSystem;
14
14
  watcherOptions: Watchpack.WatchOptions;
15
- watcher: Watchpack;
15
+ watcher?: Watchpack;
16
16
  constructor(inputFileSystem: InputFileSystem);
17
17
  watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
18
18
  }
@@ -141,8 +141,32 @@ export type KnownStatsModuleIssuer = {
141
141
  id?: string | number | null;
142
142
  };
143
143
  export type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
144
+ export declare enum StatsErrorCode {
145
+ /**
146
+ * Warning generated when either builtin `SwcJsMinimizer` or `LightningcssMinimizer` fails to minify the code.
147
+ */
148
+ ChunkMinificationError = "ChunkMinificationError",
149
+ /**
150
+ * Warning generated when either builtin `SwcJsMinimizer` or `LightningcssMinimizer` fails to minify the code.
151
+ */
152
+ ChunkMinificationWarning = "ChunkMinificationWarning",
153
+ /**
154
+ * Error generated when a module is failed to be parsed
155
+ */
156
+ ModuleParseError = "ModuleParseError",
157
+ /**
158
+ * Warning generated when a module is failed to be parsed
159
+ */
160
+ ModuleParseWarning = "ModuleParseWarning",
161
+ /**
162
+ * Error generated when a module is failed to be built (i.e being built by a
163
+ * loader)
164
+ */
165
+ ModuleBuildError = "ModuleBuildError"
166
+ }
144
167
  export type KnownStatsError = {
145
168
  message: string;
169
+ code?: StatsErrorCode | string;
146
170
  chunkName?: string;
147
171
  chunkEntry?: boolean;
148
172
  chunkInitial?: boolean;
@@ -23,6 +23,11 @@ export declare class JavaScriptTracer {
23
23
  static counter: number;
24
24
  static initJavaScriptTrace(layer: string, output: string): Promise<void>;
25
25
  static initCpuProfiler(): void;
26
+ /**
27
+ *
28
+ * @param isEnd true means we are at the end of tracing,and can append ']' to close the json
29
+ * @returns
30
+ */
26
31
  static cleanupJavaScriptTrace(): Promise<void>;
27
32
  static getTs(): number;
28
33
  static getCommonEv(): {
package/module.d.ts CHANGED
@@ -9,6 +9,8 @@
9
9
  */
10
10
 
11
11
  declare namespace Rspack {
12
+ type ModuleId = string | number;
13
+
12
14
  type DeclinedEvent =
13
15
  | {
14
16
  type: "declined";
@@ -169,6 +171,49 @@ declare namespace Rspack {
169
171
  id: string | number;
170
172
  (dependency: string): unknown;
171
173
  }
174
+
175
+ interface Module {
176
+ exports: any;
177
+ id: ModuleId;
178
+ loaded: boolean;
179
+ parents: NodeJS.Module["id"][] | null | undefined;
180
+ children: NodeJS.Module["id"][];
181
+ hot?: Hot | undefined;
182
+ }
183
+
184
+ interface RequireResolve {
185
+ (id: string): ModuleId;
186
+ }
187
+
188
+ interface Require {
189
+ (path: string): any;
190
+ <T>(path: string): T;
191
+ (paths: string[], callback: (...modules: any[]) => void): void;
192
+ resolve: NodeJS.RequireResolve;
193
+ ensure(
194
+ dependencies: string[],
195
+ callback: (require: (module: string) => void) => void,
196
+ errorCallback?: (error: Error) => void,
197
+ chunkName?: string
198
+ ): Rspack.Context;
199
+ context(
200
+ request: string,
201
+ includeSubdirectories?: boolean,
202
+ filter?: RegExp,
203
+ mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"
204
+ ): Rspack.Context;
205
+ resolveWeak(dependency: string): void;
206
+ cache: {
207
+ [id: string]: NodeJS.Module | undefined;
208
+ };
209
+ }
210
+
211
+ interface Process {
212
+ env: {
213
+ [key: string]: any;
214
+ NODE_ENV: 'development' | 'production' | (string & {});
215
+ };
216
+ }
172
217
  }
173
218
 
174
219
  interface ImportMeta {
@@ -220,25 +265,12 @@ declare var __non_webpack_require__: (id: any) => unknown;
220
265
  declare const __system_context__: object;
221
266
 
222
267
  declare namespace NodeJS {
223
- interface Module {
224
- hot: Rspack.Hot;
225
- }
226
-
227
- interface Require {
228
- ensure(
229
- dependencies: string[],
230
- callback: (require: (module: string) => void) => void,
231
- errorCallback?: (error: Error) => void,
232
- chunkName?: string
233
- ): void;
234
- context(
235
- request: string,
236
- includeSubdirectories?: boolean,
237
- filter?: RegExp,
238
- mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"
239
- ): Rspack.Context;
240
- include(dependency: string): void;
241
- resolveWeak(dependency: string): void;
242
- onError?: (error: Error) => void;
243
- }
268
+ interface Module extends Rspack.Module {}
269
+ interface Require extends Rspack.Require {}
270
+ interface RequireResolve extends Rspack.RequireResolve {}
271
+ interface Process extends Rspack.Process {}
244
272
  }
273
+
274
+ declare var module: NodeJS.Module;
275
+ declare var require: NodeJS.Require;
276
+ declare var process: NodeJS.Process;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -29,7 +29,7 @@
29
29
  "engines": {
30
30
  "node": ">=16.0.0"
31
31
  },
32
- "homepage": "https://rspack.dev",
32
+ "homepage": "https://rspack.rs",
33
33
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
34
34
  "repository": {
35
35
  "type": "git",
@@ -37,29 +37,27 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@swc/core": "1.11.24",
40
+ "@rslib/core": "0.9.0",
41
+ "@swc/core": "1.11.29",
41
42
  "@swc/types": "0.1.21",
42
- "@rslib/core": "0.7.0",
43
43
  "@types/graceful-fs": "4.1.9",
44
44
  "@types/watchpack": "^2.4.4",
45
- "@types/webpack-sources": "3.2.3",
46
- "browserslist": "^4.24.5",
45
+ "browserslist-load-config": "^1.0.0",
47
46
  "enhanced-resolve": "5.18.1",
48
47
  "graceful-fs": "^4.2.11",
49
48
  "prebundle": "^1.3.3",
49
+ "tinypool": "^1.0.2",
50
50
  "tsx": "^4.19.4",
51
51
  "typescript": "^5.8.3",
52
- "watchpack": "^2.4.2",
53
- "webpack-sources": "3.2.3",
54
- "zod": "^3.24.4",
55
- "zod-validation-error": "3.4.1",
56
- "tinypool": "^1.0.2"
52
+ "watchpack": "^2.4.4",
53
+ "webpack-sources": "3.3.0",
54
+ "zod": "^3.25.31",
55
+ "zod-validation-error": "3.4.1"
57
56
  },
58
57
  "dependencies": {
59
- "@module-federation/runtime-tools": "0.13.1",
58
+ "@module-federation/runtime-tools": "0.14.3",
60
59
  "@rspack/lite-tapable": "1.0.1",
61
- "caniuse-lite": "^1.0.30001718",
62
- "@rspack/binding": "1.3.11"
60
+ "@rspack/binding": "1.3.13"
63
61
  },
64
62
  "peerDependencies": {
65
63
  "@swc/helpers": ">=0.5.1"
@@ -1 +0,0 @@
1
- export = any;