From ca0605a0b262f068465e0038e66f60f126416fa4 Mon Sep 17 00:00:00 2001 From: Thehrz Date: Tue, 7 Feb 2023 21:58:18 +0800 Subject: [PATCH] Tidy up project --- .vscode/settings.json | 2 +- locales/README.md | 7 ----- locales/ar.yml | 14 --------- locales/de.yml | 14 --------- locales/es.yml | 14 --------- locales/fr.yml | 14 --------- locales/id.yml | 14 --------- locales/it.yml | 13 -------- locales/ja.yml | 13 -------- locales/ka.yml | 14 --------- locales/ko.yml | 13 -------- locales/pl.yml | 14 --------- locales/pt-BR.yml | 14 --------- locales/ru.yml | 13 -------- locales/tr.yml | 14 --------- locales/uk.yml | 13 -------- locales/vi.yml | 13 -------- package.json | 1 - pnpm-lock.yaml | 21 +------------ src/App.vue | 4 +-- src/auto-imports.d.ts | 6 ++-- src/components/TheCounter.vue | 19 ------------ src/components/TheInput.vue | 20 ------------ src/layouts/default.vue | 5 +-- src/layouts/home.vue | 9 ------ src/modules/i18n.ts | 2 +- src/modules/pinia.ts | 17 ----------- src/pages/[...all].vue | 14 --------- src/pages/{index.vue => _index.vue} | 5 ++- src/pages/hi/[name].vue | 47 ----------------------------- src/pages/index.md | 7 +++++ src/stores/user.ts | 34 --------------------- vite.config.ts | 1 - 33 files changed, 19 insertions(+), 406 deletions(-) delete mode 100644 locales/README.md delete mode 100644 locales/ar.yml delete mode 100644 locales/de.yml delete mode 100644 locales/es.yml delete mode 100644 locales/fr.yml delete mode 100644 locales/id.yml delete mode 100644 locales/it.yml delete mode 100644 locales/ja.yml delete mode 100644 locales/ka.yml delete mode 100644 locales/ko.yml delete mode 100644 locales/pl.yml delete mode 100644 locales/pt-BR.yml delete mode 100644 locales/ru.yml delete mode 100644 locales/tr.yml delete mode 100644 locales/uk.yml delete mode 100644 locales/vi.yml delete mode 100644 src/components/TheCounter.vue delete mode 100644 src/components/TheInput.vue delete mode 100644 src/layouts/home.vue delete mode 100644 src/modules/pinia.ts delete mode 100755 src/pages/[...all].vue rename src/pages/{index.vue => _index.vue} (93%) delete mode 100644 src/pages/hi/[name].vue create mode 100644 src/pages/index.md delete mode 100644 src/stores/user.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 50bbaf7..e948343 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "cSpell.words": ["Vitesse", "Vite", "unocss", "vitest", "vueuse", "pinia", "demi", "antfu", "iconify", "intlify", "vitejs", "unplugin", "pnpm"], - "i18n-ally.sourceLanguage": "en", + "i18n-ally.sourceLanguage": "zh-CN", "i18n-ally.keystyle": "nested", "i18n-ally.localesPaths": "locales", "i18n-ally.sortKeys": true, diff --git a/locales/README.md b/locales/README.md deleted file mode 100644 index 4b24ec2..0000000 --- a/locales/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## i18n - -This directory is to serve your locale translation files. YAML under this folder would be loaded automatically and register with their filenames as locale code. - -Check out [`vue-i18n`](https://github.com/intlify/vue-i18n-next) for more details. - -If you are using VS Code, [`i18n Ally`](https://github.com/lokalise/i18n-ally) is recommended to make the i18n experience better. diff --git a/locales/ar.yml b/locales/ar.yml deleted file mode 100644 index 9c1bbb6..0000000 --- a/locales/ar.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: حول - back: رجوع - go: تجربة - home: الرئيسية - toggle_dark: التغيير إلى الوضع المظلم - toggle_langs: تغيير اللغة -intro: - desc: vite مثال لتطبيق - dynamic-route: عرض لتوجيهات ديناميكية - hi: مرحبا {name} - aka: معروف أيضا تحت مسمى - whats-your-name: ما إسمك؟ -not-found: صفحة غير موجودة diff --git a/locales/de.yml b/locales/de.yml deleted file mode 100644 index 621f6cb..0000000 --- a/locales/de.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: Über - back: Zurück - go: Los - home: Startseite - toggle_dark: Dunkelmodus umschalten - toggle_langs: Sprachen ändern -intro: - desc: Vite Startvorlage mit Vorlieben - dynamic-route: Demo einer dynamischen Route - hi: Hi, {name}! - aka: Auch bekannt als - whats-your-name: Wie heißt du? -not-found: Nicht gefunden diff --git a/locales/es.yml b/locales/es.yml deleted file mode 100644 index 4459643..0000000 --- a/locales/es.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: Acerca de - back: Atrás - go: Ir - home: Inicio - toggle_dark: Alternar modo oscuro - toggle_langs: Cambiar idiomas -intro: - desc: Plantilla de Inicio de Vite Dogmática - dynamic-route: Demo de ruta dinámica - hi: ¡Hola, {name}! - aka: También conocido como - whats-your-name: ¿Cómo te llamas? -not-found: No se ha encontrado diff --git a/locales/fr.yml b/locales/fr.yml deleted file mode 100644 index 7f93ce2..0000000 --- a/locales/fr.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: À propos - back: Retour - go: Essayer - home: Accueil - toggle_dark: Basculer en mode sombre - toggle_langs: Changer de langue -intro: - desc: Exemple d'application Vite - dynamic-route: Démo de route dynamique - hi: Salut, {name}! - aka: Aussi connu sous le nom de - whats-your-name: Comment t'appelles-tu ? -not-found: Page non trouvée diff --git a/locales/id.yml b/locales/id.yml deleted file mode 100644 index 738573f..0000000 --- a/locales/id.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: Tentang - back: Kembali - go: Pergi - home: Beranda - toggle_dark: Ubah ke mode gelap - toggle_langs: Ubah bahasa -intro: - desc: Template awal vite - dynamic-route: Contoh rute dinamik - hi: Halo, {name}! - aka: Juga diketahui sebagai - whats-your-name: Siapa nama anda? -not-found: Tidak ditemukan diff --git a/locales/it.yml b/locales/it.yml deleted file mode 100644 index fa0d988..0000000 --- a/locales/it.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: Su di me - back: Indietro - go: Vai - home: Home - toggle_dark: Attiva/disattiva modalità scura - toggle_langs: Cambia lingua -intro: - desc: Modello per una Applicazione Vite - dynamic-route: Demo di rotta dinamica - hi: Ciao, {name}! - whats-your-name: Come ti chiami? -not-found: Non trovato diff --git a/locales/ja.yml b/locales/ja.yml deleted file mode 100644 index 834228e..0000000 --- a/locales/ja.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: これは? - back: 戻る - go: 進む - home: ホーム - toggle_dark: ダークモード切り替え - toggle_langs: 言語切り替え -intro: - desc: 固執された Vite スターターテンプレート - dynamic-route: 動的ルートのデモ - hi: こんにちは、{name}! - whats-your-name: 君の名は。 -not-found: 見つかりませんでした diff --git a/locales/ka.yml b/locales/ka.yml deleted file mode 100644 index 47e273b..0000000 --- a/locales/ka.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: შესახებ - back: უკან - go: დაწყება - home: მთავარი - toggle_dark: გადართე მუქი რეჟიმი - toggle_langs: ენის შეცვლა -intro: - desc: Opinionated Vite Starter Template - dynamic-route: დინამიური როუტინგის დემო - hi: გამარჯობა, {name}! - aka: ასევე ცნობილი როგორც - whats-your-name: რა გქვია? -not-found: ვერ მოიძებნა diff --git a/locales/ko.yml b/locales/ko.yml deleted file mode 100644 index 780f88e..0000000 --- a/locales/ko.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: 소개 - back: 뒤로가기 - go: 이동 - home: 홈 - toggle_dark: 다크모드 토글 - toggle_langs: 언어 변경 -intro: - desc: Vite 애플리케이션 템플릿 - dynamic-route: 다이나믹 라우트 데모 - hi: 안녕, {name}! - whats-your-name: 이름이 뭐예요? -not-found: 찾을 수 없습니다 diff --git a/locales/pl.yml b/locales/pl.yml deleted file mode 100644 index 7929c34..0000000 --- a/locales/pl.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: O nas - back: Wróć - go: WEJDŹ - home: Strona główna - toggle_dark: Ustaw tryb nocny - toggle_langs: Zmień język -intro: - desc: Opiniowany szablon startowy Vite - dynamic-route: Demonstracja dynamicznego route - hi: Cześć, {name}! - aka: Znany też jako - whats-your-name: Jak masz na imię? -not-found: Nie znaleziono diff --git a/locales/pt-BR.yml b/locales/pt-BR.yml deleted file mode 100644 index bd99e3b..0000000 --- a/locales/pt-BR.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: Sobre - back: Voltar - go: Ir - home: Início - toggle_dark: Alternar modo escuro - toggle_langs: Mudar de idioma -intro: - desc: Modelo Opinativo de Partida de Vite - dynamic-route: Demonstração de rota dinâmica - hi: Olá, {name}! - aka: Também conhecido como - whats-your-name: Qual é o seu nome? -not-found: Não encontrado diff --git a/locales/ru.yml b/locales/ru.yml deleted file mode 100644 index 32398f1..0000000 --- a/locales/ru.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: О шаблоне - back: Назад - go: Перейти - home: Главная - toggle_dark: Включить темный режим - toggle_langs: Сменить язык -intro: - desc: Самостоятельный начальный шаблон Vite - dynamic-route: Демо динамического маршрута - hi: Привет, {name}! - whats-your-name: Как тебя зовут? -not-found: Не найден diff --git a/locales/tr.yml b/locales/tr.yml deleted file mode 100644 index b969b2c..0000000 --- a/locales/tr.yml +++ /dev/null @@ -1,14 +0,0 @@ -button: - about: Hakkımda - back: Geri - go: İLERİ - home: Anasayfa - toggle_dark: Karanlık modu değiştir - toggle_langs: Dilleri değiştir -intro: - desc: Görüşlü Vite Başlangıç Şablonu - dynamic-route: Dinamik rota demosu - hi: Merhaba, {name}! - aka: Ayrıca şöyle bilinir - whats-your-name: Adınız nedir? -not-found: Bulunamadı diff --git a/locales/uk.yml b/locales/uk.yml deleted file mode 100644 index 280eeca..0000000 --- a/locales/uk.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: Про шаблон - back: Назад - go: Перейти - home: Головна - toggle_dark: Переключити темний режим - toggle_langs: Змінити мову -intro: - desc: Самостійний початковий шаблон Vite - dynamic-route: Демо динамічного маршруту - hi: Привіт, {name}! - whats-your-name: Як тебе звати? -not-found: Не знайдено diff --git a/locales/vi.yml b/locales/vi.yml deleted file mode 100644 index ba2322e..0000000 --- a/locales/vi.yml +++ /dev/null @@ -1,13 +0,0 @@ -button: - about: Về - back: Quay lại - go: Đi - home: Khởi đầu - toggle_dark: Chuyển đổi chế độ tối - toggle_langs: Thay đổi ngôn ngữ -intro: - desc: Ý kiến cá nhân Vite Template để bắt đầu - dynamic-route: Bản giới thiệu về dynamic route - hi: Hi, {name}! - whats-your-name: Tên bạn là gì? -not-found: Không tìm thấy diff --git a/package.json b/package.json index b2073db..50cf485 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@vueuse/core": "^9.11.0", "@vueuse/head": "^1.0.22", "nprogress": "^0.2.0", - "pinia": "^2.0.29", "vue": "^3.2.45", "vue-demi": "^0.13.11", "vue-i18n": "^9.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad4657e..a87fb48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,6 @@ specifiers: markdown-it-link-attributes: ^4.0.1 markdown-it-shiki: ^0.7.2 nprogress: ^0.2.0 - pinia: ^2.0.29 pnpm: ^7.25.1 shiki: ^0.12.1 taze: ^0.8.5 @@ -52,7 +51,6 @@ dependencies: '@vueuse/core': 9.11.0_vue@3.2.45 '@vueuse/head': 1.0.22_vue@3.2.45 nprogress: 0.2.0 - pinia: 2.0.29_prq2uz4lho2pwp6irk4cfkrxwu vue: 3.2.45 vue-demi: 0.13.11_vue@3.2.45 vue-i18n: 9.2.2_vue@3.2.45 @@ -7345,24 +7343,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /pinia/2.0.29_prq2uz4lho2pwp6irk4cfkrxwu: - resolution: {integrity: sha512-5z/KpFecq/cIgfeTnulJXldiLcTITRkTe3N58RKYSj0Pc1EdR6oyCdnf5A9jLoVwBqX5LtHhd0kGlpzWvk9oiQ==} - peerDependencies: - '@vue/composition-api': ^1.4.0 - typescript: '>=4.4.4' - vue: ^2.6.14 || ^3.2.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - typescript: - optional: true - dependencies: - '@vue/devtools-api': 6.4.5 - typescript: 4.9.4 - vue: 3.2.45 - vue-demi: 0.13.11_vue@3.2.45 - dev: false - /pkg-types/1.0.1: resolution: {integrity: sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==} dependencies: @@ -8542,6 +8522,7 @@ packages: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true + dev: true /uc.micro/1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} diff --git a/src/App.vue b/src/App.vue index 7b36d82..9e6d587 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,9 +3,9 @@ // you can use this to manipulate the document head in any components, // they will be rendered correctly in the html results with vite-ssg useHead({ - title: 'Vitesse', + title: '合肥市南园学校19预科2班', meta: [ - { name: 'description', content: 'Opinionated Vite Starter Template' }, + { name: 'description', content: '合肥市南园学校19预科2班非官方页面。' }, { name: 'theme-color', content: computed(() => isDark.value ? '#00aba9' : '#ffffff'), diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index bf5be90..e1aec5f 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -117,6 +117,7 @@ declare global { const useArrayMap: typeof import('@vueuse/core')['useArrayMap'] const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce'] const useArraySome: typeof import('@vueuse/core')['useArraySome'] + const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique'] const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue'] const useAsyncState: typeof import('@vueuse/core')['useAsyncState'] const useAttrs: typeof import('vue')['useAttrs'] @@ -202,6 +203,7 @@ declare global { const useParallax: typeof import('@vueuse/core')['useParallax'] const usePermission: typeof import('@vueuse/core')['usePermission'] const usePointer: typeof import('@vueuse/core')['usePointer'] + const usePointerLock: typeof import('@vueuse/core')['usePointerLock'] const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe'] const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme'] const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast'] @@ -249,7 +251,6 @@ declare global { const useTransition: typeof import('@vueuse/core')['useTransition'] const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams'] const useUserMedia: typeof import('@vueuse/core')['useUserMedia'] - const useUserStore: typeof import('./stores/user')['useUserStore'] const useVModel: typeof import('@vueuse/core')['useVModel'] const useVModels: typeof import('@vueuse/core')['useVModels'] const useVibrate: typeof import('@vueuse/core')['useVibrate'] @@ -397,6 +398,7 @@ declare module 'vue' { readonly useArrayMap: UnwrapRef readonly useArrayReduce: UnwrapRef readonly useArraySome: UnwrapRef + readonly useArrayUnique: UnwrapRef readonly useAsyncQueue: UnwrapRef readonly useAsyncState: UnwrapRef readonly useAttrs: UnwrapRef @@ -482,6 +484,7 @@ declare module 'vue' { readonly useParallax: UnwrapRef readonly usePermission: UnwrapRef readonly usePointer: UnwrapRef + readonly usePointerLock: UnwrapRef readonly usePointerSwipe: UnwrapRef readonly usePreferredColorScheme: UnwrapRef readonly usePreferredContrast: UnwrapRef @@ -529,7 +532,6 @@ declare module 'vue' { readonly useTransition: UnwrapRef readonly useUrlSearchParams: UnwrapRef readonly useUserMedia: UnwrapRef - readonly useUserStore: UnwrapRef readonly useVModel: UnwrapRef readonly useVModels: UnwrapRef readonly useVibrate: UnwrapRef diff --git a/src/components/TheCounter.vue b/src/components/TheCounter.vue deleted file mode 100644 index 6086a45..0000000 --- a/src/components/TheCounter.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - diff --git a/src/components/TheInput.vue b/src/components/TheInput.vue deleted file mode 100644 index be8cadc..0000000 --- a/src/components/TheInput.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 8fca368..22064c3 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -1,9 +1,6 @@ diff --git a/src/layouts/home.vue b/src/layouts/home.vue deleted file mode 100644 index 65a4646..0000000 --- a/src/layouts/home.vue +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/src/modules/i18n.ts b/src/modules/i18n.ts index 5d34801..168b072 100644 --- a/src/modules/i18n.ts +++ b/src/modules/i18n.ts @@ -17,7 +17,7 @@ const messages = Object.fromEntries( export const install: UserModule = ({ app }) => { const i18n = createI18n({ legacy: false, - locale: 'en', + locale: 'zh-CN', messages, }) diff --git a/src/modules/pinia.ts b/src/modules/pinia.ts deleted file mode 100644 index b27907a..0000000 --- a/src/modules/pinia.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createPinia } from 'pinia' -import { type UserModule } from '~/types' - -// Setup Pinia -// https://pinia.vuejs.org/ -export const install: UserModule = ({ isClient, initialState, app }) => { - const pinia = createPinia() - app.use(pinia) - // Refer to - // https://github.com/antfu/vite-ssg/blob/main/README.md#state-serialization - // for other serialization strategies. - if (isClient) - pinia.state.value = (initialState.pinia) || {} - - else - initialState.pinia = pinia.state.value -} diff --git a/src/pages/[...all].vue b/src/pages/[...all].vue deleted file mode 100755 index 673f718..0000000 --- a/src/pages/[...all].vue +++ /dev/null @@ -1,14 +0,0 @@ - - - - - -meta: - layout: 404 - diff --git a/src/pages/index.vue b/src/pages/_index.vue similarity index 93% rename from src/pages/index.vue rename to src/pages/_index.vue index 8adadbf..91a43b2 100644 --- a/src/pages/index.vue +++ b/src/pages/_index.vue @@ -1,8 +1,7 @@ - - - diff --git a/src/pages/index.md b/src/pages/index.md new file mode 100644 index 0000000..0b391b5 --- /dev/null +++ b/src/pages/index.md @@ -0,0 +1,7 @@ + + +
+

属于19预科2班的故事还未完结

+
\ No newline at end of file diff --git a/src/stores/user.ts b/src/stores/user.ts deleted file mode 100644 index b83f5b6..0000000 --- a/src/stores/user.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { acceptHMRUpdate, defineStore } from 'pinia' - -export const useUserStore = defineStore('user', () => { - /** - * Current name of the user. - */ - const savedName = ref('') - const previousNames = ref(new Set()) - - const usedNames = computed(() => Array.from(previousNames.value)) - const otherNames = computed(() => usedNames.value.filter(name => name !== savedName.value)) - - /** - * Changes the current name of the user and saves the one that was used - * before. - * - * @param name - new name to set - */ - function setNewName(name: string) { - if (savedName.value) - previousNames.value.add(savedName.value) - - savedName.value = name - } - - return { - setNewName, - otherNames, - savedName, - } -}) - -if (import.meta.hot) - import.meta.hot.accept(acceptHMRUpdate(useUserStore, import.meta.hot)) diff --git a/vite.config.ts b/vite.config.ts index 9a9bd55..a2a5c83 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -57,7 +57,6 @@ export default defineConfig({ dts: 'src/auto-imports.d.ts', dirs: [ 'src/composables', - 'src/stores', ], vueTemplate: true, }),