Files
scoreko-electron-dev/README.md
T

65 lines
2.0 KiB
Markdown

# scoreko-electron-dev
Electron wrapper to package a NodeCG installation that includes the `scoreko-dev` bundle, inspired by `opeik/runback-electron` but updated to modern Electron + TypeScript.
## Key requirements
- Node `>=22` (`.nvmrc` included).
- Electron pinned to `39.5.1`.
## What it does
- Starts `lib/nodecg/index.js` as a child process from Electron.
- Shows the bundle loading dashboard route (`/bundles/<bundle>/dashboard/loading.html`) served by NodeCG while it starts.
- Loads the bundle dashboard at `http://localhost:<port>/bundles/<bundle>/<dashboard-route>`.
- Packages NodeCG + assets inside the final app with `electron-builder`.
## Expected structure
```text
scoreko-electron-dev/
├─ lib/
│ └─ nodecg/
│ ├─ index.js
│ ├─ node_modules/
│ └─ bundles/
│ └─ scoreko-dev/
├─ src/main/main.ts
├─ static/icons/
└─ package.json
```
## Scripts
- `npm run dev`: development mode.
- `npm run build`: compile TypeScript and copy assets.
- `npm run start`: build and local run.
- `npm run test`: build + unit tests (`node:test`).
- `npm run doctor`: configuration/environment preflight (`lib/nodecg`, permissions, port, and env vars).
- `npm run lint`: minimal quality rules with ESLint.
- `npm run format`: format validation with Prettier.
- `npm run pack`: generate app without installer.
- `npm run dist`: generate installer.
## Environment variables
The **single source of truth for defaults** is in `.env.example`.
1. Copy `.env.example` to `.env` (or export variables in your shell/CI).
2. Adjust only what you need.
3. Run `npm run doctor` to validate configuration before starting.
## Cross-platform build (icons)
- `build.win.icon`: `static/icons/icon.ico`
- `build.linux.icon`: `static/icons`
- `build.mac.icon`: `static/icons/icon.icns`
> The `.icns` is referenced in build config and must exist locally to package macOS.
## Troubleshooting and architecture
- Troubleshooting guide: `docs/troubleshooting.md`
- Architecture map: `docs/architecture.md`
- Roadmap: `docs/refactor-roadmap.md`