Skip to content

Commit 2448309

Browse files
authored
refactor: move from build, lint, fmt to the all-in-one package of vite-plus (#45)
- Removed `prettier.config.js` and `tsdown.config.ts` as they are no longer needed. - Updated test files to import from `vite-plus/test` instead of `vitest`. - Created a new `vite.config.ts` for project configuration and linting. - Deleted `vitest.config.ts` as its functionality is now integrated into `vite.config.ts`. - use tsgo
1 parent ed3d970 commit 2448309

20 files changed

Lines changed: 1090 additions & 2890 deletions

.editorconfig

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
text eol=lf

.github/workflows/lint.yaml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,14 @@ jobs:
66
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Checkout
9+
- name: Checkout code
1010
uses: actions/checkout@v4
1111

12-
- name: Install pnpm
13-
run: corepack enable
14-
15-
- name: Set node version to 22
16-
uses: actions/setup-node@v6
12+
- uses: voidzero-dev/setup-vp@v1
1713
with:
1814
node-version: '22'
19-
cache: 'pnpm'
20-
21-
- name: Install dependencies
22-
run: pnpm install --no-frozen-lockfile
23-
24-
- name: Lint
25-
run: pnpm lint
26-
27-
- name: Type check
28-
run: pnpm type-check
29-
30-
- name: Build
31-
run: |
32-
pnpm build
33-
node dist/cli.js -V
34-
35-
- name: Test
36-
run: pnpm test run
15+
cache: true
16+
- run: vp install
17+
- run: vp check
18+
- run: vp test
19+
- run: vp pack

.prettierignore

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

.vite-hooks/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp run commit-lint -p $1

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["VoidZero.vite-plus-extension-pack"]
3+
}

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"prettier.enable": false,
3+
"eslint.enable": false,
4+
"editor.defaultFormatter": "oxc.oxc-vscode",
5+
"oxc.fmt.configPath": "./vite.config.ts",
6+
"editor.formatOnSave": true,
7+
"editor.formatOnSaveMode": "file",
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll.oxc": "explicit"
10+
},
11+
"js/ts.experimental.useTsgo": true
12+
}

eslint.config.js

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

package.json

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,35 @@
99
"varlet"
1010
],
1111
"bugs": "https://github.com/varletjs/release/issues",
12+
"license": "MIT",
13+
"author": "clencat <2091927351@qq.com>",
1214
"repository": {
1315
"type": "git",
14-
"url": "git+https://github.com/varletjs/release"
16+
"url": "git+https://github.com/varletjs/release.git"
1517
},
16-
"license": "MIT",
17-
"author": "clencat <2091927351@qq.com>",
18+
"bin": {
19+
"vr": "dist/cli.js"
20+
},
21+
"files": [
22+
"dist"
23+
],
1824
"type": "module",
25+
"types": "./dist/index.d.ts",
1926
"exports": {
2027
".": {
2128
"types": "./dist/index.d.ts",
2229
"default": "./dist/index.js"
2330
}
2431
},
25-
"types": "./dist/index.d.ts",
26-
"bin": {
27-
"vr": "dist/cli.js"
28-
},
29-
"files": [
30-
"dist"
31-
],
3232
"scripts": {
33-
"build": "tsdown",
33+
"build": "vp pack",
3434
"commit-lint": "node dist/cli.js commit-lint",
35-
"dev": "tsdown --watch",
36-
"format": "eslint . --fix && prettier --write .",
37-
"lint": "eslint . && prettier --check .",
38-
"release": "pnpm build && vitest run && node scripts/release.js",
39-
"release:dev": "pnpm build && node scripts/release.js",
40-
"test": "vitest",
41-
"test:coverage": "vitest run --coverage",
42-
"type-check": "tsc --noEmit"
43-
},
44-
"simple-git-hooks": {
45-
"pre-commit": "pnpm exec lint-staged --allow-empty --concurrent false",
46-
"commit-msg": "pnpm run commit-lint -p $1"
47-
},
48-
"lint-staged": {
49-
"*.{md}": "prettier --write",
50-
"*.{ts,js}": [
51-
"prettier --write",
52-
"eslint --fix"
53-
],
54-
"package.json": "prettier --write"
35+
"dev": "vp pack --watch",
36+
"release": "vp pack && vp test run && node scripts/release.js",
37+
"release:dev": "vp pack && node scripts/release.js",
38+
"test": "vp test",
39+
"test:coverage": "vp test run --coverage",
40+
"type-check": "tsgo --noEmit"
5541
},
5642
"dependencies": {
5743
"@clack/prompts": "^1.2.0",
@@ -62,26 +48,17 @@
6248
"tinyexec": "^1.1.1"
6349
},
6450
"devDependencies": {
65-
"@configurajs/eslint": "^0.1.2",
66-
"@configurajs/prettier": "^0.1.4",
67-
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
51+
"@configurajs/vite-plus": "^0.2.2",
6852
"@types/conventional-changelog": "^3.1.5",
6953
"@types/node": "^22.14.0",
7054
"@types/semver": "^7.7.1",
71-
"@vitest/coverage-v8": "^4.1.3",
72-
"eslint": "^9.39.2",
73-
"lint-staged": "^16.2.7",
74-
"prettier": "^3.8.1",
75-
"prettier-plugin-packagejson": "^3.0.0",
76-
"prettier-plugin-tailwindcss": "^0.7.2",
77-
"simple-git-hooks": "^2.13.1",
78-
"tsdown": "^0.21.7",
79-
"typescript": "^6.0.2",
80-
"vitest": "^4.1.3"
55+
"@typescript/native-preview": "7.0.0-dev.20260410.1",
56+
"@vitest/coverage-v8": "^4.1.4",
57+
"vite-plus": "catalog:"
8158
},
82-
"packageManager": "pnpm@10.28.2",
8359
"engines": {
8460
"node": "^20.19.0 || >=22.12.0",
8561
"pnpm": ">=10.0"
86-
}
62+
},
63+
"packageManager": "pnpm@10.28.2"
8764
}

0 commit comments

Comments
 (0)