From 85df1899a6c66e6809d20ffac2e62c8371aaa669 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 22 Sep 2023 16:58:23 +0800 Subject: [PATCH 1/2] chore: update project infra Signed-off-by: Ryan Wang --- .github/workflows/workflow.yaml | 16 +- build.gradle | 15 +- package.json | 13 +- packages/comment-widget/package.json | 12 +- packages/comment-widget/src/styles/dark.css | 2 +- packages/comment-widget/tsconfig.app.json | 4 +- packages/comment-widget/tsconfig.config.json | 8 - packages/comment-widget/tsconfig.json | 2 +- packages/comment-widget/tsconfig.node.json | 10 + packages/example/package.json | 2 - packages/example/src/App.vue | 1 + packages/example/tsconfig.app.json | 18 +- packages/example/tsconfig.config.json | 13 - packages/example/tsconfig.json | 2 +- packages/example/tsconfig.node.json | 9 + packages/widget/package.json | 4 +- packages/widget/tsconfig.app.json | 17 +- packages/widget/tsconfig.vite-config.json | 12 +- pnpm-lock.yaml | 338 +++++++++--------- .../resources/static/comment-widget.iife.js | 26 +- src/main/resources/static/style.css | 2 +- 21 files changed, 247 insertions(+), 279 deletions(-) delete mode 100644 packages/comment-widget/tsconfig.config.json create mode 100644 packages/comment-widget/tsconfig.node.json delete mode 100644 packages/example/tsconfig.config.json create mode 100644 packages/example/tsconfig.node.json diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 973a1db..87363ff 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -2,10 +2,20 @@ name: Build Plugin JAR File on: push: - branches: [ main ] + branches: + - main + paths: + - "**" + - "!**.md" release: types: - created + pull_request: + branches: + - main + paths: + - "**" + - "!**.md" jobs: build: @@ -23,12 +33,12 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - uses: pnpm/action-setup@v2.0.1 name: Install pnpm id: pnpm-install with: - version: 7 + version: 8 run_install: false - name: Get pnpm store directory id: pnpm-cache diff --git a/build.gradle b/build.gradle index a582081..211155b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java' id "io.freefair.lombok" version "8.0.1" - id "com.github.node-gradle.node" version "3.3.0" - id "run.halo.plugin.devtools" version "0.0.4" + id "com.github.node-gradle.node" version "5.0.0" + id "run.halo.plugin.devtools" version "0.0.6" } group 'run.halo.comment.widget' @@ -16,7 +16,7 @@ repositories { } dependencies { - implementation platform('run.halo.tools.platform:plugin:2.5.0-SNAPSHOT') + implementation platform('run.halo.tools.platform:plugin:2.9.0-SNAPSHOT') compileOnly 'run.halo.app:api' testImplementation 'run.halo.app:api' @@ -31,18 +31,11 @@ node { nodeProjectDir = file("${project.projectDir}") } -task buildFrontend(type: NpxTask) { - command = 'pnpm@7' +task buildFrontend(type: PnpmTask) { args = ['build:packages'] } -task pnpmInstall(type: NpxTask) { - command = "pnpm@7" - args = ["install"] -} - build { // build frontend before build tasks.getByName('compileJava').dependsOn('buildFrontend') - tasks.getByName("buildFrontend").dependsOn("pnpmInstall") } diff --git a/package.json b/package.json index aa7af2a..32353df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,4 @@ { - "name": "@halo-dev/plugin-comment-widget", - "private": true, "scripts": { "build:packages": "pnpm --filter \"./packages/**\" build", "example:dev": "pnpm --filter \"./packages/example\" dev", @@ -23,7 +21,9 @@ "axios": "^0.27.2", "pinia": "^2.1.3", "vue": "^3.3.4", - "vue-router": "^4.2.2" + "vue-router": "^4.2.2", + "@vueuse/components": "^10.3.0", + "@vueuse/core": "^10.3.0" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.0", @@ -34,16 +34,17 @@ "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", "@vue/test-utils": "^2.3.2", - "@vue/tsconfig": "^0.1.3", + "@vue/tsconfig": "^0.4.0", + "@tsconfig/node18": "^18.2.2", "eslint": "^8.42.0", "eslint-plugin-vue": "^9.14.1", "jsdom": "^19.0.0", "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "rollup-plugin-copy-merge": "^1.0.2", - "typescript": "~4.7.4", + "typescript": "~5.2.0", "vite": "^4.3.9", "vitest": "^0.28.5", - "vue-tsc": "^1.6.5" + "vue-tsc": "^1.8.13" } } diff --git a/packages/comment-widget/package.json b/packages/comment-widget/package.json index f2a8622..dc6a752 100644 --- a/packages/comment-widget/package.json +++ b/packages/comment-widget/package.json @@ -31,19 +31,17 @@ "./dist/style.css": "./dist/style.css" }, "dependencies": { - "@halo-dev/api-client": "^2.6.0", + "@halo-dev/api-client": "^2.9.0", "@halo-dev/components": "^1.5.0", - "@vueuse/components": "8.9.4", - "@vueuse/core": "8.9.4", "autosize": "^6.0.1", - "dayjs": "^1.11.8", - "emoji-mart-vue-fast": "^12.0.4", + "dayjs": "^1.11.10", + "emoji-mart-vue-fast": "^12.0.5", "javascript-time-ago": "^2.5.9", "lodash.clonedeep": "^4.5.0" }, "devDependencies": { "@iconify-json/mdi": "^1.1.52", - "@tailwindcss/forms": "^0.5.3", + "@tailwindcss/forms": "^0.5.6", "@types/lodash.clonedeep": "^4.5.7", "@types/qs": "^6.9.7", "@types/uuid": "^8.3.4", @@ -52,7 +50,7 @@ "prettier-plugin-tailwindcss": "^0.1.13", "release-it": "^15.11.0", "sass": "^1.62.1", - "tailwindcss": "^3.3.2", + "tailwindcss": "^3.3.3", "tailwindcss-themer": "^2.0.3", "unplugin-icons": "^0.14.15", "vue-typegen": "^0.2.0" diff --git a/packages/comment-widget/src/styles/dark.css b/packages/comment-widget/src/styles/dark.css index 2e76090..9f05f87 100644 --- a/packages/comment-widget/src/styles/dark.css +++ b/packages/comment-widget/src/styles/dark.css @@ -15,5 +15,5 @@ } .btn-secondary { - @apply dark:border-slate-600 dark:border-solid dark:border dark:bg-slate-900 dark:text-slate-50 dark:hover:text-white dark:hover:bg-slate-800; + @apply dark:border dark:border-solid dark:border-slate-600 dark:bg-slate-900 dark:text-slate-50 dark:hover:bg-slate-800 dark:hover:text-white; } diff --git a/packages/comment-widget/tsconfig.app.json b/packages/comment-widget/tsconfig.app.json index f8ced31..39b57d1 100644 --- a/packages/comment-widget/tsconfig.app.json +++ b/packages/comment-widget/tsconfig.app.json @@ -1,14 +1,14 @@ { - "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, - "lib": ["esnext"], "baseUrl": ".", "paths": { "@/*": ["./src/*"] }, + "ignoreDeprecations": "5.0", "types": ["unplugin-icons/types/vue"] } } diff --git a/packages/comment-widget/tsconfig.config.json b/packages/comment-widget/tsconfig.config.json deleted file mode 100644 index c2d3a30..0000000 --- a/packages/comment-widget/tsconfig.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "@vue/tsconfig/tsconfig.node.json", - "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"], - "compilerOptions": { - "composite": true, - "types": ["node"] - } -} diff --git a/packages/comment-widget/tsconfig.json b/packages/comment-widget/tsconfig.json index 31f9003..100cf6a 100644 --- a/packages/comment-widget/tsconfig.json +++ b/packages/comment-widget/tsconfig.json @@ -2,7 +2,7 @@ "files": [], "references": [ { - "path": "./tsconfig.config.json" + "path": "./tsconfig.node.json" }, { "path": "./tsconfig.app.json" diff --git a/packages/comment-widget/tsconfig.node.json b/packages/comment-widget/tsconfig.node.json new file mode 100644 index 0000000..502f83b --- /dev/null +++ b/packages/comment-widget/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"], + "compilerOptions": { + "composite": true, + "module": "ESNext", + "types": ["node"], + "moduleResolution": "Bundler" + } +} diff --git a/packages/example/package.json b/packages/example/package.json index 269bf1d..ceed417 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,4 @@ { - "version": "0.0.0", - "private": true, "scripts": { "dev": "vite", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", diff --git a/packages/example/src/App.vue b/packages/example/src/App.vue index c6929dd..135131c 100644 --- a/packages/example/src/App.vue +++ b/packages/example/src/App.vue @@ -1,4 +1,5 @@