mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
fix: ccw package.json removal - add root build script and fix cli.ts path resolution
- Fix cli.ts loadPackageInfo() to try root package.json first (../../package.json) - Add build script and devDependencies to root package.json - Remove ccw/package.json and ccw/package-lock.json (no longer needed) - CodexLens: add config.json support for index_dir configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,20 +28,32 @@ interface PackageInfo {
|
||||
|
||||
/**
|
||||
* Load package.json with error handling
|
||||
* Tries root package.json first (../../package.json from dist),
|
||||
* then falls back to ccw package.json (../package.json from dist)
|
||||
* @returns Package info with version
|
||||
*/
|
||||
function loadPackageInfo(): PackageInfo {
|
||||
const pkgPath = join(__dirname, '../package.json');
|
||||
// First try root package.json (parent of ccw directory)
|
||||
const rootPkgPath = join(__dirname, '../../package.json');
|
||||
// Fallback to ccw package.json
|
||||
const ccwPkgPath = join(__dirname, '../package.json');
|
||||
|
||||
try {
|
||||
if (!existsSync(pkgPath)) {
|
||||
console.error('Fatal Error: package.json not found.');
|
||||
console.error(`Expected location: ${pkgPath}`);
|
||||
process.exit(1);
|
||||
// Try root package.json first
|
||||
if (existsSync(rootPkgPath)) {
|
||||
const content = readFileSync(rootPkgPath, 'utf8');
|
||||
return JSON.parse(content) as PackageInfo;
|
||||
}
|
||||
|
||||
const content = readFileSync(pkgPath, 'utf8');
|
||||
return JSON.parse(content) as PackageInfo;
|
||||
// Fallback to ccw package.json
|
||||
if (existsSync(ccwPkgPath)) {
|
||||
const content = readFileSync(ccwPkgPath, 'utf8');
|
||||
return JSON.parse(content) as PackageInfo;
|
||||
}
|
||||
|
||||
console.error('Fatal Error: package.json not found.');
|
||||
console.error(`Tried locations:\n - ${rootPkgPath}\n - ${ccwPkgPath}`);
|
||||
process.exit(1);
|
||||
} catch (error) {
|
||||
if (error instanceof SyntaxError) {
|
||||
console.error('Fatal Error: package.json contains invalid JSON.');
|
||||
|
||||
Reference in New Issue
Block a user