Two related runtime defects surfaced when first attempting
`npm run build` + Electron launch:
1. Renderer html files referenced `/src/.../main.tsx`, which
vite dev resolves but vite production rollup cannot. Changed
both inbox and quickcapture to `./main.tsx` (sibling-relative).
2. Electron 41's main-process module hook only injects the
real `electron` API into `require('electron')` calls inside
CommonJS modules. With package.json `"type": "module"` set,
electron-vite emitted ESM bundles that did
`import { app } from "electron"`; Node's ESM CJS-interop
then loaded the on-disk index.js (which exports the binary
path string) instead, leaving `app` undefined at startup.
Fix: drop `"type": "module"` so electron-vite emits CJS for
main + preload (renderer is unaffected — vite handles its own
ESM transform regardless). Source files keep modern import
syntax via the default-import + destructure pattern
(`import electron from 'electron'; const { app } = electron;`)
which transpiles correctly to `const { app } = require('electron')`
in the CJS output.
Also updated `electron-log/main` -> `electron-log/main.js`
because Node ESM strict resolution requires the `.js` extension
even though the package's CJS entry serves both.
Verification: `npm run build` produces 47-module renderer +
1005KB main bundle without errors. `npm run typecheck` clean.
Unit suite (52 tests) unaffected.
Plan deviation log: Task 4 (logger), Task 30 (main wiring), and
Tasks 17/18/22/30 referencing electron imports landed with named
imports per plan; this commit refactors them to default+destructure
without changing semantics.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
1003 B
JSON
40 lines
1003 B
JSON
{
|
|
"name": "inkling",
|
|
"version": "0.2.0",
|
|
"private": true,
|
|
"main": "out/main/index.js",
|
|
"scripts": {
|
|
"dev": "electron-vite dev",
|
|
"build": "electron-vite build",
|
|
"start": "electron-vite preview",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:integration": "INKLING_INTEGRATION=1 vitest run tests/integration",
|
|
"test:e2e": "playwright test",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"better-sqlite3": "12.9.0",
|
|
"electron": "41.3.0",
|
|
"electron-log": "5.2.0",
|
|
"react": "19.2.5",
|
|
"react-dom": "19.2.5",
|
|
"uuid": "11.0.3",
|
|
"zod": "4.3.6",
|
|
"zustand": "5.0.12"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "1.59.1",
|
|
"@types/better-sqlite3": "7.6.11",
|
|
"@types/node": "24.0.0",
|
|
"@types/react": "19.0.0",
|
|
"@types/react-dom": "19.0.0",
|
|
"@vitejs/plugin-react": "5.1.4",
|
|
"electron-vite": "5.0.0",
|
|
"typescript": "6.0.3",
|
|
"undici": "8.1.0",
|
|
"vite": "7.3.2",
|
|
"vitest": "4.1.5"
|
|
}
|
|
}
|