@rspack/core 1.1.0-beta.0 → 1.1.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 (35) hide show
  1. package/compiled/enhanced-resolve/CachedInputFileSystem.js +267 -80
  2. package/compiled/enhanced-resolve/index.d.ts +849 -236
  3. package/compiled/enhanced-resolve/package.json +1 -1
  4. package/compiled/graceful-fs/index.js +10 -10
  5. package/compiled/graceful-fs/package.json +1 -1
  6. package/compiled/zod/index.d.ts +2 -2
  7. package/dist/Compilation.d.ts +1 -1
  8. package/dist/DependenciesBlock.d.ts +6 -4
  9. package/dist/Module.d.ts +16 -15
  10. package/dist/builtin-plugin/DllEntryPlugin.d.ts +13 -0
  11. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  12. package/dist/builtin-plugin/EntryPlugin.d.ts +14 -11
  13. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +10 -0
  14. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +10 -10
  15. package/dist/builtin-plugin/LibManifestPlugin.d.ts +18 -0
  16. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +10 -10
  17. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +8 -10
  18. package/dist/builtin-plugin/index.d.ts +3 -0
  19. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
  20. package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +3 -3
  21. package/dist/config/normalization.d.ts +3 -11
  22. package/dist/config/types.d.ts +37 -6
  23. package/dist/config/utils.d.ts +16 -0
  24. package/dist/config/zod.d.ts +94 -93
  25. package/dist/exports.d.ts +4 -2
  26. package/dist/index.js +2201 -1091
  27. package/dist/lib/DllPlugin.d.ts +42 -0
  28. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  29. package/package.json +6 -6
  30. package/dist/lib/Dependency.d.ts +0 -23
  31. package/dist/lib/formatLocation.d.ts +0 -16
  32. package/dist/logging/runtime.d.ts +0 -16
  33. package/dist/util/IterableHelpers.d.ts +0 -12
  34. package/dist/util/scheme.d.ts +0 -6
  35. package/dist/util/webpack.d.ts +0 -4
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/DllPlugin.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 type { Compiler } from "../Compiler";
11
+ export type DllPluginOptions = {
12
+ /**
13
+ * Context of requests in the manifest file (defaults to the webpack context).
14
+ */
15
+ context?: string;
16
+ /**
17
+ * If true, only entry points will be exposed.
18
+ * @default true
19
+ */
20
+ entryOnly?: boolean;
21
+ /**
22
+ * If true, manifest json file (output) will be formatted.
23
+ */
24
+ format?: boolean;
25
+ /**
26
+ * Name of the exposed dll function (external name, use value of 'output.library').
27
+ */
28
+ name?: string;
29
+ /**
30
+ * Absolute path to the manifest json file (output).
31
+ */
32
+ path: string;
33
+ /**
34
+ * Type of the dll bundle (external type, use value of 'output.libraryTarget').
35
+ */
36
+ type?: string;
37
+ };
38
+ export declare class DllPlugin {
39
+ private options;
40
+ constructor(options: DllPluginOptions);
41
+ apply(compiler: Compiler): void;
42
+ }
@@ -0,0 +1,119 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/DllReferencePlugin.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 type { JsBuildMeta } from "@rspack/binding";
11
+ import type { Compiler } from "../Compiler";
12
+ export type DllReferencePluginOptions = {
13
+ /**
14
+ * Context of requests in the manifest (or content property) as absolute path.
15
+ */
16
+ context?: string;
17
+ /**
18
+ * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
19
+ */
20
+ extensions?: string[];
21
+ /**
22
+ * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
23
+ */
24
+ manifest: string | DllReferencePluginOptionsManifest;
25
+ /**
26
+ * The name where the dll is exposed (external name, defaults to manifest.name).
27
+ */
28
+ name?: string;
29
+ /**
30
+ * Prefix which is used for accessing the content of the dll.
31
+ */
32
+ scope?: string;
33
+ /**
34
+ * How the dll is exposed (libraryTarget, defaults to manifest.type).
35
+ */
36
+ sourceType?: DllReferencePluginOptionsSourceType;
37
+ /**
38
+ * The way how the export of the dll bundle is used.
39
+ */
40
+ type?: "require" | "object";
41
+ } | {
42
+ /**
43
+ * The mappings from request to module info.
44
+ */
45
+ content: DllReferencePluginOptionsContent;
46
+ /**
47
+ * Context of requests in the manifest (or content property) as absolute path.
48
+ */
49
+ context?: string;
50
+ /**
51
+ * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
52
+ */
53
+ extensions?: string[];
54
+ /**
55
+ * The name where the dll is exposed (external name).
56
+ */
57
+ name: string;
58
+ /**
59
+ * Prefix which is used for accessing the content of the dll.
60
+ */
61
+ scope?: string;
62
+ /**
63
+ * How the dll is exposed (libraryTarget).
64
+ */
65
+ sourceType?: DllReferencePluginOptionsSourceType;
66
+ /**
67
+ * The way how the export of the dll bundle is used.
68
+ */
69
+ type?: "require" | "object";
70
+ };
71
+ /**
72
+ * The type how the dll is exposed (external type).
73
+ */
74
+ export type DllReferencePluginOptionsSourceType = "var" | "assign" | "this" | "window" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system";
75
+ /**
76
+ * An object containing content, name and type.
77
+ */
78
+ export interface DllReferencePluginOptionsManifest {
79
+ /**
80
+ * The mappings from request to module info.
81
+ */
82
+ content: DllReferencePluginOptionsContent;
83
+ /**
84
+ * The name where the dll is exposed (external name).
85
+ */
86
+ name?: string;
87
+ /**
88
+ * The type how the dll is exposed (external type).
89
+ */
90
+ type?: DllReferencePluginOptionsSourceType;
91
+ }
92
+ /**
93
+ * The mappings from request to module info.
94
+ */
95
+ export interface DllReferencePluginOptionsContent {
96
+ /**
97
+ * Module info.
98
+ */
99
+ [k: string]: {
100
+ /**
101
+ * Meta information about the module.
102
+ */
103
+ buildMeta?: JsBuildMeta;
104
+ /**
105
+ * Information about the provided exports of the module.
106
+ */
107
+ exports?: string[] | true;
108
+ /**
109
+ * Module ID.
110
+ */
111
+ id?: string;
112
+ };
113
+ }
114
+ export declare class DllReferencePlugin {
115
+ private options;
116
+ private errors;
117
+ constructor(options: DllReferencePluginOptions);
118
+ apply(compiler: Compiler): void;
119
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.1.0-beta.0",
3
+ "version": "1.1.1",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,15 +37,15 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@swc/core": "1.4.0",
40
+ "@swc/core": "1.7.40",
41
41
  "@swc/types": "0.1.12",
42
42
  "@types/graceful-fs": "4.1.9",
43
43
  "@types/watchpack": "^2.4.0",
44
44
  "@types/webpack-sources": "3.2.3",
45
45
  "browserslist": "^4.21.3",
46
46
  "cross-env": "^7.0.3",
47
- "enhanced-resolve": "5.12.0",
48
- "graceful-fs": "4.2.10",
47
+ "enhanced-resolve": "5.17.1",
48
+ "graceful-fs": "4.2.11",
49
49
  "json-parse-even-better-errors": "^3.0.0",
50
50
  "prebundle": "^1.1.0",
51
51
  "tsc-alias": "^1.8.8",
@@ -55,13 +55,13 @@
55
55
  "webpack-dev-server": "5.0.4",
56
56
  "webpack-sources": "3.2.3",
57
57
  "zod": "^3.23.8",
58
- "zod-validation-error": "3.3.1"
58
+ "zod-validation-error": "3.4.0"
59
59
  },
60
60
  "dependencies": {
61
61
  "@module-federation/runtime-tools": "0.5.1",
62
62
  "@rspack/lite-tapable": "1.0.1",
63
63
  "caniuse-lite": "^1.0.30001616",
64
- "@rspack/binding": "1.1.0-beta.0"
64
+ "@rspack/binding": "1.1.1"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@swc/helpers": ">=0.5.1"
@@ -1,23 +0,0 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Dependency.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
- export type SourcePosition = {
11
- line: number;
12
- column?: number;
13
- };
14
- export type RealDependencyLocation = {
15
- start: SourcePosition;
16
- end?: SourcePosition;
17
- index?: number;
18
- };
19
- export type SyntheticDependencyLocation = {
20
- name: string;
21
- index?: number;
22
- };
23
- export type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
@@ -1,16 +0,0 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/webpack/blob/4b4ca3b/lib/formatLocation.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 type { DependencyLocation } from "./Dependency";
11
- /**
12
- * @param loc location
13
- * @returns formatted location
14
- */
15
- declare const formatLocation: (loc: DependencyLocation) => string;
16
- export default formatLocation;
@@ -1,16 +0,0 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/webpack/webpack/blob/4b4ca3b/lib/logging/runtime.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 { Logger } from "./Logger";
11
- import { type LoggerOptions } from "./createConsoleLogger";
12
- export declare const getLogger: (name: string) => Logger;
13
- export declare const configureDefaultLogger: (options: LoggerOptions) => void;
14
- export declare const hooks: {
15
- log: any;
16
- };
@@ -1,12 +0,0 @@
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 last: <T>(set: Iterable<T>) => T | undefined;
11
- export declare const someInIterable: <T>(iterable: Iterable<T>, filter: (arg: T) => boolean) => boolean;
12
- export declare const countIterable: <T>(iterable: Iterable<T>) => number;
@@ -1,6 +0,0 @@
1
- /**
2
- * Get scheme if specifier is an absolute URL specifier
3
- * e.g. Absolute specifiers like 'file:///user/webpack/index.js'
4
- * https://tools.ietf.org/html/rfc3986#section-3.1
5
- */
6
- export declare function getScheme(specifier: string): string | undefined;
@@ -1,4 +0,0 @@
1
- declare const _default: {
2
- readonly createHash: (algorithm: "debug" | "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => import("./hash").default)) => import("./hash").default;
3
- };
4
- export default _default;