mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-20 11:03:08 +00:00
fix: Update @github/copilot-sdk version and enhance version utility to locate package.json (#840)
- Changed @github/copilot-sdk dependency from "^0.1.16" to "0.1.16" in package.json and package-lock.json. - Improved version utility in version.ts to check multiple candidate paths for package.json, ensuring better reliability in locating the file.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
"@automaker/prompts": "1.0.0",
|
||||
"@automaker/types": "1.0.0",
|
||||
"@automaker/utils": "1.0.0",
|
||||
"@github/copilot-sdk": "^0.1.16",
|
||||
"@github/copilot-sdk": "0.1.16",
|
||||
"@modelcontextprotocol/sdk": "1.25.2",
|
||||
"@openai/codex-sdk": "^0.98.0",
|
||||
"cookie-parser": "1.4.7",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Version utility - Reads version from package.json
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'fs';
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
import { createLogger } from '@automaker/utils';
|
||||
@@ -24,7 +24,20 @@ export function getVersion(): string {
|
||||
}
|
||||
|
||||
try {
|
||||
const packageJsonPath = join(__dirname, '..', '..', 'package.json');
|
||||
const candidatePaths = [
|
||||
// Development via tsx: src/lib -> project root
|
||||
join(__dirname, '..', '..', 'package.json'),
|
||||
// Packaged/build output: lib -> server bundle root
|
||||
join(__dirname, '..', 'package.json'),
|
||||
];
|
||||
|
||||
const packageJsonPath = candidatePaths.find((candidate) => existsSync(candidate));
|
||||
if (!packageJsonPath) {
|
||||
throw new Error(
|
||||
`package.json not found in any expected location: ${candidatePaths.join(', ')}`
|
||||
);
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
||||
const version = packageJson.version || '0.0.0';
|
||||
cachedVersion = version;
|
||||
|
||||
Reference in New Issue
Block a user