Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: revert erroneous commits #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"prettier.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.eslint": true
},
"files.associations": {
"*.css": "postcss"
Expand Down
25 changes: 25 additions & 0 deletions components/app/PwaInstall.client.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script>
const { $pwa } = useNuxtApp()
</script>

<template>
<div
v-if="$pwa?.showInstallPrompt && !$pwa?.needRefresh"
class="fixed right-0 bottom-[--app-footer-height] m-4 p-4 rounded-lg border-1 border-gray-200 dark:border-gray-700 flex-col gap-3"
>
<h2 class="mb-3 text-left text-base">
某星签到助手
</h2>
<div class="flex gap-2">
<NButton strong secondary type="error" size="small" @click="$pwa.install()">
<template #icon>
<Icon name="material-symbols:install-desktop-rounded" class="-z-1" />
</template>
安装
</NButton>
<NButton size="small" @click="$pwa.cancelInstall()">
取消
</NButton>
</div>
</div>
</template>
43 changes: 43 additions & 0 deletions config/pwa.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import type { ModuleOptions } from '@vite-pwa/nuxt'

export const pwa: ModuleOptions = {
registerType: 'autoUpdate',
manifest: {
name: '某星签到助手',
short_name: '某星签到助手',
theme_color: '#ffffff',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
start_url: '/',
display: 'standalone',
orientation: 'portrait',
},
workbox: {
navigateFallback: '/',
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
client: {
installPrompt: true,
},
devOptions: {
enabled: process.env.VITE_DEV_PWA === 'true',
suppressWarnings: true,
navigateFallbackAllowlist: [/^\/$/],
type: 'module',
},
}
16 changes: 11 additions & 5 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pwa } from './config/pwa'

export default defineNuxtConfig({
app: {
keepalive: true,
Expand Down Expand Up @@ -39,10 +41,11 @@ export default defineNuxtConfig({
['@pinia/nuxt', {
autoImports: ['defineStore', 'definePiniaStore'],
}],
'pinia-plugin-persistedstate/nuxt',
'@pinia-plugin-persistedstate/nuxt',
'@sidebase/nuxt-auth',
'@huntersofbook/naive-ui-nuxt',
'@nuxt/icon',
'nuxt-icon',
'@vite-pwa/nuxt',
'@nuxt/devtools',
],
imports: {
Expand Down Expand Up @@ -92,16 +95,19 @@ export default defineNuxtConfig({
},
auth: {
isEnabled: true,
globalAppMiddleware: {
isEnabled: true,
}
enableGlobalAppMiddleware: true,
globalMiddlewareOptions: {
allow404WithoutAuth: true,
addDefaultCallbackUrl: true,
},
},
build: {
transpile: ['punycode'],
},
typescript: {
shim: false,
},
pwa,
experimental: {
renderJsonPayloads: true,
asyncContext: true,
Expand Down
75 changes: 38 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev -o",
"dev:pwa": "VITE_DEV_PWA=true nuxi dev -o",
"start": "node .output/server/index.mjs",
"start:pm2": "pm2 start",
"preview": "nuxi preview --dotenv .env.production",
Expand All @@ -31,48 +32,48 @@
"release": "bumpp --commit --push --tag"
},
"dependencies": {
"@prisma/client": "^5.22.0",
"easemob-websdk": "^4.10.0",
"next-auth": "~4.21.1",
"tough-cookie": "^5.0.0"
"@prisma/client": "^5.2.0",
"easemob-websdk": "^4.2.0",
"next-auth": "4.22.5",
"tough-cookie": "^4.1.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.9.2",
"@antfu/eslint-config": "^0.40.3",
"@huntersofbook/naive-ui-nuxt": "^1.2.0",
"@iconify/json": "^2.2.276",
"@iconify/json": "^2.2.107",
"@kuizuo/utils": "^0.2.0",
"@nuxt/content": "^2.13.4",
"@nuxt/devtools": "^1.6.1",
"@nuxt/icon": "^1.8.2",
"@nuxtjs/color-mode": "^3.5.2",
"@pinia/nuxt": "^0.7.0",
"@sidebase/nuxt-auth": "^0.9.4",
"@types/async": "^3.2.24",
"@types/jsdom": "^21.1.7",
"@types/qrcode": "^1.5.5",
"@types/tough-cookie": "^4.0.5",
"@types/ws": "^8.5.13",
"@unocss/nuxt": "^0.64.1",
"@vueuse/integrations": "^11.3.0",
"@vueuse/nuxt": "^11.3.0",
"async": "^3.2.6",
"bumpp": "^9.8.1",
"cheerio": "1.0.0",
"eslint": "^9.15.0",
"got": "^14.4.5",
"jsdom": "^25.0.1",
"@nuxt/content": "^2.8.1",
"@nuxt/devtools": "^0.8.2",
"@nuxtjs/color-mode": "^3.3.0",
"@pinia-plugin-persistedstate/nuxt": "^1.1.1",
"@pinia/nuxt": "^0.4.11",
"@sidebase/nuxt-auth": "^0.5.0",
"@types/async": "^3.2.20",
"@types/jsdom": "^21.1.2",
"@types/qrcode": "^1.5.1",
"@types/tough-cookie": "^4.0.2",
"@types/ws": "^8.5.5",
"@unocss/nuxt": "^0.55.3",
"@vite-pwa/nuxt": "^0.1.0",
"@vueuse/integrations": "^10.4.1",
"@vueuse/nuxt": "^10.4.1",
"async": "^3.2.4",
"bumpp": "^8.2.1",
"cheerio": "1.0.0-rc.12",
"eslint": "^8.48.0",
"got": "^12.6.0",
"jsdom": "^22.1.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"naive-ui": "^2.40.1",
"nuxt": "3.14.1592",
"pinia-plugin-persist": "^1.0.0",
"pinia-plugin-persistedstate": "^4.1.3",
"prisma": "^5.22.0",
"qrcode": "^1.5.4",
"sass": "^1.81.0",
"typescript": "^5.7.2",
"vitest": "^2.1.5",
"vue-qrcode-reader": "^5.5.11",
"ws": "^8.18.0"
"naive-ui": "^2.34.4",
"nuxt": "3.6.5",
"nuxt-icon": "^0.5.0",
"prisma": "^5.2.0",
"qrcode": "^1.5.3",
"sass": "^1.66.1",
"typescript": "^5.2.2",
"vitest": "^0.24.5",
"vue-qrcode-reader": "^5.3.4",
"ws": "^8.13.0"
}
}
Loading