@xaidenlabs/uso 1.1.28 → 1.1.30
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 +7 -1
- package/package.json +1 -1
- package/src/commands/workflow.js +24 -1
package/bin/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const { init } = require('../src/commands/init');
|
|
|
4
4
|
const { doctor } = require('../src/commands/doctor');
|
|
5
5
|
const { verify } = require('../src/commands/verify');
|
|
6
6
|
const { create } = require('../src/commands/create');
|
|
7
|
-
const { build, test, deploy, clean, unblock, airdrop } = require('../src/commands/workflow');
|
|
7
|
+
const { build, test, deploy, clean, unblock, airdrop, validator } = require('../src/commands/workflow');
|
|
8
8
|
const { uninstall } = require('../src/commands/uninstall');
|
|
9
9
|
|
|
10
10
|
program
|
|
@@ -53,6 +53,12 @@ program
|
|
|
53
53
|
.description('Airdrop SOL to a wallet (wraps "solana airdrop")')
|
|
54
54
|
.action(airdrop);
|
|
55
55
|
|
|
56
|
+
program
|
|
57
|
+
.command('validator [args...]')
|
|
58
|
+
.description('Start local Solana validator (wraps "solana-test-validator")')
|
|
59
|
+
.allowUnknownOption() // Allow flags like --reset
|
|
60
|
+
.action(validator);
|
|
61
|
+
|
|
56
62
|
program
|
|
57
63
|
.command('clean')
|
|
58
64
|
.description('Clean the project (wraps "anchor clean")')
|
package/package.json
CHANGED
package/src/commands/workflow.js
CHANGED
|
@@ -168,6 +168,28 @@ const airdrop = (amount, recipient) => {
|
|
|
168
168
|
return runProxyCommand('airdrop', args, 'solana');
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
+
const validator = (args = []) => {
|
|
172
|
+
if (!shell.which('solana-test-validator')) {
|
|
173
|
+
log.error("❌ 'solana-test-validator' is not found in PATH.");
|
|
174
|
+
log.warn("👉 Run 'uso init' to install it.");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Check if args is the commander object (happens if no args defined in command)
|
|
179
|
+
// or if it's an array of strings (if [args...] is defined)
|
|
180
|
+
// Commander passes (args, options, command) if using [args...]
|
|
181
|
+
// If we change bin/index.js to .command('validator [args...]'), args will be array.
|
|
182
|
+
|
|
183
|
+
const cmdArgs = Array.isArray(args) ? args.join(' ') : '';
|
|
184
|
+
const fullCmd = cmdArgs ? `solana-test-validator ${cmdArgs}` : 'solana-test-validator';
|
|
185
|
+
|
|
186
|
+
log.header(`🚀 Starting Solana Test Validator (${fullCmd})...`);
|
|
187
|
+
log.info("👉 Press Ctrl+C to stop it.");
|
|
188
|
+
|
|
189
|
+
// Run without capturing output so it streams to console
|
|
190
|
+
shell.exec(fullCmd);
|
|
191
|
+
};
|
|
192
|
+
|
|
171
193
|
const unblock = () => {
|
|
172
194
|
const cwd = process.cwd();
|
|
173
195
|
log.info(`🔓 Unblocking files in ${cwd}...`);
|
|
@@ -203,5 +225,6 @@ module.exports = {
|
|
|
203
225
|
deploy,
|
|
204
226
|
clean,
|
|
205
227
|
unblock,
|
|
206
|
-
airdrop
|
|
228
|
+
airdrop,
|
|
229
|
+
validator
|
|
207
230
|
};
|