fix(js): update Electron build configuration and dependencies (#411)

This commit is contained in:
Haze
2026-03-11 15:40:08 +08:00
committed by GitHub
Unverified
parent a575977e3c
commit 4c786915c8
8 changed files with 20 additions and 15 deletions

View File

@@ -37,9 +37,9 @@ jobs:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '24'
- name: Setup pnpm
uses: pnpm/action-setup@v4

View File

@@ -100,9 +100,9 @@ dmg:
# Windows Configuration
win:
forceCodeSigning: false
# Skip update signature verification: we ship via OSS + GitHub without a
# code-signing certificate, so verifying would always fail on the updater.
verifyUpdateCodeSignature: false
signAndEditExecutable: true
extraResources:
- from: resources/bin/win32-${arch}
to: bin

View File

@@ -44,7 +44,6 @@
"postversion": "git push && git push --tags"
},
"dependencies": {
"@wecom/wecom-openclaw-plugin": "^1.0.6",
"clawhub": "^0.5.0",
"electron-store": "^11.0.2",
"electron-updater": "^6.8.3",
@@ -77,6 +76,7 @@
"@typescript-eslint/eslint-plugin": "^8.56.0",
"@typescript-eslint/parser": "^8.56.0",
"@vitejs/plugin-react": "^5.1.4",
"@wecom/wecom-openclaw-plugin": "^1.0.6",
"autoprefixer": "^10.4.24",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",

6
pnpm-lock.yaml generated
View File

@@ -8,9 +8,6 @@ importers:
.:
dependencies:
'@wecom/wecom-openclaw-plugin':
specifier: ^1.0.6
version: 1.0.6
clawhub:
specifier: ^0.5.0
version: 0.5.0
@@ -102,6 +99,9 @@ importers:
'@vitejs/plugin-react':
specifier: ^5.1.4
version: 5.1.4(vite@7.3.1(@types/node@25.3.0)(jiti@1.21.7)(yaml@2.8.2))
'@wecom/wecom-openclaw-plugin':
specifier: ^1.0.6
version: 1.0.6
autoprefixer:
specifier: ^10.4.24
version: 10.4.24(postcss@8.5.6)

View File

@@ -221,7 +221,7 @@ function bundlePlugin(nodeModulesRoot, npmName, destDir) {
}
let realPluginPath;
try { realPluginPath = realpathSync(normWin(pkgPath)); } catch { realPluginPath = pkgPath; }
try { realPluginPath = realpathSync(pkgPath); } catch { realPluginPath = pkgPath; }
// Copy plugin package itself
if (existsSync(normWin(destDir))) rmSync(normWin(destDir), { recursive: true, force: true });
@@ -258,7 +258,7 @@ function bundlePlugin(nodeModulesRoot, npmName, destDir) {
if (name === skipPkg) continue;
if (SKIP_PACKAGES.has(name) || SKIP_SCOPES.some(s => name.startsWith(s))) continue;
let rp;
try { rp = realpathSync(normWin(fullPath)); } catch { continue; }
try { rp = realpathSync(fullPath); } catch { continue; }
if (collected.has(rp)) continue;
collected.set(rp, name);
const depVirtualNM = getVirtualStoreNodeModules(rp);

View File

@@ -86,7 +86,7 @@ function bundleOnePlugin({ npmName, pluginId }) {
throw new Error(`Missing dependency "${npmName}". Run pnpm install first.`);
}
const realPluginPath = fs.realpathSync(normWin(pkgPath));
const realPluginPath = fs.realpathSync(pkgPath);
const outputDir = path.join(OUTPUT_ROOT, pluginId);
echo`📦 Bundling plugin ${npmName} -> ${outputDir}`;
@@ -126,7 +126,7 @@ function bundleOnePlugin({ npmName, pluginId }) {
let realPath;
try {
realPath = fs.realpathSync(normWin(fullPath));
realPath = fs.realpathSync(fullPath);
} catch {
continue;
}

View File

@@ -38,7 +38,7 @@ if (!fs.existsSync(openclawLink)) {
process.exit(1);
}
const openclawReal = fs.realpathSync(normWin(openclawLink));
const openclawReal = fs.realpathSync(openclawLink);
echo` openclaw resolved: ${openclawReal}`;
// 2. Clean and create output directory
@@ -152,7 +152,7 @@ while (queue.length > 0) {
let realPath;
try {
realPath = fs.realpathSync(normWin(fullPath));
realPath = fs.realpathSync(fullPath);
} catch {
continue; // broken symlink, skip
}

View File

@@ -6,6 +6,11 @@ import { resolve } from 'path';
// https://vitejs.dev/config/
export default defineConfig({
// Required for Electron: all asset URLs must be relative because the renderer
// loads via file:// in production. vite-plugin-electron-renderer sets this
// automatically, but we declare it explicitly so the intent is clear and the
// build remains correct even if plugin order ever changes.
base: './',
plugins: [
react(),
electron([
@@ -19,7 +24,7 @@ export default defineConfig({
build: {
outDir: 'dist-electron/main',
rollupOptions: {
external: ['electron', 'electron-store', 'electron-updater', 'ws'],
external: ['electron-store', 'electron-updater', 'ws'],
},
},
},