- Use lstatSync with try/catch for robust broken symlink detection
- Remove redundant existsSync check before mkdirSync with recursive: true
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes#742
This commit resolves two critical issues that prevented the Electron app from starting:
1. **Broken symlinks in server bundle**
- After npm install, local @automaker/* packages were symlinked in node_modules
- These symlinks broke after electron-builder packaging since relative paths no longer existed
- Solution: Added Step 6b in prepare-server.mjs to replace symlinks with real directory copies
- Added lstatSync and resolve imports to support symlink detection and replacement
2. **electronUserDataWriteFileSync fails on first launch**
- The userData directory doesn't exist on first app launch
- Writing .api-key file would fail with ENOENT error
- Solution: Added directory existence check and creation with { recursive: true } before writing
Files modified:
- apps/ui/scripts/prepare-server.mjs: Added symlink replacement logic after npm install
- libs/platform/src/system-paths.ts: Added parent directory creation in electronUserDataWriteFileSync
Verification: After these fixes, npm run build:electron produces a working app that starts without ERR_MODULE_NOT_FOUND errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes:
- Introduced new npm scripts for testing all packages and running tests across the server.
- Updated GitHub Actions workflow to include a step for running package tests.
Benefits:
✅ Enhanced testing capabilities for individual packages
✅ Improved CI process with comprehensive test coverage
All tests passing.
- Update prepare-server.mjs to copy workspace packages and use file:
references instead of trying to fetch from npm registry
- Lower server test coverage thresholds after moving lib files to
shared packages (lines: 55%, branches: 50%, statements: 55%)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replaced JavaScript files with ES module versions for server preparation and setup scripts.
- Introduced `prepare-server.mjs` for bundling server with Electron, enhancing dependency management.
- Added `rebuild-server-natives.cjs` for rebuilding native modules during the Electron packaging process.
- Updated `setup-e2e-fixtures.mjs` to create necessary directories and files for Playwright tests.
- Adjusted `package.json` scripts to reflect changes in file extensions and improve build process clarity.