forked from fazxes/Claude-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ts
More file actions
38 lines (33 loc) · 1017 Bytes
/
Copy pathbuild.ts
File metadata and controls
38 lines (33 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bun
/**
* Build script for Claude Code from leaked source.
*
* Usage: bun build.ts
*/
import { $ } from 'bun';
const version = process.env.VERSION || '2.1.88';
const buildTime = new Date().toISOString();
console.log(`Building Claude Code v${version}...`);
const result = await Bun.build({
entrypoints: ['src/entrypoints/cli.tsx'],
outdir: 'dist',
target: 'bun',
sourcemap: 'linked',
define: {
'MACRO.VERSION': JSON.stringify(version),
'MACRO.BUILD_TIME': JSON.stringify(buildTime),
'MACRO.FEEDBACK_CHANNEL': JSON.stringify('#claude-code'),
'MACRO.ISSUES_EXPLAINER': JSON.stringify(
'report the issue at https://github.com/anthropics/claude-code/issues',
),
},
external: ['react-devtools-core', 'sharp'],
});
if (!result.success) {
console.error('Build failed:');
for (const log of result.logs) {
console.error(log);
}
process.exit(1);
}
console.log(`Build succeeded: dist/cli.js (${(result.outputs[0]!.size / 1024 / 1024).toFixed(1)} MB)`);