@xaidenlabs/uso 1.1.17 → 1.1.19
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 +2 -2
- package/src/commands/workflow.js +19 -6
- package/src/platforms/windows.js +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaidenlabs/uso",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "Universal Solana Orchestrator - A one-command setup tool for Solana and Anchor development environments on Windows, macOS, and Linux.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"uso": "bin/index.js"
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
"ora": "^5.4.1",
|
|
27
27
|
"shelljs": "^0.10.0"
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
package/src/commands/workflow.js
CHANGED
|
@@ -114,6 +114,8 @@ const runElevatedWithProgress = (command, args = []) => {
|
|
|
114
114
|
|
|
115
115
|
// 4. Stream Log to Main Console
|
|
116
116
|
let lastSize = 0;
|
|
117
|
+
const spin = spinner('Waiting for output from elevated terminal...').start();
|
|
118
|
+
|
|
117
119
|
const checkInterval = setInterval(() => {
|
|
118
120
|
try {
|
|
119
121
|
if (!fs.existsSync(progressFile)) return;
|
|
@@ -125,17 +127,28 @@ const runElevatedWithProgress = (command, args = []) => {
|
|
|
125
127
|
fs.readSync(fd, buffer, 0, buffer.length, lastSize);
|
|
126
128
|
fs.closeSync(fd);
|
|
127
129
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
const rawText = buffer.toString('utf8');
|
|
131
|
+
const displayText = rawText
|
|
132
|
+
.replace(/USO_AC_SUCCESS/g, '')
|
|
133
|
+
.replace(/USO_AC_FAILURE/g, '');
|
|
134
|
+
|
|
135
|
+
// Stop spinner to print logs cleanly
|
|
136
|
+
spin.stop();
|
|
137
|
+
process.stdout.write(displayText);
|
|
138
|
+
|
|
131
139
|
lastSize = stats.size;
|
|
132
140
|
|
|
133
|
-
if (
|
|
141
|
+
if (rawText.includes("USO_AC_SUCCESS")) {
|
|
134
142
|
clearInterval(checkInterval);
|
|
143
|
+
spin.succeed('Elevated process completed successfully.');
|
|
135
144
|
resolve();
|
|
136
|
-
} else if (
|
|
145
|
+
} else if (rawText.includes("USO_AC_FAILURE")) {
|
|
137
146
|
clearInterval(checkInterval);
|
|
138
|
-
|
|
147
|
+
spin.fail('Elevated process reported failure.');
|
|
148
|
+
resolve();
|
|
149
|
+
} else {
|
|
150
|
+
// Restart spinner with "Building..." status since we are receiving data
|
|
151
|
+
spin.start('Building...');
|
|
139
152
|
}
|
|
140
153
|
}
|
|
141
154
|
} catch (e) {
|
package/src/platforms/windows.js
CHANGED
|
@@ -11,8 +11,10 @@ const installWindows = async (shouldInstallRust, shouldInstallSolana) => {
|
|
|
11
11
|
const hasCl = shell.which('cl');
|
|
12
12
|
if (!hasCl) {
|
|
13
13
|
log.warn("⚠️ Visual Studio C++ Build Tools (cl.exe) not found!");
|
|
14
|
+
log.error("❌ Rust and Anchor CANNOT run without these tools.");
|
|
14
15
|
log.warn("👉 Please install them from: https://visualstudio.microsoft.com/visual-cpp-build-tools/");
|
|
15
|
-
log.warn(" Make sure to select 'Desktop development with C++' workload
|
|
16
|
+
log.warn(" Make sure to select 'Desktop development with C++' workload.");
|
|
17
|
+
log.warn(" After installing, restart your terminal and run `uso init` again.");
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -21,6 +23,9 @@ const installWindows = async (shouldInstallRust, shouldInstallSolana) => {
|
|
|
21
23
|
log.info("🦀 Installing Rust (rustup-init.exe)...");
|
|
22
24
|
shell.exec('powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe"');
|
|
23
25
|
|
|
26
|
+
// Unblock the file to prevent Device Guard/SmartScreen issues
|
|
27
|
+
shell.exec('powershell -Command "Unblock-File -Path rustup-init.exe"');
|
|
28
|
+
|
|
24
29
|
const rustInstall = shell.exec('powershell -Command "./rustup-init.exe -y"');
|
|
25
30
|
|
|
26
31
|
if (rustInstall.code !== 0) {
|
|
@@ -44,6 +49,9 @@ const installWindows = async (shouldInstallRust, shouldInstallSolana) => {
|
|
|
44
49
|
const downloadCmd = 'powershell -Command "Invoke-WebRequest -Uri https://release.anza.xyz/stable/solana-install-init-x86_64-pc-windows-msvc.exe -OutFile solana-install.exe"';
|
|
45
50
|
const dlResult = shell.exec(downloadCmd);
|
|
46
51
|
|
|
52
|
+
// Unblock the file to prevent Device Guard/SmartScreen issues
|
|
53
|
+
shell.exec('powershell -Command "Unblock-File -Path solana-install.exe"');
|
|
54
|
+
|
|
47
55
|
if (dlResult.code !== 0) {
|
|
48
56
|
log.error("❌ Failed to download Solana installer.");
|
|
49
57
|
return false;
|