From 0b956de18de61e68a0f98380bfca1cc22076a533 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Mon, 9 Jan 2023 01:53:35 +0800 Subject: [PATCH] refactor: using unocss and update dependencies --- .eslintignore | 1 + .npmrc | 2 +- .vscode/extensions.json | 9 +- .vscode/settings.json | 10 +- LICENSE | 2 +- README.md | 126 +- package.json | 71 +- pnpm-lock.yaml | 7396 ------------------ scripts/client.ts | 34 +- scripts/manifest.ts | 2 +- scripts/utils.ts | 1 - shim.d.ts | 2 +- src/assets/icon.svg | 3 + src/background/contentScriptHMR.ts | 21 - src/background/index.ts | 3 - src/components/SearchBar/SearchBar.vue | 6 +- src/components/Topbar/Topbar.vue | 19 +- src/components/Topbar/TopbarUserPanelPop.vue | 60 +- src/composables/useStorageLocal.ts | 10 +- src/contentScripts/index.ts | 11 +- src/contentScripts/views/App.vue | 42 +- src/contentScripts/views/Home/Home.vue | 14 +- src/manifest.ts | 28 +- src/options/Options.vue | 8 +- src/options/main.ts | 4 - src/popup/Popup.vue | 29 +- src/styles/index.ts | 5 +- src/tests/demo.spec.ts | 7 + src/utils/i18n.ts | 2 +- tsconfig.json | 7 +- tsup.config.ts | 4 +- unocss.config.ts | 13 + vite-mv3-hmr.ts | 23 +- vite.config.content.ts | 16 - vite.config.ts | 44 +- volar.config.js | 5 - windi.config.ts | 14 - 37 files changed, 359 insertions(+), 7695 deletions(-) delete mode 100644 pnpm-lock.yaml create mode 100644 src/assets/icon.svg delete mode 100644 src/background/contentScriptHMR.ts create mode 100644 src/tests/demo.spec.ts create mode 100644 unocss.config.ts delete mode 100644 volar.config.js delete mode 100644 windi.config.ts diff --git a/.eslintignore b/.eslintignore index e6a82761..a8db16f4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ dist node_modules public +extension diff --git a/.npmrc b/.npmrc index cf040424..009aa06d 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ shamefully-hoist=true -strict-peer-dependencies=false +auto-install-peers=true diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 320368c2..99211535 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,12 @@ { "recommendations": [ - "johnsoncodehk.volar", + "vue.volar", "antfu.iconify", + "antfu.vite", "dbaeumer.vscode-eslint", - "voorjaar.windicss-intellisense", - "csstools.postcss" + "antfu.unocss", + "csstools.postcss", + "lokalise.i18n-ally", + "streetsidesoftware.code-spell-checker" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index e7108c3f..2f07bf4d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,14 +1,14 @@ { "cSpell.words": ["Vitesse"], "typescript.tsdk": "node_modules/typescript/lib", - "volar.tsPlugin": true, - "volar.tsPluginStatus": false, "vite.autoStart": false, "editor.codeActionsOnSave": { - - "source.fixAll.eslint": true, + "source.fixAll.eslint": true }, "files.associations": { - "*.css": "postcss", + "*.css": "postcss" }, + "i18n-ally.localesPaths": [ + "_locales" + ] } diff --git a/LICENSE b/LICENSE index 0f637cef..9b031a21 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Hakadao +Copyright (c) 2021 Anthony Fu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7161d185..90424817 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,96 @@ -

-
-

+# WebExtension Vite Starter -

BewlyBewly

- -

Bringing you the suggested videos on the bilibili homepage, clean and simple.

- -
- 開發中, 佛系更新 = = +A [Vite](https://vitejs.dev/) powered WebExtension ([Chrome](https://developer.chrome.com/docs/extensions/reference/), [FireFox](https://addons.mozilla.org/en-US/developers/), etc.) starter template.

-
+Popup
+
+Options Page
+
+Inject Vue App into the Content Script
+

-## ⬇️ Installation +## Features -### Firefox +- ⚡️ **Instant HMR** - use **Vite** on dev (no more refresh!) +- 🥝 Vue 3 - Composition API, [`