@rsdoctor/core 0.4.6 → 0.4.8
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/build-utils/build/module-graph/treeShaking.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/treeShaking.js +3 -2
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +1 -1
- package/dist/build-utils/build/module-graph/webpack/transform.js +3 -2
- 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/inner-plugins/plugins/progress.d.ts +1 -1
- package/dist/inner-plugins/plugins/progress.d.ts.map +1 -1
- package/dist/inner-plugins/plugins/progress.js +1 -1
- package/dist/inner-plugins/plugins/rules.d.ts.map +1 -1
- package/dist/inner-plugins/utils/config.d.ts.map +1 -1
- package/dist/inner-plugins/utils/config.js +4 -0
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +1 -1
- package/dist/rules/rules/loader-performance-optimization/utils.js +3 -3
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeShaking.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/treeShaking.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAMZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"treeShaking.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/module-graph/treeShaking.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAMZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAuJnD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,CAAC,eAAe,2BAuBpC"}
|
|
@@ -113,8 +113,9 @@ function appendTreeShaking(moduleGraph, compilation) {
|
|
|
113
113
|
}
|
|
114
114
|
if ("moduleGraph" in compilation) {
|
|
115
115
|
const exportData = /* @__PURE__ */ new Map();
|
|
116
|
-
const
|
|
117
|
-
const
|
|
116
|
+
const webpackCompilation = compilation;
|
|
117
|
+
const { moduleGraph: webpackGraph } = webpackCompilation;
|
|
118
|
+
const allModules = (0, import_compatible.getAllModules)(webpackCompilation);
|
|
118
119
|
allModules.forEach(
|
|
119
120
|
(origin) => transformMgm(origin, webpackGraph, moduleGraph, exportData)
|
|
120
121
|
);
|
|
@@ -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,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAU,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAmBnE,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;AAsND,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,6BAA6B,EAC/C,OAAO,CAAC,EAAE,gBAAgB,
|
|
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,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAU,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAmBnE,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;AAsND,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,6BAA6B,EAC/C,OAAO,CAAC,EAAE,gBAAgB,wBA0B3B"}
|
|
@@ -169,8 +169,9 @@ async function appendModuleData(origin, webpackGraph, graph, wbFs, features, con
|
|
|
169
169
|
}
|
|
170
170
|
async function appendModuleGraphByCompilation(compilation, graph, features, context) {
|
|
171
171
|
try {
|
|
172
|
-
const
|
|
173
|
-
const
|
|
172
|
+
const webpackCompilation = compilation;
|
|
173
|
+
const { moduleGraph: webpackGraph, fileSystemInfo } = webpackCompilation;
|
|
174
|
+
const allModules = (0, import_compatible.getAllModules)(webpackCompilation);
|
|
174
175
|
await Promise.all(
|
|
175
176
|
allModules.map((module2) => {
|
|
176
177
|
return appendModuleData(
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Plugin, SDK } from '@rsdoctor/types';
|
|
2
2
|
/**
|
|
3
3
|
* Reverse decode the location (loc) information.
|
|
4
|
-
*
|
|
5
|
-
* // TODO::
|
|
4
|
+
* // TODO:
|
|
6
5
|
* @link https://github.com/webpack/webpack/blob/main/lib/formatLocation.js#L30-L66
|
|
7
6
|
*/
|
|
8
7
|
export declare function getPositionByStatsLocation(loc: string): SDK.SourceRange | undefined;
|
|
@@ -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
|
|
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"}
|
|
@@ -3,7 +3,7 @@ import type { Plugin } from '@rsdoctor/types';
|
|
|
3
3
|
import { InternalBasePlugin } from './base';
|
|
4
4
|
export declare class InternalProgressPlugin<T extends Plugin.BaseCompilerType<'webpack'>> extends InternalBasePlugin<T> {
|
|
5
5
|
readonly name = "progress";
|
|
6
|
-
protected currentProgress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.
|
|
6
|
+
protected currentProgress: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.APIExtends.GetCompileProgress>;
|
|
7
7
|
apply(compiler: T): void;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG5C,qBAAa,sBAAsB,CACjC,CAAC,SAAS,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAC5C,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,cAAc;IAElC,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG5C,qBAAa,sBAAsB,CACjC,CAAC,SAAS,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAC5C,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC7B,SAAgB,IAAI,cAAc;IAElC,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAInG;IAEG,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI;CAyBhC"}
|
|
@@ -40,7 +40,7 @@ class InternalProgressPlugin extends import_base.InternalBasePlugin {
|
|
|
40
40
|
handler(percentage, msg) {
|
|
41
41
|
currentProgress.percentage = percentage;
|
|
42
42
|
currentProgress.message = msg || "";
|
|
43
|
-
const api = import_types.SDK.ServerAPI.APIExtends.
|
|
43
|
+
const api = import_types.SDK.ServerAPI.APIExtends.GetCompileProgress;
|
|
44
44
|
try {
|
|
45
45
|
sdk.server.sendAPIDataToClient(api, {
|
|
46
46
|
req: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC;IAC9E,SAAgB,IAAI,WAAW;IAExB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY;IAInC,IAAI,UAAiB,MAAM,CAAC,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;cAEc,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe;CAoDzD"}
|
|
@@ -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,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EAChB,MAAM,SAAS,CAAC;AAMjB,wBAAgB,mBAAmB,C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3B,GAAG,CAAC,UA2BN,CAAC"}
|
|
@@ -182,6 +182,10 @@ const normalizeReportType = (reportCodeType, mode) => {
|
|
|
182
182
|
default: {
|
|
183
183
|
if (reportCodeType.noCode) {
|
|
184
184
|
globalReportCodeType = import_types.SDK.ToDataType.NoCode;
|
|
185
|
+
} else if (reportCodeType.noModuleSource) {
|
|
186
|
+
globalReportCodeType = import_types.SDK.ToDataType.NoSource;
|
|
187
|
+
} else if (reportCodeType.noAssetsAndModuleSource) {
|
|
188
|
+
globalReportCodeType = import_types.SDK.ToDataType.NoSourceAndAssets;
|
|
185
189
|
} else {
|
|
186
190
|
globalReportCodeType = import_types.SDK.ToDataType.Normal;
|
|
187
191
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function match(str: string,
|
|
1
|
+
export declare function match(str: string, patterns: (string | RegExp)[]): boolean;
|
|
2
2
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/loader-performance-optimization/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/loader-performance-optimization/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAQ/D"}
|
|
@@ -21,10 +21,10 @@ __export(utils_exports, {
|
|
|
21
21
|
match: () => match
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(utils_exports);
|
|
24
|
-
function match(str,
|
|
25
|
-
if (
|
|
24
|
+
function match(str, patterns) {
|
|
25
|
+
if (patterns.length === 0)
|
|
26
26
|
return false;
|
|
27
|
-
return
|
|
27
|
+
return patterns.some((p) => {
|
|
28
28
|
if (typeof p === "string")
|
|
29
29
|
return str === p;
|
|
30
30
|
if (p instanceof RegExp)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"semver": "^7.6.3",
|
|
72
72
|
"source-map": "^0.7.4",
|
|
73
73
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
74
|
-
"@rsdoctor/graph": "0.4.
|
|
75
|
-
"@rsdoctor/sdk": "0.4.
|
|
76
|
-
"@rsdoctor/types": "0.4.
|
|
77
|
-
"@rsdoctor/utils": "0.4.
|
|
74
|
+
"@rsdoctor/graph": "0.4.8",
|
|
75
|
+
"@rsdoctor/sdk": "0.4.8",
|
|
76
|
+
"@rsdoctor/types": "0.4.8",
|
|
77
|
+
"@rsdoctor/utils": "0.4.8"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@rspack/core": "0.
|
|
80
|
+
"@rspack/core": "1.0.11",
|
|
81
81
|
"@types/fs-extra": "^11.0.4",
|
|
82
|
-
"@types/lodash": "^4.17.
|
|
82
|
+
"@types/lodash": "^4.17.10",
|
|
83
83
|
"@types/node": "^16",
|
|
84
84
|
"@types/node-fetch": "^2.6.11",
|
|
85
85
|
"@types/path-browserify": "1.0.3",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"ts-loader": "^9.5.1",
|
|
91
91
|
"tslib": "2.7.0",
|
|
92
92
|
"typescript": "^5.2.2",
|
|
93
|
-
"webpack": "^5.
|
|
93
|
+
"webpack": "^5.95.0",
|
|
94
94
|
"@scripts/test-helper": "0.1.1"
|
|
95
95
|
},
|
|
96
96
|
"publishConfig": {
|