Phase 1 step 1 of VNCprodbuild: electron/main.ts boots the same Next.js "standalone" server artifact the Dockerfile already produces (next.config.ts's output: "standalone") as a child process on a random localhost port, then opens a BrowserWindow at it. electron/preload.ts is a contextBridge stub (window.vnc.isElectron) for now. scripts/assemble-standalone.mjs copies public/ and .next/static into .next/standalone, mirroring what the Dockerfile does by hand, since `next build` deliberately leaves both out of the standalone output. scripts/build-electron.mjs bundles main.ts/preload.ts to CommonJS via esbuild (already a devDependency). New npm scripts: build:standalone, build:electron, electron:dev. electron-builder.config.js is intentionally minimal - no signing, no platform targets yet, just enough to prove the concept end to end. Also fixes a pre-existing repo-wide lint gap: vnc/plugins/smime is an independent sub-package (own package.json/esbuild build, browser-only globals) that was never added to eslint's ignores alongside repos:: and examples/**, so `npm run lint` - and the husky pre-commit hook - was failing on every commit regardless of what changed. Excluded it the same way those are, and added node globals for scripts/**/*.mjs so the new build helpers above lint cleanly too. Verified manually: npm run build:standalone && npm run build:electron && electron . boots the server and opens a window with no errors.
24 lines
918 B
JavaScript
24 lines
918 B
JavaScript
// Base electron-builder config - Phase 1 step 1 of the VNCprodbuild rollout.
|
|
// No code signing and no platform targets configured yet; this exists only
|
|
// to prove the packaging concept end to end (the app runs, boots its own
|
|
// server, opens a window). Targets (dmg/zip/nsis/AppImage/deb), branding
|
|
// icons, and code signing are wired up in later steps - see
|
|
// ~/.claude/skills/VNCprodbuild/SKILL.md, Phase 1 steps 6-9.
|
|
module.exports = {
|
|
appId: "de.vnc.vncmailplus",
|
|
productName: "VNCmail+",
|
|
directories: {
|
|
output: "dist-electron-builds",
|
|
},
|
|
files: ["dist-electron/**/*", "package.json"],
|
|
extraResources: [
|
|
{
|
|
// Same artifact the Dockerfile bakes into the container image (see
|
|
// Dockerfile + scripts/assemble-standalone.mjs). electron/main.ts
|
|
// reads it from process.resourcesPath in packaged builds.
|
|
from: ".next/standalone",
|
|
to: "standalone",
|
|
},
|
|
],
|
|
};
|