Skip to content

Commit 9f08f0f

Browse files
authored
chore: migrate to vite-plus unified toolchain (#2869)
* chore: replace biome with oxlint and oxfmt dependencies * chore: add oxlint configuration mirroring biome rules * chore: add oxfmt configuration mirroring biome formatter * chore: remove biome configuration * chore(vscode): switch recommended extension and formatter to oxc * ci(lint): run oxlint and oxfmt instead of biome * docs: replace biome references with oxlint and oxfmt * chore(vite): use oxlint instead of biome in vite-plugin-checker * refactor: convert biome-ignore directives to oxlint-disable * refactor: address lint findings surfaced by oxlint * test: update snapshot affected by oxfmt jsx whitespace * style: apply oxfmt formatting across codebase * ci(renovate): include .github in sparse checkout for setup-node action * chore: replace oxlint and oxfmt with vite-plus * refactor(vite): consolidate lint, fmt, and staged config into vite.config.ts * chore(husky): run vp staged in pre-commit hook * chore(vscode): point oxc extension at vite.config.ts * ci(lint): run pnpm check via vite-plus * docs: describe vite-plus toolchain * chore(gitignore): ignore vite-plugin-electron index.html stub at root * refactor: drop redundant type assertions flagged by sonarcloud * feat(fmt): port biome import sort rules to oxfmt sortImports * style: re-sort imports per new oxfmt groups * refactor(types): inline primer-private VariantType and ColorModeWithAuto * Revert "refactor(types): inline primer-private VariantType and ColorModeWithAuto" This reverts commit cfcfa5a.
1 parent d401cfb commit 9f08f0f

249 files changed

Lines changed: 2695 additions & 4597 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ Gitify is a Node.js/Electron desktop application that displays GitHub notificati
77
## Working Effectively
88

99
### Prerequisites and Setup
10+
1011
- **Install pnpm globally first**: `npm install -g pnpm`
1112
- **Node.js requirement**: This project requires Node.js >=22 (check .nvmrc), though it works with Node 20+ with warnings
1213
- **Bootstrap the repository**:
1314
- `pnpm install` -- takes 2.5 minutes. NEVER CANCEL. Set timeout to 5+ minutes.
1415

1516
### Development Workflow
17+
1618
- **Build the application**:
1719
- `pnpm build` -- takes 32 seconds. NEVER CANCEL. Set timeout to 60+ minutes.
1820
- Builds both main (Electron process) and renderer (React UI) bundles
@@ -27,13 +29,15 @@ Gitify is a Node.js/Electron desktop application that displays GitHub notificati
2729
- Use `CmdOrCtrl+R` to reload when watch mode detects changes
2830

2931
### Linting and Code Quality
30-
- **Check linting and formatting**:
31-
- `pnpm lint:check` -- takes <1 second using Biome
32+
33+
- **Check formatting, linting, and types**:
34+
- `pnpm check` -- runs Vite+'s unified format/lint/type-check pipeline
3235
- **ALWAYS run before committing** or CI will fail
3336
- **Auto-fix issues**:
34-
- `pnpm lint` -- automatically fixes linting and formatting issues
37+
- `pnpm check:fix` -- formats and applies lint fixes
3538

3639
### Testing
40+
3741
- **Run TypeScript compilation check**:
3842
- `pnpm tsc --noEmit` -- takes 5 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
3943
- **Run unit tests**:
@@ -47,58 +51,69 @@ Gitify is a Node.js/Electron desktop application that displays GitHub notificati
4751
**CRITICAL**: After making changes, ALWAYS validate your work by running these scenarios:
4852

4953
### Build Validation
54+
5055
1. **Clean build test**: `rm -rf build && pnpm build`
5156
2. **Verify build outputs**: Check that `build/main.js`, `build/renderer.js`, and `build/styles.css` are created
5257
3. **File sizes should be reasonable**: main.js ~300KB, renderer.js ~2MB, styles.css ~1MB
5358
4. **Success indicators**: Look for "webpack compiled successfully" messages for both main and renderer
5459

5560
### Code Quality Validation
61+
5662
1. **Linting passes**: `pnpm lint:check` should show warnings but complete successfully (exit code 0)
5763
2. **TypeScript compiles**: `pnpm tsc --noEmit` should complete without errors
5864
3. **Tests pass**: Run `pnpm test` and ensure no new test failures (some existing ones may fail - focus on your changes)
5965

6066
### Development Environment Testing
67+
6168
1. **Watch mode works**: Start `pnpm watch`, make a small change to a file in `src/`, verify webpack recompiles (look for compilation success messages)
6269
2. **Development build**: The watch mode creates development builds with source maps in `build/` directory
6370

6471
## Expected Command Outputs
6572

6673
### Successful Build
74+
6775
```
6876
webpack 5.101.2 compiled successfully in [time]
6977
```
7078

7179
### Successful Tests (with some expected failures)
80+
7281
```
7382
Test Suites: X failed, Y passed, Z total
7483
Tests: A failed, B passed, C total
7584
```
85+
7686
Note: Focus on ensuring no NEW test failures from your changes.
7787

7888
### Successful Linting
89+
7990
```
8091
Checked X files in Yms. No fixes applied.
8192
Found Z warnings.
8293
```
94+
8395
Warnings are acceptable - the important part is that it completes successfully.
8496

8597
## Common Tasks and File Locations
8698

8799
### Key Files and Directories
100+
88101
- **Main Electron process**: `src/main/` - Node.js backend code
89-
- **Renderer process**: `src/renderer/` - React frontend code
102+
- **Renderer process**: `src/renderer/` - React frontend code
90103
- **Shared code**: `src/shared/` - Common utilities and types
91104
- **Build configuration**: `config/` - Webpack configs and electron-builder settings
92105
- **Assets**: `assets/` - Icons, sounds, and static resources
93106

94107
### Configuration Files
108+
95109
- **package.json**: Main project configuration and scripts
96-
- **biome.json**: Linting and formatting rules
110+
- **vite.config.ts**: Vite+ unified config — `lint`, `fmt`, and `staged` blocks live here
97111
- **vitest.config.ts**: Test configuration
98112
- **tsconfig.json**: TypeScript configuration
99113
- **tailwind.config.ts**: CSS framework configuration
100114

101115
### Frequently Modified Areas
116+
102117
- **Notification logic**: `src/renderer/hooks/useNotifications.ts`
103118
- **GitHub API client**: `src/renderer/utils/api/`
104119
- **UI components**: `src/renderer/components/`
@@ -108,18 +123,21 @@ Warnings are acceptable - the important part is that it completes successfully.
108123
## Build and Release Process
109124

110125
### Local Packaging (for testing)
126+
111127
- **macOS**: `pnpm package:macos --publish=never`
112-
- **Windows**: `pnpm package:win --publish=never`
128+
- **Windows**: `pnpm package:win --publish=never`
113129
- **Linux**: `pnpm package:linux --publish=never`
114130
- **NOTE**: These require the full build first and additional platform-specific dependencies
115131

116132
### Pre-commit Checks
133+
117134
- **Automatic via Husky**: Git hooks run `pnpx lint-staged` on commit
118-
- **Manual validation**: Run `pnpm lint:check && pnpm tsc --noEmit && pnpm test`
135+
- **Manual validation**: Run `pnpm check && pnpm tsc --noEmit && pnpm test`
119136

120137
## Important Constraints and Limitations
121138

122139
### Timing Expectations
140+
123141
- **Dependency installation**: 2-3 minutes (normal for Electron projects)
124142
- **Full build (clean)**: 30-35 seconds
125143
- **Watch mode initial compilation**: 10-15 seconds
@@ -129,12 +147,14 @@ Warnings are acceptable - the important part is that it completes successfully.
129147
- **Linting**: <1 second
130148

131149
### Environment Issues
150+
132151
- **Electron in containers**: Will fail to start due to sandbox restrictions (expected behavior in headless environments)
133152
- **Node version warnings**: Project requires Node >=22, works with 20+ but shows warnings in `pnpm` commands
134153
- **Build warnings**: Some PostCSS/Tailwind warnings in renderer build are normal and expected
135154
- **Linting warnings**: Existing codebase has some linting warnings - focus only on your changes
136155

137156
### Common Troubleshooting
157+
138158
- **Build failures**: Check Node version, ensure `pnpm install` completed successfully
139159
- **Test snapshot failures**: Run `pnpm test -u` to update snapshots after legitimate UI changes
140160
- **Linting errors**: Run `pnpm lint` to auto-fix most issues
@@ -143,6 +163,7 @@ Warnings are acceptable - the important part is that it completes successfully.
143163
## Development Philosophy
144164

145165
This project focuses on GitHub notification monitoring, not being a full GitHub client. Keep changes:
166+
146167
- **Simple and focused** on core notification functionality
147168
- **Consistent** with existing UI patterns and design language
148169
- **Minimal** - avoid adding complexity for edge cases
@@ -151,21 +172,23 @@ This project focuses on GitHub notification monitoring, not being a full GitHub
151172
## Technology Stack Reference
152173

153174
**Core Technologies:**
175+
154176
- **Electron 40+**: Desktop app framework
155-
- **React 19+**: UI library
177+
- **React 19+**: UI library
156178
- **TypeScript 5+**: Language
157179
- **pnpm 10+**: Package manager
158-
- **Biome**: Linting and formatting
180+
- **Vite+**: Unified toolchain (lint via oxlint, format via oxfmt, dev/build/test)
159181
- **Jest**: Testing framework
160182
- **Webpack 5**: Build system
161183
- **Tailwind CSS**: Styling framework
162184

163185
**Key Dependencies:**
186+
164187
- **menubar**: System tray integration
165188
- **electron-updater**: Auto-update functionality
166189
- **@primer/react**: GitHub's React component library
167190
- **octokit**: HTTP client for GitHub API
168191
- **@primer/octicons-react**: GitHub icon library
169192
- **date-fns**: Date utilities
170193

171-
ALWAYS reference this information first before exploring the codebase or running commands to save time and avoid common pitfalls.
194+
ALWAYS reference this information first before exploring the codebase or running commands to save time and avoid common pitfalls.

.github/labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ labels:
99
- label: 'build'
1010
sync: true
1111
matcher:
12-
title: '^(ci|build)(\((?!release)\w+\))?: (?!.*\brelease\b).*'
12+
title: '^(ci|build)(\((?!release)\w+\))?: (?!.*\brelease\b).*'
1313

1414
- label: 'chore'
1515
sync: true
@@ -46,7 +46,7 @@ labels:
4646
sync: true
4747
matcher:
4848
title: '^test(\(\w+\))?: .*'
49-
49+
5050
checks:
5151
- context: 'Semantic Pull Request'
5252
description:
@@ -62,4 +62,4 @@ checks:
6262
- build
6363
- release
6464
- chore
65-
- dependency
65+
- dependency

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ changelog:
2929
- chore
3030
- title: Other Changes
3131
labels:
32-
- "*"
32+
- '*'

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions: {}
77

88
jobs:
99
lint-code:
10-
name: Lint Code [biomejs]
10+
name: Lint Code [vite-plus]
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
@@ -21,8 +21,8 @@ jobs:
2121
- name: Setup Node.js
2222
uses: ./.github/actions/setup-node
2323

24-
- name: Run linter
25-
run: pnpm lint:check
24+
- name: Run lint and format checks
25+
run: pnpm check
2626

2727
lint-actions:
2828
name: Lint GitHub Actions [actionlint]

.github/workflows/renovate.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
persist-credentials: false
24-
sparse-checkout: renovate.json
24+
sparse-checkout: |
25+
renovate.json
26+
.github
2527
2628
- uses: ./.github/actions/setup-node
2729
with:
28-
run-install: "false"
30+
run-install: 'false'
2931

3032
- name: Install Renovate
3133
run: pnpm install --global renovate

.github/workflows/zizmor.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name: GitHub Actions Security Analysis
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- "**"
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '**'
1010

1111
permissions: {}
1212

1313
jobs:
14-
zizmor:
15-
name: Run zizmor 🌈
16-
runs-on: ubuntu-latest
17-
permissions:
18-
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
19-
contents: read # Only needed for private repos. Needed to clone the repo.
20-
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
21-
steps:
22-
- name: Checkout repository
23-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24-
with:
25-
persist-credentials: false
14+
zizmor:
15+
name: Run zizmor 🌈
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
19+
contents: read # Only needed for private repos. Needed to clone the repo.
20+
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
2626

27-
- name: Run zizmor 🌈
28-
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
27+
- name: Run zizmor 🌈
28+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Build files
22
dist/
33
build/
4+
# vite-plugin-electron stub at project root
5+
/index.html
46

57
# TypeScript incremental compilation cache
68
*.tsbuildinfo

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm dlx lint-staged
1+
pnpm exec vp staged

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
3-
"biomejs.biome",
3+
"oxc.oxc-vscode",
44
"bradlc.vscode-tailwindcss",
55
"GraphQL.vscode-graphql",
66
"GraphQL.vscode-graphql-syntax",

.vscode/settings.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
{
22
"editor.codeActionsOnSave": {
3-
"source.fixAll.biome": "explicit"
3+
"source.fixAll.oxc": "explicit"
44
},
5-
"editor.defaultFormatter": "biomejs.biome",
5+
"editor.defaultFormatter": "oxc.oxc-vscode",
6+
"editor.formatOnSave": true,
7+
"oxc.lint.configPath": "./vite.config.ts",
8+
"oxc.fmt.configPath": "./vite.config.ts",
69
"files.associations": {
710
"*.css": "tailwindcss"
811
},
912
"[json]": {
10-
"editor.defaultFormatter": "biomejs.biome"
13+
"editor.defaultFormatter": "oxc.oxc-vscode"
1114
},
1215
"[typescript]": {
13-
"editor.defaultFormatter": "biomejs.biome"
16+
"editor.defaultFormatter": "oxc.oxc-vscode"
17+
},
18+
"[typescriptreact]": {
19+
"editor.defaultFormatter": "oxc.oxc-vscode"
20+
},
21+
"[javascript]": {
22+
"editor.defaultFormatter": "oxc.oxc-vscode"
1423
},
1524
"sonarlint.connectedMode.project": {
1625
"connectionId": "gitify-app",
1726
"projectKey": "gitify-app_gitify"
1827
},
19-
"cSpell.words": ["codegen"]
28+
"cSpell.words": ["codegen", "oxfmt", "oxlint"]
2029
}

0 commit comments

Comments
 (0)