chore: update infrastructure for UI (#39)

更新 UI 部分的基础设施。

1. 更新所有的依赖为最新版本。
2. 添加 `@halo-dev/api-client` 和 `axios` 依赖。
3. pnpm 要求提升至 9。
4. 更新 Node 的 Gradle 插件。

```release-note
None
```
This commit is contained in:
Ryan Wang
2024-07-02 13:41:22 +08:00
committed by GitHub
parent dad7849964
commit b302131c52
13 changed files with 2805 additions and 3390 deletions

View File

@@ -9,8 +9,8 @@ Halo 2.0 插件开发快速开始模板。
所需环境:
1. Java 17
2. Node 18
3. pnpm 8
2. Node 20
3. pnpm 9
4. Docker (可选)
克隆项目:

View File

@@ -1,6 +1,6 @@
plugins {
id 'java'
id "com.github.node-gradle.node" version "5.0.0"
id "com.github.node-gradle.node" version "7.0.2"
id "io.freefair.lombok" version "8.0.1"
id "run.halo.plugin.devtools" version "0.0.9"
}
@@ -52,5 +52,5 @@ build {
}
halo {
version = '2.11'
version = '2.17'
}

View File

@@ -9,6 +9,9 @@ module.exports = {
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier",
],
parserOptions: {
ecmaVersion: "latest",
},
env: {
"vue/setup-compiler-macros": true,
},

6
ui/env.d.ts vendored
View File

@@ -1,6 +1,2 @@
/// <reference types="vite/client" />
declare module "*.vue" {
import Vue from "vue";
export default Vue;
}
/// <reference types="unplugin-icons/types/vue" />

View File

@@ -1,41 +1,44 @@
{
"scripts": {
"dev": "vite build --watch --mode=development",
"build": "vite build",
"preview": "vite preview --port 4173",
"test:unit": "vitest --environment jsdom",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
"build": "run-p type-check \"build-only {@}\" --",
"build-only": "vite build",
"test:unit": "vitest",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"prettier": "prettier --write src/"
},
"dependencies": {
"@halo-dev/components": "^2.12.0",
"@halo-dev/console-shared": "^2.12.0",
"canvas-confetti": "^1.9.2",
"vue": "^3.3.12"
"@halo-dev/api-client": "^2.17.0",
"@halo-dev/components": "^2.17.0",
"@halo-dev/console-shared": "^2.17.0",
"axios": "^1.7.2",
"canvas-confetti": "^1.9.3",
"vue": "^3.4.31"
},
"devDependencies": {
"@halo-dev/ui-plugin-bundler-kit": "^2.12.0",
"@iconify/json": "^2.2.159",
"@rushstack/eslint-patch": "^1.6.1",
"@halo-dev/ui-plugin-bundler-kit": "^2.17.0",
"@iconify/json": "^2.2.224",
"@rushstack/eslint-patch": "^1.10.3",
"@tsconfig/node20": "^20.1.4",
"@types/canvas-confetti": "^1.6.4",
"@types/jsdom": "^20.0.1",
"@types/node": "^16.18.68",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.1",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.4.3",
"@vue/tsconfig": "^0.1.3",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.19.2",
"jsdom": "^19.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"sass": "^1.69.5",
"typescript": "~4.7.4",
"unplugin-icons": "^0.15.3",
"vite": "^4.5.1",
"vitest": "^0.24.5",
"vue-tsc": "^1.8.25"
"@types/jsdom": "^21.1.7",
"@types/node": "^20.14.9",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.26.0",
"jsdom": "^24.1.0",
"npm-run-all2": "^6.2.0",
"prettier": "^3.3.2",
"sass": "^1.77.6",
"typescript": "~5.5.3",
"unplugin-icons": "^0.19.0",
"vite": "^5.3.2",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.24"
}
}

6062
ui/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,7 @@ onMounted(() => {
</span>
</a>
<a
href="https://docs.halo.run/developer-guide/plugin/structure"
href="https://docs.halo.run/category/%E5%9F%BA%E7%A1%80"
class="docs__box"
target="_blank"
>
@@ -60,7 +60,7 @@ onMounted(() => {
</span>
</a>
<a
href="https://docs.halo.run/developer-guide/plugin/api-reference/extension"
href="https://docs.halo.run/category/api-%E5%8F%82%E8%80%83"
class="docs__box"
target="_blank"
>
@@ -119,7 +119,10 @@ onMounted(() => {
drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
&:hover {
box-shadow: 0 0 0 0px #fff, 0 0 0 1px rgb(59 130 246 / 0.5), 0 0 #0000;
box-shadow:
0 0 0 0px #fff,
0 0 0 1px rgb(59 130 246 / 0.5),
0 0 #0000;
}
.docs__box-title {

View File

@@ -1,9 +1,10 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["./env.d.ts", "./src/**/*", "./src/**/*.vue"],
"exclude": ["./src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]

View File

@@ -1,8 +0,0 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
"compilerOptions": {
"composite": true,
"types": ["node"]
}
}

View File

@@ -2,7 +2,7 @@
"files": [],
"references": [
{
"path": "./tsconfig.config.json"
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"

13
ui/tsconfig.node.json Normal file
View File

@@ -0,0 +1,13 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": ["vite.config.*", "vitest.config.*"],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
}
}

View File

@@ -3,6 +3,8 @@
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
"lib": [],
"types": ["node", "jsdom"]
}

View File

@@ -1,18 +1,12 @@
import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
import Vue from "@vitejs/plugin-vue";
import VueJsx from "@vitejs/plugin-vue-jsx";
import Icons from "unplugin-icons/vite";
import { HaloUIPluginBundlerKit } from "@halo-dev/ui-plugin-bundler-kit";
import Vue from "@vitejs/plugin-vue";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
Vue(),
VueJsx(),
Icons({ compiler: "vue3" }),
HaloUIPluginBundlerKit(),
],
plugins: [Vue(), Icons({ compiler: "vue3" }), HaloUIPluginBundlerKit()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),