Files
rea/tests/conformance/releaseConfiguration.test.ts
T
morluto 9b392bb2f8 chore(deps): finish toolchain upgrades and drop dead weight (#644)
* chore(deps): finish toolchain upgrades and drop dead weight

pino 9 to 10, @types/node 24 to 26, oxlint 1.73 to 1.87, knip 6.26
to 6.39, turbo 2.10 to 2.11. Narrow engines to supported majors
(22/24/26; vitest 5 refuses Node 25). Scope no-var-requires off for
Electron CJS hooks and fixtures.

Remove TypeDoc: incompatible with TypeScript 7 at install and
runtime, used by nothing in any gate. Drop the dep, docs:api
workflow, typedoc.json, CI artifact step, and related docs.

Replace graphology with a local call-graph adjacency plus BFS: the
only consumer is call-path search, and graphology-types ships no
types entry for TS7 NodeNext resolution. Delete both graphology
dependencies.

Remove dead re-exports newly flagged by knip 6.39.

* chore: drop stale typedoc and replay references

Remove the docs:api release-checklist step, the orphaned docs/api
ignore entry, and the nonexistent replay glob from the adapters
project.
2026-10-06 06:02:02 +08:00

114 lines
3.1 KiB
TypeScript

import { readFile } from "node:fs/promises";
import { describe, expect, it } from "vitest";
const readJson = async (path: string): Promise<unknown> =>
JSON.parse(await readFile(path, "utf8")) as unknown;
const readmes = [
"README.md",
"README_zh.md",
"README_ja.md",
"README_ko.md",
"README_ar.md",
] as const;
describe("release configuration", () => {
it("updates every package-version artifact in release PRs", async () => {
const configuration = await readJson("release-please-config.json");
expect(configuration).toMatchObject({
packages: {
".": {
"extra-files": [
...readmes.map((path) => ({ type: "generic", path })),
{
type: "generic",
path: "src/generatedPackageMetadata.ts",
},
{
type: "json",
path: "server.json",
jsonpath: "$.version",
},
{
type: "json",
path: "server.json",
jsonpath: "$.packages[0].version",
},
{
type: "json",
path: "docs/product-catalog.json",
jsonpath: "$.package.version",
},
],
},
},
});
});
it.each(readmes)(
"marks the versioned package example in %s",
async (path) => {
const content = await readFile(path, "utf8");
const versionBlock =
/<!-- x-release-please-start-version -->[\s\S]*?<!-- x-release-please-end -->/u.exec(
content,
)?.[0];
expect(versionBlock).toMatch(/rea-agents@\d+\.\d+\.\d+/u);
},
);
it("keeps the npm package and MCP Registry metadata aligned", async () => {
const packageJson = (await readJson("package.json")) as {
name: string;
version: string;
mcpName: string;
};
const serverJson = (await readJson("server.json")) as {
name: string;
version: string;
packages: Array<{
registryType: string;
registryBaseUrl: string;
identifier: string;
version: string;
runtimeHint: string;
transport: { type: string };
packageArguments: Array<{ type: string; value: string }>;
}>;
};
expect(packageJson).toMatchObject({
name: "rea-agents",
mcpName: "io.github.morluto/rea",
});
expect(serverJson).toMatchObject({
name: packageJson.mcpName,
version: packageJson.version,
packages: [
{
registryType: "npm",
registryBaseUrl: "https://registry.npmjs.org",
identifier: packageJson.name,
version: packageJson.version,
runtimeHint: "npx",
transport: { type: "stdio" },
packageArguments: [{ type: "positional", value: "mcp" }],
},
],
});
});
it("keeps generated API HTML out of the tracked tree", async () => {
await expect(readFile("typedoc.json", "utf8")).rejects.toMatchObject({
code: "ENOENT",
});
const packageJson = (await readJson("package.json")) as {
scripts?: Record<string, string>;
};
expect(packageJson.scripts?.["docs:api"]).toBeUndefined();
});
});