Convert to use typescript, implement eslint
This commit is contained in:
33
README.md
33
README.md
@@ -18,7 +18,7 @@ cd corsair-lcd-control
|
||||
npm install
|
||||
```
|
||||
|
||||
`postinstall` automatically rebuilds native modules for Electron using `@electron/rebuild`.
|
||||
`postinstall` rebuilds native USB modules for Electron.
|
||||
|
||||
## Development
|
||||
|
||||
@@ -26,13 +26,15 @@ npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
Compiles TypeScript to `build/`, then launches Electron with the compiled output.
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
Produces platform-specific packages:
|
||||
Compiles TypeScript, then produces platform-specific packages via electron-builder:
|
||||
|
||||
| Platform | Format |
|
||||
|----------|--------|
|
||||
@@ -40,6 +42,14 @@ Produces platform-specific packages:
|
||||
| macOS | `.dmg` |
|
||||
| Windows | `.exe` (NSIS) |
|
||||
|
||||
## Lint
|
||||
|
||||
```bash
|
||||
npm run lint
|
||||
```
|
||||
|
||||
Runs ESLint with `typescript-eslint` (`recommendedTypeChecked`) across all `src/` TypeScript files.
|
||||
|
||||
## Rebuild Native Modules
|
||||
|
||||
If native modules fail to load after a Node.js or Electron upgrade:
|
||||
@@ -48,9 +58,26 @@ If native modules fail to load after a Node.js or Electron upgrade:
|
||||
npm run rebuild
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
├── src/
|
||||
│ ├── main.ts # Electron main process
|
||||
│ ├── preload.ts # Context bridge for IPC
|
||||
│ ├── renderer.ts # Renderer UI logic
|
||||
│ ├── index.html # Main window HTML
|
||||
│ └── styles.css # Dark theme styles
|
||||
├── assets/
|
||||
│ └── icon.png # System tray icon
|
||||
├── build/ # Compiled JS output (gitignored)
|
||||
├── tsconfig.json # TypeScript config
|
||||
├── eslint.config.js # ESLint config
|
||||
└── package.json
|
||||
```
|
||||
|
||||
## Capabilities
|
||||
|
||||
- **USB** — `usb` module enumerates and connects to devices
|
||||
- **USB** — enumerates and connects to devices via `usb`
|
||||
- **System Tray** — background process with context menu (Show/Hide/Quit)
|
||||
- **Preferences** — persisted via `electron-store` (JSON)
|
||||
- **File Pickers** — native OS dialogs via Electron's `dialog` API
|
||||
|
||||
Reference in New Issue
Block a user