@rspack/core 1.3.10 → 1.3.12

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 (134) hide show
  1. package/compiled/watchpack/index.js +56 -18
  2. package/compiled/watchpack/package.json +1 -1
  3. package/compiled/webpack-sources/index.js +1539 -339
  4. package/compiled/webpack-sources/package.json +1 -1
  5. package/compiled/webpack-sources/types.d.ts +320 -0
  6. package/compiled/zod/dist/types/index.d.ts +3 -0
  7. package/compiled/zod/{lib → dist/types/v3}/ZodError.d.ts +7 -7
  8. package/compiled/zod/{lib → dist/types/v3}/errors.d.ts +2 -2
  9. package/compiled/zod/dist/types/v3/external.d.ts +6 -0
  10. package/compiled/zod/{lib → dist/types/v3}/helpers/errorUtil.d.ts +1 -1
  11. package/compiled/zod/{lib → dist/types/v3}/helpers/parseUtil.d.ts +4 -4
  12. package/compiled/zod/{lib → dist/types/v3}/helpers/partialUtil.d.ts +1 -1
  13. package/compiled/zod/{lib → dist/types/v3}/helpers/util.d.ts +12 -9
  14. package/compiled/zod/dist/types/v3/index.d.ts +4 -0
  15. package/compiled/zod/{lib → dist/types/v3}/locales/en.d.ts +1 -1
  16. package/compiled/zod/{lib/__tests__ → dist/types/v3/tests}/Mocker.d.ts +6 -6
  17. package/compiled/zod/{lib → dist/types/v3}/types.d.ts +118 -149
  18. package/compiled/zod/dist/types/v4/classic/checks.d.ts +1 -0
  19. package/compiled/zod/dist/types/v4/classic/coerce.d.ts +17 -0
  20. package/compiled/zod/dist/types/v4/classic/compat.d.ts +48 -0
  21. package/compiled/zod/dist/types/v4/classic/errors.d.ts +30 -0
  22. package/compiled/zod/dist/types/v4/classic/external.d.ts +8 -0
  23. package/compiled/zod/dist/types/v4/classic/index.d.ts +4 -0
  24. package/compiled/zod/dist/types/v4/classic/iso.d.ts +22 -0
  25. package/compiled/zod/dist/types/v4/classic/parse.d.ts +23 -0
  26. package/compiled/zod/dist/types/v4/classic/schemas.d.ts +657 -0
  27. package/compiled/zod/dist/types/v4/core/api.d.ts +273 -0
  28. package/compiled/zod/dist/types/v4/core/checks.d.ts +277 -0
  29. package/compiled/zod/dist/types/v4/core/config.d.ts +9 -0
  30. package/compiled/zod/dist/types/v4/core/core.d.ts +43 -0
  31. package/compiled/zod/dist/types/v4/core/doc.d.ts +14 -0
  32. package/compiled/zod/dist/types/v4/core/errors.d.ts +205 -0
  33. package/compiled/zod/dist/types/v4/core/function.d.ts +47 -0
  34. package/compiled/zod/dist/types/v4/core/index.d.ts +15 -0
  35. package/compiled/zod/dist/types/v4/core/json-schema.d.ts +100 -0
  36. package/compiled/zod/dist/types/v4/core/parse.d.ts +25 -0
  37. package/compiled/zod/dist/types/v4/core/regexes.d.ts +62 -0
  38. package/compiled/zod/dist/types/v4/core/registries.d.ts +32 -0
  39. package/compiled/zod/dist/types/v4/core/schemas.d.ts +983 -0
  40. package/compiled/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
  41. package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
  42. package/compiled/zod/dist/types/v4/core/util.d.ts +186 -0
  43. package/compiled/zod/dist/types/v4/core/versions.d.ts +5 -0
  44. package/compiled/zod/dist/types/v4/core/zsf.d.ts +91 -0
  45. package/compiled/zod/dist/types/v4/index.d.ts +3 -0
  46. package/compiled/zod/dist/types/v4/locales/ar.d.ts +7 -0
  47. package/compiled/zod/dist/types/v4/locales/az.d.ts +7 -0
  48. package/compiled/zod/dist/types/v4/locales/be.d.ts +7 -0
  49. package/compiled/zod/dist/types/v4/locales/ca.d.ts +7 -0
  50. package/compiled/zod/dist/types/v4/locales/cs.d.ts +7 -0
  51. package/compiled/zod/dist/types/v4/locales/de.d.ts +7 -0
  52. package/compiled/zod/dist/types/v4/locales/en.d.ts +7 -0
  53. package/compiled/zod/dist/types/v4/locales/es.d.ts +7 -0
  54. package/compiled/zod/dist/types/v4/locales/fa.d.ts +7 -0
  55. package/compiled/zod/dist/types/v4/locales/fi.d.ts +7 -0
  56. package/compiled/zod/dist/types/v4/locales/fr.d.ts +7 -0
  57. package/compiled/zod/dist/types/v4/locales/frCA.d.ts +7 -0
  58. package/compiled/zod/dist/types/v4/locales/he.d.ts +7 -0
  59. package/compiled/zod/dist/types/v4/locales/hu.d.ts +7 -0
  60. package/compiled/zod/dist/types/v4/locales/id.d.ts +7 -0
  61. package/compiled/zod/dist/types/v4/locales/index.d.ts +34 -0
  62. package/compiled/zod/dist/types/v4/locales/it.d.ts +7 -0
  63. package/compiled/zod/dist/types/v4/locales/ja.d.ts +7 -0
  64. package/compiled/zod/dist/types/v4/locales/ko.d.ts +7 -0
  65. package/compiled/zod/dist/types/v4/locales/mk.d.ts +7 -0
  66. package/compiled/zod/dist/types/v4/locales/ms.d.ts +7 -0
  67. package/compiled/zod/dist/types/v4/locales/no.d.ts +7 -0
  68. package/compiled/zod/dist/types/v4/locales/ota.d.ts +7 -0
  69. package/compiled/zod/dist/types/v4/locales/pl.d.ts +7 -0
  70. package/compiled/zod/dist/types/v4/locales/pt.d.ts +7 -0
  71. package/compiled/zod/dist/types/v4/locales/ru.d.ts +7 -0
  72. package/compiled/zod/dist/types/v4/locales/sl.d.ts +7 -0
  73. package/compiled/zod/dist/types/v4/locales/ta.d.ts +7 -0
  74. package/compiled/zod/dist/types/v4/locales/th.d.ts +7 -0
  75. package/compiled/zod/dist/types/v4/locales/tr.d.ts +7 -0
  76. package/compiled/zod/dist/types/v4/locales/ua.d.ts +7 -0
  77. package/compiled/zod/dist/types/v4/locales/ur.d.ts +7 -0
  78. package/compiled/zod/dist/types/v4/locales/vi.d.ts +7 -0
  79. package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +7 -0
  80. package/compiled/zod/dist/types/v4/locales/zh-tw.d.ts +7 -0
  81. package/compiled/zod/dist/types/v4/mini/checks.d.ts +1 -0
  82. package/compiled/zod/dist/types/v4/mini/coerce.d.ts +7 -0
  83. package/compiled/zod/dist/types/v4/mini/external.d.ts +7 -0
  84. package/compiled/zod/dist/types/v4/mini/index.d.ts +3 -0
  85. package/compiled/zod/dist/types/v4/mini/iso.d.ts +22 -0
  86. package/compiled/zod/dist/types/v4/mini/parse.d.ts +1 -0
  87. package/compiled/zod/dist/types/v4/mini/schemas.d.ts +407 -0
  88. package/compiled/zod/index.js +555 -602
  89. package/compiled/zod/license +1 -1
  90. package/compiled/zod/package.json +1 -1
  91. package/compiled/zod/v3/index.d.ts +1 -0
  92. package/compiled/zod/v4/core/index.d.ts +1 -0
  93. package/compiled/zod/v4/index.d.ts +1 -0
  94. package/compiled/zod/v4/locales/en.d.ts +2 -0
  95. package/compiled/zod/v4/locales/index.d.ts +1 -0
  96. package/compiled/zod/v4-mini/index.d.ts +1 -0
  97. package/dist/Compilation.d.ts +7 -7
  98. package/dist/Compiler.d.ts +1 -1
  99. package/dist/Diagnostics.d.ts +7 -0
  100. package/dist/Module.d.ts +9 -0
  101. package/dist/RspackError.d.ts +3 -0
  102. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -3
  103. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +19 -0
  104. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  105. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
  106. package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
  107. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +4 -4
  108. package/dist/builtin-plugin/index.d.ts +2 -0
  109. package/dist/config/zod.d.ts +6 -6
  110. package/dist/exports.d.ts +3 -0
  111. package/dist/index.d.ts +0 -1
  112. package/dist/index.js +392 -232
  113. package/dist/node/NodeWatchFileSystem.d.ts +2 -2
  114. package/dist/trace/index.d.ts +9 -3
  115. package/dist/trace/traceHookPlugin.d.ts +5 -0
  116. package/dist/worker.js +1 -1
  117. package/package.json +8 -9
  118. package/compiled/webpack-sources/index.d.ts +0 -130
  119. package/compiled/zod/index.d.ts +0 -2
  120. package/compiled/zod/lib/external.d.ts +0 -6
  121. package/compiled/zod/lib/index.d.ts +0 -4
  122. package/dist/setupEnv.d.ts +0 -1
  123. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/datetime.d.ts +0 -0
  124. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/discriminatedUnion.d.ts +0 -0
  125. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/index.d.ts +0 -0
  126. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/ipv4.d.ts +0 -0
  127. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/object.d.ts +0 -0
  128. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/primitives.d.ts +0 -0
  129. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/realworld.d.ts +0 -0
  130. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/string.d.ts +0 -0
  131. /package/compiled/zod/{lib → dist/types/v3}/benchmarks/union.d.ts +0 -0
  132. /package/compiled/zod/{lib → dist/types/v3}/helpers/enumUtil.d.ts +0 -0
  133. /package/compiled/zod/{lib → dist/types/v3}/helpers/typeAliases.d.ts +0 -0
  134. /package/compiled/zod/{lib → dist/types/v3}/standard-schema.d.ts +0 -0
@@ -138,7 +138,7 @@ module.exports = function (glob, opts) {
138
138
 
139
139
  /***/ }),
140
140
 
141
- /***/ 877:
141
+ /***/ 150:
142
142
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
143
143
 
144
144
  "use strict";
@@ -152,7 +152,7 @@ const EventEmitter = (__nccwpck_require__(434).EventEmitter);
152
152
  const fs = __nccwpck_require__(923);
153
153
  const path = __nccwpck_require__(928);
154
154
 
155
- const watchEventSource = __nccwpck_require__(200);
155
+ const watchEventSource = __nccwpck_require__(59);
156
156
 
157
157
  const EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
158
158
 
@@ -933,7 +933,7 @@ function ensureFsAccuracy(mtime) {
933
933
 
934
934
  /***/ }),
935
935
 
936
- /***/ 898:
936
+ /***/ 189:
937
937
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
938
938
 
939
939
  "use strict";
@@ -1048,7 +1048,7 @@ module.exports = LinkResolver;
1048
1048
 
1049
1049
  /***/ }),
1050
1050
 
1051
- /***/ 673:
1051
+ /***/ 952:
1052
1052
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1053
1053
 
1054
1054
  "use strict";
@@ -1059,7 +1059,7 @@ module.exports = LinkResolver;
1059
1059
 
1060
1060
 
1061
1061
  const path = __nccwpck_require__(928);
1062
- const DirectoryWatcher = __nccwpck_require__(877);
1062
+ const DirectoryWatcher = __nccwpck_require__(150);
1063
1063
 
1064
1064
  class WatcherManager {
1065
1065
  constructor(options) {
@@ -1108,7 +1108,7 @@ module.exports.WatcherManager = WatcherManager;
1108
1108
 
1109
1109
  /***/ }),
1110
1110
 
1111
- /***/ 181:
1111
+ /***/ 334:
1112
1112
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1113
1113
 
1114
1114
  "use strict";
@@ -1254,7 +1254,7 @@ module.exports = (plan, limit) => {
1254
1254
 
1255
1255
  /***/ }),
1256
1256
 
1257
- /***/ 200:
1257
+ /***/ 59:
1258
1258
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1259
1259
 
1260
1260
  "use strict";
@@ -1267,14 +1267,16 @@ module.exports = (plan, limit) => {
1267
1267
  const fs = __nccwpck_require__(896);
1268
1268
  const path = __nccwpck_require__(928);
1269
1269
  const { EventEmitter } = __nccwpck_require__(434);
1270
- const reducePlan = __nccwpck_require__(181);
1270
+ const reducePlan = __nccwpck_require__(334);
1271
1271
 
1272
1272
  const IS_OSX = (__nccwpck_require__(857).platform)() === "darwin";
1273
1273
  const IS_WIN = (__nccwpck_require__(857).platform)() === "win32";
1274
1274
  const SUPPORTS_RECURSIVE_WATCHING = IS_OSX || IS_WIN;
1275
1275
 
1276
+ // Use 20 for OSX to make `FSWatcher.close` faster
1277
+ // https://github.com/nodejs/node/issues/29949
1276
1278
  const watcherLimit =
1277
- +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 2000 : 10000);
1279
+ +process.env.WATCHPACK_WATCHER_LIMIT || (IS_OSX ? 20 : 10000);
1278
1280
 
1279
1281
  const recursiveWatcherLogging = !!process.env
1280
1282
  .WATCHPACK_RECURSIVE_WATCHER_LOGGING;
@@ -1294,6 +1296,33 @@ const directWatchers = new Map();
1294
1296
  /** @type {Map<Watcher, RecursiveWatcher | DirectWatcher>} */
1295
1297
  const underlyingWatcher = new Map();
1296
1298
 
1299
+ function createEPERMError(filePath) {
1300
+ const error = new Error(`Operation not permitted: ${filePath}`);
1301
+ error.code = "EPERM";
1302
+ return error;
1303
+ }
1304
+
1305
+ function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {
1306
+ return (type, filename) => {
1307
+ // TODO: After Node.js v22, fs.watch(dir) and deleting a dir will trigger the rename change event.
1308
+ // Here we just ignore it and keep the same behavior as before v22
1309
+ // https://github.com/libuv/libuv/pull/4376
1310
+ if (
1311
+ type === "rename" &&
1312
+ path.isAbsolute(filename) &&
1313
+ path.basename(filename) === path.basename(filePath)
1314
+ ) {
1315
+ if (!IS_OSX) {
1316
+ // Before v22, windows will throw EPERM error
1317
+ watcher.emit("error", createEPERMError(filename));
1318
+ }
1319
+ // Before v22, macos nothing to do
1320
+ return;
1321
+ }
1322
+ handleChangeEvent(type, filename);
1323
+ };
1324
+ }
1325
+
1297
1326
  class DirectWatcher {
1298
1327
  constructor(filePath) {
1299
1328
  this.filePath = filePath;
@@ -1301,12 +1330,18 @@ class DirectWatcher {
1301
1330
  this.watcher = undefined;
1302
1331
  try {
1303
1332
  const watcher = fs.watch(filePath);
1333
+
1304
1334
  this.watcher = watcher;
1305
- watcher.on("change", (type, filename) => {
1306
- for (const w of this.watchers) {
1307
- w.emit("change", type, filename);
1335
+ const handleChangeEvent = createHandleChangeEvent(
1336
+ watcher,
1337
+ filePath,
1338
+ (type, filename) => {
1339
+ for (const w of this.watchers) {
1340
+ w.emit("change", type, filename);
1341
+ }
1308
1342
  }
1309
- });
1343
+ );
1344
+ watcher.on("change", handleChangeEvent);
1310
1345
  watcher.on("error", error => {
1311
1346
  for (const w of this.watchers) {
1312
1347
  w.emit("error", error);
@@ -1592,10 +1627,13 @@ exports.getNumberOfWatchers = () => {
1592
1627
  return watcherCount;
1593
1628
  };
1594
1629
 
1630
+ exports.createHandleChangeEvent = createHandleChangeEvent;
1631
+ exports.watcherLimit = watcherLimit;
1632
+
1595
1633
 
1596
1634
  /***/ }),
1597
1635
 
1598
- /***/ 640:
1636
+ /***/ 393:
1599
1637
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1600
1638
 
1601
1639
  "use strict";
@@ -1605,11 +1643,11 @@ exports.getNumberOfWatchers = () => {
1605
1643
  */
1606
1644
 
1607
1645
 
1608
- const getWatcherManager = __nccwpck_require__(673);
1609
- const LinkResolver = __nccwpck_require__(898);
1646
+ const getWatcherManager = __nccwpck_require__(952);
1647
+ const LinkResolver = __nccwpck_require__(189);
1610
1648
  const EventEmitter = (__nccwpck_require__(434).EventEmitter);
1611
1649
  const globToRegExp = __nccwpck_require__(137);
1612
- const watchEventSource = __nccwpck_require__(200);
1650
+ const watchEventSource = __nccwpck_require__(59);
1613
1651
 
1614
1652
  const EMPTY_ARRAY = [];
1615
1653
  const EMPTY_OPTIONS = {};
@@ -2078,7 +2116,7 @@ module.exports = require("path");
2078
2116
  /******/ // startup
2079
2117
  /******/ // Load entry module and return exports
2080
2118
  /******/ // This entry module is referenced by other modules so it can't be inlined
2081
- /******/ var __webpack_exports__ = __nccwpck_require__(640);
2119
+ /******/ var __webpack_exports__ = __nccwpck_require__(393);
2082
2120
  /******/ module.exports = __webpack_exports__;
2083
2121
  /******/
2084
2122
  /******/ })()
@@ -1 +1 @@
1
- {"name":"watchpack","author":"Tobias Koppers @sokra","version":"2.4.2","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"watchpack","author":"Tobias Koppers @sokra","version":"2.4.3","license":"MIT","types":"index.d.ts","type":"commonjs"}