@xaidenlabs/uso 1.1.0 → 1.1.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/bin/index.js +1 -1
- package/package.json +1 -1
- package/src/commands/workflow.js +22 -4
- package/my-test-project/Anchor.toml +0 -18
- package/my-test-project/README.md +0 -36
- package/my-test-project/package-lock.json +0 -2102
- package/my-test-project/package.json +0 -17
- package/my-test-project/programs/my_test_project/Cargo.toml +0 -19
- package/my-test-project/programs/my_test_project/src/lib.rs +0 -16
- package/my-test-project/tests/my-test-project.ts +0 -16
- package/my-test-project/tsconfig.json +0 -17
package/bin/index.js
CHANGED
package/package.json
CHANGED
package/src/commands/workflow.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const shell = require('shelljs');
|
|
2
|
+
const os = require('os');
|
|
2
3
|
const { log, spinner } = require('../utils/logger');
|
|
3
4
|
|
|
4
5
|
const runProxyCommand = async (command, args = []) => {
|
|
@@ -16,9 +17,29 @@ const runProxyCommand = async (command, args = []) => {
|
|
|
16
17
|
|
|
17
18
|
if (execution.code === 0) {
|
|
18
19
|
log.success(`✅ '${command}' completed successfully.`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Check for Windows privilege error (os error 1314 — symlink creation requires elevation)
|
|
24
|
+
const output = (execution.stderr || '') + (execution.stdout || '');
|
|
25
|
+
const isPrivilegeError = output.includes('os error 1314') || output.includes('A required privilege is not held by the client');
|
|
26
|
+
|
|
27
|
+
if (isPrivilegeError && os.platform() === 'win32') {
|
|
28
|
+
log.warn("⚠️ Windows requires Administrator privileges for this operation.");
|
|
29
|
+
log.info("🔑 Requesting elevated access...");
|
|
30
|
+
|
|
31
|
+
const elevateCmd = `powershell -Command "Start-Process powershell -ArgumentList '-NoProfile', '-Command', 'cd \\"${process.cwd()}\\"; anchor ${command} ${args.join(' ')}; Read-Host \\"Press Enter to close\\"' -Verb RunAs -Wait"`;
|
|
32
|
+
|
|
33
|
+
const elevatedRun = shell.exec(elevateCmd);
|
|
34
|
+
|
|
35
|
+
if (elevatedRun.code === 0) {
|
|
36
|
+
log.success(`✅ '${command}' completed successfully (elevated).`);
|
|
37
|
+
} else {
|
|
38
|
+
log.error(`❌ '${command}' failed even with elevated privileges.`);
|
|
39
|
+
log.warn("👉 Try running your terminal as Administrator manually.");
|
|
40
|
+
}
|
|
19
41
|
} else {
|
|
20
42
|
log.error(`❌ '${command}' failed.`);
|
|
21
|
-
// We don't exit process here strictly, but let the user know
|
|
22
43
|
}
|
|
23
44
|
};
|
|
24
45
|
|
|
@@ -27,9 +48,6 @@ const test = () => runProxyCommand('test');
|
|
|
27
48
|
const deploy = () => runProxyCommand('deploy');
|
|
28
49
|
const clean = () => runProxyCommand('clean');
|
|
29
50
|
|
|
30
|
-
// Generic run command for other anchor commands?
|
|
31
|
-
// For now, explicit functions are safer for help generation.
|
|
32
|
-
|
|
33
51
|
module.exports = {
|
|
34
52
|
build,
|
|
35
53
|
test,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[toolchain]
|
|
2
|
-
|
|
3
|
-
[features]
|
|
4
|
-
seeds = false
|
|
5
|
-
skip-lint = false
|
|
6
|
-
|
|
7
|
-
[programs.localnet]
|
|
8
|
-
my_test_project = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
|
|
9
|
-
|
|
10
|
-
[registry]
|
|
11
|
-
url = "https://api.apr.dev"
|
|
12
|
-
|
|
13
|
-
[provider]
|
|
14
|
-
cluster = "Localnet"
|
|
15
|
-
wallet = "~/.config/solana/id.json"
|
|
16
|
-
|
|
17
|
-
[scripts]
|
|
18
|
-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Welcome to Your USO Project 🚀
|
|
2
|
-
|
|
3
|
-
Congratulations! You've just scaffolded a professional Solana workspace using the **Universal Solana Orchestrator (USO)**.
|
|
4
|
-
|
|
5
|
-
This isn't just a folder with files. It's a battle-tested setup ready for serious development.
|
|
6
|
-
|
|
7
|
-
## 📂 Structure
|
|
8
|
-
- `programs/`: Your Rust smart contracts live here.
|
|
9
|
-
- `tests/`: Robust TypeScript tests using Anchor.
|
|
10
|
-
- `Anchor.toml`: Your project configuration.
|
|
11
|
-
|
|
12
|
-
## ⚡ Quick Start
|
|
13
|
-
|
|
14
|
-
### 1. Build
|
|
15
|
-
Compile your smart contract:
|
|
16
|
-
```bash
|
|
17
|
-
anchor build
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### 2. Test
|
|
21
|
-
Run your test suite against a local validator:
|
|
22
|
-
```bash
|
|
23
|
-
anchor test
|
|
24
|
-
```
|
|
25
|
-
*Note: This automatically spins up a local validator, deploys your program, runs tests, and shuts down.*
|
|
26
|
-
|
|
27
|
-
### 3. Deploy (Devnet)
|
|
28
|
-
When you're ready to go public:
|
|
29
|
-
1. Switch to devnet: `solana config set --url devnet`
|
|
30
|
-
2. Airdrop SOL: `solana airdrop 2`
|
|
31
|
-
3. Deploy: `anchor deploy`
|
|
32
|
-
|
|
33
|
-
## 🧠 Need Help?
|
|
34
|
-
Run `uso doctor` if your environment feels weird. Usage instructions are also available via `uso help`.
|
|
35
|
-
|
|
36
|
-
Happy coding!
|