sandboxbox 1.0.4 → 1.0.6

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 +9 -3
  2. package/package.json +2 -2
  3. package/test-cli.js +47 -15
package/cli.js CHANGED
@@ -10,9 +10,9 @@
10
10
  * npx sandboxbox shell <project> # Interactive shell
11
11
  */
12
12
 
13
- // Debug: Make sure the script starts
14
- console.log('🚀 SandboxBox starting...');
13
+ // Optional debug output
15
14
  if (process.env.DEBUG) {
15
+ console.log('🔧 Debug: SandboxBox CLI starting...');
16
16
  console.log(`🔧 Debug: Platform: ${process.platform}`);
17
17
  console.log(`🔧 Debug: Node.js: ${process.version}`);
18
18
  console.log(`🔧 Debug: Args: ${process.argv.slice(2).join(' ')}`);
@@ -192,7 +192,13 @@ async function main() {
192
192
  case 'run':
193
193
  const projectDir = commandArgs[0] || '.';
194
194
  console.log(color('blue', '🚀 Running Playwright tests...'));
195
- if (!(await checkBubblewrap())) process.exit(1);
195
+ console.log(color('yellow', `Project directory: ${projectDir}`));
196
+
197
+ if (!(await checkBubblewrap())) {
198
+ console.log(color('red', '❌ Cannot run tests without bubblewrap'));
199
+ process.exit(1);
200
+ }
201
+
196
202
  runScript('./container.js', ['run', projectDir]);
197
203
  break;
198
204
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Zero-privilege container runner with Playwright support",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
- "sandboxbox": "./test-cli.js"
8
+ "sandboxbox": "./cli.js"
9
9
  },
10
10
  "scripts": {
11
11
  "install": "node scripts/build.js",
package/test-cli.js CHANGED
@@ -4,6 +4,21 @@ console.log('🚀 SandboxBox test starting...');
4
4
  console.log('Platform:', process.platform);
5
5
  console.log('Node.js:', process.version);
6
6
 
7
+ const args = process.argv.slice(2);
8
+
9
+ // Handle --help and no arguments
10
+ if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
11
+ showHelp();
12
+ process.exit(0);
13
+ }
14
+
15
+ // Handle version
16
+ if (args.includes('--version') || args[0] === 'version') {
17
+ console.log('SandboxBox v1.0.4');
18
+ console.log('Zero-privilege containers with Playwright support');
19
+ process.exit(0);
20
+ }
21
+
7
22
  if (process.platform !== 'linux') {
8
23
  console.log('❌ SandboxBox only works on Linux systems');
9
24
  console.log('🐧 Required: Linux with bubblewrap (bwrap)');
@@ -19,22 +34,39 @@ if (process.platform !== 'linux') {
19
34
  }
20
35
 
21
36
  console.log('✅ Platform check passed - you are on Linux!');
22
- console.log('');
23
37
  console.log('📦 SandboxBox - Zero-Privilege Container Runner');
24
38
  console.log('═════════════════════════════════════════════════════');
25
39
  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');
40
+ console.log('⚠️ This is a simplified test version.');
41
+ console.log('🔧 Full SandboxBox features are available on Linux systems.');
35
42
  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');
43
+ console.log('🚀 8ms startup • True isolation • Playwright ready');
44
+
45
+ function showHelp() {
46
+ console.log('📦 SandboxBox - Zero-Privilege Container Runner');
47
+ console.log('═════════════════════════════════════════════════════');
48
+ console.log('');
49
+ console.log('Usage: npx sandboxbox <command> [options]');
50
+ console.log('');
51
+ console.log('Commands:');
52
+ console.log(' setup Set up Alpine Linux environment (one-time)');
53
+ console.log(' build <dockerfile> Build container from Dockerfile');
54
+ console.log(' run <project-dir> Run Playwright tests in isolation');
55
+ console.log(' shell <project-dir> Start interactive shell in container');
56
+ console.log(' quick-test <project-dir> Quick test with sample Dockerfile');
57
+ console.log(' version Show version information');
58
+ console.log('');
59
+ console.log('Examples:');
60
+ console.log(' npx sandboxbox setup');
61
+ console.log(' npx sandboxbox build ./Dockerfile');
62
+ console.log(' npx sandboxbox run ./my-project');
63
+ console.log(' npx sandboxbox shell ./my-project');
64
+ console.log(' npx sandboxbox quick-test ./my-app');
65
+ console.log('');
66
+ console.log('Requirements:');
67
+ console.log(' - Linux system (WSL2 on Windows works great!)');
68
+ console.log(' - bubblewrap (bwrap): sudo apt-get install bubblewrap');
69
+ console.log(' - No root privileges needed after installation!');
70
+ console.log('');
71
+ console.log('🚀 8ms startup • True isolation • Playwright ready');
72
+ }