sandboxbox 1.0.2 → 1.0.4

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.
Files changed (3) hide show
  1. package/cli.js +21 -0
  2. package/package.json +2 -2
  3. package/test-cli.js +40 -0
package/cli.js CHANGED
@@ -10,6 +10,14 @@
10
10
  * npx sandboxbox shell <project> # Interactive shell
11
11
  */
12
12
 
13
+ // Debug: Make sure the script starts
14
+ console.log('🚀 SandboxBox starting...');
15
+ if (process.env.DEBUG) {
16
+ console.log(`🔧 Debug: Platform: ${process.platform}`);
17
+ console.log(`🔧 Debug: Node.js: ${process.version}`);
18
+ console.log(`🔧 Debug: Args: ${process.argv.slice(2).join(' ')}`);
19
+ }
20
+
13
21
  import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs';
14
22
  import { execSync } from 'child_process';
15
23
  import { fileURLToPath } from 'url';
@@ -236,7 +244,20 @@ async function main() {
236
244
  // Run if called directly
237
245
  if (import.meta.url === `file://${process.argv[1]}`) {
238
246
  main().catch(error => {
247
+ console.error('❌ SandboxBox failed to start:');
239
248
  console.error('Error:', error.message);
249
+ console.error('');
250
+ console.error('💡 This might be because:');
251
+ console.error(' • You are not on Linux (SandboxBox requires Linux)');
252
+ console.error(' • Node.js version compatibility issue');
253
+ console.error(' • Missing dependencies during installation');
254
+ console.error('');
255
+ console.error('📋 System information:');
256
+ console.error(` Platform: ${process.platform}`);
257
+ console.error(` Node.js: ${process.version}`);
258
+ console.error(` Architecture: ${process.arch}`);
259
+ console.error('');
260
+ console.error('🔧 Try: npx sandboxbox --help');
240
261
  process.exit(1);
241
262
  });
242
263
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Zero-privilege container runner with Playwright support",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
- "sandboxbox": "./cli.js"
8
+ "sandboxbox": "./test-cli.js"
9
9
  },
10
10
  "scripts": {
11
11
  "install": "node scripts/build.js",
package/test-cli.js ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+
3
+ console.log('🚀 SandboxBox test starting...');
4
+ console.log('Platform:', process.platform);
5
+ console.log('Node.js:', process.version);
6
+
7
+ if (process.platform !== 'linux') {
8
+ console.log('❌ SandboxBox only works on Linux systems');
9
+ console.log('🐧 Required: Linux with bubblewrap (bwrap)');
10
+ console.log('');
11
+ console.log('💡 Alternatives for Windows users:');
12
+ console.log(' • Use WSL2 (Windows Subsystem for Linux 2)');
13
+ console.log(' • Use Docker Desktop with Linux containers');
14
+ console.log(' • Use GitHub Actions (ubuntu-latest runners)');
15
+ console.log(' • Use a cloud Linux instance (AWS, GCP, Azure)');
16
+ console.log('');
17
+ console.log('✅ On Linux/WSL2, simply run: npx sandboxbox --help');
18
+ process.exit(1);
19
+ }
20
+
21
+ console.log('✅ Platform check passed - you are on Linux!');
22
+ console.log('');
23
+ console.log('📦 SandboxBox - Zero-Privilege Container Runner');
24
+ console.log('═════════════════════════════════════════════════════');
25
+ console.log('');
26
+ console.log('Usage: npx sandboxbox <command> [options]');
27
+ console.log('');
28
+ console.log('Commands:');
29
+ console.log(' setup Set up Alpine Linux environment (one-time)');
30
+ console.log(' build <dockerfile> Build container from Dockerfile');
31
+ console.log(' run <project-dir> Run Playwright tests in isolation');
32
+ console.log(' shell <project-dir> Start interactive shell in container');
33
+ console.log(' quick-test <project-dir> Quick test with sample Dockerfile');
34
+ console.log(' version Show version information');
35
+ console.log('');
36
+ console.log('Requirements:');
37
+ console.log(' - bubblewrap (bwrap): sudo apt-get install bubblewrap');
38
+ console.log(' - No root privileges needed after installation!');
39
+ console.log('');
40
+ console.log('🚀 8ms startup • True isolation • Playwright ready');