mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 17:20:21 +00:00
release: mirror bundled channel deps at root (#63065)
Merged via squash.
Prepared head SHA: ac26799a54
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Reviewed-by: @scoootscooob
This commit is contained in:
@@ -7,16 +7,21 @@ import { bundledPluginFile } from "../bundled-plugin-paths.js";
|
||||
|
||||
type PackageManifest = {
|
||||
dependencies?: Record<string, string>;
|
||||
optionalDependencies?: Record<string, string>;
|
||||
openclaw?: {
|
||||
install?: {
|
||||
minHostVersion?: string;
|
||||
};
|
||||
releaseChecks?: {
|
||||
rootDependencyMirrorAllowlist?: unknown;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
type PackageManifestContractParams = {
|
||||
pluginId: string;
|
||||
runtimeDeps?: string[];
|
||||
pluginLocalRuntimeDeps?: string[];
|
||||
mirroredRootRuntimeDeps?: string[];
|
||||
minHostVersionBaseline?: string;
|
||||
};
|
||||
|
||||
@@ -29,13 +34,17 @@ export function describePackageManifestContract(params: PackageManifestContractP
|
||||
const packagePath = bundledPluginFile(params.pluginId, "package.json");
|
||||
|
||||
describe(`${params.pluginId} package manifest contract`, () => {
|
||||
if (params.runtimeDeps?.length) {
|
||||
for (const dependencyName of params.runtimeDeps) {
|
||||
if (params.pluginLocalRuntimeDeps?.length) {
|
||||
for (const dependencyName of params.pluginLocalRuntimeDeps) {
|
||||
it(`keeps ${dependencyName} plugin-local`, () => {
|
||||
const rootManifest = readJson<PackageManifest>("package.json");
|
||||
const pluginManifest = readJson<PackageManifest>(packagePath);
|
||||
const pluginSpec = pluginManifest.dependencies?.[dependencyName];
|
||||
const rootSpec = rootManifest.dependencies?.[dependencyName];
|
||||
const pluginSpec =
|
||||
pluginManifest.dependencies?.[dependencyName] ??
|
||||
pluginManifest.optionalDependencies?.[dependencyName];
|
||||
const rootSpec =
|
||||
rootManifest.dependencies?.[dependencyName] ??
|
||||
rootManifest.optionalDependencies?.[dependencyName];
|
||||
|
||||
expect(pluginSpec).toBeTruthy();
|
||||
expect(rootSpec).toBeUndefined();
|
||||
@@ -43,6 +52,27 @@ export function describePackageManifestContract(params: PackageManifestContractP
|
||||
}
|
||||
}
|
||||
|
||||
if (params.mirroredRootRuntimeDeps?.length) {
|
||||
for (const dependencyName of params.mirroredRootRuntimeDeps) {
|
||||
it(`mirrors ${dependencyName} at the root package`, () => {
|
||||
const rootManifest = readJson<PackageManifest>("package.json");
|
||||
const pluginManifest = readJson<PackageManifest>(packagePath);
|
||||
const pluginSpec =
|
||||
pluginManifest.dependencies?.[dependencyName] ??
|
||||
pluginManifest.optionalDependencies?.[dependencyName];
|
||||
const rootSpec =
|
||||
rootManifest.dependencies?.[dependencyName] ??
|
||||
rootManifest.optionalDependencies?.[dependencyName];
|
||||
const allowlist = pluginManifest.openclaw?.releaseChecks?.rootDependencyMirrorAllowlist;
|
||||
|
||||
expect(pluginSpec).toBeTruthy();
|
||||
expect(rootSpec).toBe(pluginSpec);
|
||||
expect(Array.isArray(allowlist)).toBe(true);
|
||||
expect(allowlist).toContain(dependencyName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const minHostVersionBaseline = params.minHostVersionBaseline;
|
||||
if (minHostVersionBaseline) {
|
||||
it("declares a parseable minHostVersion floor at or above the baseline", () => {
|
||||
|
||||
Reference in New Issue
Block a user