@xaidenlabs/uso 1.1.83 → 1.1.84
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 +41 -41
- package/src/platforms/wsl.js +68 -0
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xaidenlabs/uso",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Universal Solana Development Toolchain. Native or Stealth WSL Mode. Build, test, and deploy without the friction.",
|
|
5
|
-
"bin": {
|
|
6
|
-
"uso": "bin/index.js"
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"bin",
|
|
10
|
-
"src",
|
|
11
|
-
"templates",
|
|
12
|
-
"anchor_program",
|
|
13
|
-
"anchor_project/Anchor.toml",
|
|
14
|
-
"anchor_project/package.json",
|
|
15
|
-
"anchor_project/tsconfig.json",
|
|
16
|
-
"anchor_project/programs/uso_verifier/Cargo.toml",
|
|
17
|
-
"anchor_project/programs/uso_verifier/src",
|
|
18
|
-
"anchor_project/tests"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"solana",
|
|
25
|
-
"anchor",
|
|
26
|
-
"web3",
|
|
27
|
-
"rust",
|
|
28
|
-
"install",
|
|
29
|
-
"setup",
|
|
30
|
-
"developer-tools"
|
|
31
|
-
],
|
|
32
|
-
"author": "Xaiden Labs",
|
|
33
|
-
"license": "ISC",
|
|
34
|
-
"type": "commonjs",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"chalk": "^4.1.2",
|
|
37
|
-
"commander": "^14.0.3",
|
|
38
|
-
"ora": "^5.4.1",
|
|
39
|
-
"shelljs": "^0.10.0"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xaidenlabs/uso",
|
|
3
|
+
"version": "1.1.84",
|
|
4
|
+
"description": "Universal Solana Development Toolchain. Native or Stealth WSL Mode. Build, test, and deploy without the friction.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"uso": "bin/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"src",
|
|
11
|
+
"templates",
|
|
12
|
+
"anchor_program",
|
|
13
|
+
"anchor_project/Anchor.toml",
|
|
14
|
+
"anchor_project/package.json",
|
|
15
|
+
"anchor_project/tsconfig.json",
|
|
16
|
+
"anchor_project/programs/uso_verifier/Cargo.toml",
|
|
17
|
+
"anchor_project/programs/uso_verifier/src",
|
|
18
|
+
"anchor_project/tests"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"solana",
|
|
25
|
+
"anchor",
|
|
26
|
+
"web3",
|
|
27
|
+
"rust",
|
|
28
|
+
"install",
|
|
29
|
+
"setup",
|
|
30
|
+
"developer-tools"
|
|
31
|
+
],
|
|
32
|
+
"author": "Xaiden Labs",
|
|
33
|
+
"license": "ISC",
|
|
34
|
+
"type": "commonjs",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"chalk": "^4.1.2",
|
|
37
|
+
"commander": "^14.0.3",
|
|
38
|
+
"ora": "^5.4.1",
|
|
39
|
+
"shelljs": "^0.10.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/platforms/wsl.js
CHANGED
|
@@ -41,6 +41,74 @@ run_with_progress() {
|
|
|
41
41
|
}
|
|
42
42
|
`.replace(/\r\n/g, "\n");
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Installs the WSL Windows Feature via an elevated PowerShell UAC prompt.
|
|
46
|
+
* This is needed when `wsl.exe` is not present on the system at all.
|
|
47
|
+
* Returns true if WSL is now available after the attempt, false otherwise.
|
|
48
|
+
*/
|
|
49
|
+
const installWslFeature = async () => {
|
|
50
|
+
log.warn(
|
|
51
|
+
"⚠️ WSL (Windows Subsystem for Linux) is not installed on this machine.",
|
|
52
|
+
);
|
|
53
|
+
log.info("🛡️ Administrator permission is required to install WSL.");
|
|
54
|
+
log.info(
|
|
55
|
+
"👉 A UAC (User Account Control) popup will appear — please click 'Yes' to allow the installation.",
|
|
56
|
+
);
|
|
57
|
+
console.log("");
|
|
58
|
+
|
|
59
|
+
// Run `wsl --install --no-distribution` elevated.
|
|
60
|
+
// --no-distribution: only enables the WSL feature, does not pull a distro yet.
|
|
61
|
+
// We wait for it to finish (-Wait) so we can check the result.
|
|
62
|
+
const elevateCmd = `powershell -Command "Start-Process -FilePath 'wsl.exe' -ArgumentList '--install', '--no-distribution' -Verb RunAs -Wait"`;
|
|
63
|
+
const result = shell.exec(elevateCmd, { silent: false });
|
|
64
|
+
|
|
65
|
+
if (result.code !== 0) {
|
|
66
|
+
// User likely denied UAC or the command failed
|
|
67
|
+
log.error("❌ WSL installation was cancelled or failed.");
|
|
68
|
+
log.warn(
|
|
69
|
+
"👉 To install manually, open PowerShell as Administrator and run:",
|
|
70
|
+
);
|
|
71
|
+
console.log(chalk.bold.yellow(" wsl --install"));
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Verify wsl is now available
|
|
76
|
+
const check = shell.exec("wsl --status", { silent: true });
|
|
77
|
+
if (check.code !== 0) {
|
|
78
|
+
// WSL was just installed — a reboot is almost certainly required
|
|
79
|
+
log.warn(
|
|
80
|
+
"⚠️ WSL feature has been installed, but a system restart is required to complete setup.",
|
|
81
|
+
);
|
|
82
|
+
log.warn(
|
|
83
|
+
"👉 Please RESTART your computer, then run `uso install` again to set up the toolchain.",
|
|
84
|
+
);
|
|
85
|
+
return false; // Signal caller that we need a restart before proceeding
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
log.success("✅ WSL feature installed successfully.");
|
|
89
|
+
return true;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const installWsl = async () => {
|
|
93
|
+
log.header("🐧 Configuring Stealth WSL Environment...");
|
|
94
|
+
|
|
95
|
+
// 1. Check if WSL is enabled
|
|
96
|
+
if (!shell.which("wsl")) {
|
|
97
|
+
log.error("❌ WSL is not enabled on this Windows machine.");
|
|
98
|
+
log.warn(
|
|
99
|
+
"👉 Please enable 'Windows Subsystem for Linux' in 'Turn Windows features on or off'.",
|
|
100
|
+
);
|
|
101
|
+
log.warn("👉 Or run this in PowerShell as Admin: wsl --install");
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 2. Install Ubuntu silently (Branded as Uso Engine)
|
|
106
|
+
// We use 'wsl -d Ubuntu -e true' to check if it's installed and runnable.
|
|
107
|
+
// 'wsl -l -v' output is notoriously unreliable due to charset encoding (UTF-16) on Windows.
|
|
108
|
+
const checkDistro = shell.exec(`wsl -d ${WSL_DISTRO} -e true`, {
|
|
109
|
+
silent: true,
|
|
110
|
+
});
|
|
111
|
+
|
|
44
112
|
// If exit code is 0, it's installed and working.
|
|
45
113
|
if (checkDistro.code !== 0) {
|
|
46
114
|
log.info(
|