@rsdoctor/utils 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.cjs +1 -1
- package/dist/build.js +1 -1
- package/dist/common.cjs +10 -3
- package/dist/common.js +10 -3
- package/package.json +2 -2
package/dist/build.cjs
CHANGED
|
@@ -18,7 +18,7 @@ var __webpack_modules__ = {
|
|
|
18
18
|
MODULE_PATH_PACKAGES: ()=>MODULE_PATH_PACKAGES,
|
|
19
19
|
PACKAGE_PATH_NAME: ()=>PACKAGE_PATH_NAME,
|
|
20
20
|
getPackageMetaFromModulePath: ()=>getPackageMetaFromModulePath
|
|
21
|
-
}), __webpack_require__("./src/common/algorithm.ts"), __webpack_require__("path"), __webpack_require__("process"), __webpack_require__("@rsdoctor/types"), __webpack_require__("./src/logger.ts"), RegExp(`(.*)${/[-|.]/.source}${/[a-
|
|
21
|
+
}), __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
22
|
var lodash = __webpack_require__("./src/common/lodash.ts");
|
|
23
23
|
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)=>{
|
|
24
24
|
var data;
|
package/dist/build.js
CHANGED
|
@@ -146,7 +146,7 @@ createLogger().override({
|
|
|
146
146
|
debug: (message)=>{
|
|
147
147
|
process.env.DEBUG && console.log(`${picocolors.blue('[RSDOCTOR DEBUG]')} ${message}`);
|
|
148
148
|
}
|
|
149
|
-
}), RegExp(`(.*)${/[-|.]/.source}${/[a-
|
|
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
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
151
|
var data;
|
|
152
152
|
let res, paths = modulePath.match(MODULE_PATH_PACKAGES);
|
package/dist/common.cjs
CHANGED
|
@@ -817,10 +817,16 @@ for(var __rspack_i in (()=>{
|
|
|
817
817
|
dependencies: (0, graph_dependency.NL)(module, dependencies)
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
|
-
let filenamePattern = RegExp(`(.*)${/[-|.]/.source}${/[a-
|
|
820
|
+
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})$`);
|
|
821
821
|
function formatAssetName(assetName, fileConfig) {
|
|
822
822
|
let splitFilesList = fileConfig?.split('.'), outputFileTailName = '', unHashedFileName = assetName;
|
|
823
|
-
|
|
823
|
+
if (splitFilesList?.length && splitFilesList.length >= 3 && splitFilesList[splitFilesList.length - 2]?.indexOf('[') < 0 && 'js|css|html'.indexOf(splitFilesList[splitFilesList.length - 1]) > -1) {
|
|
824
|
+
outputFileTailName = splitFilesList[splitFilesList.length - 2];
|
|
825
|
+
let match = assetName.match(/(.*)(\.([a-f0-9]{4,32}|[a-zA-Z]*[0-9][a-zA-Z0-9]*))(\.[^.]+){2,}$/);
|
|
826
|
+
if (match && match[3].length >= 4 && match[3].length <= 32) return unHashedFileName = match[1], `${unHashedFileName}.${outputFileTailName}.${assetName.substring(assetName.lastIndexOf('.') + 1)}`;
|
|
827
|
+
}
|
|
828
|
+
let match = assetName.match(filenamePattern);
|
|
829
|
+
return match && match[2] && match[2].length >= 4 && match[2].length <= 32 ? assetName.replace(filenamePattern, '$1$3') : assetName;
|
|
824
830
|
}
|
|
825
831
|
function isAssetMatchExtension(asset, ext) {
|
|
826
832
|
return asset.path.slice(-ext.length) === ext || extname(asset.path) === ext;
|
|
@@ -1075,7 +1081,8 @@ for(var __rspack_i in (()=>{
|
|
|
1075
1081
|
summary,
|
|
1076
1082
|
configs,
|
|
1077
1083
|
envinfo,
|
|
1078
|
-
errors
|
|
1084
|
+
errors,
|
|
1085
|
+
name: configs?.[0]?.config?.name
|
|
1079
1086
|
}));
|
|
1080
1087
|
case types_.SDK.ServerAPI.API.GetClientRoutes:
|
|
1081
1088
|
if ("u" > typeof window && window?.[types_.Constants.WINDOW_RSDOCTOR_TAG]) return window[types_.Constants.WINDOW_RSDOCTOR_TAG].enableRoutes;
|
package/dist/common.js
CHANGED
|
@@ -606,10 +606,16 @@ function getModuleDetails(moduleId, modules, dependencies) {
|
|
|
606
606
|
dependencies: getDependenciesByModule(module, dependencies)
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
|
-
let filenamePattern = RegExp(`(.*)${/[-|.]/.source}${/[a-
|
|
609
|
+
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})$`);
|
|
610
610
|
function formatAssetName(assetName, fileConfig) {
|
|
611
611
|
let splitFilesList = fileConfig?.split('.'), outputFileTailName = '', unHashedFileName = assetName;
|
|
612
|
-
|
|
612
|
+
if (splitFilesList?.length && splitFilesList.length >= 3 && splitFilesList[splitFilesList.length - 2]?.indexOf('[') < 0 && 'js|css|html'.indexOf(splitFilesList[splitFilesList.length - 1]) > -1) {
|
|
613
|
+
outputFileTailName = splitFilesList[splitFilesList.length - 2];
|
|
614
|
+
let match = assetName.match(/(.*)(\.([a-f0-9]{4,32}|[a-zA-Z]*[0-9][a-zA-Z0-9]*))(\.[^.]+){2,}$/);
|
|
615
|
+
if (match && match[3].length >= 4 && match[3].length <= 32) return unHashedFileName = match[1], `${unHashedFileName}.${outputFileTailName}.${assetName.substring(assetName.lastIndexOf('.') + 1)}`;
|
|
616
|
+
}
|
|
617
|
+
let match = assetName.match(filenamePattern);
|
|
618
|
+
return match && match[2] && match[2].length >= 4 && match[2].length <= 32 ? assetName.replace(filenamePattern, '$1$3') : assetName;
|
|
613
619
|
}
|
|
614
620
|
function isAssetMatchExtension(asset, ext) {
|
|
615
621
|
return asset.path.slice(-ext.length) === ext || extname(asset.path) === ext;
|
|
@@ -912,7 +918,8 @@ class APIDataLoader {
|
|
|
912
918
|
summary,
|
|
913
919
|
configs,
|
|
914
920
|
envinfo,
|
|
915
|
-
errors
|
|
921
|
+
errors,
|
|
922
|
+
name: configs?.[0]?.config?.name
|
|
916
923
|
}));
|
|
917
924
|
case SDK.ServerAPI.API.GetClientRoutes:
|
|
918
925
|
if ("u" > typeof window && window?.[types_Constants.WINDOW_RSDOCTOR_TAG]) return window[types_Constants.WINDOW_RSDOCTOR_TAG].enableRoutes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -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.
|
|
79
|
+
"@rsdoctor/types": "1.5.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/babel__code-frame": "7.0.6",
|