@rsdoctor/utils 1.5.3 → 1.5.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/496.js +45 -0
- package/dist/build.cjs +2 -4
- package/dist/build.js +35 -106
- package/dist/common.js +102 -183
- package/dist/error.js +3 -2
- package/dist/logger.js +1 -1
- package/dist/rslib-runtime.js +24 -0
- package/dist/ruleUtils.js +5 -22
- package/package.json +4 -4
package/dist/496.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
var lodash_namespaceObject = {};
|
|
3
|
+
function isUndefined(value) {
|
|
4
|
+
return void 0 === value;
|
|
5
|
+
}
|
|
6
|
+
function isNumber(value) {
|
|
7
|
+
return 'number' == typeof value && !Number.isNaN(value);
|
|
8
|
+
}
|
|
9
|
+
function isObject(value) {
|
|
10
|
+
return 'object' == typeof value && null !== value;
|
|
11
|
+
}
|
|
12
|
+
function isEmpty(value) {
|
|
13
|
+
return null == value || Array.isArray(value) && 0 === value.length || 'object' == typeof value && 0 === Object.keys(value).length;
|
|
14
|
+
}
|
|
15
|
+
function last(array) {
|
|
16
|
+
return array[array.length - 1];
|
|
17
|
+
}
|
|
18
|
+
function compact(array) {
|
|
19
|
+
return array.filter((item)=>null != item || !item);
|
|
20
|
+
}
|
|
21
|
+
function isNil(value) {
|
|
22
|
+
return null == value;
|
|
23
|
+
}
|
|
24
|
+
__webpack_require__.r(lodash_namespaceObject), __webpack_require__.d(lodash_namespaceObject, {
|
|
25
|
+
compact: ()=>compact,
|
|
26
|
+
isEmpty: ()=>isEmpty,
|
|
27
|
+
isNil: ()=>isNil,
|
|
28
|
+
isNumber: ()=>isNumber,
|
|
29
|
+
isObject: ()=>isObject,
|
|
30
|
+
isPlainObject: ()=>isPlainObject,
|
|
31
|
+
isString: ()=>isString,
|
|
32
|
+
isUndefined: ()=>isUndefined,
|
|
33
|
+
last: ()=>last,
|
|
34
|
+
pick: ()=>pick
|
|
35
|
+
});
|
|
36
|
+
let isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && Object.getPrototypeOf(obj) === Object.prototype, isString = (v)=>'string' == typeof v || !!v && 'object' == typeof v && !Array.isArray(v) && '[object String]' === ({}).toString.call(v);
|
|
37
|
+
function pick(obj, keys) {
|
|
38
|
+
let result = {};
|
|
39
|
+
for(let i = 0; i < keys.length; i++){
|
|
40
|
+
let key = keys[i];
|
|
41
|
+
Object.hasOwn(obj, key) && (result[key] = obj[key]);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
export { compact, isEmpty, isNil, isNumber, isObject, isUndefined, last, lodash_namespaceObject as Lodash };
|
package/dist/build.cjs
CHANGED
|
@@ -15,8 +15,6 @@ var __webpack_modules__ = {
|
|
|
15
15
|
});
|
|
16
16
|
var package_namespaceObject = {};
|
|
17
17
|
__webpack_require__.r(package_namespaceObject), __webpack_require__.d(package_namespaceObject, {
|
|
18
|
-
MODULE_PATH_PACKAGES: ()=>MODULE_PATH_PACKAGES,
|
|
19
|
-
PACKAGE_PATH_NAME: ()=>PACKAGE_PATH_NAME,
|
|
20
18
|
getPackageMetaFromModulePath: ()=>getPackageMetaFromModulePath
|
|
21
19
|
}), __webpack_require__("./src/common/algorithm.ts"), __webpack_require__("path"), __webpack_require__("process"), __webpack_require__("@rsdoctor/types"), __webpack_require__("./src/logger.ts"), RegExp(`(.*)${/[-|.]/.source}(${/(?:[a-f0-9]{4,32}|[a-zA-Z]{3,}[0-9]|[a-zA-Z]*[0-9][a-zA-Z]{2,}|[a-zA-Z]*[0-9][a-zA-Z0-9]{3,31})/.source})(${/(?:\.[a-z|A-Z|0-9]{2,}){1,}/.source})$`);
|
|
22
20
|
var lodash = __webpack_require__("./src/common/lodash.ts");
|
|
@@ -285,12 +283,12 @@ for(var __rspack_i in (()=>{
|
|
|
285
283
|
6667,
|
|
286
284
|
6668,
|
|
287
285
|
6669
|
|
288
|
-
], defaultPort = function(
|
|
286
|
+
], defaultPort = function() {
|
|
289
287
|
let port;
|
|
290
288
|
do port = (0, algorithm.random)(3000, 8999);
|
|
291
289
|
while (RESTRICTED_PORTS.includes(port));
|
|
292
290
|
return port;
|
|
293
|
-
}(
|
|
291
|
+
}();
|
|
294
292
|
async function getPort(expectPort) {
|
|
295
293
|
return external_get_port_default()({
|
|
296
294
|
port: expectPort
|
package/dist/build.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
import fs_extra, * as __rspack_external_fs_extra_ce68a66b from "fs-extra";
|
|
3
|
+
import fs from "fs";
|
|
2
4
|
import path_0, { dirname, join } from "path";
|
|
3
5
|
import node_fs from "node:fs";
|
|
4
6
|
import { JsonStreamStringify } from "json-stream-stringify";
|
|
5
|
-
import "zlib";
|
|
6
|
-
import "buffer";
|
|
7
|
-
import picocolors from "picocolors";
|
|
8
|
-
import { createLogger } from "rslog";
|
|
9
|
-
import "@rsdoctor/types";
|
|
10
|
-
import { memoryUsage, pid as external_process_pid } from "process";
|
|
11
|
-
import os_0 from "os";
|
|
12
7
|
import { Transform } from "stream";
|
|
13
8
|
import connect from "../compiled/connect/index.js";
|
|
14
9
|
import http from "http";
|
|
10
|
+
import os from "os";
|
|
15
11
|
import get_port from "get-port";
|
|
16
12
|
import { exec, execSync } from "child_process";
|
|
17
|
-
import
|
|
13
|
+
import envinfo from "envinfo";
|
|
18
14
|
import { filesize } from "../compiled/filesize/index.js";
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
import { memoryUsage, pid } from "process";
|
|
16
|
+
import { getPackageMetaFromModulePath, random } from "./common.js";
|
|
17
|
+
var envinfo_namespaceObject = {};
|
|
18
|
+
__webpack_require__.r(envinfo_namespaceObject), __webpack_require__.d(envinfo_namespaceObject, {
|
|
19
|
+
getCPUInfo: ()=>getCPUInfo,
|
|
20
|
+
getGitBranch: ()=>getGitBranch,
|
|
21
|
+
getGitRepo: ()=>getGitRepo,
|
|
22
|
+
getGlobalNpmPackageVersion: ()=>getGlobalNpmPackageVersion,
|
|
23
|
+
getMemoryInfo: ()=>getMemoryInfo,
|
|
24
|
+
getNodeVersion: ()=>getNodeVersion,
|
|
25
|
+
getNpmPackageVersion: ()=>getNpmPackageVersion,
|
|
26
|
+
getNpmVersion: ()=>getNpmVersion,
|
|
27
|
+
getOSInfo: ()=>getOSInfo,
|
|
28
|
+
getPnpmVersion: ()=>getPnpmVersion,
|
|
29
|
+
getYarnVersion: ()=>getYarnVersion
|
|
30
|
+
});
|
|
33
31
|
var cache_namespaceObject = {};
|
|
34
32
|
__webpack_require__.r(cache_namespaceObject), __webpack_require__.d(cache_namespaceObject, {
|
|
35
33
|
readFile: ()=>cache_readFile,
|
|
@@ -48,6 +46,11 @@ __webpack_require__.r(json_namespaceObject), __webpack_require__.d(json_namespac
|
|
|
48
46
|
readPackageJson: ()=>readPackageJson,
|
|
49
47
|
stringify: ()=>stringify
|
|
50
48
|
});
|
|
49
|
+
var process_namespaceObject = {};
|
|
50
|
+
__webpack_require__.r(process_namespaceObject), __webpack_require__.d(process_namespaceObject, {
|
|
51
|
+
getMemoryUsage: ()=>getMemoryUsage,
|
|
52
|
+
getMemoryUsageMessage: ()=>getMemoryUsageMessage
|
|
53
|
+
});
|
|
51
54
|
var server_namespaceObject = {};
|
|
52
55
|
__webpack_require__.r(server_namespaceObject), __webpack_require__.d(server_namespaceObject, {
|
|
53
56
|
createApp: ()=>createApp,
|
|
@@ -57,25 +60,6 @@ __webpack_require__.r(server_namespaceObject), __webpack_require__.d(server_name
|
|
|
57
60
|
getPort: ()=>getPort,
|
|
58
61
|
getPortSync: ()=>getPortSync
|
|
59
62
|
});
|
|
60
|
-
var envinfo_namespaceObject = {};
|
|
61
|
-
__webpack_require__.r(envinfo_namespaceObject), __webpack_require__.d(envinfo_namespaceObject, {
|
|
62
|
-
getCPUInfo: ()=>getCPUInfo,
|
|
63
|
-
getGitBranch: ()=>getGitBranch,
|
|
64
|
-
getGitRepo: ()=>getGitRepo,
|
|
65
|
-
getGlobalNpmPackageVersion: ()=>getGlobalNpmPackageVersion,
|
|
66
|
-
getMemoryInfo: ()=>getMemoryInfo,
|
|
67
|
-
getNodeVersion: ()=>getNodeVersion,
|
|
68
|
-
getNpmPackageVersion: ()=>getNpmPackageVersion,
|
|
69
|
-
getNpmVersion: ()=>getNpmVersion,
|
|
70
|
-
getOSInfo: ()=>getOSInfo,
|
|
71
|
-
getPnpmVersion: ()=>getPnpmVersion,
|
|
72
|
-
getYarnVersion: ()=>getYarnVersion
|
|
73
|
-
});
|
|
74
|
-
var process_namespaceObject = {};
|
|
75
|
-
__webpack_require__.r(process_namespaceObject), __webpack_require__.d(process_namespaceObject, {
|
|
76
|
-
getMemoryUsage: ()=>getMemoryUsage,
|
|
77
|
-
getMemoryUsageMessage: ()=>getMemoryUsageMessage
|
|
78
|
-
});
|
|
79
63
|
class FileSharding {
|
|
80
64
|
content;
|
|
81
65
|
limitBytes;
|
|
@@ -93,10 +77,10 @@ class FileSharding {
|
|
|
93
77
|
}
|
|
94
78
|
async writeStringToFolder(folder, ext = '', index) {
|
|
95
79
|
let dist = path_0.resolve(folder);
|
|
96
|
-
await
|
|
80
|
+
await fs_extra.ensureDir(dist);
|
|
97
81
|
let res = this.createVirtualShardingFiles(ext, index);
|
|
98
82
|
return await Promise.all(res.map((e)=>new Promise((resolve, reject)=>{
|
|
99
|
-
let stream =
|
|
83
|
+
let stream = fs.createWriteStream(path_0.join(dist, e.filename), this.encoding);
|
|
100
84
|
stream.end(e.content), stream.once('close', ()=>resolve(void 0)), stream.once('error', (err)=>reject(err));
|
|
101
85
|
}))), res;
|
|
102
86
|
}
|
|
@@ -118,60 +102,6 @@ async function readJSON(path) {
|
|
|
118
102
|
function readJSONSync(path) {
|
|
119
103
|
return JSON.parse(readFileSync(path));
|
|
120
104
|
}
|
|
121
|
-
function last(array) {
|
|
122
|
-
return array[array.length - 1];
|
|
123
|
-
}
|
|
124
|
-
createLogger().override({
|
|
125
|
-
log: (message)=>{
|
|
126
|
-
console.log(`${picocolors.green('[RSDOCTOR LOG]')} ${message}`);
|
|
127
|
-
},
|
|
128
|
-
info: (message)=>{
|
|
129
|
-
console.log(`${picocolors.yellow('[RSDOCTOR INFO]')} ${message}`);
|
|
130
|
-
},
|
|
131
|
-
warn: (message)=>{
|
|
132
|
-
console.warn(`${picocolors.yellow('[RSDOCTOR WARN]')} ${message}`);
|
|
133
|
-
},
|
|
134
|
-
start: (message)=>{
|
|
135
|
-
console.log(`${picocolors.green('[RSDOCTOR START]')} ${message}`);
|
|
136
|
-
},
|
|
137
|
-
ready: (message)=>{
|
|
138
|
-
console.log(`${picocolors.green('[RSDOCTOR READY]')} ${message}`);
|
|
139
|
-
},
|
|
140
|
-
error: (message)=>{
|
|
141
|
-
console.error(`${picocolors.red('[RSDOCTOR ERROR]')} ${message}`);
|
|
142
|
-
},
|
|
143
|
-
success: (message)=>{
|
|
144
|
-
console.error(`${picocolors.green('[RSDOCTOR SUCCESS]')} ${message}`);
|
|
145
|
-
},
|
|
146
|
-
debug: (message)=>{
|
|
147
|
-
process.env.DEBUG && console.log(`${picocolors.blue('[RSDOCTOR DEBUG]')} ${message}`);
|
|
148
|
-
}
|
|
149
|
-
}), RegExp(`(.*)${/[-|.]/.source}(${/(?:[a-f0-9]{4,32}|[a-zA-Z]{3,}[0-9]|[a-zA-Z]*[0-9][a-zA-Z]{2,}|[a-zA-Z]*[0-9][a-zA-Z0-9]{3,31})/.source})(${/(?:\.[a-z|A-Z|0-9]{2,}){1,}/.source})$`);
|
|
150
|
-
let PACKAGE_SLUG = /[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*/, MODULE_PATH_PACKAGES = RegExp(`(?:${/(?:node_modules|~)(?:\/\.pnpm)?/.source}/)(?:(?:@${PACKAGE_SLUG.source}[/|+])?(?:${PACKAGE_SLUG.source}\\+)*(?:${PACKAGE_SLUG.source})(?:${/@[\w|\-|_|.]+/.source})?)(?:_(?:@${PACKAGE_SLUG.source}[/|+])?(?:${PACKAGE_SLUG.source})(?:@${PACKAGE_SLUG.source})?)*/`, 'g'), PACKAGE_PATH_NAME = /(?:(?:node_modules|~)(?:\/\.pnpm)?\/)(?:((?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*[/|+])?(?:(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*\+)*)(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))(?:@[\w|\-|_|.]+)?)(?:_((?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*[/|+])?(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))(?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))*\//gm, getPackageMetaFromModulePath = (modulePath)=>{
|
|
151
|
-
var data;
|
|
152
|
-
let res, paths = modulePath.match(MODULE_PATH_PACKAGES);
|
|
153
|
-
if (!paths) return {
|
|
154
|
-
name: '',
|
|
155
|
-
version: ''
|
|
156
|
-
};
|
|
157
|
-
let names = (data = paths.flatMap((packagePath)=>{
|
|
158
|
-
let found = packagePath.matchAll(PACKAGE_PATH_NAME);
|
|
159
|
-
return found ? [
|
|
160
|
-
...found
|
|
161
|
-
].flat().filter((item)=>null != item || !item).slice(1).filter(Boolean).map((name)=>name.replace(/\+/g, '/')) : [];
|
|
162
|
-
}), res = [], data.forEach((item, index)=>{
|
|
163
|
-
data.slice(index + 1).includes(item) || res.push(item);
|
|
164
|
-
}), res);
|
|
165
|
-
if (null == names || Array.isArray(names) && 0 === names.length || 'object' == typeof names && 0 === Object.keys(names).length) return {
|
|
166
|
-
name: '',
|
|
167
|
-
version: ''
|
|
168
|
-
};
|
|
169
|
-
let name = last(names), pattern = RegExp(`(.*)(${last(paths)}).*`), path = modulePath.replace(pattern, '$1$2').replace(/\/$/, '');
|
|
170
|
-
return {
|
|
171
|
-
name,
|
|
172
|
-
version: path && name && path.match(RegExp(`${name}@([\\d.]+)`))?.flat().slice(1)?.[0] || ''
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
105
|
function stringify(json, replacer, space, cycle) {
|
|
176
106
|
let jsonList = [];
|
|
177
107
|
return json && 'object' == typeof json ? new Promise((resolve, reject)=>{
|
|
@@ -210,13 +140,12 @@ let readPackageJson = (file, readFile)=>{
|
|
|
210
140
|
6667,
|
|
211
141
|
6668,
|
|
212
142
|
6669
|
|
213
|
-
], defaultPort = function(
|
|
143
|
+
], defaultPort = function() {
|
|
214
144
|
let port;
|
|
215
|
-
do
|
|
216
|
-
|
|
217
|
-
}while (RESTRICTED_PORTS.includes(port));
|
|
145
|
+
do port = random(3000, 8999);
|
|
146
|
+
while (RESTRICTED_PORTS.includes(port));
|
|
218
147
|
return port;
|
|
219
|
-
}(
|
|
148
|
+
}();
|
|
220
149
|
async function getPort(expectPort) {
|
|
221
150
|
return get_port({
|
|
222
151
|
port: expectPort
|
|
@@ -256,7 +185,7 @@ getAvailablePort(${expectPort}).then(port => process.stdout.write(port.toString(
|
|
|
256
185
|
})();
|
|
257
186
|
`.trim();
|
|
258
187
|
function getPortSync(expectPort) {
|
|
259
|
-
let statement = '\n' ===
|
|
188
|
+
let statement = '\n' === os.EOL ? createGetPortSyncFunctionString(expectPort) : createGetPortSyncFunctionString(expectPort).replace(/\n/g, '');
|
|
260
189
|
return Number(execSync(`node -e "${statement}"`, {
|
|
261
190
|
encoding: 'utf-8'
|
|
262
191
|
}));
|
|
@@ -281,7 +210,7 @@ async function createServer(port) {
|
|
|
281
210
|
});
|
|
282
211
|
});
|
|
283
212
|
}
|
|
284
|
-
let helpers =
|
|
213
|
+
let helpers = envinfo.helpers, run = envinfo.run, getCPUInfo = ()=>helpers.getCPUInfo().then((res)=>res[1]), getOSInfo = ()=>helpers.getOSInfo().then((res)=>res[1]), getMemoryInfo = ()=>helpers.getMemoryInfo().then((res)=>res[1]), getNodeVersion = ()=>helpers.getNodeInfo().then((res)=>res[1]), getYarnVersion = ()=>helpers.getYarnInfo().then((res)=>res[1]), getNpmVersion = ()=>helpers.getnpmInfo().then((res)=>res[1]), getPnpmVersion = ()=>helpers.getpnpmInfo().then((res)=>res[1]);
|
|
285
214
|
function getNpmPackageVersion(pkg) {
|
|
286
215
|
let isArray = Array.isArray(pkg);
|
|
287
216
|
return run({
|
|
@@ -335,6 +264,6 @@ function getMemoryUsageMessage() {
|
|
|
335
264
|
`Heap Total: ${filesize(usage.heapTotal)}`,
|
|
336
265
|
`Heap Used: ${filesize(usage.heapUsed)}`
|
|
337
266
|
];
|
|
338
|
-
return usage.arrayBuffers && msgs.push(`ArrayBuffers: ${filesize(usage.arrayBuffers)}`), usage.external && msgs.push(`External: ${filesize(usage.external)}`), `["${
|
|
267
|
+
return usage.arrayBuffers && msgs.push(`ArrayBuffers: ${filesize(usage.arrayBuffers)}`), usage.external && msgs.push(`External: ${filesize(usage.external)}`), `["${pid}" Memory Usage] ${msgs.join(', ')}`;
|
|
339
268
|
}
|
|
340
269
|
export { envinfo_namespaceObject as EnvInfo, file_namespaceObject as File, json_namespaceObject as Json, process_namespaceObject as Process, server_namespaceObject as Server };
|
package/dist/common.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
1
2
|
import { deflateSync, inflateSync } from "zlib";
|
|
2
3
|
import { Buffer } from "buffer";
|
|
3
|
-
import picocolors from "picocolors";
|
|
4
|
-
import { createLogger } from "rslog";
|
|
5
|
-
import { Client, Constants as types_Constants, Rule, SDK } from "@rsdoctor/types";
|
|
6
4
|
import path_0, { isAbsolute, relative } from "path";
|
|
7
5
|
import { hrtime } from "process";
|
|
6
|
+
import { Client, Constants, Rule, SDK } from "@rsdoctor/types";
|
|
8
7
|
import fs from "fs";
|
|
9
8
|
import os from "os";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
17
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
20
|
-
value: !0
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var summary_namespaceObject = {};
|
|
24
|
-
__webpack_require__.r(summary_namespaceObject), __webpack_require__.d(summary_namespaceObject, {
|
|
25
|
-
SummaryCostsDataName: ()=>summary_SummaryCostsDataName
|
|
26
|
-
});
|
|
27
|
-
var crypto_namespaceObject = {};
|
|
28
|
-
__webpack_require__.r(crypto_namespaceObject), __webpack_require__.d(crypto_namespaceObject, {
|
|
29
|
-
decode: ()=>decode,
|
|
30
|
-
encode: ()=>encode
|
|
9
|
+
import { logger as rsdoctorLogger } from "./logger.js";
|
|
10
|
+
import { isEmpty, compact, last } from "./496.js";
|
|
11
|
+
var SummaryCostsDataName, RspackSummaryCostsDataName, alerts_namespaceObject = {};
|
|
12
|
+
__webpack_require__.r(alerts_namespaceObject), __webpack_require__.d(alerts_namespaceObject, {
|
|
13
|
+
getPackageRelationAlertDetails: ()=>getPackageRelationAlertDetails
|
|
31
14
|
});
|
|
32
15
|
var algorithm_namespaceObject = {};
|
|
33
16
|
__webpack_require__.r(algorithm_namespaceObject), __webpack_require__.d(algorithm_namespaceObject, {
|
|
@@ -36,49 +19,30 @@ __webpack_require__.r(algorithm_namespaceObject), __webpack_require__.d(algorith
|
|
|
36
19
|
mergeIntervals: ()=>mergeIntervals,
|
|
37
20
|
random: ()=>random
|
|
38
21
|
});
|
|
39
|
-
var
|
|
40
|
-
__webpack_require__.r(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
var bundle_namespaceObject = {};
|
|
23
|
+
__webpack_require__.r(bundle_namespaceObject), __webpack_require__.d(bundle_namespaceObject, {
|
|
24
|
+
getBundleDiffPageQueryString: ()=>getBundleDiffPageQueryString,
|
|
25
|
+
getBundleDiffPageUrl: ()=>getBundleDiffPageUrl,
|
|
26
|
+
parseFilesFromBundlePageUrlQuery: ()=>parseFilesFromBundlePageUrlQuery
|
|
44
27
|
});
|
|
45
|
-
var
|
|
46
|
-
__webpack_require__.r(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
isShardingData: ()=>isShardingData
|
|
28
|
+
var crypto_namespaceObject = {};
|
|
29
|
+
__webpack_require__.r(crypto_namespaceObject), __webpack_require__.d(crypto_namespaceObject, {
|
|
30
|
+
decode: ()=>decode,
|
|
31
|
+
encode: ()=>encode
|
|
50
32
|
});
|
|
51
|
-
var
|
|
52
|
-
__webpack_require__.r(
|
|
53
|
-
|
|
54
|
-
findLoaderTotalTiming: ()=>findLoaderTotalTiming,
|
|
55
|
-
getDirectoriesLoaders: ()=>getDirectoriesLoaders,
|
|
56
|
-
getLoaderChartData: ()=>getLoaderChartData,
|
|
57
|
-
getLoaderCosts: ()=>getLoaderCosts,
|
|
58
|
-
getLoaderFileDetails: ()=>getLoaderFileDetails,
|
|
59
|
-
getLoaderFileFirstInput: ()=>getLoaderFileFirstInput,
|
|
60
|
-
getLoaderFileInputAndOutput: ()=>getLoaderFileInputAndOutput,
|
|
61
|
-
getLoaderFileTree: ()=>getLoaderFileTree,
|
|
62
|
-
getLoaderFolderStatistics: ()=>getLoaderFolderStatistics,
|
|
63
|
-
getLoaderNames: ()=>getLoaderNames,
|
|
64
|
-
getLoadersCosts: ()=>getLoadersCosts,
|
|
65
|
-
getLoadersTransformData: ()=>getLoadersTransformData,
|
|
66
|
-
isVue: ()=>isVue
|
|
33
|
+
var data_namespaceObject = {};
|
|
34
|
+
__webpack_require__.r(data_namespaceObject), __webpack_require__.d(data_namespaceObject, {
|
|
35
|
+
APIDataLoader: ()=>APIDataLoader
|
|
67
36
|
});
|
|
68
|
-
var
|
|
69
|
-
__webpack_require__.r(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
getUnit: ()=>getUnit,
|
|
73
|
-
toFixedDigits: ()=>toFixedDigits
|
|
37
|
+
var file_namespaceObject = {};
|
|
38
|
+
__webpack_require__.r(file_namespaceObject), __webpack_require__.d(file_namespaceObject, {
|
|
39
|
+
isJsExt: ()=>isJsExt,
|
|
40
|
+
isStyleExt: ()=>isStyleExt
|
|
74
41
|
});
|
|
75
|
-
var
|
|
76
|
-
__webpack_require__.r(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
getResolverFileTree: ()=>getResolverFileTree,
|
|
80
|
-
isResolveFailData: ()=>isResolveFailData,
|
|
81
|
-
isResolveSuccessData: ()=>isResolveSuccessData
|
|
42
|
+
var global_config_namespaceObject = {};
|
|
43
|
+
__webpack_require__.r(global_config_namespaceObject), __webpack_require__.d(global_config_namespaceObject, {
|
|
44
|
+
getMcpConfigPath: ()=>getMcpConfigPath,
|
|
45
|
+
writeMcpPort: ()=>writeMcpPort
|
|
82
46
|
});
|
|
83
47
|
var graph_namespaceObject = {};
|
|
84
48
|
__webpack_require__.r(graph_namespaceObject), __webpack_require__.d(graph_namespaceObject, {
|
|
@@ -116,11 +80,34 @@ __webpack_require__.r(graph_namespaceObject), __webpack_require__.d(graph_namesp
|
|
|
116
80
|
isAssetMatchExtensions: ()=>isAssetMatchExtensions,
|
|
117
81
|
isInitialAsset: ()=>isInitialAsset
|
|
118
82
|
});
|
|
119
|
-
var
|
|
120
|
-
__webpack_require__.r(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
83
|
+
var loader_namespaceObject = {};
|
|
84
|
+
__webpack_require__.r(loader_namespaceObject), __webpack_require__.d(loader_namespaceObject, {
|
|
85
|
+
LoaderInternalPropertyName: ()=>LoaderInternalPropertyName,
|
|
86
|
+
findLoaderTotalTiming: ()=>findLoaderTotalTiming,
|
|
87
|
+
getDirectoriesLoaders: ()=>getDirectoriesLoaders,
|
|
88
|
+
getLoaderChartData: ()=>getLoaderChartData,
|
|
89
|
+
getLoaderCosts: ()=>getLoaderCosts,
|
|
90
|
+
getLoaderFileDetails: ()=>getLoaderFileDetails,
|
|
91
|
+
getLoaderFileFirstInput: ()=>getLoaderFileFirstInput,
|
|
92
|
+
getLoaderFileInputAndOutput: ()=>getLoaderFileInputAndOutput,
|
|
93
|
+
getLoaderFileTree: ()=>getLoaderFileTree,
|
|
94
|
+
getLoaderFolderStatistics: ()=>getLoaderFolderStatistics,
|
|
95
|
+
getLoaderNames: ()=>getLoaderNames,
|
|
96
|
+
getLoadersCosts: ()=>getLoadersCosts,
|
|
97
|
+
getLoadersTransformData: ()=>getLoadersTransformData,
|
|
98
|
+
isVue: ()=>isVue
|
|
99
|
+
});
|
|
100
|
+
var manifest_namespaceObject = {};
|
|
101
|
+
__webpack_require__.r(manifest_namespaceObject), __webpack_require__.d(manifest_namespaceObject, {
|
|
102
|
+
fetchShardingData: ()=>fetchShardingData,
|
|
103
|
+
fetchShardingFiles: ()=>fetchShardingFiles,
|
|
104
|
+
isShardingData: ()=>isShardingData
|
|
105
|
+
});
|
|
106
|
+
var package_namespaceObject = {};
|
|
107
|
+
__webpack_require__.r(package_namespaceObject), __webpack_require__.d(package_namespaceObject, {
|
|
108
|
+
MODULE_PATH_PACKAGES: ()=>MODULE_PATH_PACKAGES,
|
|
109
|
+
PACKAGE_PATH_NAME: ()=>PACKAGE_PATH_NAME,
|
|
110
|
+
getPackageMetaFromModulePath: ()=>getPackageMetaFromModulePath
|
|
124
111
|
});
|
|
125
112
|
var plugin_namespaceObject = {};
|
|
126
113
|
__webpack_require__.r(plugin_namespaceObject), __webpack_require__.d(plugin_namespaceObject, {
|
|
@@ -129,9 +116,13 @@ __webpack_require__.r(plugin_namespaceObject), __webpack_require__.d(plugin_name
|
|
|
129
116
|
getPluginSummary: ()=>getPluginSummary,
|
|
130
117
|
getPluginTapNames: ()=>getPluginTapNames
|
|
131
118
|
});
|
|
132
|
-
var
|
|
133
|
-
__webpack_require__.r(
|
|
134
|
-
|
|
119
|
+
var resolver_namespaceObject = {};
|
|
120
|
+
__webpack_require__.r(resolver_namespaceObject), __webpack_require__.d(resolver_namespaceObject, {
|
|
121
|
+
getResolverCosts: ()=>getResolverCosts,
|
|
122
|
+
getResolverFileDetails: ()=>getResolverFileDetails,
|
|
123
|
+
getResolverFileTree: ()=>getResolverFileTree,
|
|
124
|
+
isResolveFailData: ()=>isResolveFailData,
|
|
125
|
+
isResolveSuccessData: ()=>isResolveSuccessData
|
|
135
126
|
});
|
|
136
127
|
var rspack_namespaceObject = {};
|
|
137
128
|
__webpack_require__.r(rspack_namespaceObject), __webpack_require__.d(rspack_namespaceObject, {
|
|
@@ -139,38 +130,22 @@ __webpack_require__.r(rspack_namespaceObject), __webpack_require__.d(rspack_name
|
|
|
139
130
|
RspackSummaryCostsDataName: ()=>rspack_RspackSummaryCostsDataName,
|
|
140
131
|
checkSourceMapSupport: ()=>checkSourceMapSupport
|
|
141
132
|
});
|
|
142
|
-
var
|
|
143
|
-
__webpack_require__.r(
|
|
144
|
-
|
|
145
|
-
});
|
|
146
|
-
var lodash_namespaceObject = {};
|
|
147
|
-
__webpack_require__.r(lodash_namespaceObject), __webpack_require__.d(lodash_namespaceObject, {
|
|
148
|
-
compact: ()=>compact,
|
|
149
|
-
isEmpty: ()=>isEmpty,
|
|
150
|
-
isNil: ()=>isNil,
|
|
151
|
-
isNumber: ()=>isNumber,
|
|
152
|
-
isObject: ()=>isObject,
|
|
153
|
-
isPlainObject: ()=>isPlainObject,
|
|
154
|
-
isString: ()=>isString,
|
|
155
|
-
isUndefined: ()=>isUndefined,
|
|
156
|
-
last: ()=>last,
|
|
157
|
-
pick: ()=>pick
|
|
158
|
-
});
|
|
159
|
-
var package_namespaceObject = {};
|
|
160
|
-
__webpack_require__.r(package_namespaceObject), __webpack_require__.d(package_namespaceObject, {
|
|
161
|
-
MODULE_PATH_PACKAGES: ()=>MODULE_PATH_PACKAGES,
|
|
162
|
-
PACKAGE_PATH_NAME: ()=>PACKAGE_PATH_NAME,
|
|
163
|
-
getPackageMetaFromModulePath: ()=>getPackageMetaFromModulePath
|
|
133
|
+
var summary_namespaceObject = {};
|
|
134
|
+
__webpack_require__.r(summary_namespaceObject), __webpack_require__.d(summary_namespaceObject, {
|
|
135
|
+
SummaryCostsDataName: ()=>summary_SummaryCostsDataName
|
|
164
136
|
});
|
|
165
|
-
var
|
|
166
|
-
__webpack_require__.r(
|
|
167
|
-
|
|
168
|
-
|
|
137
|
+
var time_namespaceObject = {};
|
|
138
|
+
__webpack_require__.r(time_namespaceObject), __webpack_require__.d(time_namespaceObject, {
|
|
139
|
+
formatCosts: ()=>formatCosts,
|
|
140
|
+
getCurrentTimestamp: ()=>getCurrentTimestamp,
|
|
141
|
+
getUnit: ()=>getUnit,
|
|
142
|
+
toFixedDigits: ()=>toFixedDigits
|
|
169
143
|
});
|
|
170
|
-
var
|
|
171
|
-
__webpack_require__.r(
|
|
172
|
-
|
|
173
|
-
|
|
144
|
+
var url_namespaceObject = {};
|
|
145
|
+
__webpack_require__.r(url_namespaceObject), __webpack_require__.d(url_namespaceObject, {
|
|
146
|
+
isFilePath: ()=>isFilePath,
|
|
147
|
+
isRemoteUrl: ()=>isRemoteUrl,
|
|
148
|
+
isUrl: ()=>isUrl
|
|
174
149
|
});
|
|
175
150
|
var summary_SummaryCostsDataName = ((SummaryCostsDataName = {}).Bootstrap = "bootstrap->beforeCompile", SummaryCostsDataName.Compile = "beforeCompile->afterCompile", SummaryCostsDataName.Done = "afterCompile->done", SummaryCostsDataName.Minify = "minify(processAssets)", SummaryCostsDataName);
|
|
176
151
|
function encode(str) {
|
|
@@ -183,7 +158,6 @@ function decode(str) {
|
|
|
183
158
|
for(let i = 0; i < str.length; i++)'!' === str[i] ? (res += String.fromCharCode(+tmp), tmp = '') : tmp += str[i];
|
|
184
159
|
return tmp && (res += String.fromCharCode(+tmp)), res;
|
|
185
160
|
}
|
|
186
|
-
let rsdoctorLogger = createLogger();
|
|
187
161
|
function mergeIntervals(intervals) {
|
|
188
162
|
let previous, current;
|
|
189
163
|
intervals.sort((a, b)=>a[0] - b[0]);
|
|
@@ -418,32 +392,6 @@ function getLoaderFileInputAndOutput(file, loader, loaderIndex, loaders) {
|
|
|
418
392
|
output: ''
|
|
419
393
|
};
|
|
420
394
|
}
|
|
421
|
-
rsdoctorLogger.override({
|
|
422
|
-
log: (message)=>{
|
|
423
|
-
console.log(`${picocolors.green('[RSDOCTOR LOG]')} ${message}`);
|
|
424
|
-
},
|
|
425
|
-
info: (message)=>{
|
|
426
|
-
console.log(`${picocolors.yellow('[RSDOCTOR INFO]')} ${message}`);
|
|
427
|
-
},
|
|
428
|
-
warn: (message)=>{
|
|
429
|
-
console.warn(`${picocolors.yellow('[RSDOCTOR WARN]')} ${message}`);
|
|
430
|
-
},
|
|
431
|
-
start: (message)=>{
|
|
432
|
-
console.log(`${picocolors.green('[RSDOCTOR START]')} ${message}`);
|
|
433
|
-
},
|
|
434
|
-
ready: (message)=>{
|
|
435
|
-
console.log(`${picocolors.green('[RSDOCTOR READY]')} ${message}`);
|
|
436
|
-
},
|
|
437
|
-
error: (message)=>{
|
|
438
|
-
console.error(`${picocolors.red('[RSDOCTOR ERROR]')} ${message}`);
|
|
439
|
-
},
|
|
440
|
-
success: (message)=>{
|
|
441
|
-
console.error(`${picocolors.green('[RSDOCTOR SUCCESS]')} ${message}`);
|
|
442
|
-
},
|
|
443
|
-
debug: (message)=>{
|
|
444
|
-
process.env.DEBUG && console.log(`${picocolors.blue('[RSDOCTOR DEBUG]')} ${message}`);
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
395
|
let LoaderInternalPropertyName = '__l__', isVue = (compiler)=>('module' in compiler.options && compiler.options.module.rules || []).some((rule)=>!!(rule && 'object' == typeof rule && rule.test instanceof RegExp && rule.test?.test('.vue'))), getLoadrName = (loader)=>{
|
|
448
396
|
let regResults = loader.includes('node_modules') ? loader.split('node_modules') : null;
|
|
449
397
|
return regResults ? regResults[regResults.length - 1] : loader;
|
|
@@ -633,7 +581,7 @@ function filterAssets(assets, filterOrExtensions) {
|
|
|
633
581
|
}
|
|
634
582
|
function getAssetsSizeInfo(assets, chunks, options = {}) {
|
|
635
583
|
let { withFileContent = !0, filterOrExtensions } = options;
|
|
636
|
-
return (assets = assets.filter((e)=>!isAssetMatchExtensions(e,
|
|
584
|
+
return (assets = assets.filter((e)=>!isAssetMatchExtensions(e, Constants.MapExtensions)), filterOrExtensions && (assets = filterAssets(assets, filterOrExtensions)), assets.length) ? {
|
|
637
585
|
count: assets.length,
|
|
638
586
|
size: assets.reduce((t, c)=>t + c.size, 0),
|
|
639
587
|
files: assets.map((e)=>({
|
|
@@ -664,31 +612,31 @@ function getAssetsDiffResult(baseline, current) {
|
|
|
664
612
|
total: diffAssetsByExtensions(baseline, current)
|
|
665
613
|
},
|
|
666
614
|
js: {
|
|
667
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
668
|
-
initial: diffAssetsByExtensions(baseline, current,
|
|
615
|
+
total: diffAssetsByExtensions(baseline, current, Constants.JSExtensions),
|
|
616
|
+
initial: diffAssetsByExtensions(baseline, current, Constants.JSExtensions, !0)
|
|
669
617
|
},
|
|
670
618
|
css: {
|
|
671
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
672
|
-
initial: diffAssetsByExtensions(baseline, current,
|
|
619
|
+
total: diffAssetsByExtensions(baseline, current, Constants.CSSExtension),
|
|
620
|
+
initial: diffAssetsByExtensions(baseline, current, Constants.CSSExtension, !0)
|
|
673
621
|
},
|
|
674
622
|
imgs: {
|
|
675
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
623
|
+
total: diffAssetsByExtensions(baseline, current, Constants.ImgExtensions)
|
|
676
624
|
},
|
|
677
625
|
html: {
|
|
678
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
626
|
+
total: diffAssetsByExtensions(baseline, current, Constants.HtmlExtension)
|
|
679
627
|
},
|
|
680
628
|
media: {
|
|
681
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
629
|
+
total: diffAssetsByExtensions(baseline, current, Constants.MediaExtensions)
|
|
682
630
|
},
|
|
683
631
|
fonts: {
|
|
684
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
632
|
+
total: diffAssetsByExtensions(baseline, current, Constants.FontExtensions)
|
|
685
633
|
},
|
|
686
634
|
others: {
|
|
687
635
|
total: diffAssetsByExtensions(baseline, current, (asset)=>!isAssetMatchExtensions(asset, [
|
|
688
|
-
...
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
].concat(
|
|
636
|
+
...Constants.JSExtensions,
|
|
637
|
+
Constants.CSSExtension,
|
|
638
|
+
Constants.HtmlExtension
|
|
639
|
+
].concat(Constants.ImgExtensions, Constants.MediaExtensions, Constants.FontExtensions, Constants.MapExtensions)))
|
|
692
640
|
}
|
|
693
641
|
};
|
|
694
642
|
}
|
|
@@ -731,29 +679,29 @@ function diffAssetsByExtensions(baseline, current, filterOrExtensions, isInitial
|
|
|
731
679
|
function getAssetsSummary(assets, chunks, options = {}) {
|
|
732
680
|
let jsOpt = {
|
|
733
681
|
...options,
|
|
734
|
-
filterOrExtensions:
|
|
682
|
+
filterOrExtensions: Constants.JSExtensions
|
|
735
683
|
}, cssOpt = {
|
|
736
684
|
...options,
|
|
737
|
-
filterOrExtensions:
|
|
685
|
+
filterOrExtensions: Constants.CSSExtension
|
|
738
686
|
}, imgOpt = {
|
|
739
687
|
...options,
|
|
740
|
-
filterOrExtensions:
|
|
688
|
+
filterOrExtensions: Constants.ImgExtensions
|
|
741
689
|
}, htmlOpt = {
|
|
742
690
|
...options,
|
|
743
|
-
filterOrExtensions:
|
|
691
|
+
filterOrExtensions: Constants.HtmlExtension
|
|
744
692
|
}, mediaOpt = {
|
|
745
693
|
...options,
|
|
746
|
-
filterOrExtensions:
|
|
694
|
+
filterOrExtensions: Constants.MediaExtensions
|
|
747
695
|
}, fontOpt = {
|
|
748
696
|
...options,
|
|
749
|
-
filterOrExtensions:
|
|
697
|
+
filterOrExtensions: Constants.FontExtensions
|
|
750
698
|
}, otherOpt = {
|
|
751
699
|
...options,
|
|
752
700
|
filterOrExtensions: (asset)=>!isAssetMatchExtensions(asset, [
|
|
753
|
-
...
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
].concat(
|
|
701
|
+
...Constants.JSExtensions,
|
|
702
|
+
Constants.CSSExtension,
|
|
703
|
+
Constants.HtmlExtension
|
|
704
|
+
].concat(Constants.ImgExtensions, Constants.MediaExtensions, Constants.FontExtensions, Constants.MapExtensions))
|
|
757
705
|
};
|
|
758
706
|
return {
|
|
759
707
|
all: {
|
|
@@ -924,7 +872,7 @@ class APIDataLoader {
|
|
|
924
872
|
name: configs?.[0]?.config?.name
|
|
925
873
|
}));
|
|
926
874
|
case SDK.ServerAPI.API.GetClientRoutes:
|
|
927
|
-
if ("u" > typeof window && window?.[
|
|
875
|
+
if ("u" > typeof window && window?.[Constants.WINDOW_RSDOCTOR_TAG]) return window[Constants.WINDOW_RSDOCTOR_TAG].enableRoutes;
|
|
928
876
|
return this.loader.loadManifest().then((res)=>{
|
|
929
877
|
let { enableRoutes = [] } = res.client || {};
|
|
930
878
|
return enableRoutes;
|
|
@@ -1178,36 +1126,6 @@ class APIDataLoader {
|
|
|
1178
1126
|
}
|
|
1179
1127
|
}
|
|
1180
1128
|
}
|
|
1181
|
-
function isUndefined(value) {
|
|
1182
|
-
return void 0 === value;
|
|
1183
|
-
}
|
|
1184
|
-
function isNumber(value) {
|
|
1185
|
-
return 'number' == typeof value && !Number.isNaN(value);
|
|
1186
|
-
}
|
|
1187
|
-
function isObject(value) {
|
|
1188
|
-
return 'object' == typeof value && null !== value;
|
|
1189
|
-
}
|
|
1190
|
-
function isEmpty(value) {
|
|
1191
|
-
return null == value || Array.isArray(value) && 0 === value.length || 'object' == typeof value && 0 === Object.keys(value).length;
|
|
1192
|
-
}
|
|
1193
|
-
function last(array) {
|
|
1194
|
-
return array[array.length - 1];
|
|
1195
|
-
}
|
|
1196
|
-
function compact(array) {
|
|
1197
|
-
return array.filter((item)=>null != item || !item);
|
|
1198
|
-
}
|
|
1199
|
-
function isNil(value) {
|
|
1200
|
-
return null == value;
|
|
1201
|
-
}
|
|
1202
|
-
let isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && Object.getPrototypeOf(obj) === Object.prototype, isString = (v)=>'string' == typeof v || !!v && 'object' == typeof v && !Array.isArray(v) && '[object String]' === ({}).toString.call(v);
|
|
1203
|
-
function pick(obj, keys) {
|
|
1204
|
-
let result = {};
|
|
1205
|
-
for(let i = 0; i < keys.length; i++){
|
|
1206
|
-
let key = keys[i];
|
|
1207
|
-
Object.hasOwn(obj, key) && (result[key] = obj[key]);
|
|
1208
|
-
}
|
|
1209
|
-
return result;
|
|
1210
|
-
}
|
|
1211
1129
|
let PACKAGE_SLUG = /[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*/, MODULE_PATH_PACKAGES = RegExp(`(?:${/(?:node_modules|~)(?:\/\.pnpm)?/.source}/)(?:(?:@${PACKAGE_SLUG.source}[/|+])?(?:${PACKAGE_SLUG.source}\\+)*(?:${PACKAGE_SLUG.source})(?:${/@[\w|\-|_|.]+/.source})?)(?:_(?:@${PACKAGE_SLUG.source}[/|+])?(?:${PACKAGE_SLUG.source})(?:@${PACKAGE_SLUG.source})?)*/`, 'g'), PACKAGE_PATH_NAME = /(?:(?:node_modules|~)(?:\/\.pnpm)?\/)(?:((?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*[/|+])?(?:(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*\+)*)(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))(?:@[\w|\-|_|.]+)?)(?:_((?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*[/|+])?(?:[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))(?:@[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*))*\//gm, getPackageMetaFromModulePath = (modulePath)=>{
|
|
1212
1130
|
var data;
|
|
1213
1131
|
let res, paths = modulePath.match(MODULE_PATH_PACKAGES);
|
|
@@ -1280,4 +1198,5 @@ function decycle(object) {
|
|
|
1280
1198
|
return _value;
|
|
1281
1199
|
}(object, '$');
|
|
1282
1200
|
}
|
|
1283
|
-
export {
|
|
1201
|
+
export { Lodash } from "./496.js";
|
|
1202
|
+
export { alerts_namespaceObject as Alerts, algorithm_namespaceObject as Algorithm, bundle_namespaceObject as Bundle, crypto_namespaceObject as Crypto, data_namespaceObject as Data, decycle, file_namespaceObject as File, getPackageMetaFromModulePath, global_config_namespaceObject as GlobalConfig, graph_namespaceObject as Graph, loader_namespaceObject as Loader, manifest_namespaceObject as Manifest, package_namespaceObject as Package, plugin_namespaceObject as Plugin, random, resolver_namespaceObject as Resolver, rspack_namespaceObject as Rspack, summary_namespaceObject as Summary, time_namespaceObject as Time, url_namespaceObject as Url };
|
package/dist/error.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Err, Linter } from "@rsdoctor/types";
|
|
|
3
3
|
import { createColors } from "picocolors";
|
|
4
4
|
import deep_eql from "deep-eql";
|
|
5
5
|
import strip_ansi from "strip-ansi";
|
|
6
|
+
import { isNil } from "./496.js";
|
|
6
7
|
function truncateMessage(input, maxLen = 1000) {
|
|
7
8
|
let str = 'string' == typeof input ? input : String(input ?? '');
|
|
8
9
|
return str.length > maxLen ? str.slice(0, maxLen) : str;
|
|
@@ -171,7 +172,6 @@ class DevToolError extends Error {
|
|
|
171
172
|
highlightCode: !controller.noColor
|
|
172
173
|
}));
|
|
173
174
|
} else if ('lineText' in codeFrameOpt) {
|
|
174
|
-
var rawLines, width;
|
|
175
175
|
let { length, lineText } = codeFrameOpt, lineCodeFrame = codeFrameColumns(lineText, {
|
|
176
176
|
start: {
|
|
177
177
|
line: 1,
|
|
@@ -179,12 +179,13 @@ class DevToolError extends Error {
|
|
|
179
179
|
},
|
|
180
180
|
end: {
|
|
181
181
|
line: 1,
|
|
182
|
-
column:
|
|
182
|
+
column: isNil(start.column) || isNil(length) ? void 0 : start.column + length
|
|
183
183
|
}
|
|
184
184
|
}, {
|
|
185
185
|
highlightCode: !controller.noColor
|
|
186
186
|
});
|
|
187
187
|
if (start.line > 1) {
|
|
188
|
+
var rawLines, width;
|
|
188
189
|
let lines;
|
|
189
190
|
lineCodeFrame = lineCodeFrame.replace(' 1 |', ` ${start.line} |`), start.line >= 10 && (rawLines = lineCodeFrame, width = String(start.line).length - 1, (lines = rawLines.split('\n'))[1] = Array(width).fill(' ').join('') + lines[1], lineCodeFrame = lines.join('\n'));
|
|
190
191
|
}
|
package/dist/logger.js
CHANGED
|
@@ -42,4 +42,4 @@ function timeEnd(label) {
|
|
|
42
42
|
let duration = Date.now() - start;
|
|
43
43
|
logger.debug(`Timer '${label}' ended: ${duration}ms`), _timers.delete(label);
|
|
44
44
|
}
|
|
45
|
-
export { picocolors as chalk,
|
|
45
|
+
export { debug, picocolors as chalk, rsdoctorLogger as logger, time, timeEnd };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __webpack_module_cache__ = {};
|
|
2
|
+
function __webpack_require__(moduleId) {
|
|
3
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
9
|
+
}
|
|
10
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
11
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: definition[key]
|
|
14
|
+
});
|
|
15
|
+
}, __webpack_require__.add = function(modules) {
|
|
16
|
+
Object.assign(__webpack_require__.m, modules);
|
|
17
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
18
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
21
|
+
value: !0
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
export { __webpack_require__ };
|
package/dist/ruleUtils.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
1
2
|
import { LinesAndColumns } from "lines-and-columns";
|
|
2
3
|
import { Parser, parse } from "acorn";
|
|
3
4
|
import { importAttributes } from "acorn-import-attributes";
|
|
4
5
|
import * as __rspack_external_acorn_walk_9c3ac672 from "acorn-walk";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
8
|
-
enumerable: !0,
|
|
9
|
-
get: definition[key]
|
|
10
|
-
});
|
|
11
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
12
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
13
|
-
value: 'Module'
|
|
14
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
15
|
-
value: !0
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
var utils_namespaceObject = {};
|
|
19
|
-
function isUndefined(value) {
|
|
20
|
-
return void 0 === value;
|
|
21
|
-
}
|
|
22
|
-
function isNumber(value) {
|
|
23
|
-
return 'number' == typeof value && !Number.isNaN(value);
|
|
24
|
-
}
|
|
6
|
+
import { isUndefined, isObject, isNumber } from "./496.js";
|
|
7
|
+
var ECMAVersion, utils_namespaceObject = {};
|
|
25
8
|
__webpack_require__.r(utils_namespaceObject), __webpack_require__.d(utils_namespaceObject, {
|
|
26
9
|
canParse: ()=>canParse,
|
|
27
10
|
detectECMAVersion: ()=>detectECMAVersion,
|
|
@@ -79,7 +62,7 @@ function clearDocument() {
|
|
|
79
62
|
store.clear();
|
|
80
63
|
}
|
|
81
64
|
function isSyntaxNode(node) {
|
|
82
|
-
return
|
|
65
|
+
return isObject(node) && 'type' in node;
|
|
83
66
|
}
|
|
84
67
|
function assertCreator(type) {
|
|
85
68
|
return (node)=>isSyntaxNode(node) && node.type === type;
|
|
@@ -253,4 +236,4 @@ let acornParserInternal = Parser.extend(importAttributes), acornParserExport = P
|
|
|
253
236
|
parseExpressionAt: (input, pos, options)=>acornParserInternal.parseExpressionAt(input, pos, options)
|
|
254
237
|
}
|
|
255
238
|
};
|
|
256
|
-
export { Document,
|
|
239
|
+
export { Document, asserts, canParse, clearDocument, detectECMAVersion, getDefaultImports, getDocument, getIdentifierInDeclaration, getIdentifierInExport, getIdentifierInImport, getIdentifierInPattern, isES5, isES6, isSameSemantics, parser, types_ECMAVersion as ECMAVersion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/utils",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"json-stream-stringify": "3.0.1",
|
|
75
75
|
"lines-and-columns": "2.0.4",
|
|
76
76
|
"picocolors": "^1.1.1",
|
|
77
|
-
"rslog": "^1.2
|
|
77
|
+
"rslog": "^1.3.2",
|
|
78
78
|
"strip-ansi": "^6.0.1",
|
|
79
|
-
"@rsdoctor/types": "1.5.
|
|
79
|
+
"@rsdoctor/types": "1.5.5"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/babel__code-frame": "7.27.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@types/envinfo": "7.8.4",
|
|
86
86
|
"@types/fs-extra": "^11.0.4",
|
|
87
87
|
"@types/node": "^22.8.1",
|
|
88
|
-
"prebundle": "1.6.
|
|
88
|
+
"prebundle": "1.6.4",
|
|
89
89
|
"filesize": "^10.1.6",
|
|
90
90
|
"connect": "3.7.0",
|
|
91
91
|
"tslib": "2.8.1",
|