Skip to content

Commit cb9715f

Browse files
committed
Adopt Vite+
1 parent 31c147b commit cb9715f

46 files changed

Lines changed: 411 additions & 328 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ updates:
1111
patterns:
1212
- 'react'
1313
- 'react-dom'
14-
vitest:
15-
patterns:
16-
- 'vitest'
17-
- '@vitest/*'
1814

1915
- package-ecosystem: 'github-actions'
2016
directory: '/'

.github/workflows/ci.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,20 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v6
1313

14-
- uses: actions/setup-node@v6
14+
- uses: voidzero-dev/setup-vp@v1
1515
with:
1616
node-version: 25
17-
check-latest: true
1817

19-
- name: Install dependencies
20-
run: npm i
21-
22-
- name: Typecheck
23-
run: node --run typecheck
24-
25-
- name: ESLint
26-
run: node --run eslint
27-
28-
- name: Oxfmt
29-
run: node --run format:check
30-
31-
- name: Bundle
32-
run: node --run build
33-
34-
- name: Build website
35-
run: node --run build:website
18+
- run: vp check
19+
- run: vpr typecheck
20+
- run: vpr eslint
21+
- run: vp pack
22+
- run: vp build
3623

3724
- name: Install Playwright Browsers
38-
run: npx playwright install chromium firefox
25+
run: vpx playwright install chromium firefox
3926

40-
- name: Test
41-
run: node --run test:ci
27+
- run: vp test
4228
timeout-minutes: 4
4329

4430
- name: Upload test failure artifacts

.github/workflows/publish.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,32 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24-
- uses: actions/setup-node@v6
24+
- uses: voidzero-dev/setup-vp@v1
2525
with:
2626
node-version: 25
27-
check-latest: true
2827
registry-url: 'https://registry.npmjs.org'
2928

30-
- name: Install dependencies
31-
run: npm i
32-
33-
- name: Typecheck
34-
run: node --run typecheck
35-
36-
- name: ESLint
37-
run: node --run eslint
38-
39-
- name: Oxfmt
40-
run: node --run format:check
41-
42-
- name: Bundle
43-
run: node --run build
44-
45-
- name: Build website
46-
run: node --run build:website
29+
- run: vp check
30+
- run: vpr typecheck
31+
- run: vpr eslint
32+
- run: vp pack
33+
- run: vp build
4734

4835
- name: Install Playwright Browsers
49-
run: npx playwright install chromium firefox
36+
run: vpx playwright install chromium firefox
5037

51-
- name: Test
52-
run: node --run test:ci
38+
- run: vp test
5339
timeout-minutes: 4
5440

5541
- name: Update version
5642
run: |
5743
git config user.name "${{ github.actor }}"
5844
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
59-
npm version ${{ inputs.version }}
45+
vp env exec npm version ${{ inputs.version }}
6046
6147
# https://docs.npmjs.com/trusted-publishers
6248
- name: Publish to npm
63-
run: npm publish --tag latest
49+
run: vp env exec npm publish --tag latest
6450

6551
- name: Push tag
6652
run: git push origin v${{ inputs.version }}

.github/workflows/update-screenshots.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@ jobs:
2323
- uses: actions/checkout@v6
2424
with:
2525
ref: ${{ github.head_ref }}
26-
- uses: actions/setup-node@v6
26+
27+
- uses: voidzero-dev/setup-vp@v1
2728
with:
2829
node-version: 25
29-
check-latest: true
30+
3031
- name: Remove label
3132
if: github.event_name == 'pull_request'
3233
run: gh pr edit --remove-label 'Update Screenshots'
3334
env:
3435
GH_TOKEN: ${{ github.token }}
35-
- name: Install dependencies
36-
run: npm i
36+
3737
- name: Install Playwright Browsers
38-
run: npx playwright install chromium firefox
38+
run: vpx playwright install chromium firefox
39+
3940
- name: Update screenshots
4041
run: |
4142
rm -r test/**/screenshots/**
42-
node --run test:ci:update
43+
vp test --project visual --update
44+
4345
- name: Push new screenshots
4446
run: |
4547
git config user.name "${{ github.actor }}"

.oxfmtrc.json

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

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "oxc.oxc-vscode", "typescriptteam.native-preview"]
2+
"recommendations": [
3+
"VoidZero.vite-plus-extension-pack",
4+
"dbaeumer.vscode-eslint",
5+
"typescriptteam.native-preview"
6+
]
37
}

AGENTS.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,93 @@ website/ # demo site (Vite + TanStack Router)
6060
## Validation
6161

6262
Run before submitting changes: `node --run typecheck`, `node --run eslint`, `node --run format`, `node --run test`.
63+
64+
<!-- TODO: review -->
65+
<!--VITE PLUS START-->
66+
67+
<!-- # Using Vite+, the Unified Toolchain for the Web -->
68+
69+
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`.
70+
71+
## Vite+ Workflow
72+
73+
`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.
74+
75+
### Start
76+
77+
- create - Create a new project from a template
78+
- migrate - Migrate an existing project to Vite+
79+
- config - Configure hooks and agent integration
80+
- staged - Run linters on staged files
81+
- install (`i`) - Install dependencies
82+
- env - Manage Node.js versions
83+
84+
### Develop
85+
86+
- dev - Run the development server
87+
- check - Run format, lint, and TypeScript type checks
88+
- lint - Lint code
89+
- fmt - Format code
90+
- test - Run tests
91+
92+
### Execute
93+
94+
- run - Run monorepo tasks
95+
- exec - Execute a command from local `node_modules/.bin`
96+
- dlx - Execute a package binary without installing it as a dependency
97+
- cache - Manage the task cache
98+
99+
### Build
100+
101+
- build - Build for production
102+
- pack - Build libraries
103+
- preview - Preview production build
104+
105+
### Manage Dependencies
106+
107+
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.
108+
109+
- add - Add packages to dependencies
110+
- remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies
111+
- update (`up`) - Update packages to latest versions
112+
- dedupe - Deduplicate dependencies
113+
- outdated - Check for outdated packages
114+
- list (`ls`) - List installed packages
115+
- why (`explain`) - Show why a package is installed
116+
- info (`view`, `show`) - View package information from the registry
117+
- link (`ln`) / unlink - Manage local package links
118+
- pm - Forward a command to the package manager
119+
120+
### Maintain
121+
122+
- upgrade - Update `vp` itself to the latest version
123+
124+
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.
125+
126+
## Common Pitfalls
127+
128+
- **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations.
129+
- **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.
130+
- **Running scripts:** Vite+ built-in commands (`vp dev`, `vp build`, `vp test`, etc.) always run the Vite+ built-in tool, not any `package.json` script of the same name. To run a custom script that shares a name with a built-in command, use `vp run <script>`. For example, if you have a custom `dev` script that runs multiple services concurrently, run it with `vp run dev`, not `vp dev` (which always starts Vite's dev server).
131+
- **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.
132+
- **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands.
133+
- **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.
134+
- **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box.
135+
136+
## CI Integration
137+
138+
For GitHub Actions, consider using [`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) to replace separate `actions/setup-node`, package-manager setup, cache, and install steps with a single action.
139+
140+
```yaml
141+
- uses: voidzero-dev/setup-vp@v1
142+
with:
143+
cache: true
144+
- run: vp check
145+
- run: vp test
146+
```
147+
148+
## Review Checklist for Agents
149+
150+
- [ ] Run `vp install` after pulling remote changes and before getting started.
151+
- [ ] Run `vp check` and `vp test` to validate changes.
152+
<!--VITE PLUS END-->

package.json

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,6 @@
3131
"default": "./lib/index.js"
3232
}
3333
},
34-
"scripts": {
35-
"start": "vite serve --clearScreen false",
36-
"preview": "vite preview",
37-
"build:website": "vite build",
38-
"build": "tsdown",
39-
"test": "vitest run --project browser --project node",
40-
"test:watch": "vitest watch --project browser --project node",
41-
"test:ci": "vitest run",
42-
"test:ci:update": "vitest run --project visual --update",
43-
"format": "oxfmt",
44-
"format:check": "oxfmt --check",
45-
"eslint": "eslint --max-warnings 0 --cache --cache-location .cache/eslint --cache-strategy content",
46-
"eslint:fix": "node --run eslint -- --fix",
47-
"typecheck": "tsgo --build"
48-
},
4934
"devDependencies": {
5035
"@eslint-react/eslint-plugin": "^4.2.1",
5136
"@eslint/markdown": "^8.0.1",
@@ -58,33 +43,34 @@
5843
"@types/react-dom": "^19.2.3",
5944
"@typescript/native-preview": "^7.0.0-dev.20260401.1",
6045
"@vitejs/plugin-react": "^6.0.1",
61-
"@vitest/browser-playwright": "^4.1.2",
6246
"@vitest/coverage-istanbul": "^4.1.2",
6347
"@vitest/eslint-plugin": "^1.6.13",
48+
"@voidzero-dev/vite-plus-core": "^0.1.15",
49+
"@voidzero-dev/vite-plus-test": "^0.1.15",
6450
"clsx": "^2.1.1",
6551
"ecij": "^0.4.1",
6652
"eslint": "^10.0.3",
6753
"eslint-plugin-react-hooks": "^7.0.1",
6854
"eslint-plugin-sonarjs": "^4.0.2",
6955
"jspdf": "^4.2.0",
7056
"jspdf-autotable": "^5.0.7",
71-
"oxfmt": "0.43.0",
7257
"playwright": "~1.59.0",
7358
"postcss": "^8.5.2",
7459
"react": "^19.2.4",
7560
"react-dom": "^19.2.4",
76-
"tsdown": "^0.21.7",
7761
"typescript": "~6.0.2",
7862
"typescript-eslint": "^8.58.0",
79-
"vite": "^8.0.3",
80-
"vitest": "^4.1.2",
63+
"vite-plus": "^0.1.15",
8164
"vitest-browser-react": "^2.1.0"
8265
},
8366
"peerDependencies": {
8467
"react": "^19.2",
8568
"react-dom": "^19.2"
8669
},
8770
"overrides": {
88-
"eslint": "$eslint"
89-
}
71+
"eslint": "$eslint",
72+
"vite": "$@voidzero-dev/vite-plus-core",
73+
"vitest": "$@voidzero-dev/vite-plus-test"
74+
},
75+
"packageManager": "npm@11.12.1"
9076
}

test/browser/TreeDataGrid.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react';
2-
import { page, userEvent } from 'vitest/browser';
2+
import { page, userEvent } from 'vite-plus/test/browser';
33

44
import type { Column } from '../../src';
55
import { renderTextEditor, SelectColumn, TreeDataGrid } from '../../src';

test/browser/column/cellClass.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { page } from 'vitest/browser';
1+
import { page } from 'vite-plus/test/browser';
22

33
import type { Column } from '../../../src';
44
import { cellClassname } from '../../../src/style/cell';

0 commit comments

Comments
 (0)