@uxf/scripts 11.114.0 → 11.114.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/scripts",
|
|
3
|
-
"version": "11.114.
|
|
3
|
+
"version": "11.114.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"got": "14.6.6",
|
|
41
41
|
"madge": "8.0.0",
|
|
42
42
|
"robots-txt-parser": "2.0.3",
|
|
43
|
+
"semver": "^7.7.3",
|
|
43
44
|
"yaml": "2.8.2",
|
|
44
45
|
"yargs": "18.0.0"
|
|
45
46
|
},
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"@types/node": "24",
|
|
48
49
|
"@types/react": "18.3.27",
|
|
49
50
|
"@types/react-dom": "18.3.7",
|
|
51
|
+
"@types/semver": "^7.7.1",
|
|
50
52
|
"@uxf/core": "11.114.0",
|
|
51
53
|
"@uxf/ui": "11.114.0"
|
|
52
54
|
}
|
|
@@ -11,6 +11,7 @@ exports.printSuggestedCommands = printSuggestedCommands;
|
|
|
11
11
|
exports.installDeps = installDeps;
|
|
12
12
|
const child_process_1 = require("child_process");
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
|
+
const semver_1 = __importDefault(require("semver"));
|
|
14
15
|
const detect_package_manager_1 = require("./detect-package-manager");
|
|
15
16
|
const package_json_1 = require("./package-json");
|
|
16
17
|
/** Packages that consumers always install themselves — skip these in suggestions */
|
|
@@ -49,6 +50,25 @@ function collectRequiredPeerDeps(uxfPackages, nodeModulesPath, projectPkg) {
|
|
|
49
50
|
}
|
|
50
51
|
return peerDeps;
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether `installed` is guaranteed to satisfy the peer-dep range `required`.
|
|
55
|
+
*
|
|
56
|
+
* Project specs can be exact pins (`6.0.3`), ranges (`^18.2.0`), or non-semver
|
|
57
|
+
* (workspace:*, file:..., git+...). Peer specs can be any range expression.
|
|
58
|
+
* Checks range subset so any version permitted by the project spec also
|
|
59
|
+
* satisfies the peer range. Falls back to string equality for non-semver specs.
|
|
60
|
+
*/
|
|
61
|
+
function isCompatible(installed, required) {
|
|
62
|
+
try {
|
|
63
|
+
if (semver_1.default.subset(installed, required, { includePrerelease: true })) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// not parseable as a semver range — fall through to string match
|
|
69
|
+
}
|
|
70
|
+
return installed === required;
|
|
71
|
+
}
|
|
52
72
|
function findMissingOrMismatchedDeps(requiredPeerDeps, projectPkg) {
|
|
53
73
|
const allProjectDeps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
|
|
54
74
|
const missing = new Map();
|
|
@@ -58,7 +78,7 @@ function findMissingOrMismatchedDeps(requiredPeerDeps, projectPkg) {
|
|
|
58
78
|
if (!installedVersion) {
|
|
59
79
|
missing.set(depName, { version, requiredBy, isDev });
|
|
60
80
|
}
|
|
61
|
-
else if (installedVersion
|
|
81
|
+
else if (!isCompatible(installedVersion, version)) {
|
|
62
82
|
mismatched.set(depName, { expected: version, actual: installedVersion, requiredBy, isDev });
|
|
63
83
|
}
|
|
64
84
|
}
|