@xaidenlabs/uso 1.1.92 → 1.1.93

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": "@xaidenlabs/uso",
3
- "version": "1.1.92",
3
+ "version": "1.1.93",
4
4
  "description": "Universal Solana Development Toolchain. Native or Stealth WSL Mode. Build, test, and deploy without the friction.",
5
5
  "bin": {
6
6
  "uso": "bin/index.js"
@@ -224,12 +224,52 @@ const doctor = async () => {
224
224
  );
225
225
  }
226
226
 
227
- checkGit();
228
- if (platform === "win32") checkWsl();
229
- checkRust();
230
- checkSolana();
231
- checkAnchor();
232
- checkCppTools();
227
+ const missing = [];
228
+ if (!checkGit()) missing.push({name: 'Git', component: 'git'});
229
+ if (platform === "win32" && !checkWsl()) missing.push({name: 'WSL', component: 'wsl'});
230
+ if (!checkRust()) missing.push({name: 'Rust', component: 'rust'});
231
+ if (!checkSolana()) missing.push({name: 'Solana CLI', component: 'solana'});
232
+ if (!checkAnchor()) missing.push({name: 'Anchor', component: 'anchor'});
233
+ if (!checkCppTools()) missing.push({name: 'C++ Build Tools', component: 'cpptools'});
234
+
235
+ if (missing.length > 0) {
236
+ console.log("");
237
+ log.info("⚠️ Some components are missing.");
238
+ const { init } = require("./init");
239
+ const readline = require("readline");
240
+ const rl = readline.createInterface({
241
+ input: process.stdin,
242
+ output: process.stdout,
243
+ });
244
+
245
+ const ask = (q) => new Promise((resolve) => rl.question(q, resolve));
246
+
247
+ for (const item of missing) {
248
+ const ans = await ask(`🤔 Do you want to install ${item.name}? (y/N): `);
249
+ if (ans.trim().toLowerCase() === 'y') {
250
+ if (item.component === 'git') {
251
+ log.warn("👉 Git cannot be installed automatically yet. Please install it manually.");
252
+ } else if (item.component === 'cpptools') {
253
+ log.warn("👉 Please install C++ Build Tools manually from: https://visualstudio.microsoft.com/visual-cpp-build-tools/");
254
+ } else if (item.component === 'wsl' || platform === "win32") {
255
+ // On Windows, the init command automatically provisions the entire WSL environment with all components
256
+ log.info(`🚀 Starting installation...`);
257
+ await init();
258
+ // If we run full init on Windows, it installs everything, so we can break the loop
259
+ break;
260
+ } else {
261
+ log.info(`🚀 Installing ${item.name}...`);
262
+ await init(item.component);
263
+ }
264
+ }
265
+ }
266
+ rl.close();
267
+ console.log("");
268
+ log.success("🩺 Doctor completed. Please run 'uso doctor' again to verify.");
269
+ } else {
270
+ console.log("");
271
+ log.success("🎉 Everything looks good! You're ready to build.");
272
+ }
233
273
  };
234
274
 
235
275
  module.exports = {