Add CLI and config file support

This commit is contained in:
Nicolas Barraud
2025-03-10 20:19:23 -04:00
parent 0870a81990
commit 4c4c8a0884
20 changed files with 1456 additions and 57 deletions

24
cli/src/package-info.ts Normal file
View File

@@ -0,0 +1,24 @@
import { readFileSync } from "fs";
import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
type PackageInfo = {
name: string;
version: string;
description: string;
};
function getPackageInfo(): PackageInfo {
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const packageJsonPath = resolve(__dirname, "..", "..", "package.json");
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
return {
name: packageJson.name,
version: packageJson.version,
description: packageJson.description,
};
}
export const packageInfo: PackageInfo = getPackageInfo();