This commit is contained in:
guqing
2022-07-05 16:12:04 +08:00
7 changed files with 60 additions and 43 deletions

View File

@@ -274,7 +274,7 @@ pnpm run build
#### 构建后端 #### 构建后端
1. 开发时可以使用 `command + F9/ctrl + F9` 1. 开发时可以使用 `command + F9 / ctrl + F9`
2. 生产时:点击 `gradle``build` 2. 生产时:点击 `gradle``build`
@@ -284,4 +284,4 @@ pnpm run build
./gradlew -x build ./gradlew -x build
``` ```
然后只需复制例如`build/libs/halo-plugin-template-1.0-SNAPSHOT-plain.jar``jar` 包即可使用 然后只需复制例如`build/libs/halo-plugin-template-0.0.1-SNAPSHOT-plain.jar``jar` 包即可使用

View File

@@ -10,8 +10,8 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
}, },
"dependencies": { "dependencies": {
"@halo-dev/admin-shared": "link:/Users/ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/shared", "@halo-dev/admin-shared": "link:/Users/ryanwang/Workspace/github/halo-dev/halo-admin-next/packages/shared",
"@halo-dev/components": "link:/Users/ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/components", "@halo-dev/components": "link:/Users/ryanwang/Workspace/github/halo-dev/halo-admin-next/packages/components",
"vue": "^3.2.36" "vue": "^3.2.36"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1,8 +1,8 @@
lockfileVersion: 5.3 lockfileVersion: 5.4
specifiers: specifiers:
'@halo-dev/admin-shared': link:/Users/ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/shared '@halo-dev/admin-shared': link:/Users/ryanwang/Workspace/github/halo-dev/halo-admin-next/packages/shared
'@halo-dev/components': link:/Users/ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/components '@halo-dev/components': link:/Users/ryanwang/Workspace/github/halo-dev/halo-admin-next/packages/components
'@rushstack/eslint-patch': ^1.1.0 '@rushstack/eslint-patch': ^1.1.0
'@types/jsdom': ^16.2.14 '@types/jsdom': ^16.2.14
'@types/node': ^16.11.36 '@types/node': ^16.11.36
@@ -24,8 +24,8 @@ specifiers:
vue-tsc: ^0.35.2 vue-tsc: ^0.35.2
dependencies: dependencies:
'@halo-dev/admin-shared': link:../../../../../ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/shared '@halo-dev/admin-shared': link:../../../halo-dev/halo-admin-next/packages/shared
'@halo-dev/components': link:../../../../../ryanwang/Workspace/github/ruibaby/halo-admin-next/packages/components '@halo-dev/components': link:../../../halo-dev/halo-admin-next/packages/components
vue: 3.2.37 vue: 3.2.37
devDependencies: devDependencies:
@@ -34,8 +34,8 @@ devDependencies:
'@types/node': 16.11.38 '@types/node': 16.11.38
'@vitejs/plugin-vue': 2.3.3_vite@2.9.10+vue@3.2.37 '@vitejs/plugin-vue': 2.3.3_vite@2.9.10+vue@3.2.37
'@vitejs/plugin-vue-jsx': 1.3.10 '@vitejs/plugin-vue-jsx': 1.3.10
'@vue/eslint-config-prettier': 7.0.0_eslint@8.17.0+prettier@2.6.2 '@vue/eslint-config-prettier': 7.0.0_ddjd75dz7x3czaucyvuaamiqdi
'@vue/eslint-config-typescript': 10.0.0_77f16daacf2783bf5a1937336883d0a6 '@vue/eslint-config-typescript': 10.0.0_o7yw3kwpe6b36wqzg4zwra6quy
'@vue/test-utils': 2.0.0_vue@3.2.37 '@vue/test-utils': 2.0.0_vue@3.2.37
'@vue/tsconfig': 0.1.3_@types+node@16.11.38 '@vue/tsconfig': 0.1.3_@types+node@16.11.38
eslint: 8.17.0 eslint: 8.17.0
@@ -484,7 +484,7 @@ packages:
resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==}
dev: true dev: true
/@typescript-eslint/eslint-plugin/5.27.1_043f48e0ee10c350c28cdede89899bc7: /@typescript-eslint/eslint-plugin/5.27.1_aq7uryhocdbvbqum33pitcm3y4:
resolution: {integrity: sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==} resolution: {integrity: sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
@@ -495,10 +495,10 @@ packages:
typescript: typescript:
optional: true optional: true
dependencies: dependencies:
'@typescript-eslint/parser': 5.27.1_eslint@8.17.0+typescript@4.7.3 '@typescript-eslint/parser': 5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4
'@typescript-eslint/scope-manager': 5.27.1 '@typescript-eslint/scope-manager': 5.27.1
'@typescript-eslint/type-utils': 5.27.1_eslint@8.17.0+typescript@4.7.3 '@typescript-eslint/type-utils': 5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4
'@typescript-eslint/utils': 5.27.1_eslint@8.17.0+typescript@4.7.3 '@typescript-eslint/utils': 5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4
debug: 4.3.4 debug: 4.3.4
eslint: 8.17.0 eslint: 8.17.0
functional-red-black-tree: 1.0.1 functional-red-black-tree: 1.0.1
@@ -511,7 +511,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/parser/5.27.1_eslint@8.17.0+typescript@4.7.3: /@typescript-eslint/parser/5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4:
resolution: {integrity: sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==} resolution: {integrity: sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
@@ -539,7 +539,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.27.1 '@typescript-eslint/visitor-keys': 5.27.1
dev: true dev: true
/@typescript-eslint/type-utils/5.27.1_eslint@8.17.0+typescript@4.7.3: /@typescript-eslint/type-utils/5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4:
resolution: {integrity: sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==} resolution: {integrity: sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
@@ -549,7 +549,7 @@ packages:
typescript: typescript:
optional: true optional: true
dependencies: dependencies:
'@typescript-eslint/utils': 5.27.1_eslint@8.17.0+typescript@4.7.3 '@typescript-eslint/utils': 5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4
debug: 4.3.4 debug: 4.3.4
eslint: 8.17.0 eslint: 8.17.0
tsutils: 3.21.0_typescript@4.7.3 tsutils: 3.21.0_typescript@4.7.3
@@ -584,7 +584,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/utils/5.27.1_eslint@8.17.0+typescript@4.7.3: /@typescript-eslint/utils/5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4:
resolution: {integrity: sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==} resolution: {integrity: sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
@@ -720,7 +720,7 @@ packages:
'@vue/compiler-dom': 3.2.37 '@vue/compiler-dom': 3.2.37
'@vue/shared': 3.2.37 '@vue/shared': 3.2.37
/@vue/eslint-config-prettier/7.0.0_eslint@8.17.0+prettier@2.6.2: /@vue/eslint-config-prettier/7.0.0_ddjd75dz7x3czaucyvuaamiqdi:
resolution: {integrity: sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==} resolution: {integrity: sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==}
peerDependencies: peerDependencies:
eslint: '>= 7.28.0' eslint: '>= 7.28.0'
@@ -728,25 +728,29 @@ packages:
dependencies: dependencies:
eslint: 8.17.0 eslint: 8.17.0
eslint-config-prettier: 8.5.0_eslint@8.17.0 eslint-config-prettier: 8.5.0_eslint@8.17.0
eslint-plugin-prettier: 4.0.0_a088652d234d3f0e6595b5f3073e25de eslint-plugin-prettier: 4.0.0_ucegkljdju7q4zmvwxzqoprf3y
prettier: 2.6.2 prettier: 2.6.2
dev: true dev: true
/@vue/eslint-config-typescript/10.0.0_77f16daacf2783bf5a1937336883d0a6: /@vue/eslint-config-typescript/10.0.0_o7yw3kwpe6b36wqzg4zwra6quy:
resolution: {integrity: sha512-F94cL8ug3FaYXlCfU5/wiGjk1qeadmoBpRGAOBq+qre3Smdupa59dd6ZJrsfRODpsMPyTG7330juMDsUvpZ3Rw==} resolution: {integrity: sha512-F94cL8ug3FaYXlCfU5/wiGjk1qeadmoBpRGAOBq+qre3Smdupa59dd6ZJrsfRODpsMPyTG7330juMDsUvpZ3Rw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
eslint-plugin-vue: ^8.0.1 eslint-plugin-vue: ^8.0.1
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies: dependencies:
'@typescript-eslint/eslint-plugin': 5.27.1_043f48e0ee10c350c28cdede89899bc7 '@typescript-eslint/eslint-plugin': 5.27.1_aq7uryhocdbvbqum33pitcm3y4
'@typescript-eslint/parser': 5.27.1_eslint@8.17.0+typescript@4.7.3 '@typescript-eslint/parser': 5.27.1_ud6rd4xtew5bv4yhvkvu24pzm4
eslint: 8.17.0 eslint: 8.17.0
eslint-plugin-vue: 8.7.1_eslint@8.17.0 eslint-plugin-vue: 8.7.1_eslint@8.17.0
typescript: 4.7.3
vue-eslint-parser: 8.3.0_eslint@8.17.0 vue-eslint-parser: 8.3.0_eslint@8.17.0
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
- typescript
dev: true dev: true
/@vue/reactivity-transform/3.2.37: /@vue/reactivity-transform/3.2.37:
@@ -768,7 +772,6 @@ packages:
dependencies: dependencies:
'@vue/reactivity': 3.2.37 '@vue/reactivity': 3.2.37
'@vue/shared': 3.2.37 '@vue/shared': 3.2.37
dev: false
/@vue/runtime-dom/3.2.37: /@vue/runtime-dom/3.2.37:
resolution: {integrity: sha512-HimKdh9BepShW6YozwRKAYjYQWg9mQn63RGEiSswMbW+ssIht1MILYlVGkAGGQbkhSh31PCdoUcfiu4apXJoPw==} resolution: {integrity: sha512-HimKdh9BepShW6YozwRKAYjYQWg9mQn63RGEiSswMbW+ssIht1MILYlVGkAGGQbkhSh31PCdoUcfiu4apXJoPw==}
@@ -776,7 +779,6 @@ packages:
'@vue/runtime-core': 3.2.37 '@vue/runtime-core': 3.2.37
'@vue/shared': 3.2.37 '@vue/shared': 3.2.37
csstype: 2.6.20 csstype: 2.6.20
dev: false
/@vue/server-renderer/3.2.37_vue@3.2.37: /@vue/server-renderer/3.2.37_vue@3.2.37:
resolution: {integrity: sha512-kLITEJvaYgZQ2h47hIzPh2K3jG8c1zCVbp/o/bzQOyvzaKiCquKS7AaioPI28GNxIsE/zSx+EwWYsNxDCX95MA==} resolution: {integrity: sha512-kLITEJvaYgZQ2h47hIzPh2K3jG8c1zCVbp/o/bzQOyvzaKiCquKS7AaioPI28GNxIsE/zSx+EwWYsNxDCX95MA==}
@@ -786,7 +788,6 @@ packages:
'@vue/compiler-ssr': 3.2.37 '@vue/compiler-ssr': 3.2.37
'@vue/shared': 3.2.37 '@vue/shared': 3.2.37
vue: 3.2.37 vue: 3.2.37
dev: false
/@vue/shared/3.2.37: /@vue/shared/3.2.37:
resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==} resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==}
@@ -1074,7 +1075,6 @@ packages:
/csstype/2.6.20: /csstype/2.6.20:
resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==} resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==}
dev: false
/data-urls/3.0.2: /data-urls/3.0.2:
resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==}
@@ -1439,7 +1439,7 @@ packages:
eslint: 8.17.0 eslint: 8.17.0
dev: true dev: true
/eslint-plugin-prettier/4.0.0_a088652d234d3f0e6595b5f3073e25de: /eslint-plugin-prettier/4.0.0_ucegkljdju7q4zmvwxzqoprf3y:
resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==} resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
peerDependencies: peerDependencies:
@@ -2866,7 +2866,6 @@ packages:
'@vue/runtime-dom': 3.2.37 '@vue/runtime-dom': 3.2.37
'@vue/server-renderer': 3.2.37_vue@3.2.37 '@vue/server-renderer': 3.2.37_vue@3.2.37
'@vue/shared': 3.2.37 '@vue/shared': 3.2.37
dev: false
/w3c-hr-time/1.0.2: /w3c-hr-time/1.0.2:
resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==}

View File

@@ -1,12 +1,11 @@
import type { Plugin } from "@halo-dev/admin-shared/src/types"; import { definePlugin } from "@halo-dev/admin-shared";
import DefaultView from "./views/DefaultView.vue"; import DefaultView from "./views/DefaultView.vue";
import { IconGrid } from "@halo-dev/components"; import { IconGrid } from "@halo-dev/components";
import "./styles/index.css"; import "./styles/index.css";
const plugin: Plugin = { export default definePlugin({
name: "PluginTemplate", name: "PluginTemplate",
components: [], components: [],
extensionPoints: {},
routes: [ routes: [
{ {
path: "/hello-world", path: "/hello-world",
@@ -26,11 +25,11 @@ const plugin: Plugin = {
], ],
}, },
], ],
extensionPoints: {},
activated() { activated() {
// TODO // TODO
}, },
deactivated() { deactivated() {
// TODO // TODO
}, },
}; });
export default plugin;

View File

@@ -1,6 +1,6 @@
import {fileURLToPath, URL} from "url"; import { fileURLToPath, URL } from "url";
import {defineConfig} from "vite"; import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue"; import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx"; import vueJsx from "@vitejs/plugin-vue-jsx";
@@ -13,7 +13,9 @@ export default defineConfig({
}, },
}, },
build: { build: {
outDir: fileURLToPath(new URL("../src/main/resources/admin", import.meta.url)), outDir: fileURLToPath(
new URL("../src/main/resources/admin", import.meta.url)
),
emptyOutDir: true, emptyOutDir: true,
lib: { lib: {
entry: "src/index.ts", entry: "src/index.ts",
@@ -26,7 +28,8 @@ export default defineConfig({
output: { output: {
globals: { globals: {
vue: "Vue", vue: "Vue",
"@halo-dev/components": "components", "@halo-dev/components": "HaloComponents",
"@halo-dev/admin-shared": "HaloAdminShared",
}, },
}, },
}, },

View File

@@ -1,6 +1,7 @@
plugins { plugins {
id 'org.springframework.boot' version '3.0.0-M3' id 'org.springframework.boot' version '3.0.0-M3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "com.github.node-gradle.node" version "3.3.0"
id 'java' id 'java'
} }
@@ -49,3 +50,17 @@ dependencies {
test { test {
useJUnitPlatform() useJUnitPlatform()
} }
node {
nodeProjectDir = file("${project.projectDir}/admin-frontend")
}
task buildFrontend(type: NpxTask) {
command = 'pnpm'
args = ['build']
}
build {
// build frontend before build
tasks.getByName('compileJava').dependsOn('buildFrontend')
}

File diff suppressed because one or more lines are too long