Skip to content

Commit 3c764b7

Browse files
committed
Vite+
1 parent 38a89a0 commit 3c764b7

25 files changed

Lines changed: 4907 additions & 11510 deletions

.github/workflows/build.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,39 @@ jobs:
2020
runs-on: ubuntu-24.04
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2424

25-
- uses: actions/setup-node@v4
25+
- uses: voidzero-dev/setup-vp@v1
2626
with:
2727
node-version-file: .node-version
28+
run-install: true
29+
cache: true
2830

29-
- uses: actions-rust-lang/setup-rust-toolchain@v1
31+
- name: Install Rust stable
32+
uses: dtolnay/rust-toolchain@stable
3033

3134
- name: Install native dependencies
3235
run: |
3336
sudo apt-get update
3437
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
3538
36-
- name: Install UI dependencies
37-
run: npm ci
38-
3939
- name: Install Playwright dependencies
40-
run: npx playwright install chromium --with-deps
41-
42-
- name: 'Test: Format'
43-
run: 'npm run test:format'
40+
run: vp exec playwright install chromium --with-deps
4441

45-
- name: 'Test: Lint'
46-
run: 'npm run test:lint'
42+
- name: 'Check: Format/Lint/Types'
43+
run: 'vp check'
4744

48-
- name: 'Test: Unit'
49-
run: 'npm run test:unit'
45+
- name: 'Test: Unit + E2E'
46+
run: 'vp test'
5047

51-
- name: 'Test: E2E'
52-
run: 'npm run test:ui'
48+
- name: Build application
49+
run: vp build
5350

5451
- name: 'Generate translations'
55-
run: npm run gen:translations
56-
57-
- name: Build application
58-
run: npm run build
52+
run: vp run gen:translations
5953

6054
- name: 'Test: Rust (+ Generate Types)'
61-
run: npm run gen:types
55+
run: vp run gen:types
6256

6357
# Check one of the command above did not generate any unexpected artifacts
6458
# (like types generation)
@@ -96,11 +90,13 @@ jobs:
9690

9791
runs-on: ${{ matrix.platform }}
9892
steps:
99-
- uses: actions/checkout@v4
93+
- uses: actions/checkout@v6
10094

101-
- uses: actions/setup-node@v4
95+
- uses: voidzero-dev/setup-vp@v1
10296
with:
10397
node-version-file: .node-version
98+
run-install: true
99+
cache: true
104100

105101
- name: Install Rust stable
106102
uses: dtolnay/rust-toolchain@stable
@@ -122,9 +118,6 @@ jobs:
122118
flatpak install -y flathub org.gnome.Platform//48 org.gnome.Sdk//48
123119
flatpak install flathub -y org.flatpak.Builder
124120
125-
- name: Install frontend dependencies
126-
run: npm ci
127-
128121
- uses: tauri-apps/tauri-action@v0
129122
env:
130123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -136,6 +129,7 @@ jobs:
136129
APPLE_ID: ${{ secrets.APPLE_ID }}
137130
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
138131
with:
132+
tauriScript: vp run tauri
139133
includeUpdaterJson: false
140134
# compile a universal binary for intel + apple sillicon
141135
args: ${{ matrix.platform == 'macos-14' && '--target universal-apple-darwin' || '' }}

.oxfmtrc.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

.oxlintrc.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

.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-
"oxc.oxc-vscode",
3+
"VoidZero.vite-plus-extension-pack",
44
"tauri-apps.tauri-vscode",
55
"rust-lang.rust-analyzer",
66
"yash-singh.stylex"

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
2-
// oxfmt
2+
// vite+ (linting and formatting)
33
"editor.codeActionsOnSave": {
44
"source.fixAll.oxc": "always"
55
},
6-
"oxc.typeAware": true,
7-
// oxfmt
8-
"oxc.fmt.configPath": ".oxfmtrc.json",
96
"editor.defaultFormatter": "oxc.oxc-vscode",
107
"editor.formatOnSave": true,
8+
"editor.formatOnSaveMode": "file",
9+
"oxc.typeAware": true,
1110
// others
1211
"files.watcherExclude": {
1312
"**/.git/objects/**": true,

AGENTS.md

Lines changed: 95 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ Museeks is a music player desktop app built on top of Tauri. It focuses on clean
1414
- Global State Management: Zustand
1515
- Styling: [StyleX](https://stylexjs.com/docs/learn)
1616
- Localization/i18n: [Lingui.js](https://lingui.dev/introduction)
17-
- Linting: Oxlint
18-
- Formatting: Oxfmt
19-
- Unit tests: Vitest
20-
- E2E tests: [Vitest Browser Mode](https://vitest.dev/guide/browser/) (w/ Playwright)
21-
- Bundler: Vite
22-
- Infra Runtime: Node.js
17+
- Dev Infra (all the following is setup via [Vite Plus](https://viteplus.dev/guide/)) (see below for explanations)
18+
- Node.js
19+
- Linting: Oxlint
20+
- Formatting: Oxfmt
21+
- Unit tests: Vitest
22+
- E2E tests: [Vitest Browser Mode](https://vitest.dev/guide/browser/) (w/ Playwright)
23+
- Bundler: Vite
2324

2425
- **Backend**
2526
- Language: Rust · Desktop integration: Tauri v2
@@ -30,22 +31,18 @@ Museeks is a music player desktop app built on top of Tauri. It focuses on clean
3031
## Development Commands
3132

3233
```bash
33-
npm ci # Install dependencies
34-
npm run tauri dev # Start dev (Vite + Tauri with hot reload)
35-
npm run tauri build # Build distributable binaries for the current platform
36-
npm run build # Front-end code build only
37-
npm run test:format # Check formatting (Oxfmt)
38-
npm run test:format:fix # Auto-fix formatting (Oxfmt)
39-
npm run test:lint # Lint (Oxlint), also type-checks TypeScript
40-
npm run test:unit # Run unit tests (Vitest)
41-
npm run test:ui # E2E tests (Vitest Browser + Playwright)
34+
vp install # Install dependencies
35+
vp run tauri dev # Start dev (Vite + Tauri with hot reload)
36+
vp run tauri build # Build distributable binaries for the current platform
37+
vp build # Front-end code build only
38+
vp check # Check formatting (Oxfmt) and Lint/Typecheck (Oxlint)
4239

4340
# Code Generation
44-
npm run gen:types # Generate TS types from Rust (ts-rs)
45-
npm run gen:translations # Extract i18n strings to .po files
41+
vp run gen:types # Generate TS types from Rust (ts-rs)
42+
vp run gen:translations # Extract i18n strings to .po files
4643

4744
# Rust
48-
npm run clippy # Rust linting
45+
vp run clippy # Rust linting
4946
```
5047

5148
## Project Structure
@@ -101,10 +98,87 @@ src-tauri/ # Rust/Tauri backend
10198

10299
## Agent Operations Rules
103100

104-
- After UI edits: ensure `npm run test:lint` (covers linting + type-check) and `npm run test:format` (formatting) pass.
101+
- After UI edits: ensure `vp check` (covers formatting, linting + type-check) passes
105102
- After Rust edits: ensure `cargo test` in `src-tauri` passes. Clippy is a bonus.
106-
- After modifying a Rust struct exposed via `ts-rs`: run `npm run gen:types` and commit the output.
107-
- After editing the configuration of a route, regenerating the route-tree must be done via the `build` script.
103+
- After modifying a Rust struct exposed via `ts-rs`: run `vp run gen:types` and commit the output.
104+
- After editing the configuration of a route, regenerating the route-tree must be done via the `vp build` script.
108105
- Never manually edit `src/generated` — always regenerate.
109106
- Don't fix pre-existing issues unrelated to the current task.
110107
- When uncertain, read nearby file patterns first, then ask.
108+
109+
<!--VITE PLUS START-->
110+
111+
# Using Vite+, the Unified Toolchain for the Web
112+
113+
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`.
114+
115+
## Vite+ Workflow
116+
117+
`vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
118+
119+
Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles.
120+
121+
### Start
122+
123+
- create - Create a new project from a template
124+
- migrate - Migrate an existing project to Vite+
125+
- config - Configure hooks and agent integration
126+
- staged - Run linters on staged files
127+
- install (`i`) - Install dependencies
128+
- env - Manage Node.js versions
129+
130+
### Develop
131+
132+
- dev - Run the development server
133+
- check - Run format, lint, and TypeScript type checks
134+
- lint - Lint code
135+
- fmt - Format code
136+
- test - Run tests
137+
138+
### Execute
139+
140+
- run - Run monorepo tasks
141+
- exec - Execute a command from local `node_modules/.bin`
142+
- dlx - Execute a package binary without installing it as a dependency
143+
- cache - Manage the task cache
144+
145+
### Build
146+
147+
- build - Build for production
148+
- pack - Build libraries
149+
- preview - Preview production build
150+
151+
### Manage Dependencies
152+
153+
- add - Add packages to dependencies
154+
- remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies
155+
- update (`up`) - Update packages to latest versions
156+
- dedupe - Deduplicate dependencies
157+
- outdated - Check for outdated packages
158+
- list (`ls`) - List installed packages
159+
- why (`explain`) - Show why a package is installed
160+
- info (`view`, `show`) - View package information from the registry
161+
- link (`ln`) / unlink - Manage local package links
162+
- pm - Forward a command to the package manager
163+
164+
### Maintain
165+
166+
- upgrade - Update `vp` itself to the latest version
167+
168+
These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs.
169+
170+
## Common Pitfalls
171+
172+
- **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations.
173+
- **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead.
174+
- **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`.
175+
- **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. They must not be installed directly. You cannot upgrade these tools by installing their latest versions. Always use Vite+ commands.
176+
- **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands.
177+
- **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities.
178+
- **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box.
179+
180+
## Review Checklist for Agents
181+
182+
- [ ] Run `vp install` after pulling remote changes and before getting started.
183+
- [ ] Run `vp check` and `vp test` to validate changes.
184+
<!--VITE PLUS END-->

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,26 @@ Museeks is built upon:
8383
So you will need to install the following dependencies:
8484

8585
- [Tauri requirements](https://v2.tauri.app/start/prerequisites/) for `rust`
86-
- [`Node.js`](https://nodejs.org)
86+
- [`vp` (Vite+)](https://viteplus.dev/guide/) for the frontend toolchain (handles Node.js, dependencies, and build tools)
8787

8888
Then you can:
8989

9090
- Fork the repository
9191
- `git clone git@github.com:<username>/museeks.git`
9292
- `cd museeks`
93+
- `vp env use` to setup Node.js and the package manager
9394

9495
### Development Mode
9596

96-
- `npm ci`
97-
- `npm run tauri dev`
97+
- `vp install`
98+
- `vp run tauri dev`
9899

99100
This will launch Museeks in dev mode. Hot reload will work out-of-the-box, so when you update a `.js` file, the UI will automatically update. When you edit a `.rs` file, Museeks will automatically rebuild.
100101

101102
### Package Binaries
102103

103-
- `npm ci`
104-
- `npm run tauri build`
104+
- `vp install`
105+
- `vp run tauri build`
105106

106107
Tauri does not support cross-platform binaries, so the command will only generate binaries for your current platform (macOS, Linux, or Windows).
107108

@@ -110,7 +111,7 @@ Tauri does not support cross-platform binaries, so the command will only generat
110111
- Follow the steps from the "Setup" and "Development Mode" sections
111112
- Go to `src/translations/languages.ts`
112113
- Add your language information to the list
113-
- Run `npm run gen:translations`
114+
- Run `vp run gen:translations`
114115
- This will create a new file `<your_language_code>.po` in the same folder
115116
- Fill in the translations from the created `.po` file
116117
- Open a Pull Request

0 commit comments

Comments
 (0)