@uxf/scripts 12.7.1 → 13.0.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": "12.7.1",
3
+ "version": "13.0.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -42,10 +42,10 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "24",
45
- "@types/react": "18.3.31",
46
- "@types/react-dom": "18.3.7",
45
+ "@types/react": "19.3.0",
46
+ "@types/react-dom": "19.3.0",
47
47
  "@types/semver": "^7.8.0",
48
- "@uxf/core": "12.7.0",
49
- "@uxf/ui": "12.7.1"
48
+ "@uxf/core": "13.0.0",
49
+ "@uxf/ui": "13.0.1"
50
50
  }
51
51
  }
@@ -114,10 +114,13 @@ async function checkUxfDependencies(options) {
114
114
  // --- Peer dependency check ---
115
115
  const requiredPeerDeps = (0, peer_deps_1.collectRequiredPeerDeps)(uxfPackages, nodeModulesPath, projectPkg);
116
116
  const { missing, mismatched, overridden } = (0, peer_deps_1.findMissingOrMismatchedDeps)(requiredPeerDeps, projectPkg);
117
+ const consumerMismatched = (0, peer_deps_1.findConsumerProvidedMismatches)(uxfPackages, nodeModulesPath, projectPkg);
118
+ (0, peer_deps_1.printConsumerProvidedGuidance)(consumerMismatched, pm);
117
119
  if (missing.size === 0 && mismatched.size === 0) {
118
120
  (0, peer_deps_1.printPeerDepsReport)(missing, mismatched, overridden);
119
- console.log("All peer dependencies are correctly installed."); // eslint-disable-line no-console
120
- return hasIssues ? 1 : 0;
121
+ // eslint-disable-next-line no-console
122
+ console.log(`All ${consumerMismatched.size > 0 ? "other " : ""}peer dependencies are correctly installed.`);
123
+ return hasIssues || consumerMismatched.size > 0 ? 1 : 0;
121
124
  }
122
125
  (0, peer_deps_1.printPeerDepsReport)(missing, mismatched, overridden);
123
126
  hasIssues = true;
@@ -126,5 +129,6 @@ async function checkUxfDependencies(options) {
126
129
  (0, peer_deps_1.printUxfMismatchGuidance)(mismatched, pm);
127
130
  return 1;
128
131
  }
129
- return runFixPasses({ missing, mismatched, overridden }, { cwd, nodeModulesPath, pm });
132
+ const fixResult = runFixPasses({ missing, mismatched, overridden }, { cwd, nodeModulesPath, pm });
133
+ return consumerMismatched.size > 0 ? 1 : fixResult;
130
134
  }
@@ -13,6 +13,13 @@ export declare function findMissingOrMismatchedDeps(requiredPeerDeps: Map<string
13
13
  mismatched: Map<string, MismatchInfo>;
14
14
  overridden: Map<string, string>;
15
15
  };
16
+ /**
17
+ * `react`, `react-dom` and `next` are left out of the peer collection, so `--fix` never installs them:
18
+ * the project picks those versions. A project whose own spec cannot satisfy what an installed `@uxf/*`
19
+ * package needs is still a failed check, or it would stay on React 18 under a release that requires 19.
20
+ */
21
+ export declare function findConsumerProvidedMismatches(uxfPackages: string[], nodeModulesPath: string, projectPkg: PackageJson): Map<string, MismatchInfo>;
22
+ export declare function printConsumerProvidedGuidance(mismatched: Map<string, MismatchInfo>, pm: PackageManager): void;
16
23
  export declare function printPeerDepsReport(missing: Map<string, DepInfo>, mismatched: Map<string, MismatchInfo>, overridden?: Map<string, string>): void;
17
24
  /**
18
25
  * Splits version mismatches into the ones `--fix` may install and the ones it must not.
@@ -7,6 +7,8 @@ exports.findInstalledUxfPackages = findInstalledUxfPackages;
7
7
  exports.collectRequiredPeerDeps = collectRequiredPeerDeps;
8
8
  exports.isOverrideSpec = isOverrideSpec;
9
9
  exports.findMissingOrMismatchedDeps = findMissingOrMismatchedDeps;
10
+ exports.findConsumerProvidedMismatches = findConsumerProvidedMismatches;
11
+ exports.printConsumerProvidedGuidance = printConsumerProvidedGuidance;
10
12
  exports.printPeerDepsReport = printPeerDepsReport;
11
13
  exports.splitFixableMismatches = splitFixableMismatches;
12
14
  exports.printUxfMismatchGuidance = printUxfMismatchGuidance;
@@ -124,6 +126,59 @@ function findMissingOrMismatchedDeps(requiredPeerDeps, projectPkg) {
124
126
  }
125
127
  return { missing, mismatched, overridden };
126
128
  }
129
+ /**
130
+ * `react`, `react-dom` and `next` are left out of the peer collection, so `--fix` never installs them:
131
+ * the project picks those versions. A project whose own spec cannot satisfy what an installed `@uxf/*`
132
+ * package needs is still a failed check, or it would stay on React 18 under a release that requires 19.
133
+ */
134
+ function findConsumerProvidedMismatches(uxfPackages, nodeModulesPath, projectPkg) {
135
+ var _a, _b;
136
+ const allProjectDeps = { ...projectPkg.dependencies, ...projectPkg.devDependencies };
137
+ const mismatched = new Map();
138
+ // The same transitive walk as `collectRequiredPeerDeps`: a package the project reaches only through
139
+ // another @uxf/* package's peers still runs on the project's React.
140
+ const visited = new Set();
141
+ const queue = [...uxfPackages];
142
+ while (queue.length > 0) {
143
+ const uxfPkg = queue.shift();
144
+ if (visited.has(uxfPkg)) {
145
+ continue;
146
+ }
147
+ visited.add(uxfPkg);
148
+ const peers = (_b = (_a = (0, package_json_1.readPackageJson)(path_1.default.join(nodeModulesPath, uxfPkg, "package.json"))) === null || _a === void 0 ? void 0 : _a.peerDependencies) !== null && _b !== void 0 ? _b : {};
149
+ queue.push(...Object.keys(peers).filter((depName) => depName.startsWith("@uxf/")));
150
+ for (const depName of CONSUMER_PROVIDED) {
151
+ const required = peers[depName];
152
+ const installed = allProjectDeps[depName];
153
+ if (!required || !installed || isOverrideSpec(installed) || isCompatible(installed, required)) {
154
+ continue;
155
+ }
156
+ const existing = mismatched.get(depName);
157
+ if (existing) {
158
+ existing.requiredBy.push(uxfPkg);
159
+ }
160
+ else {
161
+ mismatched.set(depName, { actual: installed, expected: required, isDev: false, requiredBy: [uxfPkg] });
162
+ }
163
+ }
164
+ }
165
+ return mismatched;
166
+ }
167
+ function printConsumerProvidedGuidance(mismatched, pm) {
168
+ if (mismatched.size === 0) {
169
+ return;
170
+ }
171
+ console.log("Provided by the project, never installed by --fix:"); // eslint-disable-line no-console
172
+ for (const [name, { expected, actual, requiredBy }] of mismatched) {
173
+ // eslint-disable-next-line no-console
174
+ console.log(` ${name}: installed ${actual}, expected ${expected} (required by ${requiredBy.join(", ")})`);
175
+ }
176
+ const { cmd, addArg } = (0, detect_package_manager_1.getInstallCommand)(pm);
177
+ const args = Array.from(mismatched.entries())
178
+ .map(([name, { expected }]) => `"${name}@${expected}"`)
179
+ .join(" ");
180
+ console.log(`\nUpgrade them yourself:\n ${cmd} ${addArg} ${args}\n`); // eslint-disable-line no-console
181
+ }
127
182
  function printPeerDepsReport(missing, mismatched, overridden = new Map()) {
128
183
  if (overridden.size > 0) {
129
184
  console.log("Overridden, so not version-checked:"); // eslint-disable-line no-console