@rsdoctor/utils 1.1.9 → 1.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/cjs/build/envinfo.js +107 -95
  2. package/dist/cjs/build/file/cache.js +65 -56
  3. package/dist/cjs/build/file/index.js +78 -41
  4. package/dist/cjs/build/file/sharding.js +90 -78
  5. package/dist/cjs/build/index.js +49 -47
  6. package/dist/cjs/build/json.js +91 -98
  7. package/dist/cjs/build/process.js +47 -42
  8. package/dist/cjs/build/server.js +110 -87
  9. package/dist/cjs/common/alerts.js +46 -44
  10. package/dist/cjs/common/algorithm.js +63 -54
  11. package/dist/cjs/common/bundle.js +52 -46
  12. package/dist/cjs/common/crypto.js +47 -46
  13. package/dist/cjs/common/data/index.js +381 -455
  14. package/dist/cjs/common/file.js +44 -0
  15. package/dist/cjs/common/global-config.js +72 -64
  16. package/dist/cjs/common/graph/assets.js +274 -308
  17. package/dist/cjs/common/graph/chunk.js +66 -63
  18. package/dist/cjs/common/graph/dependency.js +42 -32
  19. package/dist/cjs/common/graph/entrypoints.js +33 -25
  20. package/dist/cjs/common/graph/index.js +93 -27
  21. package/dist/cjs/common/graph/modules.js +113 -98
  22. package/dist/cjs/common/index.js +101 -83
  23. package/dist/cjs/common/loader.js +277 -273
  24. package/dist/cjs/common/lodash.js +73 -62
  25. package/dist/cjs/common/manifest.js +57 -59
  26. package/dist/cjs/common/package.js +79 -80
  27. package/dist/cjs/common/plugin.js +78 -73
  28. package/dist/cjs/common/resolver.js +79 -69
  29. package/dist/cjs/common/rspack.js +43 -34
  30. package/dist/cjs/common/summary.js +39 -31
  31. package/dist/cjs/common/time.js +73 -78
  32. package/dist/cjs/common/url.js +44 -36
  33. package/dist/cjs/error/error.js +183 -220
  34. package/dist/cjs/error/index.js +70 -28
  35. package/dist/cjs/error/transform.js +150 -143
  36. package/dist/cjs/error/utils.js +54 -58
  37. package/dist/cjs/index.js +37 -38
  38. package/dist/cjs/logger.js +99 -73
  39. package/dist/cjs/rule-utils/document/document.js +83 -82
  40. package/dist/cjs/rule-utils/document/index.js +75 -23
  41. package/dist/cjs/rule-utils/document/server.js +42 -35
  42. package/dist/cjs/rule-utils/document/types.js +17 -15
  43. package/dist/cjs/rule-utils/index.js +66 -21
  44. package/dist/cjs/rule-utils/parser/asserts.js +129 -147
  45. package/dist/cjs/rule-utils/parser/index.js +84 -25
  46. package/dist/cjs/rule-utils/parser/parser.js +50 -85
  47. package/dist/cjs/rule-utils/parser/types.js +38 -30
  48. package/dist/cjs/rule-utils/parser/utils.js +141 -168
  49. package/dist/esm/build/envinfo.mjs +57 -0
  50. package/dist/esm/build/file/cache.mjs +23 -0
  51. package/dist/esm/build/file/index.mjs +4 -0
  52. package/dist/esm/build/file/sharding.mjs +50 -0
  53. package/dist/esm/build/index.mjs +6 -0
  54. package/dist/esm/build/json.mjs +66 -0
  55. package/dist/esm/build/process.mjs +17 -0
  56. package/dist/esm/build/server.mjs +96 -0
  57. package/dist/esm/common/alerts.mjs +17 -0
  58. package/dist/esm/common/algorithm.mjs +32 -0
  59. package/dist/esm/common/bundle.mjs +22 -0
  60. package/dist/esm/common/crypto.mjs +17 -0
  61. package/dist/esm/common/data/index.mjs +354 -0
  62. package/dist/esm/common/file.mjs +7 -0
  63. package/dist/esm/common/global-config.mjs +32 -0
  64. package/dist/esm/common/graph/assets.mjs +238 -0
  65. package/dist/esm/common/graph/chunk.mjs +32 -0
  66. package/dist/esm/common/graph/dependency.mjs +10 -0
  67. package/dist/esm/common/graph/entrypoints.mjs +4 -0
  68. package/dist/esm/common/graph/index.mjs +5 -0
  69. package/dist/esm/common/graph/modules.mjs +78 -0
  70. package/dist/esm/common/index.mjs +19 -0
  71. package/dist/esm/common/loader.mjs +247 -0
  72. package/dist/esm/common/lodash.mjs +32 -0
  73. package/dist/esm/common/manifest.mjs +30 -0
  74. package/dist/esm/common/package.mjs +56 -0
  75. package/dist/esm/common/plugin.mjs +48 -0
  76. package/dist/esm/common/resolver.mjs +46 -0
  77. package/dist/esm/common/rspack.mjs +9 -0
  78. package/dist/esm/common/summary.mjs +8 -0
  79. package/dist/esm/common/time.mjs +43 -0
  80. package/dist/esm/common/url.mjs +14 -0
  81. package/dist/esm/error/error.mjs +154 -0
  82. package/dist/esm/error/index.mjs +3 -0
  83. package/dist/esm/error/transform.mjs +138 -0
  84. package/dist/esm/error/utils.mjs +22 -0
  85. package/dist/esm/index.mjs +3 -0
  86. package/dist/esm/logger.mjs +49 -0
  87. package/dist/esm/rule-utils/document/document.mjs +58 -0
  88. package/dist/esm/rule-utils/document/index.mjs +3 -0
  89. package/dist/esm/rule-utils/document/server.mjs +12 -0
  90. package/dist/esm/rule-utils/index.mjs +2 -0
  91. package/dist/esm/rule-utils/parser/asserts.mjs +104 -0
  92. package/dist/esm/rule-utils/parser/index.mjs +4 -0
  93. package/dist/esm/rule-utils/parser/parser.mjs +23 -0
  94. package/dist/esm/rule-utils/parser/types.mjs +7 -0
  95. package/dist/esm/rule-utils/parser/utils.mjs +109 -0
  96. package/dist/type/common/file.d.ts +3 -0
  97. package/dist/type/common/file.d.ts.map +1 -0
  98. package/dist/type/common/graph/modules.d.ts +1 -1
  99. package/dist/type/common/graph/modules.d.ts.map +1 -1
  100. package/dist/type/common/index.d.ts +1 -0
  101. package/dist/type/common/index.d.ts.map +1 -1
  102. package/dist/type/logger.d.ts +3 -0
  103. package/dist/type/logger.d.ts.map +1 -1
  104. package/package.json +13 -12
  105. package/dist/esm/build/envinfo.js +0 -75
  106. package/dist/esm/build/file/cache.js +0 -30
  107. package/dist/esm/build/file/index.js +0 -7
  108. package/dist/esm/build/file/sharding.js +0 -50
  109. package/dist/esm/build/index.js +0 -12
  110. package/dist/esm/build/json.js +0 -85
  111. package/dist/esm/build/process.js +0 -24
  112. package/dist/esm/build/server.js +0 -96
  113. package/dist/esm/common/alerts.js +0 -25
  114. package/dist/esm/common/algorithm.js +0 -39
  115. package/dist/esm/common/bundle.js +0 -30
  116. package/dist/esm/common/crypto.js +0 -28
  117. package/dist/esm/common/data/index.js +0 -428
  118. package/dist/esm/common/global-config.js +0 -38
  119. package/dist/esm/common/graph/assets.js +0 -310
  120. package/dist/esm/common/graph/chunk.js +0 -49
  121. package/dist/esm/common/graph/dependency.js +0 -14
  122. package/dist/esm/common/graph/entrypoints.js +0 -6
  123. package/dist/esm/common/graph/index.js +0 -5
  124. package/dist/esm/common/graph/modules.js +0 -90
  125. package/dist/esm/common/index.js +0 -36
  126. package/dist/esm/common/loader.js +0 -279
  127. package/dist/esm/common/lodash.js +0 -49
  128. package/dist/esm/common/manifest.js +0 -46
  129. package/dist/esm/common/package.js +0 -71
  130. package/dist/esm/common/plugin.js +0 -59
  131. package/dist/esm/common/resolver.js +0 -54
  132. package/dist/esm/common/rspack.js +0 -12
  133. package/dist/esm/common/summary.js +0 -10
  134. package/dist/esm/common/time.js +0 -64
  135. package/dist/esm/common/url.js +0 -20
  136. package/dist/esm/error/error.js +0 -202
  137. package/dist/esm/error/index.js +0 -5
  138. package/dist/esm/error/transform.js +0 -141
  139. package/dist/esm/error/utils.js +0 -40
  140. package/dist/esm/index.js +0 -6
  141. package/dist/esm/logger.js +0 -43
  142. package/dist/esm/rule-utils/document/document.js +0 -67
  143. package/dist/esm/rule-utils/document/index.js +0 -3
  144. package/dist/esm/rule-utils/document/server.js +0 -17
  145. package/dist/esm/rule-utils/index.js +0 -2
  146. package/dist/esm/rule-utils/parser/asserts.js +0 -132
  147. package/dist/esm/rule-utils/parser/index.js +0 -4
  148. package/dist/esm/rule-utils/parser/parser.js +0 -58
  149. package/dist/esm/rule-utils/parser/types.js +0 -9
  150. package/dist/esm/rule-utils/parser/utils.js +0 -164
  151. /package/dist/esm/rule-utils/document/{types.js → types.mjs} +0 -0
@@ -1,82 +1,93 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var lodash_exports = {};
20
- __export(lodash_exports, {
21
- compact: () => compact,
22
- isEmpty: () => isEmpty,
23
- isNil: () => isNil,
24
- isNumber: () => isNumber,
25
- isObject: () => isObject,
26
- isPlainObject: () => isPlainObject,
27
- isString: () => isString,
28
- isUndefined: () => isUndefined,
29
- last: () => last,
30
- pick: () => pick
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ compact: ()=>compact,
28
+ isEmpty: ()=>isEmpty,
29
+ isNil: ()=>isNil,
30
+ isNumber: ()=>isNumber,
31
+ isObject: ()=>isObject,
32
+ isPlainObject: ()=>isPlainObject,
33
+ isString: ()=>isString,
34
+ isUndefined: ()=>isUndefined,
35
+ last: ()=>last,
36
+ pick: ()=>pick
31
37
  });
32
- module.exports = __toCommonJS(lodash_exports);
33
38
  function isUndefined(value) {
34
- return typeof value === "undefined";
39
+ return void 0 === value;
35
40
  }
36
41
  function isNumber(value) {
37
- return typeof value === "number" && !Number.isNaN(value);
42
+ return 'number' == typeof value && !Number.isNaN(value);
38
43
  }
39
44
  function isObject(value) {
40
- return typeof value === "object" && value !== null;
45
+ return 'object' == typeof value && null !== value;
41
46
  }
42
47
  function isEmpty(value) {
43
- return value == null || // Check for null or undefined
44
- Array.isArray(value) && value.length === 0 || // Check for empty array
45
- typeof value === "object" && Object.keys(value).length === 0;
48
+ return null == value || Array.isArray(value) && 0 === value.length || 'object' == typeof value && 0 === Object.keys(value).length;
46
49
  }
47
50
  function last(array) {
48
- return array[array.length - 1];
51
+ return array[array.length - 1];
49
52
  }
50
53
  function compact(array) {
51
- return array.filter((item) => item != null || !item);
54
+ return array.filter((item)=>null != item || !item);
52
55
  }
53
56
  function isNil(value) {
54
- return value === null || value === void 0;
57
+ return null == value;
55
58
  }
56
- const isPlainObject = (obj) => {
57
- return obj !== null && typeof obj === "object" && Object.getPrototypeOf(obj) === Object.prototype;
58
- };
59
- const isString = (v) => typeof v === "string" || !!v && typeof v === "object" && !Array.isArray(v) && {}.toString.call(v) === "[object String]";
59
+ const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && Object.getPrototypeOf(obj) === Object.prototype;
60
+ const isString = (v)=>'string' == typeof v || !!v && 'object' == typeof v && !Array.isArray(v) && '[object String]' === ({}).toString.call(v);
60
61
  function pick(obj, keys) {
61
- const result = {};
62
- for (let i = 0; i < keys.length; i++) {
63
- const key = keys[i];
64
- if (Object.hasOwn(obj, key)) {
65
- result[key] = obj[key];
62
+ const result = {};
63
+ for(let i = 0; i < keys.length; i++){
64
+ const key = keys[i];
65
+ if (Object.hasOwn(obj, key)) result[key] = obj[key];
66
66
  }
67
- }
68
- return result;
67
+ return result;
69
68
  }
70
- // Annotate the CommonJS export names for ESM import in node:
71
- 0 && (module.exports = {
72
- compact,
73
- isEmpty,
74
- isNil,
75
- isNumber,
76
- isObject,
77
- isPlainObject,
78
- isString,
79
- isUndefined,
80
- last,
81
- pick
69
+ exports.compact = __webpack_exports__.compact;
70
+ exports.isEmpty = __webpack_exports__.isEmpty;
71
+ exports.isNil = __webpack_exports__.isNil;
72
+ exports.isNumber = __webpack_exports__.isNumber;
73
+ exports.isObject = __webpack_exports__.isObject;
74
+ exports.isPlainObject = __webpack_exports__.isPlainObject;
75
+ exports.isString = __webpack_exports__.isString;
76
+ exports.isUndefined = __webpack_exports__.isUndefined;
77
+ exports.last = __webpack_exports__.last;
78
+ exports.pick = __webpack_exports__.pick;
79
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
80
+ "compact",
81
+ "isEmpty",
82
+ "isNil",
83
+ "isNumber",
84
+ "isObject",
85
+ "isPlainObject",
86
+ "isString",
87
+ "isUndefined",
88
+ "last",
89
+ "pick"
90
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
91
+ Object.defineProperty(exports, '__esModule', {
92
+ value: true
82
93
  });
@@ -1,72 +1,70 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var manifest_exports = {};
20
- __export(manifest_exports, {
21
- fetchShardingData: () => fetchShardingData,
22
- fetchShardingFiles: () => fetchShardingFiles,
23
- isShardingData: () => isShardingData
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ isShardingData: ()=>isShardingData,
28
+ fetchShardingData: ()=>fetchShardingData,
29
+ fetchShardingFiles: ()=>fetchShardingFiles
24
30
  });
25
- module.exports = __toCommonJS(manifest_exports);
26
- var import_algorithm = require("./algorithm");
27
- var import_url = require("./url");
31
+ const external_algorithm_js_namespaceObject = require("./algorithm.js");
32
+ const external_url_js_namespaceObject = require("./url.js");
28
33
  function isShardingData(data) {
29
- if (Array.isArray(data) && data.length > 0) {
30
- if (data.every((e) => (0, import_url.isRemoteUrl)(e))) {
31
- return true;
34
+ if (Array.isArray(data) && data.length > 0) {
35
+ if (data.every((e)=>(0, external_url_js_namespaceObject.isRemoteUrl)(e))) return true;
32
36
  }
33
- }
34
- return false;
37
+ return false;
35
38
  }
36
39
  async function fetchShardingData(shardingFiles, fetchImplement) {
37
- const res = await Promise.all(
38
- shardingFiles.map((url) => fetchImplement(url))
39
- );
40
- const strings = res.length === 0 ? [] : res.reduce((t, e) => t + e);
41
- return typeof strings === "object" ? strings : JSON.parse((0, import_algorithm.decompressText)(strings));
40
+ const res = await Promise.all(shardingFiles.map((url)=>fetchImplement(url)));
41
+ const strings = 0 === res.length ? [] : res.reduce((t, e)=>t + e);
42
+ return 'object' == typeof strings ? strings : JSON.parse((0, external_algorithm_js_namespaceObject.decompressText)(strings));
42
43
  }
43
44
  async function fetchShardingFiles(data, fetchImplement, filterKeys) {
44
- const datas = await Promise.all(
45
- Object.keys(data).map(async (_key) => {
46
- const key = _key;
47
- const val = data[key];
48
- if (filterKeys?.length && filterKeys.indexOf(key) < 0) {
49
- return {
50
- [key]: []
45
+ const datas = await Promise.all(Object.keys(data).map(async (_key)=>{
46
+ const key = _key;
47
+ const val = data[key];
48
+ if ((null == filterKeys ? void 0 : filterKeys.length) && filterKeys.indexOf(key) < 0) return {
49
+ [key]: []
50
+ };
51
+ if (isShardingData(val)) return {
52
+ [key]: await fetchShardingData(val, fetchImplement)
51
53
  };
52
- }
53
- if (isShardingData(val)) {
54
54
  return {
55
- [key]: await fetchShardingData(val, fetchImplement)
55
+ [key]: val
56
56
  };
57
- }
58
- return {
59
- [key]: val
60
- };
61
- })
62
- );
63
- return datas.reduce(
64
- (t, c) => Object.assign(t, c)
65
- );
57
+ }));
58
+ return datas.reduce((t, c)=>Object.assign(t, c));
66
59
  }
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- fetchShardingData,
70
- fetchShardingFiles,
71
- isShardingData
60
+ exports.fetchShardingData = __webpack_exports__.fetchShardingData;
61
+ exports.fetchShardingFiles = __webpack_exports__.fetchShardingFiles;
62
+ exports.isShardingData = __webpack_exports__.isShardingData;
63
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
64
+ "fetchShardingData",
65
+ "fetchShardingFiles",
66
+ "isShardingData"
67
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
68
+ Object.defineProperty(exports, '__esModule', {
69
+ value: true
72
70
  });
@@ -1,97 +1,96 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var package_exports = {};
20
- __export(package_exports, {
21
- MODULE_PATH_PACKAGES: () => MODULE_PATH_PACKAGES,
22
- PACKAGE_PATH_NAME: () => PACKAGE_PATH_NAME,
23
- getPackageMetaFromModulePath: () => getPackageMetaFromModulePath
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ getPackageMetaFromModulePath: ()=>getPackageMetaFromModulePath,
28
+ MODULE_PATH_PACKAGES: ()=>MODULE_PATH_PACKAGES,
29
+ PACKAGE_PATH_NAME: ()=>PACKAGE_PATH_NAME
24
30
  });
25
- module.exports = __toCommonJS(package_exports);
26
- var import_lodash = require("./lodash");
31
+ const external_lodash_js_namespaceObject = require("./lodash.js");
27
32
  const PACKAGE_PREFIX = /(?:node_modules|~)(?:\/\.pnpm)?/;
28
33
  const PACKAGE_SLUG = /[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*/;
29
34
  const VERSION = /@[\w|\-|_|.]+/;
30
- const VERSION_NUMBER = "@([\\d.]+)";
31
- const MODULE_PATH_PACKAGES = new RegExp(
32
- [
33
- // match dependency directory (eg: `node_modules/`, `node_modules/.pnpm/`)
35
+ const VERSION_NUMBER = '@([\\d.]+)';
36
+ const MODULE_PATH_PACKAGES = new RegExp([
34
37
  `(?:${PACKAGE_PREFIX.source}/)`,
35
- // match package name
36
- "(?:",
37
- // match `@organization/` or `@organization+`(pnpm)
38
+ '(?:',
38
39
  `(?:@${PACKAGE_SLUG.source}[/|+])?`,
39
- // match github.com+organization+
40
40
  `(?:${PACKAGE_SLUG.source}\\+)*`,
41
- // match package name
42
41
  `(?:${PACKAGE_SLUG.source})`,
43
- // match version
44
42
  `(?:${VERSION.source})?`,
45
- ")",
46
- // Match pnpm peer dependencies (eg: package-a@version_package-b@version)
47
- "(?:_",
43
+ ')',
44
+ '(?:_',
48
45
  `(?:@${PACKAGE_SLUG.source}[/|+])?`,
49
46
  `(?:${PACKAGE_SLUG.source})`,
50
47
  `(?:@${PACKAGE_SLUG.source})?`,
51
- ")*",
52
- "/"
53
- ].join(""),
54
- "g"
55
- );
48
+ ')*',
49
+ '/'
50
+ ].join(''), 'g');
56
51
  const 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;
57
- const uniqLast = (data) => {
58
- const res = [];
59
- data.forEach((item, index) => {
60
- if (!data.slice(index + 1).includes(item)) {
61
- res.push(item);
62
- }
63
- });
64
- return res;
52
+ const uniqLast = (data)=>{
53
+ const res = [];
54
+ data.forEach((item, index)=>{
55
+ if (!data.slice(index + 1).includes(item)) res.push(item);
56
+ });
57
+ return res;
65
58
  };
66
- const getPackageMetaFromModulePath = (modulePath) => {
67
- const paths = modulePath.match(MODULE_PATH_PACKAGES);
68
- if (!paths) {
69
- return { name: "", version: "" };
70
- }
71
- const names = uniqLast(
72
- paths.flatMap((packagePath) => {
73
- const found = packagePath.matchAll(PACKAGE_PATH_NAME);
74
- if (!found) {
75
- return [];
76
- }
77
- const paksArray = (0, import_lodash.compact)([...found].flat());
78
- return paksArray.slice(1).filter(Boolean).map((name2) => name2.replace(/\+/g, "/"));
79
- })
80
- );
81
- if ((0, import_lodash.isEmpty)(names)) {
82
- return { name: "", version: "" };
83
- }
84
- const name = (0, import_lodash.last)(names);
85
- const pattern = new RegExp(`(.*)(${(0, import_lodash.last)(paths)}).*`);
86
- const path = modulePath.replace(pattern, "$1$2").replace(/\/$/, "");
87
- return {
88
- name,
89
- version: path && name ? path.match(new RegExp(`${name}${VERSION_NUMBER}`))?.flat().slice(1)?.[0] || "" : ""
90
- };
59
+ const getPackageMetaFromModulePath = (modulePath)=>{
60
+ var _path_match_flat_slice, _path_match;
61
+ const paths = modulePath.match(MODULE_PATH_PACKAGES);
62
+ if (!paths) return {
63
+ name: '',
64
+ version: ''
65
+ };
66
+ const names = uniqLast(paths.flatMap((packagePath)=>{
67
+ const found = packagePath.matchAll(PACKAGE_PATH_NAME);
68
+ if (!found) return [];
69
+ const paksArray = (0, external_lodash_js_namespaceObject.compact)([
70
+ ...found
71
+ ].flat());
72
+ return paksArray.slice(1).filter(Boolean).map((name)=>name.replace(/\+/g, '/'));
73
+ }));
74
+ if ((0, external_lodash_js_namespaceObject.isEmpty)(names)) return {
75
+ name: '',
76
+ version: ''
77
+ };
78
+ const name = (0, external_lodash_js_namespaceObject.last)(names);
79
+ const pattern = new RegExp(`(.*)(${(0, external_lodash_js_namespaceObject.last)(paths)}).*`);
80
+ const path = modulePath.replace(pattern, '$1$2').replace(/\/$/, '');
81
+ return {
82
+ name,
83
+ version: path && name ? (null == (_path_match = path.match(new RegExp(`${name}${VERSION_NUMBER}`))) ? void 0 : null == (_path_match_flat_slice = _path_match.flat().slice(1)) ? void 0 : _path_match_flat_slice[0]) || '' : ''
84
+ };
91
85
  };
92
- // Annotate the CommonJS export names for ESM import in node:
93
- 0 && (module.exports = {
94
- MODULE_PATH_PACKAGES,
95
- PACKAGE_PATH_NAME,
96
- getPackageMetaFromModulePath
86
+ exports.MODULE_PATH_PACKAGES = __webpack_exports__.MODULE_PATH_PACKAGES;
87
+ exports.PACKAGE_PATH_NAME = __webpack_exports__.PACKAGE_PATH_NAME;
88
+ exports.getPackageMetaFromModulePath = __webpack_exports__.getPackageMetaFromModulePath;
89
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
90
+ "MODULE_PATH_PACKAGES",
91
+ "PACKAGE_PATH_NAME",
92
+ "getPackageMetaFromModulePath"
93
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ Object.defineProperty(exports, '__esModule', {
95
+ value: true
97
96
  });
@@ -1,86 +1,91 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var plugin_exports = {};
20
- __export(plugin_exports, {
21
- getPluginData: () => getPluginData,
22
- getPluginHooks: () => getPluginHooks,
23
- getPluginSummary: () => getPluginSummary,
24
- getPluginTapNames: () => getPluginTapNames
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ getPluginData: ()=>getPluginData,
28
+ getPluginHooks: ()=>getPluginHooks,
29
+ getPluginSummary: ()=>getPluginSummary,
30
+ getPluginTapNames: ()=>getPluginTapNames
25
31
  });
26
- module.exports = __toCommonJS(plugin_exports);
27
32
  function getPluginHooks(plugin) {
28
- return Object.keys(plugin);
33
+ return Object.keys(plugin);
29
34
  }
30
35
  function getPluginTapNames(plugin) {
31
- const hooks = getPluginHooks(plugin);
32
- const tapNames = /* @__PURE__ */ new Set();
33
- hooks.forEach((hook) => {
34
- plugin[hook].forEach((data) => {
35
- tapNames.add(data.tapName);
36
+ const hooks = getPluginHooks(plugin);
37
+ const tapNames = new Set();
38
+ hooks.forEach((hook)=>{
39
+ plugin[hook].forEach((data)=>{
40
+ tapNames.add(data.tapName);
41
+ });
36
42
  });
37
- });
38
- return [...tapNames];
43
+ return [
44
+ ...tapNames
45
+ ];
39
46
  }
40
47
  function getPluginSummary(plugin) {
41
- return {
42
- hooks: getPluginHooks(plugin),
43
- tapNames: getPluginTapNames(plugin)
44
- };
48
+ return {
49
+ hooks: getPluginHooks(plugin),
50
+ tapNames: getPluginTapNames(plugin)
51
+ };
45
52
  }
46
53
  function getPluginData(plugin, selectedHooks = [], selectedTapNames = []) {
47
- const hooks = getPluginHooks(plugin).filter((hook) => {
48
- if (selectedHooks.length && selectedHooks.indexOf(hook) === -1) {
49
- return false;
50
- }
51
- return true;
52
- });
53
- if (!hooks.length)
54
- return [];
55
- const tapNames = getPluginTapNames(plugin);
56
- return tapNames.reduce((total, tapName) => {
57
- if (selectedTapNames.length && selectedTapNames.indexOf(tapName) === -1) {
58
- return total;
59
- }
60
- hooks.forEach((hook) => {
61
- const hookData = plugin[hook].filter((e) => e.tapName === tapName);
62
- if (hookData.length === 0)
63
- return;
64
- total.push({
65
- tapName,
66
- hook,
67
- data: hookData.map((e) => {
68
- return {
69
- startAt: e.startAt,
70
- endAt: e.endAt,
71
- costs: e.costs,
72
- type: e.type
73
- };
74
- })
75
- });
54
+ const hooks = getPluginHooks(plugin).filter((hook)=>{
55
+ if (selectedHooks.length && -1 === selectedHooks.indexOf(hook)) return false;
56
+ return true;
76
57
  });
77
- return total;
78
- }, []);
58
+ if (!hooks.length) return [];
59
+ const tapNames = getPluginTapNames(plugin);
60
+ return tapNames.reduce((total, tapName)=>{
61
+ if (selectedTapNames.length && -1 === selectedTapNames.indexOf(tapName)) return total;
62
+ hooks.forEach((hook)=>{
63
+ const hookData = plugin[hook].filter((e)=>e.tapName === tapName);
64
+ if (0 === hookData.length) return;
65
+ total.push({
66
+ tapName,
67
+ hook,
68
+ data: hookData.map((e)=>({
69
+ startAt: e.startAt,
70
+ endAt: e.endAt,
71
+ costs: e.costs,
72
+ type: e.type
73
+ }))
74
+ });
75
+ });
76
+ return total;
77
+ }, []);
79
78
  }
80
- // Annotate the CommonJS export names for ESM import in node:
81
- 0 && (module.exports = {
82
- getPluginData,
83
- getPluginHooks,
84
- getPluginSummary,
85
- getPluginTapNames
79
+ exports.getPluginData = __webpack_exports__.getPluginData;
80
+ exports.getPluginHooks = __webpack_exports__.getPluginHooks;
81
+ exports.getPluginSummary = __webpack_exports__.getPluginSummary;
82
+ exports.getPluginTapNames = __webpack_exports__.getPluginTapNames;
83
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
84
+ "getPluginData",
85
+ "getPluginHooks",
86
+ "getPluginSummary",
87
+ "getPluginTapNames"
88
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
89
+ Object.defineProperty(exports, '__esModule', {
90
+ value: true
86
91
  });