mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
2a880fb09c
Each release scope has its own packages, version source, and independent version track: - monorepo: 12 core @copilotkit/* packages (shared version) - cli: copilotkit CLI (independent version) - angular: @copilotkitnext/angular (independent version) Branch pattern is now release/publish/<scope>/v<version> and git tags use <scope>/v<version> for non-monorepo scopes.
38 lines
934 B
TypeScript
38 lines
934 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
export const ROOT = path.resolve(
|
|
path.dirname(fileURLToPath(import.meta.url)),
|
|
"../../..",
|
|
);
|
|
|
|
export type ReleaseScope = "monorepo" | "cli" | "angular";
|
|
|
|
export interface ScopeConfig {
|
|
packages: string[];
|
|
versionSource: string;
|
|
sharedVersion: boolean;
|
|
}
|
|
|
|
export interface ReleaseConfig {
|
|
prereleaseTag: string;
|
|
scopes: Record<ReleaseScope, ScopeConfig>;
|
|
}
|
|
|
|
export function loadConfig(): ReleaseConfig {
|
|
const configPath = path.join(ROOT, "release.config.json");
|
|
return JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
}
|
|
|
|
export function getScopeConfig(scope: ReleaseScope): ScopeConfig {
|
|
const config = loadConfig();
|
|
const scopeConfig = config.scopes[scope];
|
|
if (!scopeConfig) {
|
|
throw new Error(
|
|
`Unknown scope: ${scope}. Valid scopes: ${Object.keys(config.scopes).join(", ")}`,
|
|
);
|
|
}
|
|
return scopeConfig;
|
|
}
|