@xaidenlabs/uso 1.1.53 → 1.1.55

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.53",
3
+ "version": "1.1.55",
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"
@@ -183,9 +183,32 @@ const runElevatedWithProgress = (command, args = [], binary = 'anchor') => {
183
183
  };
184
184
 
185
185
  const build = () => runProxyCommand('build', [], 'anchor');
186
- const test = (args = []) => runProxyCommand('test', Array.isArray(args) ? args : [], 'anchor');
187
186
  const deploy = () => runProxyCommand('deploy', [], 'anchor');
188
187
  const clean = () => runProxyCommand('clean', [], 'anchor');
188
+
189
+ const test = async (args = []) => {
190
+ const userArgs = Array.isArray(args) ? args : [];
191
+
192
+ // On Windows, auto-detect validator to prevent anchor test from hanging
193
+ if (os.platform() === 'win32' && !userArgs.includes('--skip-local-validator')) {
194
+ const isValidatorUp = () => {
195
+ const res = shell.exec('netstat -an | findstr 8899', { silent: true });
196
+ return res.code === 0 && res.stdout.length > 0;
197
+ };
198
+
199
+ if (isValidatorUp()) {
200
+ log.info("✅ Validator detected on port 8899. Running tests against it.");
201
+ userArgs.push('--skip-local-validator');
202
+ } else {
203
+ log.warn("⚠️ No validator detected. Starting one first...");
204
+ log.info("👉 Run 'uso val' in a separate terminal, then re-run 'uso test'.");
205
+ log.info(" Or use 'uso dev' to do both automatically.");
206
+ return;
207
+ }
208
+ }
209
+
210
+ return runProxyCommand('test', userArgs, 'anchor');
211
+ };
189
212
  const airdrop = (amount, recipient) => {
190
213
  const args = [amount];
191
214
  if (recipient) args.push(recipient);