@rspack/core 1.6.0-beta.0 → 1.6.0-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.
@@ -1,5 +1,11 @@
1
1
  import WebpackError from "../lib/WebpackError";
2
- export default class ModuleError extends WebpackError {
2
+ export declare class ModuleError extends WebpackError {
3
+ error?: Error;
4
+ constructor(err: Error, { from }?: {
5
+ from?: string;
6
+ });
7
+ }
8
+ export declare class ModuleWarning extends WebpackError {
3
9
  error?: Error;
4
10
  constructor(err: Error, { from }?: {
5
11
  from?: string;
@@ -1,4 +1,20 @@
1
1
  import type { Compiler } from "../Compiler";
2
+ export declare const SHARED_ITEM_NAMES: {
3
+ "compilation.children[]": string;
4
+ "compilation.modules[]": string;
5
+ "compilation.entrypoints[]": string;
6
+ "compilation.namedChunkGroups[]": string;
7
+ "compilation.errors[]": string;
8
+ "chunk.modules[]": string;
9
+ "chunk.origins[]": string;
10
+ "compilation.chunks[]": string;
11
+ "compilation.assets[]": string;
12
+ "asset.related[]": string;
13
+ "module.issuerPath[]": string;
14
+ "module.reasons[]": string;
15
+ "module.modules[]": string;
16
+ "module.children[]": string;
17
+ };
2
18
  export declare class DefaultStatsFactoryPlugin {
3
19
  apply(compiler: Compiler): void;
4
20
  }
package/dist/util/fs.d.ts CHANGED
@@ -326,9 +326,9 @@ export type Open = (file: PathLike, flags: undefined | string | number, callback
326
326
  export type IntermediateFileSystemExtras = {
327
327
  rename: (arg0: PathLike, arg1: PathLike, arg2: (arg0: null | NodeJS.ErrnoException) => void) => void;
328
328
  mkdirSync: MkdirSync;
329
- write: Write<Buffer>;
329
+ write: Write;
330
330
  open: Open;
331
- read: Read<Buffer>;
331
+ read: Read;
332
332
  close: (arg0: number, arg1: (arg0: null | NodeJS.ErrnoException) => void) => void;
333
333
  };
334
334
  export declare function rmrf(fs: OutputFileSystem, p: string, callback: (err?: Error | null) => void): void;
@@ -5,7 +5,4 @@ export declare const toObject: (input: string | Buffer | object) => object;
5
5
  export declare function serializeObject(map: string | object | undefined | null): Buffer | undefined;
6
6
  export declare function indent(str: string, prefix: string): string;
7
7
  export declare function stringifyLoaderObject(o: LoaderObject): string;
8
- export declare function asArray<T>(item: T[]): T[];
9
- export declare function asArray<T>(item: readonly T[]): readonly T[];
10
- export declare function asArray<T>(item: T): T[];
11
8
  export declare const unsupported: (name: string, issue?: string) => never;
@@ -0,0 +1,5 @@
1
+ import type { Configuration } from "../config";
2
+ /**
3
+ * Performs configuration validation that cannot be covered by TypeScript types.
4
+ */
5
+ export declare function validateRspackConfig(config: Configuration): void;
package/dist/worker.js CHANGED
@@ -206,10 +206,9 @@ var __webpack_modules__ = {
206
206
  "./src/util/createHash.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
207
207
  let createMd4, createXxhash64;
208
208
  __webpack_require__.d(__webpack_exports__, {
209
- n: ()=>createHash
209
+ n: ()=>createHash_createHash
210
210
  });
211
- let external_node_crypto_namespaceObject = require("node:crypto");
212
- var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject), external_node_util_ = __webpack_require__("node:util");
211
+ var external_node_util_ = __webpack_require__("node:util");
213
212
  class WebpackError_WebpackError extends Error {
214
213
  loc;
215
214
  file;
@@ -383,7 +382,7 @@ var __webpack_modules__ = {
383
382
  return encoding ? this.wasmHash.digest(encoding) : this.wasmHash.digest();
384
383
  }
385
384
  }
386
- let createHash = (algorithm)=>{
385
+ let createHash_createHash = (algorithm)=>{
387
386
  if ("function" == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
388
387
  switch(algorithm){
389
388
  case "debug":
@@ -405,15 +404,24 @@ var __webpack_modules__ = {
405
404
  return createMd4();
406
405
  })());
407
406
  case "native-md4":
408
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
407
+ return new BulkUpdateDecorator(()=>{
408
+ let { createHash } = __webpack_require__("node:crypto");
409
+ return createHash("md4");
410
+ }, "md4");
409
411
  default:
410
- return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash(algorithm), algorithm);
412
+ return new BulkUpdateDecorator(()=>{
413
+ let { createHash } = __webpack_require__("node:crypto");
414
+ return createHash(algorithm);
415
+ }, algorithm);
411
416
  }
412
417
  };
413
418
  },
414
419
  "@rspack/binding": function(module) {
415
420
  module.exports = require("@rspack/binding");
416
421
  },
422
+ "node:crypto": function(module) {
423
+ module.exports = require("node:crypto");
424
+ },
417
425
  "node:fs": function(module) {
418
426
  module.exports = require("node:fs");
419
427
  },
@@ -430,6 +438,11 @@ var __webpack_modules__ = {
430
438
  module.exports = import("../compiled/tinypool/dist/index.js").then(function(module) {
431
439
  return module;
432
440
  });
441
+ },
442
+ "node:worker_threads": function(module) {
443
+ module.exports = import("node:worker_threads").then(function(module) {
444
+ return module;
445
+ });
433
446
  }
434
447
  }, __webpack_module_cache__ = {};
435
448
  function __webpack_require__(moduleId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.6.0-beta.0",
3
+ "version": "1.6.0-beta.1",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -39,28 +39,25 @@
39
39
  "devDependencies": {
40
40
  "@ast-grep/napi": "^0.39.6",
41
41
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
42
- "@rslib/core": "0.15.0",
42
+ "@rslib/core": "0.15.1",
43
43
  "@swc/types": "0.1.25",
44
- "@types/graceful-fs": "4.1.9",
44
+ "@types/node": "^20.19.23",
45
45
  "@types/watchpack": "^2.4.4",
46
46
  "browserslist-load-config": "^1.0.1",
47
47
  "enhanced-resolve": "5.18.3",
48
48
  "glob-to-regexp": "^0.4.1",
49
- "graceful-fs": "^4.2.11",
50
49
  "memfs": "4.48.1",
51
50
  "prebundle": "^1.4.2",
52
51
  "tinypool": "^1.1.1",
53
52
  "tsx": "^4.20.6",
54
53
  "typescript": "^5.9.3",
55
54
  "watchpack": "^2.4.4",
56
- "webpack-sources": "3.3.3",
57
- "zod": "^3.25.76",
58
- "zod-validation-error": "3.5.3"
55
+ "webpack-sources": "3.3.3"
59
56
  },
60
57
  "dependencies": {
61
- "@module-federation/runtime-tools": "0.20.0",
58
+ "@module-federation/runtime-tools": "0.21.1",
62
59
  "@rspack/lite-tapable": "1.0.1",
63
- "@rspack/binding": "1.6.0-beta.0"
60
+ "@rspack/binding": "1.6.0-beta.1"
64
61
  },
65
62
  "peerDependencies": {
66
63
  "@swc/helpers": ">=0.5.1"
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- export * from 'fs';
3
-
4
- /**
5
- * Use this method to patch the global fs module (or any other fs-like module).
6
- * NOTE: This should only ever be done at the top-level application layer, in order to delay on
7
- * EMFILE errors from any fs-using dependencies. You should **not** do this in a library, because
8
- * it can cause unexpected delays in other parts of the program.
9
- * @param fsModule The reference to the fs module or an fs-like module.
10
- */
11
- declare function gracefulify<T>(fsModule: T): T;
12
-
13
- export { gracefulify };