From e8d29a0bff2916b9cb3037e3bff99c9c99fa7345 Mon Sep 17 00:00:00 2001 From: zhixin Date: Sun, 14 Jul 2024 20:31:03 +0800 Subject: [PATCH] Upgrade themes from vue2 to vue3 to fix the build themes error --- .github/workflows/deploy.yml | 10 +- site/_themes/{.eslintrc.js => .eslintrc.cjs} | 0 site/_themes/babel.config.js | 5 - site/_themes/{public => }/index.html | 32 +- site/_themes/package.json | 25 +- site/_themes/public/themes.html | 1 - site/_themes/src/App.vue | 313 ++++--- site/_themes/src/components/Categories.vue | 107 ++- site/_themes/src/components/List.vue | 806 +++++++++---------- site/_themes/src/main.js | 10 +- site/_themes/themes.html | 3 + site/_themes/vite.config.js | 33 + site/_themes/vue.config.js | 30 - 13 files changed, 669 insertions(+), 706 deletions(-) rename site/_themes/{.eslintrc.js => .eslintrc.cjs} (100%) delete mode 100644 site/_themes/babel.config.js rename site/_themes/{public => }/index.html (55%) delete mode 100644 site/_themes/public/themes.html create mode 100644 site/_themes/themes.html create mode 100644 site/_themes/vite.config.js delete mode 100644 site/_themes/vue.config.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9979d20862..8ce98c3457 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,13 +21,9 @@ jobs: cd ${{ github.workspace }}/site/_themes yarn install --frozen-lockfile yarn build - mv dist/js ../assets/js/themes - cd ../assets/js/themes - FILE=../../../_includes/themes.html - echo "" > $FILE - for f in *.js; do - echo "" >> $FILE - done + rm -rf ../assets/js/themes + mv dist/themes.html ../_includes/themes.html + mv dist ../assets/js/themes - uses: ruby/setup-ruby@v1 with: diff --git a/site/_themes/.eslintrc.js b/site/_themes/.eslintrc.cjs similarity index 100% rename from site/_themes/.eslintrc.js rename to site/_themes/.eslintrc.cjs diff --git a/site/_themes/babel.config.js b/site/_themes/babel.config.js deleted file mode 100644 index e9558405fd..0000000000 --- a/site/_themes/babel.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} diff --git a/site/_themes/public/index.html b/site/_themes/index.html similarity index 55% rename from site/_themes/public/index.html rename to site/_themes/index.html index e6ed50ce55..9bcb947a09 100644 --- a/site/_themes/public/index.html +++ b/site/_themes/index.html @@ -4,9 +4,9 @@ - Themes + @@ -16,11 +16,11 @@