Skip to content

Commit c11a0fe

Browse files
committed
feat: release vite-plus cli
1 parent 085f66e commit c11a0fe

4 files changed

Lines changed: 66 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
run: pnpm install
8383

8484
- name: Build
85-
run: pnpm --filter=vite-plus build:binding --target ${{ matrix.target }} -x
85+
run: pnpm --filter=@voidzero-dev/vite-plus build:binding --target ${{ matrix.target }} -x
8686
env:
8787
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin-cache
8888

@@ -130,14 +130,21 @@ jobs:
130130
pattern: bindings-*
131131
merge-multiple: true
132132

133+
- name: Copy *.node to cli/binding
134+
run: |
135+
cp -r packages/global/dist/*.node packages/cli/binding
136+
ls -ah packages/cli/binding
137+
133138
- name: Set version
134139
run: |
135140
sed -i '' 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/global/package.json
141+
sed -i '' 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/cli/package.json
136142
137143
- name: Publish
138144
run: |
139145
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
140146
echo "@voidzero-dev:registry=https://npm.pkg.github.com/" >> ~/.npmrc
141147
pnpm publish --filter=./packages/global --registry https://npm.pkg.github.com --no-git-checks
148+
pnpm publish --filter=./packages/cli --registry https://npm.pkg.github.com --no-git-checks
142149
env:
143150
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"node": "22.17.0"
77
},
88
"scripts": {
9-
"bootstrap-cli": "pnpm --filter=vite-plus build && cp -r ./packages/cli/binding/*.node ./packages/global/dist && pnpm --filter=@voidzero-dev/global build && npm install -g ./packages/global",
10-
"bootstrap-cli:ci": "pnpm --filter=vite-plus build:ts && pnpm --filter=@voidzero-dev/global build && npm install -g ./packages/global",
9+
"bootstrap-cli": "pnpm --filter=@voidzero-dev/vite-plus build && cp -r ./packages/cli/binding/*.node ./packages/global/dist && pnpm --filter=@voidzero-dev/global build && npm install -g ./packages/global",
10+
"bootstrap-cli:ci": "pnpm --filter=@voidzero-dev/vite-plus build:ts && pnpm --filter=@voidzero-dev/global build && npm install -g ./packages/global",
1111
"typecheck": "tsc -b tsconfig.json",
1212
"prepare": "husky"
1313
},

packages/cli/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,58 @@
44

55
This package provides the JavaScript-to-Rust bridge that enables vite-plus to execute JavaScript tooling (like Vite, Vitest, and oxlint) from the Rust core. It uses NAPI-RS to create native Node.js bindings.
66

7+
## Usage
8+
9+
### Install
10+
11+
Add to your project's devDependencies:
12+
13+
```bash
14+
pnpm add -D @voidzero-dev/vite-plus
15+
```
16+
17+
### Built-in Commands
18+
19+
#### Build
20+
21+
build command will use `rolldown-vite` to build your project.
22+
23+
```bash
24+
pnpx vite build
25+
```
26+
27+
#### Test
28+
29+
test command will use `vitest` to test your project.
30+
31+
```bash
32+
pnpx vite test
33+
```
34+
35+
#### Lint
36+
37+
lint command will use `oxlint` to lint your project.
38+
39+
```bash
40+
pnpx vite lint
41+
```
42+
43+
#### Task runner
44+
45+
You can use `vite run` to run any task that you want.
46+
47+
Run a task on the current project.
48+
49+
```bash
50+
pnpx vite run <task-name>
51+
```
52+
53+
Run all task with the same name in monorepo.
54+
55+
```bash
56+
pnpx vite run -r <task-name>
57+
```
58+
759
## Architecture
860

961
### How It Works

packages/cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "vite-plus",
2+
"name": "@voidzero-dev/vite-plus",
33
"version": "0.0.0",
4-
"private": true,
54
"type": "module",
65
"bin": {
6+
"vite": "./bin/vite-plus",
77
"vite-plus": "./bin/vite-plus"
88
},
99
"exports": {
@@ -24,8 +24,8 @@
2424
},
2525
"files": [
2626
"bin",
27-
"index.js",
28-
"index.d.ts"
27+
"binding",
28+
"dist"
2929
],
3030
"dependencies": {
3131
"oxlint": "catalog:",

0 commit comments

Comments
 (0)