refactor: align macro bootstrap with cli entry
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
import { feature } from 'bun:bundle';
|
||||
|
||||
const CLI_MACRO =
|
||||
typeof MACRO !== 'undefined'
|
||||
? MACRO
|
||||
: {
|
||||
VERSION: 'dev',
|
||||
BUILD_TIME: '',
|
||||
PACKAGE_URL: '@anthropic-ai/claude-code',
|
||||
ISSUES_EXPLAINER:
|
||||
'https://docs.anthropic.com/en/docs/claude-code/feedback',
|
||||
FEEDBACK_CHANNEL: 'github',
|
||||
};
|
||||
// Define MACRO global for development (normally injected by bun build --define)
|
||||
if (typeof MACRO === 'undefined') {
|
||||
(globalThis as typeof globalThis & {
|
||||
MACRO: {
|
||||
VERSION: string
|
||||
BUILD_TIME: string
|
||||
PACKAGE_URL: string
|
||||
ISSUES_EXPLAINER: string
|
||||
FEEDBACK_CHANNEL: string
|
||||
}
|
||||
}).MACRO = {
|
||||
VERSION: '2.1.88-dev',
|
||||
BUILD_TIME: new Date().toISOString(),
|
||||
PACKAGE_URL: 'claude-code-recover',
|
||||
ISSUES_EXPLAINER:
|
||||
'https://docs.anthropic.com/en/docs/claude-code/feedback',
|
||||
FEEDBACK_CHANNEL: 'github',
|
||||
};
|
||||
}
|
||||
|
||||
// Bugfix for corepack auto-pinning, which adds yarnpkg to peoples' package.jsons
|
||||
// eslint-disable-next-line custom-rules/no-top-level-side-effects
|
||||
@@ -49,7 +57,7 @@ async function main(): Promise<void> {
|
||||
if (args.length === 1 && (args[0] === '--version' || args[0] === '-v' || args[0] === '-V')) {
|
||||
// MACRO.VERSION is inlined at build time
|
||||
// biome-ignore lint/suspicious/noConsole:: intentional console output
|
||||
console.log(`${CLI_MACRO.VERSION} (Claude Code)`);
|
||||
console.log(`${MACRO.VERSION} (Claude Code)`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user