@rsdoctor/core 1.3.11 → 1.3.13-beta.0
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/compiled/axios/index.js +823 -466
- package/dist/build-utils/build/module-graph/webpack/transform.cjs +2 -1
- package/dist/build-utils/build/module-graph/webpack/transform.js +2 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +5 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +5 -1
- package/dist/inner-plugins/plugins/index.cjs +9 -0
- package/dist/inner-plugins/plugins/index.d.ts +1 -0
- package/dist/inner-plugins/plugins/index.js +1 -0
- package/dist/inner-plugins/plugins/resolver.cjs +90 -0
- package/dist/inner-plugins/plugins/resolver.d.ts +13 -0
- package/dist/inner-plugins/plugins/resolver.js +58 -0
- package/package.json +6 -6
|
@@ -70,7 +70,8 @@ function appendDependency(webpackDep, module, webpackGraph, graph) {
|
|
|
70
70
|
const resolveRequest = graph_namespaceObject.Webpack.getWebpackModulePath(resolvedWebpackModule);
|
|
71
71
|
const request = rawRequest ?? resolveRequest;
|
|
72
72
|
if (!module.getDependencyByRequest(request)) {
|
|
73
|
-
const
|
|
73
|
+
const depLayer = resolvedWebpackModule.layer || void 0;
|
|
74
|
+
const depModule = graph.getModuleByFile(resolveRequest, depLayer)[0];
|
|
74
75
|
if (depModule) {
|
|
75
76
|
const dep = module.addDependency(request, depModule, graph_namespaceObject.ModuleGraphTrans.getImportKind(webpackDep));
|
|
76
77
|
if (dep) graph.addDependency(dep);
|
|
@@ -33,7 +33,8 @@ function appendDependency(webpackDep, module, webpackGraph, graph) {
|
|
|
33
33
|
const resolveRequest = Webpack.getWebpackModulePath(resolvedWebpackModule);
|
|
34
34
|
const request = rawRequest ?? resolveRequest;
|
|
35
35
|
if (!module.getDependencyByRequest(request)) {
|
|
36
|
-
const
|
|
36
|
+
const depLayer = resolvedWebpackModule.layer || void 0;
|
|
37
|
+
const depModule = graph.getModuleByFile(resolveRequest, depLayer)[0];
|
|
37
38
|
if (depModule) {
|
|
38
39
|
const dep = module.addDependency(request, depModule, ModuleGraphTrans.getImportKind(webpackDep));
|
|
39
40
|
if (dep) graph.addDependency(dep);
|
|
@@ -78,7 +78,11 @@ async function doneHandler(_stats, _this, context, compiler) {
|
|
|
78
78
|
ids: true,
|
|
79
79
|
hash: true,
|
|
80
80
|
errors: true,
|
|
81
|
-
warnings: true
|
|
81
|
+
warnings: true,
|
|
82
|
+
nestedModules: true,
|
|
83
|
+
cachedModules: true,
|
|
84
|
+
orphanModules: true,
|
|
85
|
+
runtimeModules: true
|
|
82
86
|
});
|
|
83
87
|
return cached;
|
|
84
88
|
};
|
|
@@ -50,7 +50,11 @@ async function doneHandler(_stats, _this, context, compiler) {
|
|
|
50
50
|
ids: true,
|
|
51
51
|
hash: true,
|
|
52
52
|
errors: true,
|
|
53
|
-
warnings: true
|
|
53
|
+
warnings: true,
|
|
54
|
+
nestedModules: true,
|
|
55
|
+
cachedModules: true,
|
|
56
|
+
orphanModules: true,
|
|
57
|
+
runtimeModules: true
|
|
54
58
|
});
|
|
55
59
|
return cached;
|
|
56
60
|
};
|
|
@@ -24,6 +24,9 @@ var __webpack_modules__ = {
|
|
|
24
24
|
"./progress": function(module) {
|
|
25
25
|
module.exports = require("./progress.cjs");
|
|
26
26
|
},
|
|
27
|
+
"./resolver": function(module) {
|
|
28
|
+
module.exports = require("./resolver.cjs");
|
|
29
|
+
},
|
|
27
30
|
"./rules?b94c": function(module) {
|
|
28
31
|
module.exports = require("./rules.cjs");
|
|
29
32
|
},
|
|
@@ -134,6 +137,12 @@ var __webpack_exports__ = {};
|
|
|
134
137
|
return _bundleTagPlugin__WEBPACK_IMPORTED_MODULE_9__[key];
|
|
135
138
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
136
139
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
140
|
+
var _resolver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./resolver");
|
|
141
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
142
|
+
for(var __WEBPACK_IMPORT_KEY__ in _resolver__WEBPACK_IMPORTED_MODULE_10__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
143
|
+
return _resolver__WEBPACK_IMPORTED_MODULE_10__[key];
|
|
144
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
145
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
137
146
|
})();
|
|
138
147
|
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
139
148
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
InternalResolverPlugin: ()=>InternalResolverPlugin
|
|
28
|
+
});
|
|
29
|
+
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
+
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
31
|
+
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
32
|
+
class InternalResolverPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
33
|
+
apply(compiler) {
|
|
34
|
+
this.scheduler.ensureModulesChunksGraphApplied(compiler);
|
|
35
|
+
compiler.hooks.normalModuleFactory.tap(this.tapPostOptions, this.handleNormalModuleFactory);
|
|
36
|
+
this.sdk.addClientRoutes([
|
|
37
|
+
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.ModuleResolve
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
constructor(...args){
|
|
41
|
+
super(...args), this.name = 'resolver', this.resolveDataMap = new Map(), this.handleNormalModuleFactory = (normalModuleFactory)=>{
|
|
42
|
+
normalModuleFactory.hooks.beforeResolve.tap(this.tapPostOptions, (resolveData)=>{
|
|
43
|
+
if (!resolveData) return;
|
|
44
|
+
const issuer = resolveData.contextInfo?.issuer || resolveData.context || '';
|
|
45
|
+
const request = resolveData.request;
|
|
46
|
+
if (issuer && request) {
|
|
47
|
+
const key = `${issuer}::${request}`;
|
|
48
|
+
this.resolveDataMap.set(key, {
|
|
49
|
+
startAt: Date.now(),
|
|
50
|
+
startHRTime: process.hrtime(),
|
|
51
|
+
request
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
normalModuleFactory.hooks.afterResolve.tap(this.tapPostOptions, (resolveData)=>{
|
|
56
|
+
if (!resolveData) return;
|
|
57
|
+
const issuer = resolveData.contextInfo?.issuer || resolveData.context || '';
|
|
58
|
+
const request = resolveData.request;
|
|
59
|
+
const result = resolveData.createData?.resource || resolveData.resourceResolveData?.path;
|
|
60
|
+
if (issuer && request) {
|
|
61
|
+
const key = `${issuer}::${request}`;
|
|
62
|
+
const startData = this.resolveDataMap.get(key);
|
|
63
|
+
if (startData) {
|
|
64
|
+
const data = {
|
|
65
|
+
isEntry: Boolean(issuer),
|
|
66
|
+
issuerPath: issuer,
|
|
67
|
+
request: startData.request,
|
|
68
|
+
startAt: startData.startAt,
|
|
69
|
+
endAt: common_namespaceObject.Time.getCurrentTimestamp(startData.startAt, startData.startHRTime),
|
|
70
|
+
result: result || '',
|
|
71
|
+
pid: process.pid,
|
|
72
|
+
ppid: process.ppid
|
|
73
|
+
};
|
|
74
|
+
this.sdk.reportResolver([
|
|
75
|
+
data
|
|
76
|
+
]);
|
|
77
|
+
this.resolveDataMap.delete(key);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.InternalResolverPlugin = __webpack_exports__.InternalResolverPlugin;
|
|
85
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
86
|
+
"InternalResolverPlugin"
|
|
87
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
88
|
+
Object.defineProperty(exports, '__esModule', {
|
|
89
|
+
value: true
|
|
90
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Plugin } from '@rsdoctor/types';
|
|
2
|
+
import { InternalBasePlugin } from './base.js';
|
|
3
|
+
import type { Compiler as WebpackCompiler } from 'webpack';
|
|
4
|
+
export declare class InternalResolverPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
+
readonly name = "resolver";
|
|
6
|
+
protected resolveDataMap: Map<string, {
|
|
7
|
+
startAt: number;
|
|
8
|
+
startHRTime: [number, number];
|
|
9
|
+
request: string;
|
|
10
|
+
}>;
|
|
11
|
+
apply(compiler: T): void;
|
|
12
|
+
protected handleNormalModuleFactory: (normalModuleFactory: Plugin.RspackNormalModuleFactory | ReturnType<WebpackCompiler["createNormalModuleFactory"]>) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { Manifest } from "@rsdoctor/types";
|
|
4
|
+
import { Time } from "@rsdoctor/utils/common";
|
|
5
|
+
import { InternalBasePlugin } from "./base.js";
|
|
6
|
+
class InternalResolverPlugin extends InternalBasePlugin {
|
|
7
|
+
apply(compiler) {
|
|
8
|
+
this.scheduler.ensureModulesChunksGraphApplied(compiler);
|
|
9
|
+
compiler.hooks.normalModuleFactory.tap(this.tapPostOptions, this.handleNormalModuleFactory);
|
|
10
|
+
this.sdk.addClientRoutes([
|
|
11
|
+
Manifest.RsdoctorManifestClientRoutes.ModuleResolve
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
constructor(...args){
|
|
15
|
+
super(...args), this.name = 'resolver', this.resolveDataMap = new Map(), this.handleNormalModuleFactory = (normalModuleFactory)=>{
|
|
16
|
+
normalModuleFactory.hooks.beforeResolve.tap(this.tapPostOptions, (resolveData)=>{
|
|
17
|
+
if (!resolveData) return;
|
|
18
|
+
const issuer = resolveData.contextInfo?.issuer || resolveData.context || '';
|
|
19
|
+
const request = resolveData.request;
|
|
20
|
+
if (issuer && request) {
|
|
21
|
+
const key = `${issuer}::${request}`;
|
|
22
|
+
this.resolveDataMap.set(key, {
|
|
23
|
+
startAt: Date.now(),
|
|
24
|
+
startHRTime: process.hrtime(),
|
|
25
|
+
request
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
normalModuleFactory.hooks.afterResolve.tap(this.tapPostOptions, (resolveData)=>{
|
|
30
|
+
if (!resolveData) return;
|
|
31
|
+
const issuer = resolveData.contextInfo?.issuer || resolveData.context || '';
|
|
32
|
+
const request = resolveData.request;
|
|
33
|
+
const result = resolveData.createData?.resource || resolveData.resourceResolveData?.path;
|
|
34
|
+
if (issuer && request) {
|
|
35
|
+
const key = `${issuer}::${request}`;
|
|
36
|
+
const startData = this.resolveDataMap.get(key);
|
|
37
|
+
if (startData) {
|
|
38
|
+
const data = {
|
|
39
|
+
isEntry: Boolean(issuer),
|
|
40
|
+
issuerPath: issuer,
|
|
41
|
+
request: startData.request,
|
|
42
|
+
startAt: startData.startAt,
|
|
43
|
+
endAt: Time.getCurrentTimestamp(startData.startAt, startData.startHRTime),
|
|
44
|
+
result: result || '',
|
|
45
|
+
pid: process.pid,
|
|
46
|
+
ppid: process.ppid
|
|
47
|
+
};
|
|
48
|
+
this.sdk.reportResolver([
|
|
49
|
+
data
|
|
50
|
+
]);
|
|
51
|
+
this.resolveDataMap.delete(key);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export { InternalResolverPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13-beta.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"fs-extra": "^11.1.1",
|
|
70
70
|
"semver": "^7.7.3",
|
|
71
71
|
"source-map": "^0.7.6",
|
|
72
|
-
"@rsdoctor/graph": "1.3.
|
|
73
|
-
"@rsdoctor/
|
|
74
|
-
"@rsdoctor/
|
|
75
|
-
"@rsdoctor/
|
|
72
|
+
"@rsdoctor/graph": "1.3.13-beta.0",
|
|
73
|
+
"@rsdoctor/sdk": "1.3.13-beta.0",
|
|
74
|
+
"@rsdoctor/types": "1.3.13-beta.0",
|
|
75
|
+
"@rsdoctor/utils": "1.3.13-beta.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"axios": "^1.12.2",
|
|
79
|
-
"@rspack/core": "1.6.
|
|
79
|
+
"@rspack/core": "1.6.5",
|
|
80
80
|
"@types/fs-extra": "^11.0.4",
|
|
81
81
|
"@types/node": "^22.8.1",
|
|
82
82
|
"@types/node-fetch": "^2.6.13",
|