mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
fe685eb46f
- release.config.json: 'bot' scope versions @copilotkit/bot and @copilotkit/bot-ui together (sharedVersion: true, source: bot); 'bot-slack' is its own scope, mirroring the angular precedent - ReleaseScope type + VALID_SCOPES arrays + usage strings extended across release scripts - stable-release.yml / publish-release.yml: scope choice options - bot, bot-ui, bot-slack manifests: drop private, add publishConfig (public), repository/homepage/keywords, publint/attw targets; first release v0.0.1 - internal bot-package deps use workspace:~ (tilde): caret on a 0.0.x version pins the exact patch, tilde tracks the 0.0.x line; core/shared stay workspace:^ (caret is correct at 1.x) Verified: release-script tests 85/85; prepare-release --scope bot --dry-run bumps bot AND bot-ui in lockstep; actionlint clean on touched lines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 lines
948 B
TypeScript
38 lines
948 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" | "angular" | "bot" | "bot-slack";
|
|
|
|
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;
|
|
}
|