@rsdoctor/core 0.4.13 → 1.0.0-alpha.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.
- package/README.md +1 -1
- package/dist/build-utils/build/chunks/assetsModules.d.ts +2 -2
- package/dist/build-utils/build/chunks/assetsModules.d.ts.map +1 -1
- package/dist/build-utils/build/chunks/assetsModules.js +3 -2
- package/dist/build-utils/build/module-graph/transform.d.ts +2 -2
- package/dist/build-utils/build/module-graph/transform.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +2 -3
- package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/treeShaking.js +2 -1
- package/dist/build-utils/build/module-graph/utils.d.ts +3 -3
- package/dist/build-utils/build/module-graph/utils.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +2 -3
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/webpack/transform.js +5 -10
- package/dist/build-utils/build/utils/loader.d.ts.map +1 -1
- package/dist/build-utils/build/utils/parseBundle.d.ts.map +1 -1
- package/dist/build-utils/build/utils/parseBundle.js +1 -4
- package/dist/build-utils/build/utils/plugin.js +1 -1
- package/dist/build-utils/common/chunks/assetsContent.d.ts +2 -2
- package/dist/build-utils/common/chunks/assetsContent.d.ts.map +1 -1
- package/dist/build-utils/common/chunks/assetsModules.d.ts +3 -4
- package/dist/build-utils/common/chunks/assetsModules.d.ts.map +1 -1
- package/dist/build-utils/common/chunks/assetsModules.js +8 -29
- package/dist/build-utils/common/module-graph/compatible.d.ts +1 -2
- package/dist/build-utils/common/module-graph/compatible.d.ts.map +1 -1
- package/dist/build-utils/common/module-graph/compatible.js +3 -8
- package/dist/build-utils/common/module-graph/transform.d.ts +3 -3
- package/dist/build-utils/common/module-graph/transform.d.ts.map +1 -1
- package/dist/build-utils/common/module-graph/transform.js +2 -0
- package/dist/build-utils/common/module-graph/utils.d.ts +1 -2
- package/dist/build-utils/common/module-graph/utils.d.ts.map +1 -1
- package/dist/build-utils/common/trans-utils/transStats.d.ts +2 -3
- package/dist/build-utils/common/trans-utils/transStats.d.ts.map +1 -1
- package/dist/build-utils/common/trans-utils/transStats.js +10 -2
- package/dist/build-utils/common/webpack/compatible.d.ts +4 -13
- package/dist/build-utils/common/webpack/compatible.d.ts.map +1 -1
- package/dist/build-utils/common/webpack/compatible.js +0 -23
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +1 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +18 -17
- package/dist/inner-plugins/plugins/loader.d.ts.map +1 -1
- package/dist/inner-plugins/plugins/loader.js +3 -7
- package/dist/inner-plugins/plugins/summary.d.ts.map +1 -1
- package/dist/inner-plugins/plugins/summary.js +1 -6
- package/dist/inner-plugins/utils/config.d.ts.map +1 -1
- package/dist/inner-plugins/utils/config.js +40 -21
- package/dist/rules/rules/ecma-version-check/index.d.ts.map +1 -1
- package/dist/rules/rules/ecma-version-check/index.js +28 -16
- package/dist/rules/rules/ecma-version-check/types.d.ts +2 -6
- package/dist/rules/rules/ecma-version-check/types.d.ts.map +1 -1
- package/dist/types/chunks.d.ts +2 -2
- package/dist/types/chunks.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +27 -17
- package/dist/types/plugin.d.ts.map +1 -1
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
1
|
import { ParsedModuleSizeData } from '../../common/chunks';
|
|
3
|
-
|
|
2
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
|
+
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, hasParseBundle?: boolean): Promise<ParsedModuleSizeData | null>;
|
|
4
4
|
//# sourceMappingURL=assetsModules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/chunks/assetsModules.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/chunks/assetsModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,GAAG,CAAC,mBAAmB,EACpC,UAAU,EAAE,GAAG,CAAC,kBAAkB,EAClC,SAAS,EAAE,MAAM,EACjB,cAAc,UAAO,GACpB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAOtC"}
|
|
@@ -23,9 +23,10 @@ __export(assetsModules_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(assetsModules_exports);
|
|
24
24
|
var import_chunks = require("../../common/chunks");
|
|
25
25
|
var import_utils = require("../utils");
|
|
26
|
-
async function getAssetsModulesData(
|
|
26
|
+
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, hasParseBundle = true) {
|
|
27
27
|
return (0, import_chunks.getAssetsModulesData)(
|
|
28
|
-
|
|
28
|
+
moduleGraph,
|
|
29
|
+
chunkGraph,
|
|
29
30
|
bundleDir,
|
|
30
31
|
hasParseBundle ? { parseBundle: import_utils.parseBundle } : {}
|
|
31
32
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from '@rsdoctor/types';
|
|
2
2
|
import { TransformContext } from '.';
|
|
3
|
-
import {
|
|
4
|
-
export declare function getModuleGraphByStats(compilation: Plugin.BaseCompilation, stats: Plugin.StatsCompilation, root: string, chunkGraph:
|
|
3
|
+
import { SDK } from '@rsdoctor/types';
|
|
4
|
+
export declare function getModuleGraphByStats(compilation: Plugin.BaseCompilation, stats: Plugin.StatsCompilation, root: string, chunkGraph: SDK.ChunkGraphInstance, features?: Plugin.RsdoctorWebpackPluginFeatures, context?: TransformContext): Promise<SDK.ModuleGraphInstance>;
|
|
5
5
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAkC,MAAM,GAAG,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAkC,MAAM,GAAG,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAC9B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,GAAG,CAAC,kBAAkB,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,6BAA6B,EAC/C,OAAO,CAAC,EAAE,gBAAgB,oCAQ3B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare function appendTreeShaking(moduleGraph: ModuleGraph, compilation: Plugin.BaseCompilation): ModuleGraph | undefined;
|
|
1
|
+
import type { SDK, Plugin } from '@rsdoctor/types';
|
|
2
|
+
export declare function appendTreeShaking(moduleGraph: SDK.ModuleGraphInstance, compilation: Plugin.BaseCompilation): SDK.ModuleGraphInstance;
|
|
4
3
|
//# sourceMappingURL=treeShaking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeShaking.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/treeShaking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"treeShaking.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/treeShaking.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAuJnD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,GAAG,CAAC,mBAAmB,EACpC,WAAW,EAAE,MAAM,CAAC,eAAe,2BAyBpC"}
|
|
@@ -108,7 +108,7 @@ function appendImportConnection(origin, graph) {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function appendTreeShaking(moduleGraph, compilation) {
|
|
111
|
-
if (!(0, import_module_graph.
|
|
111
|
+
if (!(0, import_module_graph.isWebpack5orRspack)(compilation)) {
|
|
112
112
|
return moduleGraph;
|
|
113
113
|
}
|
|
114
114
|
if ("moduleGraph" in compilation) {
|
|
@@ -126,6 +126,7 @@ function appendTreeShaking(moduleGraph, compilation) {
|
|
|
126
126
|
exportData.clear();
|
|
127
127
|
return moduleGraph;
|
|
128
128
|
}
|
|
129
|
+
return moduleGraph;
|
|
129
130
|
}
|
|
130
131
|
// Annotate the CommonJS export names for ESM import in node:
|
|
131
132
|
0 && (module.exports = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function getExportIdentifierStatement(name: string, module: SDK.
|
|
3
|
-
export declare function getDeclarationIdentifier(name: string, module: SDK.
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
export declare function getExportIdentifierStatement(name: string, module: SDK.ModuleInstance): SDK.StatementInstance | undefined;
|
|
3
|
+
export declare function getDeclarationIdentifier(name: string, module: SDK.ModuleInstance): SDK.StatementInstance | undefined;
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAuDtC,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,cAAc,qCAwB3B;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,GAAG,CAAC,cAAc,qCAkC3B"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { SourceMapConsumer } from 'source-map';
|
|
2
2
|
import * as Webpack from 'webpack';
|
|
3
3
|
import { Node } from '@rsdoctor/utils/ruleUtils';
|
|
4
|
-
import { Plugin } from '@rsdoctor/types';
|
|
5
|
-
import { ModuleGraph } from '@rsdoctor/graph';
|
|
4
|
+
import { Plugin, SDK } from '@rsdoctor/types';
|
|
6
5
|
export interface TransformContext {
|
|
7
6
|
astCache?: Map<Webpack.NormalModule, Node.Program>;
|
|
8
7
|
packagePathMap?: Map<string, string>;
|
|
9
8
|
getSourceMap?(module: string): Promise<SourceMapConsumer | undefined>;
|
|
10
9
|
}
|
|
11
|
-
export declare function appendModuleGraphByCompilation(compilation: Plugin.BaseCompilation, graph:
|
|
10
|
+
export declare function appendModuleGraphByCompilation(compilation: Plugin.BaseCompilation, graph: SDK.ModuleGraphInstance, features?: Plugin.RsdoctorWebpackPluginFeatures, context?: TransformContext): Promise<SDK.ModuleGraphInstance>;
|
|
12
11
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../../src/build-utils/build/module-graph/webpack/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../../src/build-utils/build/module-graph/webpack/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAiB9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;CACvE;AAuND,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,KAAK,EAAE,GAAG,CAAC,mBAAmB,EAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC,6BAA6B,EAC/C,OAAO,CAAC,EAAE,gBAAgB,oCA0B3B"}
|
|
@@ -50,10 +50,7 @@ async function readFile(target, wbFs) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
function appendDependency(webpackDep, module2, webpackGraph, graph) {
|
|
53
|
-
const resolvedWebpackModule =
|
|
54
|
-
webpackDep,
|
|
55
|
-
webpackGraph
|
|
56
|
-
);
|
|
53
|
+
const resolvedWebpackModule = webpackGraph?.getResolvedModule ? webpackGraph.getResolvedModule(webpackDep) : void 0;
|
|
57
54
|
if (!resolvedWebpackModule) {
|
|
58
55
|
return;
|
|
59
56
|
}
|
|
@@ -79,8 +76,7 @@ function appendDependency(webpackDep, module2, webpackGraph, graph) {
|
|
|
79
76
|
const dependency = module2.getDependencyByRequest(request);
|
|
80
77
|
if (dependency) {
|
|
81
78
|
dependency.setBuildMeta({
|
|
82
|
-
exportsType:
|
|
83
|
-
resolvedWebpackModule,
|
|
79
|
+
exportsType: resolvedWebpackModule.getExportsType(
|
|
84
80
|
webpackGraph,
|
|
85
81
|
module2.meta.strictHarmonyModule
|
|
86
82
|
)
|
|
@@ -108,7 +104,7 @@ function getModuleSource(modulePath, wbFs, sourceMap) {
|
|
|
108
104
|
}
|
|
109
105
|
return process.env.NODE_ENV === "test" ? Buffer.from("test code") : readFile(modulePath, wbFs);
|
|
110
106
|
}
|
|
111
|
-
async function appendModuleData(origin, webpackGraph, graph, wbFs, features, context
|
|
107
|
+
async function appendModuleData(origin, webpackGraph, graph, wbFs, features, context) {
|
|
112
108
|
const module2 = graph.getModuleByWebpackId((0, import_compatible.getWebpackModuleId)(origin));
|
|
113
109
|
if (!origin || !module2) {
|
|
114
110
|
return;
|
|
@@ -155,7 +151,7 @@ async function appendModuleData(origin, webpackGraph, graph, wbFs, features, con
|
|
|
155
151
|
}
|
|
156
152
|
module2.meta.strictHarmonyModule = origin.buildMeta?.strictHarmonyModule ?? false;
|
|
157
153
|
module2.meta.packageData = packageData;
|
|
158
|
-
if (!features?.lite && origin?.dependencies
|
|
154
|
+
if (!features?.lite && origin?.dependencies) {
|
|
159
155
|
Array.from(origin.dependencies).filter((item) => (0, import_module_graph.isImportDependency)(item)).concat(
|
|
160
156
|
origin.blocks.reduce(
|
|
161
157
|
(ans, item) => ans.concat(item.dependencies),
|
|
@@ -180,8 +176,7 @@ async function appendModuleGraphByCompilation(compilation, graph, features, cont
|
|
|
180
176
|
graph,
|
|
181
177
|
fileSystemInfo,
|
|
182
178
|
features,
|
|
183
|
-
context
|
|
184
|
-
(0, import_module_graph.isRspack)(compilation)
|
|
179
|
+
context
|
|
185
180
|
);
|
|
186
181
|
})
|
|
187
182
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAQ,cAAc,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAW/E,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAOA;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,GAAG,SAAgB,GAClB;IACD,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACzD,KAAK,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAC5C,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CACrB,CAiBA;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAqBtE;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,gBAAgB,EAC5D,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GACvB,CAAC,EAAE,CAgFL;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,WA2BrD;AAoCD,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,MAAM,CAAC,gBAAgB,EAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,UAAO,WAgBd;AACD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,gBAAgB,EACpE,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,KAAK,OAAO,GAC1C,CAAC,EAAE,CA4EL;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,EAC9C,KAAK,EAAE,CACL,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAC3B,SAAS,CAAC,EAAE,qBAAqB,KAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAQ,cAAc,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAW/E,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAOA;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,GAAG,SAAgB,GAClB;IACD,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACzD,KAAK,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAC5C,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CACrB,CAiBA;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAqBtE;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,gBAAgB,EAC5D,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GACvB,CAAC,EAAE,CAgFL;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,WA2BrD;AAoCD,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,MAAM,CAAC,gBAAgB,EAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,UAAO,WAgBd;AACD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,gBAAgB,EACpE,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,KAAK,OAAO,GAC1C,CAAC,EAAE,CA4EL;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,EAC9C,KAAK,EAAE,CACL,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAC3B,SAAS,CAAC,EAAE,qBAAqB,KAC9B,IAAI,iDAqFV;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM;;EAMvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseBundle.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/parseBundle.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC;;;;;;;;;GASG;AAEH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"parseBundle.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/parseBundle.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC;;;;;;;;;GASG;AAEH,eAAO,MAAM,WAAW,EAAE,WAsPzB,CAAC"}
|
|
@@ -186,10 +186,7 @@ const parseBundle = (bundlePath, modulesData) => {
|
|
|
186
186
|
}
|
|
187
187
|
const moduleContent = modules[module2];
|
|
188
188
|
const size = moduleContent && Buffer.byteLength(moduleContent);
|
|
189
|
-
const
|
|
190
|
-
id: Number(module2)
|
|
191
|
-
});
|
|
192
|
-
const identifier = _filterModules?.identifier || (0, import_lodash.find)(modulesData, { id: module2 })?.identifier || "";
|
|
189
|
+
const identifier = (0, import_lodash.find)(modulesData, { renderId: module2 })?.webpackId || "";
|
|
193
190
|
modulesObj[identifier] = {
|
|
194
191
|
size,
|
|
195
192
|
sizeConvert: (0, import_filesize.filesize)(size || 0),
|
|
@@ -46,7 +46,7 @@ function interceptCompilerHooks(compiler, interceptor) {
|
|
|
46
46
|
}
|
|
47
47
|
function interceptCompilationHooks(compilation, interceptor) {
|
|
48
48
|
Object.keys(compilation.hooks).forEach((hook) => {
|
|
49
|
-
if (hook === "normalModuleLoader" && (0, import_compatible.
|
|
49
|
+
if (hook === "normalModuleLoader" && (0, import_compatible.isWebpack5orRspack)(compilation)) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
const v = compilation.hooks[hook];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
2
|
export declare function assetsContents(assetMap: Map<string, {
|
|
3
3
|
content: string;
|
|
4
|
-
}>, chunkGraph:
|
|
4
|
+
}>, chunkGraph: SDK.ChunkGraphInstance): void;
|
|
5
5
|
//# sourceMappingURL=assetsContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsContent.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"assetsContent.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,UAAU,EAAE,GAAG,CAAC,kBAAkB,QAOnC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ModuleGraph } from '@rsdoctor/graph';
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
3
2
|
import { ParseBundle } from '../../../types';
|
|
4
3
|
export type ParsedModuleSizeData = {
|
|
5
4
|
[x: string]: {
|
|
@@ -17,8 +16,8 @@ export type ParsedModuleSizeData = {
|
|
|
17
16
|
* Copyright JS Foundation and other contributors.
|
|
18
17
|
* https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
|
|
19
18
|
*/
|
|
20
|
-
export declare function getAssetsModulesData(
|
|
19
|
+
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, opts: {
|
|
21
20
|
parseBundle?: ParseBundle;
|
|
22
21
|
}): Promise<ParsedModuleSizeData | null>;
|
|
23
|
-
export declare function transformAssetsModulesData(parsedModulesData: ParsedModuleSizeData, moduleGraph:
|
|
22
|
+
export declare function transformAssetsModulesData(parsedModulesData: ParsedModuleSizeData, moduleGraph: SDK.ModuleGraphInstance): void;
|
|
24
23
|
//# sourceMappingURL=assetsModules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsModules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsModules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE,CAAC;AACF;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,GAAG,CAAC,mBAAmB,EACpC,UAAU,EAAE,GAAG,CAAC,kBAAkB,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA2CtC;AAED,wBAAgB,0BAA0B,CACxC,iBAAiB,EAAE,oBAAoB,EACvC,WAAW,EAAE,GAAG,CAAC,mBAAmB,QAUrC"}
|
|
@@ -35,48 +35,27 @@ module.exports = __toCommonJS(assetsModules_exports);
|
|
|
35
35
|
var import_lodash = require("lodash");
|
|
36
36
|
var import_path = __toESM(require("path"));
|
|
37
37
|
var import_logger = require("@rsdoctor/utils/logger");
|
|
38
|
-
|
|
39
|
-
async function getAssetsModulesData(bundleStats, bundleDir, opts) {
|
|
38
|
+
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, opts) {
|
|
40
39
|
const { parseBundle = () => ({}) } = opts || {};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const _bundleStats = children?.[0];
|
|
44
|
-
if (!children) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
for (let i = 1; i < children.length; i++) {
|
|
48
|
-
children[i]?.assets?.forEach((asset) => {
|
|
49
|
-
_bundleStats?.assets?.push(asset);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
} else if (!(0, import_lodash.isEmpty)(bundleStats.children)) {
|
|
53
|
-
bundleStats?.children?.forEach((child) => {
|
|
54
|
-
child?.assets?.forEach((asset) => {
|
|
55
|
-
bundleStats?.assets?.push(asset);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
40
|
+
const assets = chunkGraph.getAssets();
|
|
41
|
+
const modules = moduleGraph.getModules();
|
|
59
42
|
let bundlesSources = null;
|
|
60
43
|
let parsedModules = null;
|
|
61
|
-
if (bundleDir &&
|
|
44
|
+
if (bundleDir && assets.length) {
|
|
62
45
|
bundlesSources = {};
|
|
63
46
|
parsedModules = {};
|
|
64
|
-
for (const
|
|
65
|
-
const assetFile = import_path.default.join(bundleDir,
|
|
47
|
+
for (const asset of assets) {
|
|
48
|
+
const assetFile = import_path.default.join(bundleDir, asset.path);
|
|
66
49
|
let bundleInfo;
|
|
67
|
-
const collectedModules = [];
|
|
68
|
-
(0, import_module_graph.getModulesFromArray)(bundleStats.modules ?? [], collectedModules);
|
|
69
|
-
const childrenModules = bundleStats.children?.flatMap((c) => c.modules || []) || [];
|
|
70
|
-
collectedModules.push(...childrenModules);
|
|
71
50
|
try {
|
|
72
|
-
bundleInfo =
|
|
51
|
+
bundleInfo = parseBundle(assetFile, modules);
|
|
73
52
|
} catch (err) {
|
|
74
53
|
const { code = "", message } = err;
|
|
75
54
|
const msg = code === "ENOENT" ? "no such file" : message;
|
|
76
55
|
process.env.DEVTOOLS_NODE_DEV === "1" && import_logger.logger.warn(`Error parsing bundle asset "${assetFile}": ${msg}`);
|
|
77
56
|
continue;
|
|
78
57
|
}
|
|
79
|
-
bundlesSources[
|
|
58
|
+
bundlesSources[asset.path] = (0, import_lodash.pick)(bundleInfo, "src", "runtimeSrc");
|
|
80
59
|
Object.assign(parsedModules, bundleInfo?.modules || {});
|
|
81
60
|
}
|
|
82
61
|
if ((0, import_lodash.isEmpty)(bundlesSources)) {
|
|
@@ -5,6 +5,5 @@ import { Plugin, SDK } from '@rsdoctor/types';
|
|
|
5
5
|
* @link https://github.com/webpack/webpack/blob/main/lib/formatLocation.js#L30-L66
|
|
6
6
|
*/
|
|
7
7
|
export declare function getPositionByStatsLocation(loc: string): SDK.SourceRange | undefined;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function isRspack(compilation: Plugin.BaseCompilation): Boolean;
|
|
8
|
+
export declare function isWebpack5orRspack(compilation: Plugin.BaseCompilation): Boolean;
|
|
10
9
|
//# sourceMappingURL=compatible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatible.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/compatible.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GACV,GAAG,CAAC,WAAW,GAAG,SAAS,CAqC7B;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"compatible.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/compatible.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GACV,GAAG,CAAC,WAAW,GAAG,SAAS,CAqC7B;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,CAAC,eAAe,GAClC,OAAO,CAET"}
|
|
@@ -19,8 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var compatible_exports = {};
|
|
20
20
|
__export(compatible_exports, {
|
|
21
21
|
getPositionByStatsLocation: () => getPositionByStatsLocation,
|
|
22
|
-
|
|
23
|
-
isRspack: () => isRspack
|
|
22
|
+
isWebpack5orRspack: () => isWebpack5orRspack
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(compatible_exports);
|
|
26
25
|
function getPositionByStatsLocation(loc) {
|
|
@@ -54,15 +53,11 @@ function getPositionByStatsLocation(loc) {
|
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
function
|
|
56
|
+
function isWebpack5orRspack(compilation) {
|
|
58
57
|
return "moduleGraph" in compilation && Boolean(compilation.moduleGraph);
|
|
59
58
|
}
|
|
60
|
-
function isRspack(compilation) {
|
|
61
|
-
return "rspackVersion" in compilation.compiler.webpack && Boolean(compilation.compiler.webpack.rspackVersion);
|
|
62
|
-
}
|
|
63
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
64
60
|
0 && (module.exports = {
|
|
65
61
|
getPositionByStatsLocation,
|
|
66
|
-
|
|
67
|
-
isRspack
|
|
62
|
+
isWebpack5orRspack
|
|
68
63
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { ModuleGraph
|
|
1
|
+
import { SDK, Plugin } from '@rsdoctor/types';
|
|
2
|
+
import { ModuleGraph } from '@rsdoctor/graph';
|
|
3
3
|
export declare function getModulesFromArray(modules: Plugin.StatsModule[], collectedModules: Plugin.StatsModule[]): void;
|
|
4
4
|
/**
|
|
5
5
|
* this function can run in browser & node.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getModuleGraphByStats({ modules, chunks }: Plugin.StatsCompilation, root: string, chunkGraph:
|
|
7
|
+
export declare function getModuleGraphByStats({ modules, chunks }: Plugin.StatsCompilation, root: string, chunkGraph: SDK.ChunkGraphInstance): ModuleGraph;
|
|
8
8
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/transform.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAqB,MAAM,iBAAiB,CAAC;AAqCjE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,EAC7B,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,QAKvC;AAaD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,gBAAgB,EAC5C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,GAAG,CAAC,kBAAkB,eAwKnC"}
|
|
@@ -92,6 +92,7 @@ function getModuleGraphByStats({ modules, chunks }, root, chunkGraph) {
|
|
|
92
92
|
getGetModuleName(root, data),
|
|
93
93
|
data.depth === 0,
|
|
94
94
|
isConcatenated ? import_types.SDK.ModuleKind.Concatenation : import_types.SDK.ModuleKind.Normal,
|
|
95
|
+
data.id ? String(data.id) : void 0,
|
|
95
96
|
data.layer
|
|
96
97
|
);
|
|
97
98
|
data.chunks?.forEach((_chunkId) => {
|
|
@@ -121,6 +122,7 @@ function getModuleGraphByStats({ modules, chunks }, root, chunkGraph) {
|
|
|
121
122
|
getGetModuleName(root, normal),
|
|
122
123
|
normal.depth === 0,
|
|
123
124
|
import_types.SDK.ModuleKind.Normal,
|
|
125
|
+
normal.id ? String(normal.id) : void 0,
|
|
124
126
|
normal.layer
|
|
125
127
|
);
|
|
126
128
|
if (normal.chunks?.length) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SDK } from '@rsdoctor/types';
|
|
2
|
-
import type { ModuleGraph } from '@rsdoctor/graph';
|
|
3
2
|
interface DependencyData {
|
|
4
3
|
type?: string;
|
|
5
4
|
}
|
|
@@ -10,7 +9,7 @@ export declare function getImportKind(dep: DependencyData): SDK.DependencyKind;
|
|
|
10
9
|
* Remove the css module without connection
|
|
11
10
|
* - This will happen when the user uses the mini-css plug-in.
|
|
12
11
|
*/
|
|
13
|
-
export declare function removeNoImportStyle(graph:
|
|
12
|
+
export declare function removeNoImportStyle(graph: SDK.ModuleGraphInstance): void;
|
|
14
13
|
export declare function isStyleExt(path: string): boolean;
|
|
15
14
|
export {};
|
|
16
15
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/module-graph/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,cAAc,WAS1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,GAAG,CAAC,cAAc,CAwBrE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,mBAAmB,QAMjE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,WAEtC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Plugin } from '@rsdoctor/types';
|
|
1
|
+
import { Plugin, SDK } from '@rsdoctor/types';
|
|
3
2
|
export declare function transStats(json: Plugin.StatsCompilation): Promise<{
|
|
4
|
-
chunkGraph:
|
|
3
|
+
chunkGraph: SDK.ChunkGraphInstance;
|
|
5
4
|
moduleGraph: import("@rsdoctor/graph").ModuleGraph;
|
|
6
5
|
}>;
|
|
7
6
|
//# sourceMappingURL=transStats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transStats.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/trans-utils/transStats.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transStats.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/trans-utils/transStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAG9C,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB;;;GAe7D"}
|
|
@@ -23,9 +23,17 @@ __export(transStats_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(transStats_exports);
|
|
24
24
|
var import__ = require("..");
|
|
25
25
|
async function transStats(json) {
|
|
26
|
-
const chunkGraph = import__.Chunks.chunkTransform(
|
|
26
|
+
const chunkGraph = import__.Chunks.chunkTransform(
|
|
27
|
+
/* @__PURE__ */ new Map(),
|
|
28
|
+
json
|
|
29
|
+
);
|
|
27
30
|
const moduleGraph = import__.ModuleGraph.getModuleGraphByStats(json, ".", chunkGraph);
|
|
28
|
-
const assetsModuleMap = await import__.Chunks.getAssetsModulesData(
|
|
31
|
+
const assetsModuleMap = await import__.Chunks.getAssetsModulesData(
|
|
32
|
+
moduleGraph,
|
|
33
|
+
chunkGraph,
|
|
34
|
+
json.outputPath || "",
|
|
35
|
+
{}
|
|
36
|
+
) || {};
|
|
29
37
|
import__.Chunks.transformAssetsModulesData(assetsModuleMap, moduleGraph);
|
|
30
38
|
return { chunkGraph, moduleGraph };
|
|
31
39
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { SDK } from '@rsdoctor/types';
|
|
2
|
-
import { ModuleGraph as SdkModuleGraph, Module as SdkModule, Statement } from '@rsdoctor/graph';
|
|
3
1
|
import { Compilation, Dependency, ExternalModule, Module, ModuleGraph, NormalModule } from 'webpack';
|
|
4
2
|
import type { EntryPoint, ExportInfo } from '../../../types/index';
|
|
3
|
+
import { SDK } from '@rsdoctor/types';
|
|
5
4
|
export declare function isNormalModule(mod: Module): mod is NormalModule;
|
|
6
5
|
export declare function getWebpackModuleId(mod: Module): string;
|
|
7
6
|
export declare function getWebpackModulePath(mod: NormalModule): string;
|
|
@@ -9,19 +8,11 @@ export declare function getWebpackDependencyRequest(dep: Dependency, module?: No
|
|
|
9
8
|
export declare function getResolveRequest(dep: Dependency, graph: ModuleGraph): string;
|
|
10
9
|
export declare function isExternalModule(mod: Module): mod is ExternalModule;
|
|
11
10
|
export declare function getModuleSource(mod: NormalModule): string;
|
|
12
|
-
export declare function getResolveModule(dep: Dependency, graph?: ModuleGraph): Module | null;
|
|
13
11
|
export declare function getEntryModule(entryMap: Map<string, EntryPoint>): NormalModule[];
|
|
14
|
-
|
|
15
|
-
* Get the type of dependencies between modules.
|
|
16
|
-
* This property can determine what runtime webpack has added to the modules.
|
|
17
|
-
* In webpack 5, it can be directly obtained using internal APIs.
|
|
18
|
-
* In webpack 4, manual conversion is required. Since webpack 4 is not as strict as webpack 5 in terms of compatibility, we can follow the logic of webpack 5 here.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getModuleExportsType(module: NormalModule, moduleGraph?: ModuleGraph, strict?: boolean): SDK.DependencyBuildMeta['exportsType'];
|
|
21
|
-
export declare function getDependencyPosition(dep: Dependency, module: SdkModule, getSource?: boolean): Statement | undefined;
|
|
12
|
+
export declare function getDependencyPosition(dep: Dependency, module: SDK.ModuleInstance, getSource?: boolean): SDK.StatementInstance | undefined;
|
|
22
13
|
export declare function getExportDependency(info: ExportInfo, module: NormalModule): Dependency | undefined;
|
|
23
|
-
export declare function getSdkDependencyByWebpackDependency(dep: Dependency, module: NormalModule, graph:
|
|
24
|
-
export declare function getExportStatement(info: ExportInfo, normalModule: NormalModule, graph:
|
|
14
|
+
export declare function getSdkDependencyByWebpackDependency(dep: Dependency, module: NormalModule, graph: SDK.ModuleGraphInstance): SDK.DependencyInstance | undefined;
|
|
15
|
+
export declare function getExportStatement(info: ExportInfo, normalModule: NormalModule, graph: SDK.ModuleGraphInstance): SDK.StatementInstance | undefined;
|
|
25
16
|
export declare function getLastExportInfo(info: ExportInfo, webpackGraph: ModuleGraph): ExportInfo | undefined;
|
|
26
17
|
export declare function getAllModules(compilation: Compilation): NormalModule[];
|
|
27
18
|
//# sourceMappingURL=compatible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatible.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/webpack/compatible.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compatible.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/webpack/compatible.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,YAAY,CAE/D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAE9D;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,UAAU,EACf,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CAER;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,UAEpE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,cAAc,CAEnE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAIzD;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAChC,YAAY,EAAE,CAMhB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,GAAG,CAAC,cAAc,EAC1B,SAAS,UAAO,GACf,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAyBnC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,0BAgBzE;AAED,wBAAgB,mCAAmC,CACjD,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,GAAG,CAAC,mBAAmB,sCAS/B;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,GAAG,CAAC,mBAAmB,qCA4B/B;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,WAAW,GACxB,UAAU,GAAG,SAAS,CAWxB;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,kBAcrD"}
|
|
@@ -24,9 +24,7 @@ __export(compatible_exports, {
|
|
|
24
24
|
getExportDependency: () => getExportDependency,
|
|
25
25
|
getExportStatement: () => getExportStatement,
|
|
26
26
|
getLastExportInfo: () => getLastExportInfo,
|
|
27
|
-
getModuleExportsType: () => getModuleExportsType,
|
|
28
27
|
getModuleSource: () => getModuleSource,
|
|
29
|
-
getResolveModule: () => getResolveModule,
|
|
30
28
|
getResolveRequest: () => getResolveRequest,
|
|
31
29
|
getSdkDependencyByWebpackDependency: () => getSdkDependencyByWebpackDependency,
|
|
32
30
|
getWebpackDependencyRequest: () => getWebpackDependencyRequest,
|
|
@@ -59,28 +57,9 @@ function isExternalModule(mod) {
|
|
|
59
57
|
function getModuleSource(mod) {
|
|
60
58
|
return isExternalModule(mod) ? "" : mod.originalSource?.()?.source().toString() ?? "";
|
|
61
59
|
}
|
|
62
|
-
function getResolveModule(dep, graph) {
|
|
63
|
-
if (graph && "getResolvedModule" in graph) {
|
|
64
|
-
return graph.getResolvedModule(dep);
|
|
65
|
-
}
|
|
66
|
-
return dep.module ?? void 0;
|
|
67
|
-
}
|
|
68
60
|
function getEntryModule(entryMap) {
|
|
69
61
|
return Array.from(entryMap.values()).map((entry) => entry.getRuntimeChunk()).map((chunk) => chunk ? chunk.entryModule : null).filter(Boolean).map((mod) => isNormalModule(mod) ? mod : mod.rootModule);
|
|
70
62
|
}
|
|
71
|
-
function getModuleExportsType(module2, moduleGraph, strict = false) {
|
|
72
|
-
if (moduleGraph) {
|
|
73
|
-
return module2.getExportsType(moduleGraph, strict);
|
|
74
|
-
}
|
|
75
|
-
const exportsType = module2.buildMeta?.exportsType;
|
|
76
|
-
if (!exportsType && !strict) {
|
|
77
|
-
return "dynamic";
|
|
78
|
-
}
|
|
79
|
-
if (exportsType === "named") {
|
|
80
|
-
return "namespace";
|
|
81
|
-
}
|
|
82
|
-
return strict ? "default-with-named" : "dynamic";
|
|
83
|
-
}
|
|
84
63
|
function getDependencyPosition(dep, module2, getSource = true) {
|
|
85
64
|
const { loc: depLoc } = dep;
|
|
86
65
|
if (!("start" in depLoc)) {
|
|
@@ -168,9 +147,7 @@ function getAllModules(compilation) {
|
|
|
168
147
|
getExportDependency,
|
|
169
148
|
getExportStatement,
|
|
170
149
|
getLastExportInfo,
|
|
171
|
-
getModuleExportsType,
|
|
172
150
|
getModuleSource,
|
|
173
|
-
getResolveModule,
|
|
174
151
|
getResolveRequest,
|
|
175
152
|
getSdkDependencyByWebpackDependency,
|
|
176
153
|
getWebpackDependencyRequest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureModulesChunkGraph.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/ensureModulesChunkGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ensureModulesChunkGraph.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/ensureModulesChunkGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAA4B,MAAM,iBAAiB,CAAC;AAW3E;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAC3B,MAAM,CAAC,YAAY,SACtB,sBAAsB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,SAiG5E,CAAC"}
|
|
@@ -73,25 +73,25 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
|
|
|
73
73
|
"Rspack currently does not support treeShaking capabilities."
|
|
74
74
|
)
|
|
75
75
|
);
|
|
76
|
-
|
|
77
|
-
_this.modulesGraph = import_build2.ModuleGraph.appendTreeShaking(
|
|
78
|
-
_this.modulesGraph,
|
|
79
|
-
stats.compilation
|
|
80
|
-
) || _this.modulesGraph;
|
|
81
|
-
_this.sdk.addClientRoutes([
|
|
82
|
-
import_types2.Manifest.RsdoctorManifestClientRoutes.TreeShaking
|
|
83
|
-
]);
|
|
84
|
-
(0, import_logger.debug)(
|
|
85
|
-
import_build.Process.getMemoryUsageMessage,
|
|
86
|
-
"[After AppendTreeShaking to ModuleGraph]"
|
|
87
|
-
);
|
|
76
|
+
return;
|
|
88
77
|
}
|
|
78
|
+
_this.modulesGraph = import_build2.ModuleGraph.appendTreeShaking(
|
|
79
|
+
_this.modulesGraph,
|
|
80
|
+
stats.compilation
|
|
81
|
+
) || _this.modulesGraph;
|
|
82
|
+
_this.sdk.addClientRoutes([
|
|
83
|
+
import_types2.Manifest.RsdoctorManifestClientRoutes.TreeShaking
|
|
84
|
+
]);
|
|
85
|
+
(0, import_logger.debug)(
|
|
86
|
+
import_build.Process.getMemoryUsageMessage,
|
|
87
|
+
"[After AppendTreeShaking to ModuleGraph]"
|
|
88
|
+
);
|
|
89
89
|
}
|
|
90
90
|
const shouldParseBundle = _this.options.supports.parseBundle !== false;
|
|
91
|
-
await
|
|
91
|
+
await getModulesInfos(
|
|
92
92
|
compiler,
|
|
93
|
-
statsJson,
|
|
94
93
|
_this.modulesGraph,
|
|
94
|
+
_this.chunkGraph,
|
|
95
95
|
shouldParseBundle
|
|
96
96
|
);
|
|
97
97
|
(0, import_logger.debug)(import_build.Process.getMemoryUsageMessage, "[After Transform ModuleGraph]");
|
|
@@ -106,7 +106,7 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
|
|
|
106
106
|
import_build2.Chunks.TileGraphReportName
|
|
107
107
|
),
|
|
108
108
|
reportTitle: "bundle-analyzer",
|
|
109
|
-
reportDir: _this.options.reportDir
|
|
109
|
+
reportDir: _this.options.output.reportDir
|
|
110
110
|
},
|
|
111
111
|
compiler.outputPath
|
|
112
112
|
);
|
|
@@ -117,13 +117,14 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
|
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
};
|
|
120
|
-
async function
|
|
120
|
+
async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle) {
|
|
121
121
|
if (!moduleGraph) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
try {
|
|
125
125
|
const parsedModulesData = await import_build2.Chunks.getAssetsModulesData(
|
|
126
|
-
|
|
126
|
+
moduleGraph,
|
|
127
|
+
chunkGraph,
|
|
127
128
|
compiler.outputPath,
|
|
128
129
|
parseBundle
|
|
129
130
|
) || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG5C,qBAAa,oBAAoB,CAC/B,CAAC,SAAS,MAAM,CAAC,YAAY,CAC7B,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,YAAY;IAEhC,SAAgB,kBAAkB,SAAuC;IAElE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAcjB,YAAY,aAAc,CAAC,UAYhC;IAEK,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG5C,qBAAa,oBAAoB,CAC/B,CAAC,SAAS,MAAM,CAAC,YAAY,CAC7B,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,YAAY;IAEhC,SAAgB,kBAAkB,SAAuC;IAElE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAcjB,YAAY,aAAc,CAAC,UAYhC;IAEK,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,eAAe;IAqG5D,iBAAiB,CACtB,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAC9B,MAAM,CAAC,gBAAgB,EAAE;CAa7B"}
|
|
@@ -135,13 +135,9 @@ class InternalLoaderPlugin extends import_base.InternalBasePlugin {
|
|
|
135
135
|
return tap;
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
).loader.intercept(interceptor);
|
|
142
|
-
} else if ("normalModuleLoader" in compilation.hooks) {
|
|
143
|
-
"normalModuleLoader" in compilation.hooks && compilation.hooks.normalModuleLoader.intercept(interceptor);
|
|
144
|
-
}
|
|
138
|
+
compiler.webpack.NormalModule.getCompilationHooks(
|
|
139
|
+
compilation
|
|
140
|
+
).loader.intercept(interceptor);
|
|
145
141
|
}
|
|
146
142
|
getInterceptRules(compiler, rules) {
|
|
147
143
|
return (0, import_utils.interceptLoader)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/summary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE5C,qBAAa,qBAAqB,CAChC,CAAC,SAAS,MAAM,CAAC,YAAY,CAC7B,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,aAAa;IAEjC,OAAO,CAAC,KAAK,CAAwD;IAErE,OAAO,CAAC,QAAQ,CAAwD;IAExE,OAAO,CAAC,SAAS,CAAwD;IAElE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAiBxB,OAAO,CAAC,IAAI;IAeL,aAAa,QAAa,OAAO,CAAC,IAAI,CAAC,CAQ5C;IAEK,YAAY,gBACJ,MAAM,CAAC,eAAe,KAClC,OAAO,CAAC,IAAI,CAAC,CAWd;IAEK,IAAI,aAAoB,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/summary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE5C,qBAAa,qBAAqB,CAChC,CAAC,SAAS,MAAM,CAAC,YAAY,CAC7B,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,aAAa;IAEjC,OAAO,CAAC,KAAK,CAAwD;IAErE,OAAO,CAAC,QAAQ,CAAwD;IAExE,OAAO,CAAC,SAAS,CAAwD;IAElE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAiBxB,OAAO,CAAC,IAAI;IAeL,aAAa,QAAa,OAAO,CAAC,IAAI,CAAC,CAQ5C;IAEK,YAAY,gBACJ,MAAM,CAAC,eAAe,KAClC,OAAO,CAAC,IAAI,CAAC,CAWd;IAEK,IAAI,aAAoB,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAoB9C;IAEF,OAAO,CAAC,MAAM;CAYf"}
|
|
@@ -51,12 +51,7 @@ class InternalSummaryPlugin extends import_base.InternalBasePlugin {
|
|
|
51
51
|
this.report(import_common.Summary.SummaryCostsDataName.Done, start);
|
|
52
52
|
if (compiler.options.optimization.minimize !== false) {
|
|
53
53
|
const pluginData = this.sdk.getStoreData().plugin;
|
|
54
|
-
const minifyHookData = [
|
|
55
|
-
...pluginData.optimizeChunkAssets || [],
|
|
56
|
-
// webpack4
|
|
57
|
-
...pluginData.processAssets || []
|
|
58
|
-
// webpack5
|
|
59
|
-
];
|
|
54
|
+
const minifyHookData = [...pluginData.processAssets || []];
|
|
60
55
|
minifyHookData.length && this.sdk.reportSummaryData({
|
|
61
56
|
costs: [
|
|
62
57
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EACV,gBAAgB,IAAI,sBAAsB,EAC1C,WAAW,IAAI,iBAAiB,EACjC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,IAAI,uBAAuB,EAC3C,wBAAwB,IAAI,+BAA+B,EAC3D,WAAW,IAAI,kBAAkB,EAClC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EAChB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EACV,gBAAgB,IAAI,sBAAsB,EAC1C,WAAW,IAAI,iBAAiB,EACjC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,IAAI,uBAAuB,EAC3C,wBAAwB,IAAI,+BAA+B,EAC3D,WAAW,IAAI,kBAAkB,EAClC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EAChB,MAAM,SAAS,CAAC;AAOjB,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,CAAC,cAAc,EAAE,EACvE,MAAM,GAAE,4BAA4B,CAAC,KAAK,CAAM,GAC/C,+BAA+B,CAAC,KAAK,CAAC,CA0HxC;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EACA,sBAAsB,GACtB,+BAA+B,GAC/B,uBAAuB,GACvB,IAAI,QAcT;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EACD,MAAM,CAAC,WAAW,EAAE,GACpB,iBAAiB,CAAC,OAAO,CAAC,GAC1B,kBAAkB,CAAC,OAAO,CAAC,QA+BhC;AAED,eAAO,MAAM,mBAAmB,mBACd,eAAe,QACzB,MAAM,OAAO,GAAG,CAAC,KAAK,KAC3B,GAAG,CAAC,UA2BN,CAAC"}
|
|
@@ -36,6 +36,7 @@ __export(config_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(config_exports);
|
|
37
37
|
var import_types = require("@rsdoctor/types");
|
|
38
38
|
var import_assert = __toESM(require("assert"));
|
|
39
|
+
var import_logger = require("@rsdoctor/utils/logger");
|
|
39
40
|
function defaultBoolean(v, dft) {
|
|
40
41
|
return typeof v === "boolean" ? v : dft;
|
|
41
42
|
}
|
|
@@ -46,15 +47,17 @@ function normalizeUserConfig(config = {}) {
|
|
|
46
47
|
loaderInterceptorOptions = {},
|
|
47
48
|
disableClientServer = false,
|
|
48
49
|
sdkInstance,
|
|
49
|
-
reportCodeType = {
|
|
50
|
-
noModuleSource: false,
|
|
51
|
-
noAssetsAndModuleSource: false,
|
|
52
|
-
noCode: false,
|
|
53
|
-
sourceCode: true,
|
|
54
|
-
assetsCode: true
|
|
55
|
-
},
|
|
56
50
|
disableTOSUpload = false,
|
|
57
51
|
innerClientPath = "",
|
|
52
|
+
output = {
|
|
53
|
+
reportCodeType: {
|
|
54
|
+
noModuleSource: false,
|
|
55
|
+
noAssetsAndModuleSource: false,
|
|
56
|
+
noCode: false
|
|
57
|
+
},
|
|
58
|
+
reportDir: "",
|
|
59
|
+
compressData: true
|
|
60
|
+
},
|
|
58
61
|
supports = {
|
|
59
62
|
parseBundle: true,
|
|
60
63
|
banner: void 0,
|
|
@@ -67,8 +70,7 @@ function normalizeUserConfig(config = {}) {
|
|
|
67
70
|
reportHtmlDir: void 0,
|
|
68
71
|
reportHtmlName: void 0,
|
|
69
72
|
writeDataJson: false
|
|
70
|
-
}
|
|
71
|
-
reportDir = ""
|
|
73
|
+
}
|
|
72
74
|
} = config;
|
|
73
75
|
(0, import_assert.default)(linter && typeof linter === "object");
|
|
74
76
|
(0, import_assert.default)(features && typeof features === "object");
|
|
@@ -107,23 +109,40 @@ function normalizeUserConfig(config = {}) {
|
|
|
107
109
|
},
|
|
108
110
|
disableClientServer,
|
|
109
111
|
sdkInstance,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
output: {
|
|
113
|
+
/**
|
|
114
|
+
* Data storage is divided into three types:
|
|
115
|
+
* The first type: normal mode, all codes are saved.
|
|
116
|
+
* The second type: lite is the same as reportCodeType.noModuleSource, which lacks module source code.
|
|
117
|
+
* The third type: reportCodeType.noAssetsAndModuleSource means there is no module source code nor the packaged product code.
|
|
118
|
+
*
|
|
119
|
+
* */
|
|
120
|
+
reportCodeType: output.reportCodeType ? normalizeReportType(output.reportCodeType, mode) : normalizeReportType(
|
|
121
|
+
{
|
|
122
|
+
noModuleSource: false,
|
|
123
|
+
noAssetsAndModuleSource: false,
|
|
124
|
+
noCode: false
|
|
125
|
+
},
|
|
126
|
+
mode
|
|
127
|
+
),
|
|
128
|
+
reportDir: output.reportDir || "",
|
|
129
|
+
compressData: output.compressData !== void 0 ? output.compressData : true
|
|
130
|
+
},
|
|
118
131
|
disableTOSUpload,
|
|
119
132
|
innerClientPath,
|
|
120
133
|
supports,
|
|
121
134
|
port,
|
|
122
135
|
printLog,
|
|
123
136
|
mode,
|
|
124
|
-
brief
|
|
125
|
-
reportDir
|
|
137
|
+
brief
|
|
126
138
|
};
|
|
139
|
+
if (!output.compressData && (output.reportCodeType && !output.reportCodeType?.noAssetsAndModuleSource || !output.reportCodeType)) {
|
|
140
|
+
import_logger.logger.info(
|
|
141
|
+
import_logger.chalk.yellow(
|
|
142
|
+
`[RSDOCTOR]: When you use compressData: false, it is recommended to set output.reportCodeType to { noAssetsAndModuleSource: true }.`
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
}
|
|
127
146
|
return res;
|
|
128
147
|
}
|
|
129
148
|
function makeRuleSetSerializable(item) {
|
|
@@ -182,10 +201,10 @@ const normalizeReportType = (reportCodeType, mode) => {
|
|
|
182
201
|
default: {
|
|
183
202
|
if (reportCodeType.noCode) {
|
|
184
203
|
globalReportCodeType = import_types.SDK.ToDataType.NoCode;
|
|
185
|
-
} else if (reportCodeType.noModuleSource) {
|
|
186
|
-
globalReportCodeType = import_types.SDK.ToDataType.NoSource;
|
|
187
204
|
} else if (reportCodeType.noAssetsAndModuleSource) {
|
|
188
205
|
globalReportCodeType = import_types.SDK.ToDataType.NoSourceAndAssets;
|
|
206
|
+
} else if (reportCodeType.noModuleSource) {
|
|
207
|
+
globalReportCodeType = import_types.SDK.ToDataType.NoSource;
|
|
189
208
|
} else {
|
|
190
209
|
globalReportCodeType = import_types.SDK.ToDataType.Normal;
|
|
191
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,eAAO,MAAM,IAAI,+CAuDf,CAAC"}
|
|
@@ -31,10 +31,10 @@ __export(ecma_version_check_exports, {
|
|
|
31
31
|
rule: () => rule
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(ecma_version_check_exports);
|
|
34
|
-
var import_ruleUtils = require("@rsdoctor/utils/ruleUtils");
|
|
35
34
|
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_plugin_check_syntax = require("@rsbuild/plugin-check-syntax");
|
|
36
|
+
var import_browserslist_load_config = require("browserslist-load-config");
|
|
36
37
|
var import_rule = require("../../rule");
|
|
37
|
-
var import_utils = require("./utils");
|
|
38
38
|
var import_types2 = require("@rsdoctor/types");
|
|
39
39
|
const title = "ecma-version-check";
|
|
40
40
|
const rule = (0, import_rule.defineRule)(() => {
|
|
@@ -45,33 +45,45 @@ const rule = (0, import_rule.defineRule)(() => {
|
|
|
45
45
|
category: "bundle",
|
|
46
46
|
severity: import_types2.Linter.Severity.Warn,
|
|
47
47
|
defaultConfig: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
ecmaVersion: void 0,
|
|
49
|
+
targets: []
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
check({ chunkGraph, report, ruleConfig }) {
|
|
52
|
+
async check({ chunkGraph, report, ruleConfig, root, configs }) {
|
|
53
53
|
for (const asset of chunkGraph.getAssets()) {
|
|
54
54
|
if (import_path.default.extname(asset.path) !== ".js") {
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
57
|
+
const browserslistConfig = (0, import_browserslist_load_config.loadConfig)({
|
|
58
|
+
path: root,
|
|
59
|
+
env: "production"
|
|
60
|
+
});
|
|
61
|
+
const { exclude, excludeOutput, targets, ecmaVersion } = ruleConfig;
|
|
62
|
+
const finalTargets = targets || browserslistConfig || [];
|
|
63
|
+
if (!finalTargets.length && !ecmaVersion) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const buildConfig = configs[0]?.config;
|
|
67
|
+
const context = buildConfig?.context || root;
|
|
68
|
+
const checkSyntax = new import_plugin_check_syntax.CheckSyntax({
|
|
69
|
+
exclude,
|
|
70
|
+
excludeOutput,
|
|
71
|
+
ecmaVersion,
|
|
72
|
+
rootPath: context,
|
|
73
|
+
targets: finalTargets
|
|
74
|
+
});
|
|
75
|
+
const outputDir = buildConfig?.output?.path || import_path.default.resolve(root, "dist");
|
|
76
|
+
const assetPath = import_path.default.resolve(outputDir, asset.path);
|
|
77
|
+
await checkSyntax.check(assetPath, asset.content);
|
|
78
|
+
checkSyntax.errors.forEach((err) => {
|
|
68
79
|
report({
|
|
69
|
-
message: `
|
|
80
|
+
message: `Find some syntax that does not match "ecmaVersion <= ${checkSyntax.ecmaVersion}"`,
|
|
70
81
|
detail: {
|
|
82
|
+
error: err,
|
|
71
83
|
type: "link"
|
|
72
84
|
}
|
|
73
85
|
});
|
|
74
|
-
}
|
|
86
|
+
});
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface Config {
|
|
3
|
-
/** Check the ecma version */
|
|
4
|
-
highestVersion: ECMAVersion;
|
|
5
|
-
/** Js files that need to be ignored */
|
|
6
|
-
ignore: string[];
|
|
1
|
+
import type { PluginCheckSyntaxOptions } from '@rsbuild/plugin-check-syntax';
|
|
2
|
+
export interface Config extends PluginCheckSyntaxOptions {
|
|
7
3
|
}
|
|
8
4
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,MAAM,WAAW,MAAO,SAAQ,wBAAwB;CAAG"}
|
package/dist/types/chunks.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
1
|
+
import { Plugin, SDK } from '@rsdoctor/types';
|
|
2
2
|
export type AssetsModules = {
|
|
3
3
|
label?: string;
|
|
4
4
|
isAsset?: boolean;
|
|
5
5
|
modules?: Plugin.StatsModule[];
|
|
6
6
|
};
|
|
7
|
-
export type ParseBundle = (assetFile: string, modules:
|
|
7
|
+
export type ParseBundle = (assetFile: string, modules: Pick<SDK.ModuleInstance, 'renderId' | 'webpackId'>[]) => {
|
|
8
8
|
modules?: Record<string, any>;
|
|
9
9
|
src?: string;
|
|
10
10
|
runtimeSrc?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/types/chunks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/types/chunks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,CAAC,EAAE,KAC1D;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Linter as LinterType, Common, Plugin, SDK } from '@rsdoctor/types';
|
|
2
2
|
import type { RsdoctorPrimarySDK, RsdoctorSDK } from '@rsdoctor/sdk';
|
|
3
|
-
import { ChunkGraph, ModuleGraph } from '@rsdoctor/graph';
|
|
4
3
|
import { rules } from '../rules/rules';
|
|
5
4
|
type InternalRules = Common.UnionToTuple<(typeof rules)[number]>;
|
|
6
5
|
export type IReportCodeType = {
|
|
@@ -26,7 +25,7 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
|
|
|
26
25
|
*/
|
|
27
26
|
mode?: keyof typeof SDK.IMode;
|
|
28
27
|
/**
|
|
29
|
-
* configuration of the interceptor for webpack loaders.
|
|
28
|
+
* configuration of the interceptor for webpack loaders. TODO: delete this options.
|
|
30
29
|
* @description worked when the `features.loader === true`.
|
|
31
30
|
*/
|
|
32
31
|
loaderInterceptorOptions?: {
|
|
@@ -41,21 +40,13 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
|
|
|
41
40
|
*/
|
|
42
41
|
disableClientServer?: boolean;
|
|
43
42
|
/**
|
|
44
|
-
* sdk instance of outside
|
|
43
|
+
* sdk instance of outside. TODO: delete this options
|
|
45
44
|
*/
|
|
46
45
|
sdkInstance?: RsdoctorSDK;
|
|
47
46
|
/**
|
|
48
47
|
* Whether to turn on some characteristic analysis capabilities, such as: the support for the BannerPlugin.
|
|
49
48
|
*/
|
|
50
49
|
supports?: ISupport;
|
|
51
|
-
/**
|
|
52
|
-
* The directory where the report files will be output.
|
|
53
|
-
*/
|
|
54
|
-
reportDir?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Control the Rsdoctor reporter codes records.
|
|
57
|
-
*/
|
|
58
|
-
reportCodeType?: IReportCodeType | undefined;
|
|
59
50
|
/**
|
|
60
51
|
* The port of the Rsdoctor server.
|
|
61
52
|
*/
|
|
@@ -69,15 +60,30 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
|
|
|
69
60
|
*/
|
|
70
61
|
brief?: SDK.BriefConfig;
|
|
71
62
|
/**
|
|
72
|
-
* control the Rsdoctor upload data to TOS, used by inner-rsdoctor.
|
|
63
|
+
* control the Rsdoctor upload data to TOS, used by inner-rsdoctor. TODO: delete this options
|
|
73
64
|
* @default false
|
|
74
65
|
*/
|
|
75
66
|
disableTOSUpload?: boolean;
|
|
76
67
|
/**
|
|
77
|
-
* The name of inner rsdoctor's client package, used by inner-rsdoctor.
|
|
68
|
+
* The name of inner rsdoctor's client package, used by inner-rsdoctor. TODO: delete this options
|
|
78
69
|
* @default false
|
|
79
70
|
*/
|
|
80
71
|
innerClientPath?: string;
|
|
72
|
+
output?: {
|
|
73
|
+
/**
|
|
74
|
+
* The directory where the report files will be output.
|
|
75
|
+
*/
|
|
76
|
+
reportDir?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Control the Rsdoctor reporter codes records.
|
|
79
|
+
*/
|
|
80
|
+
reportCodeType?: IReportCodeType | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Configure whether to compress data.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
compressData?: boolean;
|
|
86
|
+
};
|
|
81
87
|
}
|
|
82
88
|
export interface RsdoctorMultiplePluginOptions<Rules extends LinterType.ExtendRuleData[] = LinterType.ExtendRuleData[]> extends Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance'>, Pick<ConstructorParameters<typeof RsdoctorPrimarySDK>[0], 'stage'> {
|
|
83
89
|
/**
|
|
@@ -90,12 +96,16 @@ interface ISupport {
|
|
|
90
96
|
parseBundle?: boolean;
|
|
91
97
|
generateTileGraph?: boolean;
|
|
92
98
|
}
|
|
93
|
-
export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance' | 'linter' | '
|
|
99
|
+
export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance' | 'linter' | 'output' | 'supports' | 'port' | 'brief'>> {
|
|
94
100
|
features: Common.DeepRequired<Plugin.RsdoctorWebpackPluginFeatures>;
|
|
95
101
|
linter: Required<LinterType.Options<Rules, InternalRules>>;
|
|
96
102
|
sdkInstance?: RsdoctorSDK;
|
|
103
|
+
output: {
|
|
104
|
+
reportCodeType: SDK.ToDataType;
|
|
105
|
+
reportDir: string;
|
|
106
|
+
compressData: boolean;
|
|
107
|
+
};
|
|
97
108
|
port?: number;
|
|
98
|
-
reportCodeType: SDK.ToDataType;
|
|
99
109
|
supports: ISupport;
|
|
100
110
|
brief: SDK.BriefConfig;
|
|
101
111
|
}
|
|
@@ -113,8 +123,8 @@ export interface RsdoctorPluginInstance<T extends Plugin.BaseCompiler, Rules ext
|
|
|
113
123
|
readonly sdk: RsdoctorSDK;
|
|
114
124
|
readonly isRsdoctorPlugin: boolean;
|
|
115
125
|
_modulesGraphApplied?: boolean;
|
|
116
|
-
chunkGraph?:
|
|
117
|
-
modulesGraph:
|
|
126
|
+
chunkGraph?: SDK.ChunkGraphInstance;
|
|
127
|
+
modulesGraph: SDK.ModuleGraphInstance;
|
|
118
128
|
ensureModulesChunksGraphApplied(compiler: T): void;
|
|
119
129
|
}
|
|
120
130
|
export interface RsdoctorRspackPluginInstance<Rules extends LinterType.ExtendRuleData[] = []> extends RsdoctorPluginInstance<Plugin.BaseCompilerType<'rspack'>, Rules> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,IAAI,UAAU,EACpB,MAAM,EACN,MAAM,EACN,GAAG,EACJ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -71,15 +71,17 @@
|
|
|
71
71
|
"semver": "^7.6.3",
|
|
72
72
|
"source-map": "^0.7.4",
|
|
73
73
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
74
|
-
"@
|
|
75
|
-
"
|
|
76
|
-
"@rsdoctor/
|
|
77
|
-
"@rsdoctor/
|
|
74
|
+
"@rsbuild/plugin-check-syntax": "1.2.1",
|
|
75
|
+
"browserslist-load-config": "^1.0.0",
|
|
76
|
+
"@rsdoctor/graph": "1.0.0-alpha.1",
|
|
77
|
+
"@rsdoctor/sdk": "1.0.0-alpha.1",
|
|
78
|
+
"@rsdoctor/types": "1.0.0-alpha.1",
|
|
79
|
+
"@rsdoctor/utils": "1.0.0-alpha.1"
|
|
78
80
|
},
|
|
79
81
|
"devDependencies": {
|
|
80
82
|
"@rspack/core": "^1.1.8",
|
|
81
83
|
"@types/fs-extra": "^11.0.4",
|
|
82
|
-
"@types/lodash": "^4.17.
|
|
84
|
+
"@types/lodash": "^4.17.14",
|
|
83
85
|
"@types/node": "^16",
|
|
84
86
|
"@types/node-fetch": "^2.6.12",
|
|
85
87
|
"@types/path-browserify": "1.0.3",
|
|
@@ -87,10 +89,10 @@
|
|
|
87
89
|
"@types/tapable": "2.2.7",
|
|
88
90
|
"babel-loader": "9.1.3",
|
|
89
91
|
"string-loader": "0.0.1",
|
|
90
|
-
"ts-loader": "^9.5.
|
|
92
|
+
"ts-loader": "^9.5.2",
|
|
91
93
|
"tslib": "2.8.1",
|
|
92
94
|
"typescript": "^5.2.2",
|
|
93
|
-
"webpack": "^5.
|
|
95
|
+
"webpack": "^5.97.1",
|
|
94
96
|
"@scripts/test-helper": "0.1.1"
|
|
95
97
|
},
|
|
96
98
|
"publishConfig": {
|