- Main Electron process lives in
src/main.ts; the renderer bootstraps fromsrc/renderer.tsx. - UI components sit under
src/components/, helpers insrc/lib/, shared types insrc/types/. - Tests mirror runtime code under
src/__tests__/withintegration/,performance/, and__mocks__/for feature-specific coverage. - Assets reside in
src/assets/; the HTML shell is inpublic/; production bundles land indist/and release artifacts inrelease/.
npm run devstarts the webpack watcher and Electron for live reload during feature work.npm startperforms a clean build then launches the packaged desktop app for verification.npm run buildemits production bundles intodist/for distribution and signing flows.npm testruns the Jest suite once;npm run test:watchkeeps tests hot while iterating.npm run lintapplies ESLint auto-fixes; usenpm run lint:checkto validate without writing.
- All runtime code is TypeScript with two-space indentation and required semicolons.
- Prefer functional React components; name them in PascalCase and helpers in camelCase.
- Components in
src/components/follow kebab-case filenames (e.g.,share-list.tsx). - Import third-party packages before internal modules and use the
@/alias for local paths. - Tailwind utility classes style JSX; reserve inline styles for dynamic values only.
- Jest with Testing Library powers renderer specs; place new tests beside features as
<subject>.test.tsx. - Register shared mocks in
src/__tests__/setup.tsand reuse fixtures fromsrc/__tests__/__mocks__/. - Cover new IPC handlers with unit tests plus at least one scenario in
src/__tests__/integration/. - Debug flaky Electron tests with
npm test -- --runInBandto serialize execution.
- Write imperative commit subjects (e.g., “Add share unlock modal”) followed by bullet details and issue references like
Refs #123. - PRs should describe the change set, include screenshots or recordings for UI tweaks, and list run commands (
npm test,npm run lint). - Call out installer or release impacts whenever changes touch
dist:*scripts or packaging configs.
- Keep secrets in environment variables or OS keychains; never commit sensitive values.
- Store signing certificates with restricted access and rotate credentials when contributors change.
- Document new configuration toggles in
README.mdor relevant scripts underbuild/orscripts/.