@rspack/core 0.7.2-canary-c66cfe5-20240606035303 → 0.7.2-canary-fdfff21-20240606140946
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.
package/dist/Compilation.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Copyright (c) JS Foundation and other contributors
|
|
9
9
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
10
10
|
*/
|
|
11
|
-
import type { ExternalObject,
|
|
11
|
+
import type { ExternalObject, JsCompilation, JsModule, JsPathData, JsRuntimeModule, JsStatsError, JsStatsWarning } from "@rspack/binding";
|
|
12
12
|
import * as tapable from "tapable";
|
|
13
13
|
import { Source } from "webpack-sources";
|
|
14
14
|
import { Filename, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
|
|
@@ -25,13 +25,14 @@ import { NormalModuleFactory } from "./NormalModuleFactory";
|
|
|
25
25
|
import { Stats } from "./Stats";
|
|
26
26
|
import { StatsFactory } from "./stats/StatsFactory";
|
|
27
27
|
import { StatsPrinter } from "./stats/StatsPrinter";
|
|
28
|
+
import { type AssetInfo } from "./util/AssetInfo";
|
|
28
29
|
import MergeCaller from "./util/MergeCaller";
|
|
29
|
-
export type AssetInfo
|
|
30
|
+
export { type AssetInfo } from "./util/AssetInfo";
|
|
30
31
|
export type Assets = Record<string, Source>;
|
|
31
32
|
export interface Asset {
|
|
32
33
|
name: string;
|
|
33
34
|
source: Source;
|
|
34
|
-
info:
|
|
35
|
+
info: AssetInfo;
|
|
35
36
|
}
|
|
36
37
|
export type PathData = JsPathData;
|
|
37
38
|
export interface LogEntry {
|
|
@@ -289,4 +290,3 @@ export declare class Compilation {
|
|
|
289
290
|
static PROCESS_ASSETS_STAGE_ANALYSE: number;
|
|
290
291
|
static PROCESS_ASSETS_STAGE_REPORT: number;
|
|
291
292
|
}
|
|
292
|
-
export {};
|
package/dist/Compilation.js
CHANGED
|
@@ -52,6 +52,7 @@ const Stats_1 = require("./Stats");
|
|
|
52
52
|
const StatsFactory_1 = require("./stats/StatsFactory");
|
|
53
53
|
const StatsPrinter_1 = require("./stats/StatsPrinter");
|
|
54
54
|
const util_1 = require("./util");
|
|
55
|
+
const AssetInfo_1 = require("./util/AssetInfo");
|
|
55
56
|
const fake_1 = require("./util/fake");
|
|
56
57
|
const memoize_1 = require("./util/memoize");
|
|
57
58
|
const MergeCaller_1 = __importDefault(require("./util/MergeCaller"));
|
|
@@ -310,8 +311,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
310
311
|
__classPrivateFieldGet(this, _Compilation_inner, "f").updateAsset(filename, compatNewSourceOrFunction, assetInfoUpdateOrFunction === undefined
|
|
311
312
|
? assetInfoUpdateOrFunction
|
|
312
313
|
: typeof assetInfoUpdateOrFunction === "function"
|
|
313
|
-
? jsAssetInfo =>
|
|
314
|
-
:
|
|
314
|
+
? jsAssetInfo => AssetInfo_1.JsAssetInfo.__to_binding(assetInfoUpdateOrFunction(jsAssetInfo))
|
|
315
|
+
: AssetInfo_1.JsAssetInfo.__to_binding(assetInfoUpdateOrFunction));
|
|
315
316
|
}
|
|
316
317
|
/**
|
|
317
318
|
* Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
|
|
@@ -321,7 +322,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
321
322
|
* @param assetInfo - extra asset information
|
|
322
323
|
*/
|
|
323
324
|
emitAsset(filename, source, assetInfo) {
|
|
324
|
-
__classPrivateFieldGet(this, _Compilation_inner, "f").emitAsset(filename, source_1.JsSource.__to_binding(source),
|
|
325
|
+
__classPrivateFieldGet(this, _Compilation_inner, "f").emitAsset(filename, source_1.JsSource.__to_binding(source), AssetInfo_1.JsAssetInfo.__to_binding(assetInfo));
|
|
325
326
|
}
|
|
326
327
|
deleteAsset(filename) {
|
|
327
328
|
__classPrivateFieldGet(this, _Compilation_inner, "f").deleteAsset(filename);
|
|
@@ -335,8 +336,13 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
335
336
|
getAssets() {
|
|
336
337
|
const assets = __classPrivateFieldGet(this, _Compilation_inner, "f").getAssets();
|
|
337
338
|
return assets.map(asset => {
|
|
338
|
-
return Object.
|
|
339
|
-
|
|
339
|
+
return Object.defineProperties(asset, {
|
|
340
|
+
info: {
|
|
341
|
+
value: AssetInfo_1.JsAssetInfo.__from_binding(asset.info)
|
|
342
|
+
},
|
|
343
|
+
source: {
|
|
344
|
+
get: () => this.__internal__getAssetSource(asset.name)
|
|
345
|
+
}
|
|
340
346
|
});
|
|
341
347
|
});
|
|
342
348
|
}
|
|
@@ -345,8 +351,13 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
345
351
|
if (!asset) {
|
|
346
352
|
return;
|
|
347
353
|
}
|
|
348
|
-
return Object.
|
|
349
|
-
|
|
354
|
+
return Object.defineProperties(asset, {
|
|
355
|
+
info: {
|
|
356
|
+
value: AssetInfo_1.JsAssetInfo.__from_binding(asset.info)
|
|
357
|
+
},
|
|
358
|
+
source: {
|
|
359
|
+
get: () => this.__internal__getAssetSource(asset.name)
|
|
360
|
+
}
|
|
350
361
|
});
|
|
351
362
|
}
|
|
352
363
|
/**
|
|
@@ -34,7 +34,7 @@ function toRawSplitChunksOptions(sc, compiler) {
|
|
|
34
34
|
return name(undefined);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
return name(Module_1.Module.__from_binding(ctx.module, compiler._lastCompilation));
|
|
37
|
+
return name(Module_1.Module.__from_binding(ctx.module, compiler._lastCompilation), getChunks(ctx.chunks), ctx.cacheGroupKey);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -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,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsAssetInfo = void 0;
|
|
4
|
+
class JsAssetInfo {
|
|
5
|
+
static __from_binding(jsAssetInfo) {
|
|
6
|
+
const { immutable, minimized, development, hotModuleReplacement, related, chunkHash, contentHash, javascriptModule, sourceFilename, extras } = jsAssetInfo;
|
|
7
|
+
return {
|
|
8
|
+
...extras,
|
|
9
|
+
immutable,
|
|
10
|
+
minimized,
|
|
11
|
+
development,
|
|
12
|
+
hotModuleReplacement,
|
|
13
|
+
related,
|
|
14
|
+
chunkHash,
|
|
15
|
+
contentHash,
|
|
16
|
+
javascriptModule,
|
|
17
|
+
sourceFilename
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static __to_binding(assetInfo = {}) {
|
|
21
|
+
let { immutable = false, minimized = false, development = false, hotModuleReplacement = false, related = {}, chunkHash = [], contentHash = [], javascriptModule, sourceFilename, ...extras } = assetInfo;
|
|
22
|
+
extras = extras ?? {};
|
|
23
|
+
return {
|
|
24
|
+
immutable,
|
|
25
|
+
minimized,
|
|
26
|
+
development,
|
|
27
|
+
hotModuleReplacement,
|
|
28
|
+
related,
|
|
29
|
+
chunkHash,
|
|
30
|
+
contentHash,
|
|
31
|
+
extras
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.JsAssetInfo = JsAssetInfo;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type {
|
|
3
|
-
import { AssetInfo } from "../Compilation";
|
|
2
|
+
import type { JsStatsError } from "@rspack/binding";
|
|
4
3
|
import { LoaderObject } from "../config/adapterRuleUse";
|
|
5
4
|
export declare function mapValues(record: Record<string, string>, fn: (key: string) => string): {
|
|
6
5
|
[k: string]: string;
|
|
@@ -17,6 +16,5 @@ export declare function stringifyLoaderObject(o: LoaderObject): string;
|
|
|
17
16
|
export declare function asArray<T>(item: T[]): T[];
|
|
18
17
|
export declare function asArray<T>(item: readonly T[]): readonly T[];
|
|
19
18
|
export declare function asArray<T>(item: T): T[];
|
|
20
|
-
export declare function toJsAssetInfo(info?: AssetInfo): JsAssetInfo;
|
|
21
19
|
export declare const deprecatedWarn: (content: string, enable?: boolean) => void;
|
|
22
20
|
export declare const unsupported: (name: string, issue?: string) => never;
|
package/dist/util/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unsupported = exports.deprecatedWarn = exports.
|
|
3
|
+
exports.unsupported = exports.deprecatedWarn = exports.asArray = exports.stringifyLoaderObject = exports.indent = exports.concatErrorMsgAndStack = exports.isJsStatsError = exports.isPromiseLike = exports.serializeObject = exports.toObject = exports.toBuffer = exports.isNil = exports.mapValues = void 0;
|
|
4
4
|
function mapValues(record, fn) {
|
|
5
5
|
return Object.fromEntries(Object.entries(record).map(([key, value]) => [key, fn(value)]));
|
|
6
6
|
}
|
|
@@ -82,19 +82,6 @@ function asArray(item) {
|
|
|
82
82
|
return Array.isArray(item) ? item : [item];
|
|
83
83
|
}
|
|
84
84
|
exports.asArray = asArray;
|
|
85
|
-
function toJsAssetInfo(info) {
|
|
86
|
-
return {
|
|
87
|
-
immutable: false,
|
|
88
|
-
minimized: false,
|
|
89
|
-
development: false,
|
|
90
|
-
hotModuleReplacement: false,
|
|
91
|
-
related: {},
|
|
92
|
-
chunkHash: [],
|
|
93
|
-
contentHash: [],
|
|
94
|
-
...info
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
exports.toJsAssetInfo = toJsAssetInfo;
|
|
98
85
|
const getDeprecationStatus = () => {
|
|
99
86
|
const defaultEnableDeprecatedWarning = true;
|
|
100
87
|
if (process.env.RSPACK_DEP_WARNINGS === "false" ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "0.7.2-canary-
|
|
3
|
+
"version": "0.7.2-canary-fdfff21-20240606140946",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Fast Rust-based Web Bundler",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"watchpack": "^2.4.0",
|
|
73
73
|
"zod": "^3.21.4",
|
|
74
74
|
"zod-validation-error": "1.3.1",
|
|
75
|
-
"@rspack/core": "0.7.2-canary-
|
|
76
|
-
"@rspack/plugin-minify": "^0.7.2-canary-
|
|
75
|
+
"@rspack/core": "0.7.2-canary-fdfff21-20240606140946",
|
|
76
|
+
"@rspack/plugin-minify": "^0.7.2-canary-fdfff21-20240606140946"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@module-federation/runtime-tools": "0.1.6",
|
|
80
80
|
"caniuse-lite": "^1.0.30001616",
|
|
81
81
|
"tapable": "2.2.1",
|
|
82
82
|
"webpack-sources": "3.2.3",
|
|
83
|
-
"@rspack/binding": "0.7.2-canary-
|
|
83
|
+
"@rspack/binding": "0.7.2-canary-fdfff21-20240606140946"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@swc/helpers": ">=0.5.1"
|