@rsdoctor/core 0.2.4 → 0.2.5
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/utils/parseBundle.d.ts.map +1 -1
- package/dist/build-utils/build/utils/parseBundle.js +105 -15
- package/dist/build-utils/build/utils/plugin.d.ts +4 -4
- package/dist/build-utils/build/utils/plugin.d.ts.map +1 -1
- package/dist/build-utils/common/chunks/assetsModules.d.ts.map +1 -1
- package/dist/build-utils/common/chunks/assetsModules.js +2 -0
- package/dist/inner-plugins/plugins/rules.d.ts.map +1 -1
- package/dist/inner-plugins/utils/plugin.d.ts +2 -2
- package/dist/inner-plugins/utils/plugin.d.ts.map +1 -1
- package/dist/rules/rule.d.ts.map +1 -1
- package/dist/rules/rule.js +5 -2
- package/package.json +6 -6
|
@@ -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;
|
|
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,WA4PzB,CAAC"}
|
|
@@ -36,6 +36,7 @@ var import_lodash = require("lodash");
|
|
|
36
36
|
var import_bytes = __toESM(require("bytes"));
|
|
37
37
|
var import_ruleUtils = require("@rsdoctor/utils/ruleUtils");
|
|
38
38
|
var import_path = require("path");
|
|
39
|
+
var import_logger = require("@rsdoctor/utils/logger");
|
|
39
40
|
const parseBundle = (bundlePath, modulesData) => {
|
|
40
41
|
if (bundlePath.indexOf(".worker.") > 0) {
|
|
41
42
|
return {};
|
|
@@ -43,7 +44,24 @@ const parseBundle = (bundlePath, modulesData) => {
|
|
|
43
44
|
if ((0, import_path.extname)(bundlePath) !== ".js") {
|
|
44
45
|
return {};
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
let content = import_fs.default.readFileSync(bundlePath, "utf8");
|
|
48
|
+
const tagCache = /* @__PURE__ */ new Map();
|
|
49
|
+
let hasBannerPlugin = content.indexOf("RSDOCTOR_START::") > 0;
|
|
50
|
+
if (hasBannerPlugin && !tagCache.get(bundlePath)) {
|
|
51
|
+
const tagMatchResult = getStringBetween(
|
|
52
|
+
content,
|
|
53
|
+
0,
|
|
54
|
+
/([a-z|A-Z]+\.[a-z]+)\(\SRSDOCTOR_START::(.*?);/,
|
|
55
|
+
/([a-z|A-Z]+\.[a-z]+)\(\SRSDOCTOR_END::(.*?)\)/
|
|
56
|
+
);
|
|
57
|
+
content = tagMatchResult.result?.trim() || content;
|
|
58
|
+
tagCache.set(bundlePath, tagMatchResult.loc);
|
|
59
|
+
hasBannerPlugin = true;
|
|
60
|
+
} else if (hasBannerPlugin && !tagCache.get(bundlePath)) {
|
|
61
|
+
const loc = tagCache.get(bundlePath);
|
|
62
|
+
content = content.slice(loc.start, loc.end);
|
|
63
|
+
hasBannerPlugin = true;
|
|
64
|
+
}
|
|
47
65
|
const ast = import_ruleUtils.parser.internal.parse(content, {
|
|
48
66
|
sourceType: "script",
|
|
49
67
|
ecmaVersion: "latest"
|
|
@@ -57,19 +75,50 @@ const parseBundle = (bundlePath, modulesData) => {
|
|
|
57
75
|
if (state.locations)
|
|
58
76
|
return;
|
|
59
77
|
state.expressionStatementDepth++;
|
|
60
|
-
|
|
61
|
-
// Webpack 5 stores modules in the the top-level IIFE
|
|
62
|
-
state.expressionStatementDepth === 1 && // ast?.range?.includes(node) &&
|
|
63
|
-
isIIFE(node)
|
|
64
|
-
) {
|
|
65
|
-
const fn = getIIFECallExpression(node);
|
|
78
|
+
try {
|
|
66
79
|
if (
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
// Webpack 5 stores modules in the the top-level IIFE
|
|
81
|
+
state.expressionStatementDepth === 1 && // ast?.range?.includes(node) &&
|
|
82
|
+
isIIFE(node)
|
|
70
83
|
) {
|
|
71
|
-
const
|
|
72
|
-
|
|
84
|
+
const fn = getIIFECallExpression(node);
|
|
85
|
+
if (
|
|
86
|
+
// It should not contain neither arguments
|
|
87
|
+
fn.arguments.length === 0 && // ...nor parameters
|
|
88
|
+
fn.callee.params.length === 0
|
|
89
|
+
) {
|
|
90
|
+
const firstVariableDeclaration = fn.callee.body.body.find(
|
|
91
|
+
(node2) => node2.type === "VariableDeclaration"
|
|
92
|
+
);
|
|
93
|
+
if (firstVariableDeclaration) {
|
|
94
|
+
for (const declaration of firstVariableDeclaration.declarations) {
|
|
95
|
+
if (declaration.init) {
|
|
96
|
+
state.locations = getModulesLocations(declaration.init);
|
|
97
|
+
if (state.locations) {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!state.locations) {
|
|
106
|
+
c(node.expression, state);
|
|
107
|
+
}
|
|
108
|
+
} catch (e) {
|
|
109
|
+
(0, import_logger.debug)(() => e);
|
|
110
|
+
}
|
|
111
|
+
state.expressionStatementDepth--;
|
|
112
|
+
},
|
|
113
|
+
Program(node, state, _c) {
|
|
114
|
+
if (state.locations)
|
|
115
|
+
return;
|
|
116
|
+
try {
|
|
117
|
+
if (hasBannerPlugin) {
|
|
118
|
+
const firstVariableDeclaration = node.body.find(
|
|
119
|
+
(node2) => {
|
|
120
|
+
return node2.type === "VariableDeclaration" && node2.declarations?.[0]?.init?.type === "ObjectExpression" && node2.declarations?.[0]?.init?.properties?.length;
|
|
121
|
+
}
|
|
73
122
|
);
|
|
74
123
|
if (firstVariableDeclaration) {
|
|
75
124
|
for (const declaration of firstVariableDeclaration.declarations) {
|
|
@@ -82,9 +131,11 @@ const parseBundle = (bundlePath, modulesData) => {
|
|
|
82
131
|
}
|
|
83
132
|
}
|
|
84
133
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
134
|
+
if (!state.locations) {
|
|
135
|
+
node.body.forEach((n) => _c(n, state));
|
|
136
|
+
}
|
|
137
|
+
} catch (e) {
|
|
138
|
+
(0, import_logger.debug)(() => e);
|
|
88
139
|
}
|
|
89
140
|
state.expressionStatementDepth--;
|
|
90
141
|
},
|
|
@@ -271,6 +322,45 @@ function getModuleLocation(node) {
|
|
|
271
322
|
end: node.end
|
|
272
323
|
};
|
|
273
324
|
}
|
|
325
|
+
function getStringBetween(raw, position, start, end) {
|
|
326
|
+
try {
|
|
327
|
+
const matchStart = raw.match(start);
|
|
328
|
+
const startFlagIndex = matchStart?.length ? raw.indexOf(matchStart[0], position) : -1;
|
|
329
|
+
if (startFlagIndex === -1 || !matchStart?.length) {
|
|
330
|
+
return {
|
|
331
|
+
result: null,
|
|
332
|
+
remain: position
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const startTagLength = matchStart[0].length;
|
|
336
|
+
const matchEnd = raw.match(end);
|
|
337
|
+
const endFlagIndex = matchEnd?.length ? raw.indexOf(matchEnd[0], startFlagIndex + startTagLength) : -1;
|
|
338
|
+
if (endFlagIndex === -1 || !matchEnd?.length) {
|
|
339
|
+
return {
|
|
340
|
+
result: null,
|
|
341
|
+
remain: position
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
let innerContent = raw.slice(startFlagIndex + startTagLength, endFlagIndex).trim();
|
|
345
|
+
if (innerContent.endsWith(",")) {
|
|
346
|
+
innerContent = innerContent.slice(0, -1);
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
result: innerContent,
|
|
350
|
+
remain: matchEnd?.length ? endFlagIndex + matchEnd[0].length : endFlagIndex,
|
|
351
|
+
loc: {
|
|
352
|
+
start: startFlagIndex + startTagLength,
|
|
353
|
+
end: endFlagIndex
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
} catch (e) {
|
|
357
|
+
(0, import_logger.debug)(() => e);
|
|
358
|
+
return {
|
|
359
|
+
result: null,
|
|
360
|
+
remain: position
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
}
|
|
274
364
|
// Annotate the CommonJS export names for ESM import in node:
|
|
275
365
|
0 && (module.exports = {
|
|
276
366
|
parseBundle
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Hook } from 'tapable';
|
|
2
1
|
import { Plugin } from '@rsdoctor/types';
|
|
3
|
-
export
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
2
|
+
export type IHook = Plugin.BaseCompiler['hooks'][keyof Plugin.BaseCompiler['hooks']];
|
|
3
|
+
export declare function shouldInterceptPluginHook<T extends IHook>(hook: T): boolean;
|
|
4
|
+
export declare function interceptCompilerHooks(compiler: Plugin.BaseCompiler, interceptor: (name: string, hook: IHook, scope: 'compiler') => void): void;
|
|
5
|
+
export declare function interceptCompilationHooks(compilation: Plugin.BaseCompilation, interceptor: (name: string, hook: IHook, scope: 'compilation') => void): void;
|
|
6
6
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,KAAK,GACf,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnE,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,KAAK,EAAE,IAAI,EAAE,CAAC,WAoBjE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,QAQpE;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,QAiBvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsModules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,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,MAAM,CAAC,gBAAgB,EACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsModules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,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,MAAM,CAAC,gBAAgB,EACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAsEtC;AAED,wBAAgB,0BAA0B,CACxC,iBAAiB,EAAE,oBAAoB,EACvC,WAAW,EAAE,WAAW,QAUzB"}
|
|
@@ -66,6 +66,8 @@ async function getAssetsModulesData(bundleStats, bundleDir, opts) {
|
|
|
66
66
|
let bundleInfo;
|
|
67
67
|
const collectedModules = [];
|
|
68
68
|
(0, import_module_graph.getModulesFromArray)(bundleStats.modules ?? [], collectedModules);
|
|
69
|
+
const childrenModules = bundleStats.children?.flatMap((c) => c.modules || []) || [];
|
|
70
|
+
collectedModules.push(...childrenModules);
|
|
69
71
|
try {
|
|
70
72
|
bundleInfo = await parseBundle(assetFile, collectedModules);
|
|
71
73
|
} catch (err) {
|
|
@@ -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,
|
|
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;AAIzC,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC;IAC9E,SAAgB,IAAI,WAAW;IAExB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY;IAInC,IAAI,UAAiB,OAAO,SAAS,KAAG,QAAQ,IAAI,CAAC,CAE1D;cAEc,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe;CAoDzD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Hook } from 'tapable';
|
|
2
1
|
import type { SDK } from '@rsdoctor/types';
|
|
3
2
|
import type { RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
3
|
+
import { IHook } from '../../build-utils/build/utils';
|
|
4
4
|
export declare function reportPluginData(sdk: RsdoctorWebpackSDK, hook: string, tapName: string, start: number, type: SDK.PluginHookData['type'], _res: unknown, err?: Error): void;
|
|
5
|
-
export declare function interceptPluginHook(sdk: RsdoctorWebpackSDK, name: string, hook:
|
|
5
|
+
export declare function interceptPluginHook(sdk: RsdoctorWebpackSDK, name: string, hook: IHook): void;
|
|
6
6
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/utils/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/utils/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,MAAM,CA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,wBAAgB,UAAU,CACxB,KAAK,SAAS,MAAM,CAAC,gBAAgB,EACrC,CAAC,GAAG,MAAM,CAAC,iBAAiB,EAE5B,WAAW,EAAE,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAC,GAClD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACnC,wBAAgB,UAAU,CACxB,KAAK,SAAS,MAAM,CAAC,gBAAgB,EACrC,CAAC,GAAG,MAAM,CAAC,iBAAiB,EAC5B,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
package/dist/rules/rule.js
CHANGED
|
@@ -94,14 +94,17 @@ class Rule {
|
|
|
94
94
|
if (remove) {
|
|
95
95
|
replace.push(remove);
|
|
96
96
|
}
|
|
97
|
+
let severity = data.severity ? (0, import_utils.toSeverity)(data.severity, this.severity) : this.severity;
|
|
97
98
|
const error = {
|
|
98
99
|
...data,
|
|
99
100
|
code: this.code,
|
|
100
|
-
severity
|
|
101
|
+
severity,
|
|
101
102
|
category: this.category,
|
|
102
103
|
title: this.title.toUpperCase()
|
|
103
104
|
};
|
|
104
|
-
|
|
105
|
+
if (severity !== import_types.Linter.Severity.Ignore) {
|
|
106
|
+
errors.push(error);
|
|
107
|
+
}
|
|
105
108
|
};
|
|
106
109
|
await this.check({
|
|
107
110
|
...context,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"semver": "^7.5.4",
|
|
73
73
|
"source-map": "^0.7.4",
|
|
74
74
|
"webpack-bundle-analyzer": "^4.9.1",
|
|
75
|
-
"@rsdoctor/graph": "0.2.
|
|
76
|
-
"@rsdoctor/sdk": "0.2.
|
|
77
|
-
"@rsdoctor/types": "0.2.
|
|
78
|
-
"@rsdoctor/utils": "0.2.
|
|
75
|
+
"@rsdoctor/graph": "0.2.5",
|
|
76
|
+
"@rsdoctor/sdk": "0.2.5",
|
|
77
|
+
"@rsdoctor/types": "0.2.5",
|
|
78
|
+
"@rsdoctor/utils": "0.2.5"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@rspack/core": "0.5
|
|
81
|
+
"@rspack/core": "0.6.5",
|
|
82
82
|
"@types/bytes": "3.1.1",
|
|
83
83
|
"@types/fs-extra": "^11.0.2",
|
|
84
84
|
"@types/loader-utils": "^2.0.5",
|