@rsdoctor/utils 1.5.3-alpha.0 → 1.5.4
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/connect/index.js +33 -33
- package/dist/496.js +45 -0
- package/dist/build.cjs +2 -4
- package/dist/build.js +35 -106
- package/dist/common/graph/modules.d.ts +1 -1
- package/dist/common.cjs +9 -5
- package/dist/common.js +111 -188
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 943:
|
|
5
5
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
var debug = __nccwpck_require__(
|
|
23
|
+
var debug = __nccwpck_require__(825)('connect:dispatcher');
|
|
24
24
|
var EventEmitter = (__nccwpck_require__(434).EventEmitter);
|
|
25
|
-
var finalhandler = __nccwpck_require__(
|
|
25
|
+
var finalhandler = __nccwpck_require__(361);
|
|
26
26
|
var http = __nccwpck_require__(611);
|
|
27
|
-
var merge = __nccwpck_require__(
|
|
28
|
-
var parseUrl = __nccwpck_require__(
|
|
27
|
+
var merge = __nccwpck_require__(983);
|
|
28
|
+
var parseUrl = __nccwpck_require__(696);
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Module exports.
|
|
@@ -288,7 +288,7 @@ function getProtohost(url) {
|
|
|
288
288
|
|
|
289
289
|
/***/ }),
|
|
290
290
|
|
|
291
|
-
/***/
|
|
291
|
+
/***/ 881:
|
|
292
292
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -297,7 +297,7 @@ function getProtohost(url) {
|
|
|
297
297
|
* Expose `debug()` as the module.
|
|
298
298
|
*/
|
|
299
299
|
|
|
300
|
-
exports = module.exports = __nccwpck_require__(
|
|
300
|
+
exports = module.exports = __nccwpck_require__(86);
|
|
301
301
|
exports.log = log;
|
|
302
302
|
exports.formatArgs = formatArgs;
|
|
303
303
|
exports.save = save;
|
|
@@ -480,7 +480,7 @@ function localstorage() {
|
|
|
480
480
|
|
|
481
481
|
/***/ }),
|
|
482
482
|
|
|
483
|
-
/***/
|
|
483
|
+
/***/ 86:
|
|
484
484
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
485
485
|
|
|
486
486
|
|
|
@@ -496,7 +496,7 @@ exports.coerce = coerce;
|
|
|
496
496
|
exports.disable = disable;
|
|
497
497
|
exports.enable = enable;
|
|
498
498
|
exports.enabled = enabled;
|
|
499
|
-
exports.humanize = __nccwpck_require__(
|
|
499
|
+
exports.humanize = __nccwpck_require__(753);
|
|
500
500
|
|
|
501
501
|
/**
|
|
502
502
|
* The currently active debug mode names, and names to skip.
|
|
@@ -689,7 +689,7 @@ function coerce(val) {
|
|
|
689
689
|
|
|
690
690
|
/***/ }),
|
|
691
691
|
|
|
692
|
-
/***/
|
|
692
|
+
/***/ 825:
|
|
693
693
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
694
694
|
|
|
695
695
|
/**
|
|
@@ -698,15 +698,15 @@ function coerce(val) {
|
|
|
698
698
|
*/
|
|
699
699
|
|
|
700
700
|
if (typeof process !== 'undefined' && process.type === 'renderer') {
|
|
701
|
-
module.exports = __nccwpck_require__(
|
|
701
|
+
module.exports = __nccwpck_require__(881);
|
|
702
702
|
} else {
|
|
703
|
-
module.exports = __nccwpck_require__(
|
|
703
|
+
module.exports = __nccwpck_require__(281);
|
|
704
704
|
}
|
|
705
705
|
|
|
706
706
|
|
|
707
707
|
/***/ }),
|
|
708
708
|
|
|
709
|
-
/***/
|
|
709
|
+
/***/ 281:
|
|
710
710
|
/***/ ((module, exports, __nccwpck_require__) => {
|
|
711
711
|
|
|
712
712
|
/**
|
|
@@ -722,7 +722,7 @@ var util = __nccwpck_require__(23);
|
|
|
722
722
|
* Expose `debug()` as the module.
|
|
723
723
|
*/
|
|
724
724
|
|
|
725
|
-
exports = module.exports = __nccwpck_require__(
|
|
725
|
+
exports = module.exports = __nccwpck_require__(86);
|
|
726
726
|
exports.init = init;
|
|
727
727
|
exports.log = log;
|
|
728
728
|
exports.formatArgs = formatArgs;
|
|
@@ -961,7 +961,7 @@ exports.enable(load());
|
|
|
961
961
|
|
|
962
962
|
/***/ }),
|
|
963
963
|
|
|
964
|
-
/***/
|
|
964
|
+
/***/ 944:
|
|
965
965
|
/***/ ((module) => {
|
|
966
966
|
|
|
967
967
|
"use strict";
|
|
@@ -1064,7 +1064,7 @@ function listener(event, done) {
|
|
|
1064
1064
|
|
|
1065
1065
|
/***/ }),
|
|
1066
1066
|
|
|
1067
|
-
/***/
|
|
1067
|
+
/***/ 570:
|
|
1068
1068
|
/***/ ((module) => {
|
|
1069
1069
|
|
|
1070
1070
|
"use strict";
|
|
@@ -1132,7 +1132,7 @@ function encodeUrl (url) {
|
|
|
1132
1132
|
|
|
1133
1133
|
/***/ }),
|
|
1134
1134
|
|
|
1135
|
-
/***/
|
|
1135
|
+
/***/ 107:
|
|
1136
1136
|
/***/ ((module) => {
|
|
1137
1137
|
|
|
1138
1138
|
"use strict";
|
|
@@ -1218,7 +1218,7 @@ function escapeHtml(string) {
|
|
|
1218
1218
|
|
|
1219
1219
|
/***/ }),
|
|
1220
1220
|
|
|
1221
|
-
/***/
|
|
1221
|
+
/***/ 361:
|
|
1222
1222
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1223
1223
|
|
|
1224
1224
|
"use strict";
|
|
@@ -1235,13 +1235,13 @@ function escapeHtml(string) {
|
|
|
1235
1235
|
* @private
|
|
1236
1236
|
*/
|
|
1237
1237
|
|
|
1238
|
-
var debug = __nccwpck_require__(
|
|
1239
|
-
var encodeUrl = __nccwpck_require__(
|
|
1240
|
-
var escapeHtml = __nccwpck_require__(
|
|
1241
|
-
var onFinished = __nccwpck_require__(
|
|
1242
|
-
var parseUrl = __nccwpck_require__(
|
|
1243
|
-
var statuses = __nccwpck_require__(
|
|
1244
|
-
var unpipe = __nccwpck_require__(
|
|
1238
|
+
var debug = __nccwpck_require__(825)('finalhandler')
|
|
1239
|
+
var encodeUrl = __nccwpck_require__(570)
|
|
1240
|
+
var escapeHtml = __nccwpck_require__(107)
|
|
1241
|
+
var onFinished = __nccwpck_require__(622)
|
|
1242
|
+
var parseUrl = __nccwpck_require__(696)
|
|
1243
|
+
var statuses = __nccwpck_require__(723)
|
|
1244
|
+
var unpipe = __nccwpck_require__(752)
|
|
1245
1245
|
|
|
1246
1246
|
/**
|
|
1247
1247
|
* Module variables.
|
|
@@ -1557,7 +1557,7 @@ function setHeaders (res, headers) {
|
|
|
1557
1557
|
|
|
1558
1558
|
/***/ }),
|
|
1559
1559
|
|
|
1560
|
-
/***/
|
|
1560
|
+
/***/ 753:
|
|
1561
1561
|
/***/ ((module) => {
|
|
1562
1562
|
|
|
1563
1563
|
/**
|
|
@@ -1716,7 +1716,7 @@ function plural(ms, n, name) {
|
|
|
1716
1716
|
|
|
1717
1717
|
/***/ }),
|
|
1718
1718
|
|
|
1719
|
-
/***/
|
|
1719
|
+
/***/ 622:
|
|
1720
1720
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1721
1721
|
|
|
1722
1722
|
"use strict";
|
|
@@ -1742,7 +1742,7 @@ module.exports.isFinished = isFinished
|
|
|
1742
1742
|
* @private
|
|
1743
1743
|
*/
|
|
1744
1744
|
|
|
1745
|
-
var first = __nccwpck_require__(
|
|
1745
|
+
var first = __nccwpck_require__(944)
|
|
1746
1746
|
|
|
1747
1747
|
/**
|
|
1748
1748
|
* Variables.
|
|
@@ -1920,7 +1920,7 @@ function patchAssignSocket(res, callback) {
|
|
|
1920
1920
|
|
|
1921
1921
|
/***/ }),
|
|
1922
1922
|
|
|
1923
|
-
/***/
|
|
1923
|
+
/***/ 696:
|
|
1924
1924
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1925
1925
|
|
|
1926
1926
|
"use strict";
|
|
@@ -2086,7 +2086,7 @@ function fresh (url, parsedUrl) {
|
|
|
2086
2086
|
|
|
2087
2087
|
/***/ }),
|
|
2088
2088
|
|
|
2089
|
-
/***/
|
|
2089
|
+
/***/ 723:
|
|
2090
2090
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2091
2091
|
|
|
2092
2092
|
"use strict";
|
|
@@ -2207,7 +2207,7 @@ function status (code) {
|
|
|
2207
2207
|
|
|
2208
2208
|
/***/ }),
|
|
2209
2209
|
|
|
2210
|
-
/***/
|
|
2210
|
+
/***/ 752:
|
|
2211
2211
|
/***/ ((module) => {
|
|
2212
2212
|
|
|
2213
2213
|
"use strict";
|
|
@@ -2284,7 +2284,7 @@ function unpipe(stream) {
|
|
|
2284
2284
|
|
|
2285
2285
|
/***/ }),
|
|
2286
2286
|
|
|
2287
|
-
/***/
|
|
2287
|
+
/***/ 983:
|
|
2288
2288
|
/***/ ((module, exports) => {
|
|
2289
2289
|
|
|
2290
2290
|
/**
|
|
@@ -2420,7 +2420,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"100":"Continue","101":"Switching Pro
|
|
|
2420
2420
|
/******/ // startup
|
|
2421
2421
|
/******/ // Load entry module and return exports
|
|
2422
2422
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
2423
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
2423
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(943);
|
|
2424
2424
|
/******/ module.exports = __webpack_exports__;
|
|
2425
2425
|
/******/
|
|
2426
2426
|
/******/ })()
|
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 };
|
|
@@ -6,4 +6,4 @@ export declare function getModulesByChunk(chunk: SDK.ChunkData, modules: SDK.Mod
|
|
|
6
6
|
export declare function getModulesByChunks(chunks: SDK.ChunkData[], modules: SDK.ModuleData[], filterModules?: (keyof SDK.ModuleData)[], checkModules?: (module: SDK.ModuleData) => boolean): SDK.ModuleData[];
|
|
7
7
|
export declare function getModuleByDependency(dep: SDK.DependencyData, modules: SDK.ModuleData[]): SDK.ModuleData | undefined;
|
|
8
8
|
export declare function filterModulesAndDependenciesByPackageDeps(deps: Rule.DependencyWithPackageData[], dependencies: SDK.DependencyData[], modules: SDK.ModuleData[]): Pick<SDK.ModuleGraphData, 'dependencies' | 'modules'>;
|
|
9
|
-
export declare function getModuleDetails(moduleId: number, modules: SDK.ModuleData[], dependencies: SDK.DependencyData[]): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleDetails>;
|
|
9
|
+
export declare function getModuleDetails(moduleId: number, modules: SDK.ModuleData[], dependencies: SDK.DependencyData[], sideEffectCodes?: SDK.SideEffectCodeData[]): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleDetails>;
|
package/dist/common.cjs
CHANGED
|
@@ -809,11 +809,14 @@ for(var __rspack_i in (()=>{
|
|
|
809
809
|
modules: _modules
|
|
810
810
|
};
|
|
811
811
|
}
|
|
812
|
-
function getModuleDetails(moduleId, modules, dependencies) {
|
|
812
|
+
function getModuleDetails(moduleId, modules, dependencies, sideEffectCodes) {
|
|
813
813
|
let module = modules.find((e)=>e.id === moduleId);
|
|
814
814
|
return {
|
|
815
815
|
module,
|
|
816
|
-
dependencies: (0, graph_dependency.NL)(module, dependencies)
|
|
816
|
+
dependencies: (0, graph_dependency.NL)(module, dependencies),
|
|
817
|
+
...sideEffectCodes?.length ? {
|
|
818
|
+
sideEffectCodes
|
|
819
|
+
} : {}
|
|
817
820
|
};
|
|
818
821
|
}
|
|
819
822
|
let filenamePattern = 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})$`);
|
|
@@ -1167,10 +1170,11 @@ for(var __rspack_i in (()=>{
|
|
|
1167
1170
|
case types_.SDK.ServerAPI.API.GetModuleDetails:
|
|
1168
1171
|
return Promise.all([
|
|
1169
1172
|
this.loader.loadData('chunkGraph'),
|
|
1170
|
-
this.loader.loadData('moduleGraph')
|
|
1173
|
+
this.loader.loadData('moduleGraph'),
|
|
1174
|
+
this.loader.loadData('treeShaking')
|
|
1171
1175
|
]).then((res)=>{
|
|
1172
|
-
let { moduleId } = body, { modules = [], dependencies = [] } = res[1] || {};
|
|
1173
|
-
return getModuleDetails(moduleId, modules, dependencies);
|
|
1176
|
+
let { moduleId } = body, { modules = [], dependencies = [] } = res[1] || {}, treeShaking = res[2], sideEffectCodes = treeShaking?.sideEffectCodes[moduleId] || [];
|
|
1177
|
+
return getModuleDetails(moduleId, modules, dependencies, sideEffectCodes);
|
|
1174
1178
|
});
|
|
1175
1179
|
case types_.SDK.ServerAPI.API.GetModulesByModuleIds:
|
|
1176
1180
|
return this.loader.loadData('moduleGraph').then((res)=>{
|
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;
|
|
@@ -598,11 +546,14 @@ function filterModulesAndDependenciesByPackageDeps(deps, dependencies, modules)
|
|
|
598
546
|
modules: _modules
|
|
599
547
|
};
|
|
600
548
|
}
|
|
601
|
-
function getModuleDetails(moduleId, modules, dependencies) {
|
|
549
|
+
function getModuleDetails(moduleId, modules, dependencies, sideEffectCodes) {
|
|
602
550
|
let module = modules.find((e)=>e.id === moduleId);
|
|
603
551
|
return {
|
|
604
552
|
module,
|
|
605
|
-
dependencies: getDependenciesByModule(module, dependencies)
|
|
553
|
+
dependencies: getDependenciesByModule(module, dependencies),
|
|
554
|
+
...sideEffectCodes?.length ? {
|
|
555
|
+
sideEffectCodes
|
|
556
|
+
} : {}
|
|
606
557
|
};
|
|
607
558
|
}
|
|
608
559
|
let filenamePattern = 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})$`);
|
|
@@ -630,7 +581,7 @@ function filterAssets(assets, filterOrExtensions) {
|
|
|
630
581
|
}
|
|
631
582
|
function getAssetsSizeInfo(assets, chunks, options = {}) {
|
|
632
583
|
let { withFileContent = !0, filterOrExtensions } = options;
|
|
633
|
-
return (assets = assets.filter((e)=>!isAssetMatchExtensions(e,
|
|
584
|
+
return (assets = assets.filter((e)=>!isAssetMatchExtensions(e, Constants.MapExtensions)), filterOrExtensions && (assets = filterAssets(assets, filterOrExtensions)), assets.length) ? {
|
|
634
585
|
count: assets.length,
|
|
635
586
|
size: assets.reduce((t, c)=>t + c.size, 0),
|
|
636
587
|
files: assets.map((e)=>({
|
|
@@ -661,31 +612,31 @@ function getAssetsDiffResult(baseline, current) {
|
|
|
661
612
|
total: diffAssetsByExtensions(baseline, current)
|
|
662
613
|
},
|
|
663
614
|
js: {
|
|
664
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
665
|
-
initial: diffAssetsByExtensions(baseline, current,
|
|
615
|
+
total: diffAssetsByExtensions(baseline, current, Constants.JSExtensions),
|
|
616
|
+
initial: diffAssetsByExtensions(baseline, current, Constants.JSExtensions, !0)
|
|
666
617
|
},
|
|
667
618
|
css: {
|
|
668
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
669
|
-
initial: diffAssetsByExtensions(baseline, current,
|
|
619
|
+
total: diffAssetsByExtensions(baseline, current, Constants.CSSExtension),
|
|
620
|
+
initial: diffAssetsByExtensions(baseline, current, Constants.CSSExtension, !0)
|
|
670
621
|
},
|
|
671
622
|
imgs: {
|
|
672
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
623
|
+
total: diffAssetsByExtensions(baseline, current, Constants.ImgExtensions)
|
|
673
624
|
},
|
|
674
625
|
html: {
|
|
675
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
626
|
+
total: diffAssetsByExtensions(baseline, current, Constants.HtmlExtension)
|
|
676
627
|
},
|
|
677
628
|
media: {
|
|
678
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
629
|
+
total: diffAssetsByExtensions(baseline, current, Constants.MediaExtensions)
|
|
679
630
|
},
|
|
680
631
|
fonts: {
|
|
681
|
-
total: diffAssetsByExtensions(baseline, current,
|
|
632
|
+
total: diffAssetsByExtensions(baseline, current, Constants.FontExtensions)
|
|
682
633
|
},
|
|
683
634
|
others: {
|
|
684
635
|
total: diffAssetsByExtensions(baseline, current, (asset)=>!isAssetMatchExtensions(asset, [
|
|
685
|
-
...
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
].concat(
|
|
636
|
+
...Constants.JSExtensions,
|
|
637
|
+
Constants.CSSExtension,
|
|
638
|
+
Constants.HtmlExtension
|
|
639
|
+
].concat(Constants.ImgExtensions, Constants.MediaExtensions, Constants.FontExtensions, Constants.MapExtensions)))
|
|
689
640
|
}
|
|
690
641
|
};
|
|
691
642
|
}
|
|
@@ -728,29 +679,29 @@ function diffAssetsByExtensions(baseline, current, filterOrExtensions, isInitial
|
|
|
728
679
|
function getAssetsSummary(assets, chunks, options = {}) {
|
|
729
680
|
let jsOpt = {
|
|
730
681
|
...options,
|
|
731
|
-
filterOrExtensions:
|
|
682
|
+
filterOrExtensions: Constants.JSExtensions
|
|
732
683
|
}, cssOpt = {
|
|
733
684
|
...options,
|
|
734
|
-
filterOrExtensions:
|
|
685
|
+
filterOrExtensions: Constants.CSSExtension
|
|
735
686
|
}, imgOpt = {
|
|
736
687
|
...options,
|
|
737
|
-
filterOrExtensions:
|
|
688
|
+
filterOrExtensions: Constants.ImgExtensions
|
|
738
689
|
}, htmlOpt = {
|
|
739
690
|
...options,
|
|
740
|
-
filterOrExtensions:
|
|
691
|
+
filterOrExtensions: Constants.HtmlExtension
|
|
741
692
|
}, mediaOpt = {
|
|
742
693
|
...options,
|
|
743
|
-
filterOrExtensions:
|
|
694
|
+
filterOrExtensions: Constants.MediaExtensions
|
|
744
695
|
}, fontOpt = {
|
|
745
696
|
...options,
|
|
746
|
-
filterOrExtensions:
|
|
697
|
+
filterOrExtensions: Constants.FontExtensions
|
|
747
698
|
}, otherOpt = {
|
|
748
699
|
...options,
|
|
749
700
|
filterOrExtensions: (asset)=>!isAssetMatchExtensions(asset, [
|
|
750
|
-
...
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
].concat(
|
|
701
|
+
...Constants.JSExtensions,
|
|
702
|
+
Constants.CSSExtension,
|
|
703
|
+
Constants.HtmlExtension
|
|
704
|
+
].concat(Constants.ImgExtensions, Constants.MediaExtensions, Constants.FontExtensions, Constants.MapExtensions))
|
|
754
705
|
};
|
|
755
706
|
return {
|
|
756
707
|
all: {
|
|
@@ -921,7 +872,7 @@ class APIDataLoader {
|
|
|
921
872
|
name: configs?.[0]?.config?.name
|
|
922
873
|
}));
|
|
923
874
|
case SDK.ServerAPI.API.GetClientRoutes:
|
|
924
|
-
if ("u" > typeof window && window?.[
|
|
875
|
+
if ("u" > typeof window && window?.[Constants.WINDOW_RSDOCTOR_TAG]) return window[Constants.WINDOW_RSDOCTOR_TAG].enableRoutes;
|
|
925
876
|
return this.loader.loadManifest().then((res)=>{
|
|
926
877
|
let { enableRoutes = [] } = res.client || {};
|
|
927
878
|
return enableRoutes;
|
|
@@ -1004,10 +955,11 @@ class APIDataLoader {
|
|
|
1004
955
|
case SDK.ServerAPI.API.GetModuleDetails:
|
|
1005
956
|
return Promise.all([
|
|
1006
957
|
this.loader.loadData('chunkGraph'),
|
|
1007
|
-
this.loader.loadData('moduleGraph')
|
|
958
|
+
this.loader.loadData('moduleGraph'),
|
|
959
|
+
this.loader.loadData('treeShaking')
|
|
1008
960
|
]).then((res)=>{
|
|
1009
|
-
let { moduleId } = body, { modules = [], dependencies = [] } = res[1] || {};
|
|
1010
|
-
return getModuleDetails(moduleId, modules, dependencies);
|
|
961
|
+
let { moduleId } = body, { modules = [], dependencies = [] } = res[1] || {}, treeShaking = res[2], sideEffectCodes = treeShaking?.sideEffectCodes[moduleId] || [];
|
|
962
|
+
return getModuleDetails(moduleId, modules, dependencies, sideEffectCodes);
|
|
1011
963
|
});
|
|
1012
964
|
case SDK.ServerAPI.API.GetModulesByModuleIds:
|
|
1013
965
|
return this.loader.loadData('moduleGraph').then((res)=>{
|
|
@@ -1174,36 +1126,6 @@ class APIDataLoader {
|
|
|
1174
1126
|
}
|
|
1175
1127
|
}
|
|
1176
1128
|
}
|
|
1177
|
-
function isUndefined(value) {
|
|
1178
|
-
return void 0 === value;
|
|
1179
|
-
}
|
|
1180
|
-
function isNumber(value) {
|
|
1181
|
-
return 'number' == typeof value && !Number.isNaN(value);
|
|
1182
|
-
}
|
|
1183
|
-
function isObject(value) {
|
|
1184
|
-
return 'object' == typeof value && null !== value;
|
|
1185
|
-
}
|
|
1186
|
-
function isEmpty(value) {
|
|
1187
|
-
return null == value || Array.isArray(value) && 0 === value.length || 'object' == typeof value && 0 === Object.keys(value).length;
|
|
1188
|
-
}
|
|
1189
|
-
function last(array) {
|
|
1190
|
-
return array[array.length - 1];
|
|
1191
|
-
}
|
|
1192
|
-
function compact(array) {
|
|
1193
|
-
return array.filter((item)=>null != item || !item);
|
|
1194
|
-
}
|
|
1195
|
-
function isNil(value) {
|
|
1196
|
-
return null == value;
|
|
1197
|
-
}
|
|
1198
|
-
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);
|
|
1199
|
-
function pick(obj, keys) {
|
|
1200
|
-
let result = {};
|
|
1201
|
-
for(let i = 0; i < keys.length; i++){
|
|
1202
|
-
let key = keys[i];
|
|
1203
|
-
Object.hasOwn(obj, key) && (result[key] = obj[key]);
|
|
1204
|
-
}
|
|
1205
|
-
return result;
|
|
1206
|
-
}
|
|
1207
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)=>{
|
|
1208
1130
|
var data;
|
|
1209
1131
|
let res, paths = modulePath.match(MODULE_PATH_PACKAGES);
|
|
@@ -1276,4 +1198,5 @@ function decycle(object) {
|
|
|
1276
1198
|
return _value;
|
|
1277
1199
|
}(object, '$');
|
|
1278
1200
|
}
|
|
1279
|
-
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.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/estree": "1.0.5",
|
|
67
67
|
"acorn": "^8.10.0",
|
|
68
68
|
"acorn-import-attributes": "^1.9.5",
|
|
69
|
-
"acorn-walk": "8.3.
|
|
69
|
+
"acorn-walk": "8.3.5",
|
|
70
70
|
"deep-eql": "4.1.4",
|
|
71
71
|
"envinfo": "7.21.0",
|
|
72
72
|
"fs-extra": "^11.1.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"picocolors": "^1.1.1",
|
|
77
77
|
"rslog": "^1.2.11",
|
|
78
78
|
"strip-ansi": "^6.0.1",
|
|
79
|
-
"@rsdoctor/types": "1.5.
|
|
79
|
+
"@rsdoctor/types": "1.5.4"
|
|
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.4
|
|
88
|
+
"prebundle": "1.6.4",
|
|
89
89
|
"filesize": "^10.1.6",
|
|
90
90
|
"connect": "3.7.0",
|
|
91
91
|
"tslib": "2.8.1",
|