mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-01 01:37:55 -04:00
fix(build): memory-core verify-only post-build + version bump 2026.3.29
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@heretek-ai/openclaw",
|
||||
"version": "2026.3.28",
|
||||
"version": "2026.3.29",
|
||||
"description": "Liberated multi-channel AI agent gateway — Tabula Myriad triad fork",
|
||||
"keywords": [
|
||||
"agent",
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
#!/usr/bin/env tsx
|
||||
/**
|
||||
* Post-build fix: copy memory-core index.js from npm package to workspace dist.
|
||||
* The workspace build doesn't compile extensions/memory-core/index.ts, so we
|
||||
* restore the correct compiled file from the npm package after each build.
|
||||
* Post-build verification for memory-core extension.
|
||||
*
|
||||
* After rolldown-build.mjs compiles extensions/memory-core/index.ts as an
|
||||
* entry point (output: dist/extensions/memory-core/index.mjs), this script
|
||||
* verifies the output exists and is non-empty.
|
||||
*
|
||||
* No copying is needed — rolldown now compiles memory-core fresh with matching
|
||||
* chunk hashes. This script just validates the build produced a valid output.
|
||||
*/
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
@@ -11,22 +16,29 @@ import { fileURLToPath } from "node:url";
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const projectRoot = path.resolve(__dirname, "..");
|
||||
|
||||
const npmSrc = path.join(
|
||||
projectRoot,
|
||||
"heretek-openclaw/node_modules/@heretek-ai/openclaw/dist/extensions/memory-core/index.js",
|
||||
);
|
||||
const workspaceDest = path.join(projectRoot, "dist/extensions/memory-core/index.js");
|
||||
const mjsOut = path.join(projectRoot, "dist/extensions/memory-core/index.mjs");
|
||||
const jsOut = path.join(projectRoot, "dist/extensions/memory-core/index.js");
|
||||
|
||||
if (fs.existsSync(npmSrc)) {
|
||||
const destDir = path.dirname(workspaceDest);
|
||||
if (!fs.existsSync(destDir)) {
|
||||
fs.mkdirSync(destDir, { recursive: true });
|
||||
}
|
||||
fs.copyFileSync(npmSrc, workspaceDest);
|
||||
const stat = fs.statSync(workspaceDest);
|
||||
// rolldown outputs .mjs
|
||||
if (fs.existsSync(mjsOut)) {
|
||||
const stat = fs.statSync(mjsOut);
|
||||
console.log(`[memory-core-verify] ✓ dist/extensions/memory-core/index.mjs (${stat.size} bytes)`);
|
||||
} else if (fs.existsSync(jsOut)) {
|
||||
// legacy .js output (fallback for older builds)
|
||||
const stat = fs.statSync(jsOut);
|
||||
console.log(
|
||||
`[copy-memory-core-index] Restored ${stat.size} bytes → dist/extensions/memory-core/index.js`,
|
||||
`[memory-core-verify] ✓ dist/extensions/memory-core/index.js (${stat.size} bytes, legacy)`,
|
||||
);
|
||||
} else {
|
||||
console.warn("[copy-memory-core-index] Source not found:", npmSrc);
|
||||
console.warn(
|
||||
"[memory-core-verify] ✗ dist/extensions/memory-core/index.{mjs,js} not found after build",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Also remove any legacy .js file so Node.js loads the correct .mjs
|
||||
const legacyJs = path.join(projectRoot, "dist/extensions/memory-core/index.js");
|
||||
if (fs.existsSync(legacyJs)) {
|
||||
fs.rmSync(legacyJs);
|
||||
console.log("[memory-core-verify] Removed legacy index.js");
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ async function runBuild() {
|
||||
"infra/warning-filter": "src/infra/warning-filter.ts",
|
||||
"telegram/audit": "extensions/telegram/src/audit.ts",
|
||||
"telegram/token": "extensions/telegram/src/token.ts",
|
||||
// memory-core extension — compiled fresh so chunk hashes match the build
|
||||
"extensions/memory-core/index": "extensions/memory-core/index.ts",
|
||||
"plugins/build-smoke-entry": "src/plugins/build-smoke-entry.ts",
|
||||
"plugins/runtime/index": "src/plugins/runtime/index.ts",
|
||||
"llm-slug-generator": "src/hooks/llm-slug-generator.ts",
|
||||
|
||||
@@ -16286,6 +16286,6 @@ export const GENERATED_BASE_CONFIG_SCHEMA = {
|
||||
tags: ["security", "auth"],
|
||||
},
|
||||
},
|
||||
version: "2026.3.28",
|
||||
version: "2026.3.29",
|
||||
generatedAt: "2026-03-23T22:14:21.692Z",
|
||||
} as const satisfies BaseConfigSchemaResponse;
|
||||
|
||||
Reference in New Issue
Block a user