@naarang/ccc 2.0.0-alpha.4 → 2.0.0-alpha.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.
- package/bin/ccc.cjs +83 -83
- package/dist/index.js +39 -39
- package/dist/scripts/build-binaries.ts +270 -14
- package/dist/scripts/postinstall.cjs +84 -84
- package/package.json +79 -79
- package/scripts/build-binaries.ts +270 -14
- package/scripts/postinstall.cjs +84 -84
package/bin/ccc.cjs
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* CCC - Code Chat Connect v2
|
|
5
|
-
*
|
|
6
|
-
* Global CLI to start the Code Chat Connect backend server.
|
|
7
|
-
* Control Claude Code from your mobile device.
|
|
8
|
-
*
|
|
9
|
-
* Usage: ccc [options]
|
|
10
|
-
*
|
|
11
|
-
* REQUIRES: Bun runtime (https://bun.sh)
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const { existsSync } = require('fs');
|
|
15
|
-
const { join } = require('path');
|
|
16
|
-
const { spawn } = require('child_process');
|
|
17
|
-
|
|
18
|
-
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
19
|
-
const packageJson = require(join(__dirname, '..', 'package.json'));
|
|
20
|
-
|
|
21
|
-
// Handle --version / -v flag quickly without needing Bun
|
|
22
|
-
const args = process.argv.slice(2);
|
|
23
|
-
if (args.includes('--version') || args.includes('-v')) {
|
|
24
|
-
console.log(`ccc v${packageJson.version}`);
|
|
25
|
-
process.exit(0);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Check if Bun is available
|
|
29
|
-
function checkBun() {
|
|
30
|
-
return new Promise((resolve) => {
|
|
31
|
-
const result = spawn('bun', ['--version'], { stdio: 'pipe' });
|
|
32
|
-
result.on('close', (code) => resolve(code === 0));
|
|
33
|
-
result.on('error', () => resolve(false));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async function main() {
|
|
38
|
-
// Check if Bun is installed
|
|
39
|
-
const hasBun = await checkBun();
|
|
40
|
-
|
|
41
|
-
if (!hasBun) {
|
|
42
|
-
console.error(`
|
|
43
|
-
╔═══════════════════════════════════════════════════════════╗
|
|
44
|
-
║ ║
|
|
45
|
-
║ CCC - Code Chat Connect v${packageJson.version.padEnd(30)}║
|
|
46
|
-
║ ║
|
|
47
|
-
║ ERROR: Bun runtime is required but not installed. ║
|
|
48
|
-
║ ║
|
|
49
|
-
║ Install Bun: ║
|
|
50
|
-
║ Windows: powershell -c "irm bun.sh/install.ps1|iex" ║
|
|
51
|
-
║ macOS: curl -fsSL https://bun.sh/install | bash ║
|
|
52
|
-
║ Linux: curl -fsSL https://bun.sh/install | bash ║
|
|
53
|
-
║ ║
|
|
54
|
-
║ Learn more: https://bun.sh ║
|
|
55
|
-
║ ║
|
|
56
|
-
╚═══════════════════════════════════════════════════════════╝
|
|
57
|
-
`);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Check if dist exists
|
|
62
|
-
if (!existsSync(distPath)) {
|
|
63
|
-
console.error('Error: Build files not found. Please reinstall the package.');
|
|
64
|
-
process.exit(1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Run with Bun
|
|
68
|
-
const bunProcess = spawn('bun', ['run', distPath].concat(process.argv.slice(2)), {
|
|
69
|
-
stdio: 'inherit',
|
|
70
|
-
env: process.env,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
bunProcess.on('close', (code) => {
|
|
74
|
-
process.exit(code || 0);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
bunProcess.on('error', (err) => {
|
|
78
|
-
console.error('Failed to start:', err.message);
|
|
79
|
-
process.exit(1);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CCC - Code Chat Connect v2
|
|
5
|
+
*
|
|
6
|
+
* Global CLI to start the Code Chat Connect backend server.
|
|
7
|
+
* Control Claude Code from your mobile device.
|
|
8
|
+
*
|
|
9
|
+
* Usage: ccc [options]
|
|
10
|
+
*
|
|
11
|
+
* REQUIRES: Bun runtime (https://bun.sh)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const { existsSync } = require('fs');
|
|
15
|
+
const { join } = require('path');
|
|
16
|
+
const { spawn } = require('child_process');
|
|
17
|
+
|
|
18
|
+
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
19
|
+
const packageJson = require(join(__dirname, '..', 'package.json'));
|
|
20
|
+
|
|
21
|
+
// Handle --version / -v flag quickly without needing Bun
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
24
|
+
console.log(`ccc v${packageJson.version}`);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check if Bun is available
|
|
29
|
+
function checkBun() {
|
|
30
|
+
return new Promise((resolve) => {
|
|
31
|
+
const result = spawn('bun', ['--version'], { stdio: 'pipe' });
|
|
32
|
+
result.on('close', (code) => resolve(code === 0));
|
|
33
|
+
result.on('error', () => resolve(false));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function main() {
|
|
38
|
+
// Check if Bun is installed
|
|
39
|
+
const hasBun = await checkBun();
|
|
40
|
+
|
|
41
|
+
if (!hasBun) {
|
|
42
|
+
console.error(`
|
|
43
|
+
╔═══════════════════════════════════════════════════════════╗
|
|
44
|
+
║ ║
|
|
45
|
+
║ CCC - Code Chat Connect v${packageJson.version.padEnd(30)}║
|
|
46
|
+
║ ║
|
|
47
|
+
║ ERROR: Bun runtime is required but not installed. ║
|
|
48
|
+
║ ║
|
|
49
|
+
║ Install Bun: ║
|
|
50
|
+
║ Windows: powershell -c "irm bun.sh/install.ps1|iex" ║
|
|
51
|
+
║ macOS: curl -fsSL https://bun.sh/install | bash ║
|
|
52
|
+
║ Linux: curl -fsSL https://bun.sh/install | bash ║
|
|
53
|
+
║ ║
|
|
54
|
+
║ Learn more: https://bun.sh ║
|
|
55
|
+
║ ║
|
|
56
|
+
╚═══════════════════════════════════════════════════════════╝
|
|
57
|
+
`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Check if dist exists
|
|
62
|
+
if (!existsSync(distPath)) {
|
|
63
|
+
console.error('Error: Build files not found. Please reinstall the package.');
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Run with Bun
|
|
68
|
+
const bunProcess = spawn('bun', ['run', distPath].concat(process.argv.slice(2)), {
|
|
69
|
+
stdio: 'inherit',
|
|
70
|
+
env: process.env,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
bunProcess.on('close', (code) => {
|
|
74
|
+
process.exit(code || 0);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
bunProcess.on('error', (err) => {
|
|
78
|
+
console.error('Failed to start:', err.message);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
main();
|