fix(wechat): deliver failure notices and hot-swappable wechat-mp bundle

Notify users when HTML publish guards reject stub pages instead of silently
failing, send real page links when non-stub files exist, and split wechat-mp
into wechat-mp.bundle.mjs for fast production updates without full portal rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-04 12:52:59 +08:00
parent 5ed655b6c3
commit 6bc5d128d2
9 changed files with 327 additions and 116 deletions
+7
View File
@@ -369,6 +369,7 @@ async function writeMetadata() {
'',
'Bundled alongside server.mjs (required for sandbox-fs MCP):',
' mindspace-sandbox-mcp.mjs (esbuild bundle; includes schedule-service deps)',
' wechat-mp.bundle.mjs (esbuild bundle; hot-swappable WeChat MP module)',
'',
'Post-deploy validation (scripts/check-mindspace-public-links.mjs):',
' Scans MindSpace/*/public/*.html for missing relative href/src/cover targets.',
@@ -423,10 +424,16 @@ async function writeMetadata() {
);
}
async function bundleWechatMp() {
console.log('==> 打包 WeChat MP runtime bundle');
await run('node', ['scripts/build-wechat-mp-runtime.mjs']);
}
async function main() {
await buildFrontend();
await copyRuntimeAssets();
await bundleServer();
await bundleWechatMp();
await bundleSandboxMcp();
await bundleAgentRunWorker();
if (runtimeInstallMode === 'bundle-node-modules' && !skipNodeModules) {