refactor: 重构插件配置

This commit is contained in:
guqing
2022-06-22 00:05:54 +08:00
parent 0f4dce097e
commit 0d6bcddac8
10 changed files with 37 additions and 45 deletions

2
.gitignore vendored
View File

@@ -9,7 +9,7 @@ logs/
/out/
!gradle/wrapper/gradle-wrapper.jar
bin/
*.jar
### STS ###
.apt_generated
.classpath

View File

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

View File

@@ -19,7 +19,7 @@ export default defineConfig({
entry: "src/index.ts",
name: "PluginTemplate",
formats: ["iife"],
fileName: () => "halo-plugin-template.js",
fileName: () => "main.js",
},
rollupOptions: {
external: ["vue", "@halo-dev/shared", "@halo-dev/components"],

View File

@@ -29,6 +29,7 @@ jar {
}
dependencies {
compileOnly files("lib/halo-2.0.0-SNAPSHOT-plain.jar")
implementation 'io.github.guqing:pluggable-suite:0.0.1-SNAPSHOT'
compileOnly 'org.springframework.boot:spring-boot-starter-webflux'
annotationProcessor 'io.github.guqing:pluggable-suite:0.0.1-SNAPSHOT'

View File

@@ -4,13 +4,15 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import run.halo.app.plugin.ApiVersion;
/**
* @author guqing
* @since 2.0.0
*/
@ApiVersion("v1alpha1")
@RestController
@RequestMapping("/apis/apples.guqing.github.com/v1alpha1/apples")
@RequestMapping("apples")
public class ApplesController {
@GetMapping

View File

@@ -4,13 +4,15 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import run.halo.app.plugin.ApiVersion;
/**
* @author guqing
* @since 2.0.0
*/
@ApiVersion("v1alpha1")
@RestController
@RequestMapping("/apis/template.guqing.github.com/v1alpha1/posts")
@RequestMapping("posts")
public class PostController {
private final PostService postService;

View File

@@ -8,6 +8,3 @@ rules:
- path: /static/**
file:
directory: static
- path: /admin/**
file:
directory: admin

View File

@@ -1,13 +0,0 @@
apiVersion: v1alpha1
kind: Role
metadata:
name: role-template-view-apples
labels:
halo.run/role-template: "true"
annotations:
halo.run/module: "Apples Management"
halo.run/alias-name: "Apples View"
rules:
- apiGroups: [ "apples.guqing.github.com" ]
resources: [ "apples" ]
verbs: [ "get", "list" ]

View File

@@ -4,6 +4,7 @@ metadata:
# The name defines how the plugin is invoked,A unique name
name: io.github.guqing.apples
spec:
enabled: true
# 'version' is a valid semantic version string (see semver.org).
version: 0.0.1
requires: "*"
@@ -15,3 +16,4 @@ spec:
displayName: "测试插件"
description: "这是一个用来测试的插件"
license: MIT