Skip to content

Commit 9e35740

Browse files
committed
chore: add Husky pre-commit hook and update scripts
1 parent a7097c3 commit 9e35740

4 files changed

Lines changed: 27 additions & 43 deletions

File tree

ui/.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd ui
2+
pnpm format

ui/package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
2+
"private": true,
23
"type": "module",
34
"scripts": {
4-
"build": "run-p type-check \"build-only {@}\" --",
5-
"build-only": "rsbuild build",
6-
"dev": "rsbuild build --watch --env-mode=development",
5+
"dev": "pnpm run \"/^watch:.*/\"",
6+
"watch:rsbuild": "rsbuild build --watch --env-mode=development",
7+
"build": "run-p build:type-check \"build:build-only {@}\" --",
8+
"build:type-check": "vue-tsc --build",
9+
"build:build-only": "rsbuild build",
10+
"lint": "run-s lint:*",
711
"lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
812
"lint:eslint": "eslint . --fix",
9-
"lint": "run-s lint:*",
10-
"prettier": "prettier --write src/",
13+
"format": "pnpm run \"/^format:.*/\"",
14+
"format:prettier": "prettier --write src/",
15+
"test": "pnpm run \"/^test:.*/\"",
1116
"test:unit": "vitest --passWithNoTests",
12-
"type-check": "vue-tsc --build"
17+
"prepare": "cd .. && husky ui/.husky"
1318
},
1419
"prettier": {
1520
"printWidth": 100,
@@ -23,6 +28,7 @@
2328
"@halo-dev/console-shared": "^2.21.0",
2429
"axios": "^1.7.2",
2530
"canvas-confetti": "^1.9.3",
31+
"husky": "^9.1.7",
2632
"vue": "^3.5.17"
2733
},
2834
"devDependencies": {
@@ -50,7 +56,8 @@
5056
"typescript": "~5.9.2",
5157
"unplugin-icons": "^22.1.0",
5258
"vitest": "^3.2.4",
53-
"vue-tsc": "^3.0.7"
59+
"vue-tsc": "^3.0.7",
60+
"husky": "^8.0.0"
5461
},
5562
"packageManager": "pnpm@9.15.9"
5663
}

ui/pnpm-lock.yaml

Lines changed: 11 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/index.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,6 @@
11
import { definePlugin } from '@halo-dev/console-shared'
2-
import HomeView from './views/HomeView.vue'
3-
import { IconPlug } from '@halo-dev/components'
4-
import { markRaw } from 'vue'
52

63
export default definePlugin({
74
components: {},
8-
routes: [
9-
{
10-
parentName: 'Root',
11-
route: {
12-
path: '/example',
13-
name: 'Example',
14-
component: HomeView,
15-
meta: {
16-
title: '示例页面',
17-
searchable: true,
18-
menu: {
19-
name: '示例页面',
20-
group: '示例分组',
21-
icon: markRaw(IconPlug),
22-
priority: 0,
23-
},
24-
},
25-
},
26-
},
27-
],
285
extensionPoints: {},
296
})

0 commit comments

Comments
 (0)