Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <[email protected]>
  • Loading branch information
ZTL-UwU committed Sep 8, 2024
1 parent 4e72116 commit ff4f53c
Show file tree
Hide file tree
Showing 29 changed files with 80 additions and 83 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /app
ENV NODE_ENV="production"

# Install bun
RUN npm install -g bun@1.0.30
RUN npm install -g bun@1.1.27

# Throw-away build stage to reduce size of final image
FROM base as build
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion components/ModifyPasswordDialog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useForm } from 'vee-validate';
import { Loader2 } from 'lucide-vue-next';
import { useForm } from 'vee-validate';
import z from 'zod';
import { passwordRegex } from '~/constants';
Expand Down
5 changes: 3 additions & 2 deletions components/RegisterDialog.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script setup lang="ts">
import { useForm } from 'vee-validate';
import { Loader2 } from 'lucide-vue-next';
import { useForm } from 'vee-validate';
import { z } from 'zod';
import { passwordRegex } from '~/constants/index';
const { $api, $toast } = useNuxtApp();
const formSchema = toTypedSchema(z.object({
username: z.string({ required_error: '用户名长度应至少为4' })
.min(4, { message: '用户名长度应至少为4' }).max(24, { message: '用户名超出长度范围' }),
.min(4, { message: '用户名长度应至少为4' })
.max(24, { message: '用户名超出长度范围' }),
password: z
.string({ required_error: '请输入密码' })
.min(8, { message: '用户密码长度应至少为8' })
Expand Down
17 changes: 9 additions & 8 deletions components/SubmitDialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { toTypedSchema } from '@vee-validate/zod';
import { Loader2 } from 'lucide-vue-next';
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/zod';
import { z } from 'zod';
import { useSongStore } from '~/stores/song';
import type { TSafeSong } from '~/types';
Expand All @@ -14,16 +14,17 @@ const isInternational = ref(false);
const formSchema = toTypedSchema(z.object({
name: z.string({ required_error: '歌名长度至少为1' })
.min(1, '歌名长度至少为1').max(50, '歌名长度最大为50')
.min(1, '歌名长度至少为1')
.max(50, '歌名长度最大为50')
.refine(val => !(val.trim().startsWith('') || val.trim().endsWith('')), '歌曲名不需带书名号'),
creator: z.string({ required_error: '歌手名长度至少为1' })
.min(1, '歌手名长度至少为1').max(50, '歌手长度最大为50'),
.min(1, '歌手名长度至少为1')
.max(50, '歌手长度最大为50'),
submitterName: z.string({ required_error: '提交者名字长度至少为2' })
.min(2, '提交者名字长度至少为2').max(15, '提交者名字长度最大为15'),
submitterGrade: z.coerce.number({ invalid_type_error: '请填一个数字' })
.int('请填一个整数').min(1, '年级为1~5').max(5, '年级为1~5'),
submitterClass: z.coerce.number({ invalid_type_error: '请填一个数字' })
.min(0, '班级号应大于0').max(100, '班级号应小于100'),
.min(2, '提交者名字长度至少为2')
.max(15, '提交者名字长度最大为15'),
submitterGrade: z.coerce.number({ invalid_type_error: '请填一个数字' }).int('请填一个整数').min(1, '年级为1~5').max(5, '年级为1~5'),
submitterClass: z.coerce.number({ invalid_type_error: '请填一个数字' }).min(0, '班级号应大于0').max(100, '班级号应小于100'),
type: z.enum(
['normal', 'withMsg'],
{ errorMap: () => ({ message: '提交了不存在的歌曲类型' }) },
Expand Down
4 changes: 2 additions & 2 deletions components/TimeCreateForm.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { toTypedSchema } from '@vee-validate/zod';
import { Loader2 } from 'lucide-vue-next';
import { DatePicker } from 'v-calendar';
import 'v-calendar/style.css';
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/zod';
import { z } from 'zod';
import type { TTime } from '~/types';
import 'v-calendar/style.css';
const emit = defineEmits<{ (event: 'submitSuccess', time: TTime): void }>();
const { $api, $toast } = useNuxtApp();
Expand Down
4 changes: 2 additions & 2 deletions components/TimeEditForm.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { toTypedSchema } from '@vee-validate/zod';
import { Loader2 } from 'lucide-vue-next';
import { DatePicker } from 'v-calendar';
import 'v-calendar/style.css';
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/zod';
import { z } from 'zod';
import type { TTime } from '~/types';
import 'v-calendar/style.css';
const props = defineProps<{ time: TTime }>();
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,56 @@
"db:push": "drizzle-kit push:sqlite"
},
"dependencies": {
"@libsql/client": "^0.5.6",
"@nuxt/image": "^1.7.0",
"@libsql/client": "^0.10.0",
"@nuxt/image": "^1.8.0",
"@pinia/nuxt": "^0.5.4",
"@trpc/client": "^10.45.2",
"@trpc/server": "^10.45.2",
"@vee-validate/nuxt": "^4.13.2",
"@vee-validate/zod": "^4.13.2",
"@vueuse/core": "^10.11.1",
"@vueuse/core": "^11.0.3",
"@vueuse/gesture": "2.0.0-beta.1",
"@vueuse/integrations": "^10.11.1",
"@vueuse/nuxt": "^10.11.1",
"@vueuse/integrations": "^11.0.3",
"@vueuse/nuxt": "^11.0.3",
"bcrypt": "^5.1.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"drizzle-orm": "^0.30.10",
"drizzle-orm": "^0.33.0",
"fuse.js": "^7.0.0",
"jose": "^5.7.0",
"lucide-vue-next": "^0.292.0",
"jose": "^5.8.0",
"lucide-vue-next": "^0.439.0",
"nanoid": "^5.0.7",
"pinia": "^2.2.2",
"radix-vue": "^1.9.4",
"radix-vue": "^1.9.5",
"superjson": "^2.2.1",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"trpc-nuxt": "^0.10.22",
"v-calendar": "^3.1.2",
"vee-validate": "^4.13.2",
"vue-draggable-plus": "^0.3.5",
"vue-sonner": "^1.1.4",
"vue-draggable-plus": "^0.5.3",
"vue-sonner": "^1.1.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.0",
"@iconify-json/radix-icons": "^1.1.15",
"@iconify-json/tabler": "^1.1.120",
"@iconify/tailwind": "^0.1.4",
"@antfu/eslint-config": "^3.4.1",
"@iconify-json/radix-icons": "^1.2.0",
"@iconify-json/tabler": "^1.2.0",
"@iconify/tailwind": "^1.1.3",
"@nuxt/devtools": "latest",
"@nuxtjs/tailwindcss": "^6.12.1",
"@pinia-plugin-persistedstate/nuxt": "^1.2.1",
"@tailwindcss/typography": "^0.5.14",
"@tailwindcss/typography": "^0.5.15",
"@types/bcrypt": "^5.0.2",
"@types/bun": "^1.1.6",
"@types/bun": "^1.1.8",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.20.18",
"eslint": "^8.57.0",
"nuxt": "^3.12.4",
"drizzle-kit": "^0.24.2",
"eslint": "^9.10.0",
"nuxt": "^3.13.1",
"trpc-panel": "^1.3.4",
"typescript": "^5.5.4",
"vue": "^3.4.38",
"vue": "^3.5.3",
"vue-router": "^4.4.3"
}
}
8 changes: 4 additions & 4 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { Music4 } from 'lucide-vue-next';
import { useWindowFocus } from '@vueuse/core';
import { useDrag } from '@vueuse/gesture';
import { useFuse } from '@vueuse/integrations/useFuse';
import { Music4 } from 'lucide-vue-next';
import { DatePicker } from 'v-calendar';
import 'v-calendar/style.css';
import { useDrag } from '@vueuse/gesture';
import { useWindowFocus } from '@vueuse/core';
import { getDateString } from '~/lib/utils';
import 'v-calendar/style.css';
const { $api } = useNuxtApp();
Expand Down
13 changes: 5 additions & 8 deletions pages/manage/index.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import dayjs from 'dayjs';
import {
ArrowDown,
ArrowDownRight,
Expand All @@ -17,11 +18,10 @@ import {
X,
} from 'lucide-vue-next';
import { DatePicker } from 'v-calendar';
import 'v-calendar/style.css';
import dayjs from 'dayjs';
import { VueDraggable } from 'vue-draggable-plus';
import { getDateString } from '~/lib/utils';
import type { TArrangementList, TSong, TSongList, TStatus } from '~/types';
import 'v-calendar/style.css';
const { $api, $toast } = useNuxtApp();
Expand Down Expand Up @@ -91,16 +91,13 @@ const arrangeScope = computed(() => {
const arrangeLoading = ref(false);
const unsetList = computed(
() => songList.value.filter(s => (s.status === 'unset'))
.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
() => songList.value.filter(s => (s.status === 'unset')).sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
);
const approvedList = computed(
() => songList.value.filter(s => (s.status === 'approved'))
.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
() => songList.value.filter(s => (s.status === 'approved')).sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
);
const rejectedList = computed(
() => songList.value.filter(s => (s.status === 'rejected'))
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)), // Newest first
() => songList.value.filter(s => (s.status === 'rejected')).sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)), // Newest first
);
const showLength = reactive({
Expand Down
4 changes: 2 additions & 2 deletions pages/manage/login.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/zod';
import { Loader2 } from 'lucide-vue-next';
import { toTypedSchema } from '@vee-validate/zod';
import { useForm } from 'vee-validate';
import * as z from 'zod';
const { $api, $toast } = useNuxtApp();
Expand Down
9 changes: 3 additions & 6 deletions pages/manage/review.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ useHead({
const songList = ref<TSongList>([]);
const unsetList = computed(
() => songList.value.filter(s => (s.status === 'unset'))
.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
() => songList.value.filter(s => (s.status === 'unset')).sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
);
const approvedList = computed(
() => songList.value.filter(s => (s.status === 'approved'))
.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
() => songList.value.filter(s => (s.status === 'approved')).sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1)), // Oldest first
);
const rejectedList = computed(
() => songList.value.filter(s => (s.status === 'rejected'))
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)), // Newest first
() => songList.value.filter(s => (s.status === 'rejected')).sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)), // Newest first
);
const isDesktop = ref(true);
Expand Down
2 changes: 1 addition & 1 deletion plugins/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client';
import superjson from 'superjson';
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client';
import type { AppRouter } from '~/server/trpc/routers';

export default defineNuxtPlugin(() => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/sonner.client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Toaster, toast } from 'vue-sonner';
import { toast, Toaster } from 'vue-sonner';

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component('Toaster', Toaster);
Expand Down
4 changes: 2 additions & 2 deletions server/api/search/song.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getMusicURL } from '~/server/lib/song';
import type { TSearchResponse } from '~~/types';
import { searchSchema } from '~~/types';
import type { TSearchResponse } from '~~/types';
import { getMusicURL } from '~/server/lib/song';

export default eventHandler(async (event) => {
const paramsParse = await getValidatedQuery(event, params => searchSchema.safeParse(params));
Expand Down
2 changes: 1 addition & 1 deletion server/api/stream.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMusicURL } from '~/server/lib/song';
import { streamSchema } from '~~/types/stream';
import { getMusicURL } from '~/server/lib/song';

export default eventHandler(async (event) => {
const paramsParse = await getValidatedQuery(event, params => streamSchema.safeParse(params));
Expand Down
2 changes: 1 addition & 1 deletion server/api/trpc/[trpc].ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createNuxtApiHandler } from 'trpc-nuxt';
import { appRouter } from '~/server/trpc/routers';
import { createContext } from '~/server/trpc/context';
import { appRouter } from '~/server/trpc/routers';

// export API handler
export default createNuxtApiHandler({
Expand Down
2 changes: 1 addition & 1 deletion server/db/db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client';
import { drizzle } from 'drizzle-orm/libsql';
import { env } from '../env';
import type { arrangements, refreshTokens, songs, users } from './schema';
import type { times } from './schema/time';
Expand Down
4 changes: 2 additions & 2 deletions server/db/schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './user';
export * from './arrangement';
export * from './song';
export * from './time';
export * from './arrangement';
export * from './user';
6 changes: 3 additions & 3 deletions server/trpc/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import process from 'node:process';
import type { inferAsyncReturnType } from '@trpc/server';
import type { H3Event } from 'h3';
import { db } from '../db/db';
import type { TRawArrangement, TRawSong, TRawTime, TRawUser } from '../db/db';
import { ArrangementController } from './controllers/arrangement';

import { UserController } from './controllers/user';
import { SongController } from './controllers/song';
import { ArrangementController } from './controllers/arrangement';
import { TimeController } from './controllers/time';
import { UserController } from './controllers/user';
import type { TRawArrangement, TRawSong, TRawTime, TRawUser } from '../db/db';

const newGlobal = globalThis as unknown as {
userController: UserController | undefined;
Expand Down
6 changes: 3 additions & 3 deletions server/trpc/controllers/arrangement.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LibsqlError } from '@libsql/client';
import { and, eq, gt } from 'drizzle-orm';
import type { TNewArrangement, TRawSong } from '../../db/db';
import { getDateString } from '~/lib/utils';
import { arrangements } from '~/server/db/schema';
import { db } from '../../db/db';
import { SongController } from './song';
import { arrangements } from '~/server/db/schema';
import { getDateString } from '~/lib/utils';
import type { TNewArrangement, TRawSong } from '../../db/db';

export class ArrangementController {
sc = new SongController();
Expand Down
2 changes: 1 addition & 1 deletion server/trpc/controllers/song.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LibsqlError } from '@libsql/client';
import { and, eq, gt, inArray, or } from 'drizzle-orm';
import { type TNewSong, db } from '../../db/db';
import { songs } from '~/server/db/schema';
import type { TStatus } from '~/types';
import { db, type TNewSong } from '../../db/db';

export class SongController {
async create(newSong: TNewSong) {
Expand Down
2 changes: 1 addition & 1 deletion server/trpc/controllers/time.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LibsqlError } from '@libsql/client';
import { eq } from 'drizzle-orm';
import { type TNewTime, db } from '../../db/db';
import { times } from '~/server/db/schema/time';
import { db, type TNewTime } from '../../db/db';

export class TimeController {
async create(newTime: TNewTime) {
Expand Down
4 changes: 2 additions & 2 deletions server/trpc/controllers/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LibsqlError } from '@libsql/client';
import bcrypt from 'bcrypt';
import { and, eq } from 'drizzle-orm';
import { LibsqlError } from '@libsql/client';
import { type TNewUser, type TRawUser, db } from '../../db/db';
import { db, type TNewUser, type TRawUser } from '../../db/db';
import { refreshTokens, users } from '../../db/schema/';
import { Auth } from '../utils/auth';

Expand Down
4 changes: 2 additions & 2 deletions server/trpc/routers/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { router } from '../trpc';
import { userRouter } from './user';
import { arrangementRouter } from './arrangement';
import { songRouter } from './song';
import { timeRouter } from './time';
import { arrangementRouter } from './arrangement';
import { userRouter } from './user';

export const appRouter = router({
user: userRouter,
Expand Down
Loading

0 comments on commit ff4f53c

Please sign in to comment.