mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
fix(plugins): restore shared boundary sdk prep
This commit is contained in:
@@ -242,9 +242,14 @@ export function isBoundaryCompileFresh(extensionId, params = {}) {
|
||||
collectNewestMtime(extensionRoot, { includeFile: isRelevantCompileInput });
|
||||
const sharedNewestInputMtimeMs =
|
||||
params.sharedNewestInputMtimeMs ??
|
||||
collectNewestMtime(resolve(rootDir, "packages/plugin-sdk/dist"), {
|
||||
skipDistDirectories: false,
|
||||
});
|
||||
Math.max(
|
||||
collectNewestMtime(resolve(rootDir, "dist/plugin-sdk"), {
|
||||
skipDistDirectories: false,
|
||||
}),
|
||||
collectNewestMtime(resolve(rootDir, "packages/plugin-sdk/dist"), {
|
||||
skipDistDirectories: false,
|
||||
}),
|
||||
);
|
||||
const newestInputMtimeMs = Math.max(extensionNewestInputMtimeMs, sharedNewestInputMtimeMs);
|
||||
const oldestOutputMtimeMs = collectOldestMtime([
|
||||
resolveBoundaryTsStampPath(extensionId, rootDir),
|
||||
@@ -553,19 +558,17 @@ async function runCompileCheck(extensionIds) {
|
||||
process.stdout.write(
|
||||
`preparing plugin-sdk boundary artifacts for ${extensionIds.length} plugins\n`,
|
||||
);
|
||||
runNodeStep(
|
||||
"plugin-sdk boundary prep",
|
||||
[prepareBoundaryArtifactsBin, "--mode=package-boundary"],
|
||||
420_000,
|
||||
);
|
||||
runNodeStep("plugin-sdk boundary prep", [prepareBoundaryArtifactsBin], 420_000);
|
||||
const prepElapsedMs = Date.now() - prepStartedAt;
|
||||
const concurrency = resolveCompileConcurrency();
|
||||
const verboseFreshLogs = process.env.OPENCLAW_EXTENSION_BOUNDARY_VERBOSE_FRESH === "1";
|
||||
const sharedNewestInputMtimeMs = collectNewestMtime(
|
||||
resolve(repoRoot, "packages/plugin-sdk/dist"),
|
||||
{
|
||||
const sharedNewestInputMtimeMs = Math.max(
|
||||
collectNewestMtime(resolve(repoRoot, "dist/plugin-sdk"), {
|
||||
skipDistDirectories: false,
|
||||
},
|
||||
}),
|
||||
collectNewestMtime(resolve(repoRoot, "packages/plugin-sdk/dist"), {
|
||||
skipDistDirectories: false,
|
||||
}),
|
||||
);
|
||||
process.stdout.write(`compile concurrency ${concurrency}\n`);
|
||||
const compileStartedAt = Date.now();
|
||||
|
||||
@@ -206,7 +206,7 @@ describe("check-extension-package-tsc-boundary", () => {
|
||||
).toBe("skipped 97 fresh plugin compiles\n");
|
||||
});
|
||||
|
||||
it("treats a plugin compile as fresh only when its outputs are newer than plugin and package sdk inputs", () => {
|
||||
it("treats a plugin compile as fresh only when its outputs are newer than plugin and shared sdk inputs", () => {
|
||||
const { rootDir, extensionRoot } = createTempExtensionRoot();
|
||||
const extensionSourcePath = path.join(extensionRoot, "index.ts");
|
||||
const extensionTsconfigPath = path.join(extensionRoot, "tsconfig.json");
|
||||
@@ -252,10 +252,6 @@ describe("check-extension-package-tsc-boundary", () => {
|
||||
|
||||
fs.utimesSync(rootSdkTypePath, new Date(4_000), new Date(4_000));
|
||||
|
||||
expect(isBoundaryCompileFresh("demo", { rootDir })).toBe(true);
|
||||
|
||||
fs.utimesSync(packageSdkTypePath, new Date(4_000), new Date(4_000));
|
||||
|
||||
expect(isBoundaryCompileFresh("demo", { rootDir })).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user