@rsdoctor/core 1.1.7 → 1.1.9
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.
|
@@ -39,7 +39,7 @@ __export(loader_exports, {
|
|
|
39
39
|
parseQuery: () => parseQuery
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(loader_exports);
|
|
42
|
-
var
|
|
42
|
+
var import_node_path = __toESM(require("node:path"));
|
|
43
43
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
44
44
|
var import_lodash = require("lodash");
|
|
45
45
|
var import_common = require("@rsdoctor/utils/common");
|
|
@@ -56,8 +56,8 @@ function parsePathQueryFragment(str) {
|
|
|
56
56
|
}
|
|
57
57
|
function loadLoaderModule(loaderPath, cwd = process.cwd()) {
|
|
58
58
|
const cleanLoaderPath = parsePathQueryFragment(loaderPath).path;
|
|
59
|
-
const mod = process.env.DOCTOR_TEST ? require(
|
|
60
|
-
paths: [cwd,
|
|
59
|
+
const mod = process.env.DOCTOR_TEST ? require(import_node_path.default.resolve(cwd, cleanLoaderPath)) : require(require.resolve(cleanLoaderPath, {
|
|
60
|
+
paths: [cwd, import_node_path.default.resolve(cwd, "node_modules")]
|
|
61
61
|
}));
|
|
62
62
|
const isESM = mod.__esModule && typeof mod.default === "function";
|
|
63
63
|
return {
|
|
@@ -68,7 +68,7 @@ function loadLoaderModule(loaderPath, cwd = process.cwd()) {
|
|
|
68
68
|
}
|
|
69
69
|
function extractLoaderName(loaderPath, cwd = "") {
|
|
70
70
|
let res = loaderPath.replace(cwd, "");
|
|
71
|
-
if (!
|
|
71
|
+
if (!import_node_path.default.isAbsolute(res))
|
|
72
72
|
return res;
|
|
73
73
|
const nms = "/node_modules/";
|
|
74
74
|
const idx = res.lastIndexOf(nms);
|
|
@@ -155,7 +155,7 @@ function isESMLoader(r) {
|
|
|
155
155
|
let _loaderName = typeof r === "object" && typeof r?.loader === "string" ? r.loader : typeof r === "string" ? r : "";
|
|
156
156
|
if (!_loaderName)
|
|
157
157
|
return false;
|
|
158
|
-
const isPath =
|
|
158
|
+
const isPath = import_node_path.default.isAbsolute(_loaderName) || _loaderName.startsWith("./") || _loaderName.startsWith("../");
|
|
159
159
|
if (isPath) {
|
|
160
160
|
const packageJsonData = (0, import_graph.readPackageJson)(_loaderName, (file) => {
|
|
161
161
|
try {
|
|
@@ -171,7 +171,7 @@ function isESMLoader(r) {
|
|
|
171
171
|
}
|
|
172
172
|
function appendProbeLoaders(compiler, loaderConfig) {
|
|
173
173
|
const _options = typeof loaderConfig === "object" ? typeof loaderConfig.options === "string" ? { options: loaderConfig.options } : loaderConfig.options : {};
|
|
174
|
-
const loaderPath =
|
|
174
|
+
const loaderPath = import_node_path.default.join(__dirname, "../loader/probeLoader.js");
|
|
175
175
|
const loader = typeof loaderConfig === "string" ? loaderConfig : typeof loaderConfig === "object" && loaderConfig.loader;
|
|
176
176
|
const createProbeLoader = (type) => ({
|
|
177
177
|
loader: loaderPath,
|
|
@@ -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;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,MAAM,CAAC,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;cAEc,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe;CAuDzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"semver": "^7.7.2",
|
|
74
74
|
"source-map": "^0.7.4",
|
|
75
75
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
76
|
-
"@rsdoctor/graph": "1.1.
|
|
77
|
-
"@rsdoctor/sdk": "1.1.
|
|
78
|
-
"@rsdoctor/types": "1.1.
|
|
79
|
-
"@rsdoctor/utils": "1.1.
|
|
76
|
+
"@rsdoctor/graph": "1.1.9",
|
|
77
|
+
"@rsdoctor/sdk": "1.1.9",
|
|
78
|
+
"@rsdoctor/types": "1.1.9",
|
|
79
|
+
"@rsdoctor/utils": "1.1.9"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@rspack/core": "1.4.
|
|
82
|
+
"@rspack/core": "1.4.3",
|
|
83
83
|
"@types/fs-extra": "^11.0.4",
|
|
84
84
|
"@types/lodash": "^4.17.19",
|
|
85
85
|
"@types/node": "^22.8.1",
|