mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
c23d66e3b5
* refactor: consolidate coercion ownership * test: align shard check with weighted planning * chore: refresh plugin SDK API baseline
33 lines
1009 B
TypeScript
33 lines
1009 B
TypeScript
import fs from "node:fs";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
type PackageManifest = {
|
|
exports: Record<
|
|
string,
|
|
{
|
|
default: string;
|
|
import: string;
|
|
types: string;
|
|
}
|
|
>;
|
|
scripts: { build: string };
|
|
};
|
|
|
|
const packageJsonPath = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
const manifest = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")) as PackageManifest;
|
|
|
|
describe("normalization-core package exports", () => {
|
|
it("builds every focused export from its matching source entry", () => {
|
|
for (const [subpath, target] of Object.entries(manifest.exports)) {
|
|
const entryName = subpath === "." ? "index" : subpath.slice(2);
|
|
expect(target).toEqual({
|
|
types: `./dist/${entryName}.d.mts`,
|
|
import: `./dist/${entryName}.mjs`,
|
|
default: `./dist/${entryName}.mjs`,
|
|
});
|
|
expect(manifest.scripts.build.split(/\s+/u)).toContain(`src/${entryName}.ts`);
|
|
}
|
|
});
|
|
});
|