Add Server Data management
This commit is contained in:
454
assets/globals.css
Normal file
454
assets/globals.css
Normal file
File diff suppressed because one or more lines are too long
@@ -3,7 +3,8 @@ export default defineNuxtConfig({
|
||||
compatibilityDate: '2024-11-01',
|
||||
devtools: { enabled: true },
|
||||
modules: ['@nuxt/eslint'],
|
||||
css: ['/assets/globals.css'],
|
||||
build: {
|
||||
transpile: ['trpc-nuxt']
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
},
|
||||
"packageManager": "pnpm@10.5.2+sha512.da9dc28cd3ff40d0592188235ab25d3202add8a207afbedc682220e4a0029ffbff4562102b9e6e46b4e3f9e8bd53e6d05de48544b0c57d4b0179e22c76d1199b",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.0",
|
||||
"typescript": "^5.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
105
pnpm-lock.yaml
generated
105
pnpm-lock.yaml
generated
@@ -10,7 +10,7 @@ importers:
|
||||
dependencies:
|
||||
'@nuxt/eslint':
|
||||
specifier: 1.3.0
|
||||
version: 1.3.0(@vue/compiler-sfc@3.5.13)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
version: 1.3.0(@vue/compiler-sfc@3.5.13)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@trpc/client':
|
||||
specifier: ^11.0.1
|
||||
version: 11.0.1(@trpc/server@11.0.1(typescript@5.8.2))(typescript@5.8.2)
|
||||
@@ -28,7 +28,7 @@ importers:
|
||||
version: 8.0.0
|
||||
nuxt:
|
||||
specifier: ^3.16.2
|
||||
version: 3.16.2(@parcel/watcher@2.5.1)(db0@0.3.1)(eslint@9.23.0(jiti@2.4.2))(ioredis@5.6.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(yaml@2.7.1)
|
||||
version: 3.16.2(@parcel/watcher@2.5.1)(@types/node@22.14.0)(db0@0.3.1)(eslint@9.23.0(jiti@2.4.2))(ioredis@5.6.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(yaml@2.7.1)
|
||||
sort-by:
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0
|
||||
@@ -48,6 +48,9 @@ importers:
|
||||
specifier: ^3.24.2
|
||||
version: 3.24.2
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^22.14.0
|
||||
version: 22.14.0
|
||||
typescript:
|
||||
specifier: ^5.8.2
|
||||
version: 5.8.2
|
||||
@@ -979,6 +982,9 @@ packages:
|
||||
'@types/json-schema@7.0.15':
|
||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||
|
||||
'@types/node@22.14.0':
|
||||
resolution: {integrity: sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==}
|
||||
|
||||
'@types/normalize-package-data@2.4.4':
|
||||
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
|
||||
|
||||
@@ -3291,6 +3297,9 @@ packages:
|
||||
unctx@2.4.1:
|
||||
resolution: {integrity: sha512-AbaYw0Nm4mK4qjhns67C+kgxR2YWiwlDBPzxrN8h8C6VtAdCgditAY5Dezu3IJy4XVqAnbrXt9oQJvsn3fyozg==}
|
||||
|
||||
undici-types@6.21.0:
|
||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||
|
||||
unenv@2.0.0-rc.15:
|
||||
resolution: {integrity: sha512-J/rEIZU8w6FOfLNz/hNKsnY+fFHWnu9MH4yRbSZF3xbbGHovcetXPs7sD+9p8L6CeNC//I9bhRYAOsBt2u7/OA==}
|
||||
|
||||
@@ -4167,12 +4176,12 @@ snapshots:
|
||||
|
||||
'@nuxt/devalue@2.0.2': {}
|
||||
|
||||
'@nuxt/devtools-kit@2.3.2(magicast@0.3.5)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))':
|
||||
'@nuxt/devtools-kit@2.3.2(magicast@0.3.5)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
'@nuxt/schema': 3.16.2
|
||||
execa: 8.0.1
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
transitivePeerDependencies:
|
||||
- magicast
|
||||
|
||||
@@ -4187,12 +4196,12 @@ snapshots:
|
||||
prompts: 2.4.2
|
||||
semver: 7.7.1
|
||||
|
||||
'@nuxt/devtools@2.3.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
'@nuxt/devtools@2.3.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
dependencies:
|
||||
'@nuxt/devtools-kit': 2.3.2(magicast@0.3.5)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@nuxt/devtools-kit': 2.3.2(magicast@0.3.5)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@nuxt/devtools-wizard': 2.3.2
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
'@vue/devtools-core': 7.7.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@vue/devtools-core': 7.7.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@vue/devtools-kit': 7.7.2
|
||||
birpc: 2.3.0
|
||||
consola: 3.4.2
|
||||
@@ -4217,9 +4226,9 @@ snapshots:
|
||||
sirv: 3.0.1
|
||||
structured-clone-es: 1.0.0
|
||||
tinyglobby: 0.2.12
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-plugin-inspect: 11.0.0(@nuxt/kit@3.16.2(magicast@0.3.5))(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite-plugin-vue-tracer: 0.1.3(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-plugin-inspect: 11.0.0(@nuxt/kit@3.16.2(magicast@0.3.5))(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite-plugin-vue-tracer: 0.1.3(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
which: 5.0.0
|
||||
ws: 8.18.1
|
||||
transitivePeerDependencies:
|
||||
@@ -4265,10 +4274,10 @@ snapshots:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@nuxt/eslint@1.3.0(@vue/compiler-sfc@3.5.13)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))':
|
||||
'@nuxt/eslint@1.3.0(@vue/compiler-sfc@3.5.13)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@eslint/config-inspector': 1.0.2(eslint@9.23.0(jiti@2.4.2))
|
||||
'@nuxt/devtools-kit': 2.3.2(magicast@0.3.5)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@nuxt/devtools-kit': 2.3.2(magicast@0.3.5)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@nuxt/eslint-config': 1.3.0(@vue/compiler-sfc@3.5.13)(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
'@nuxt/eslint-plugin': 1.3.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
@@ -4342,12 +4351,12 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- magicast
|
||||
|
||||
'@nuxt/vite-builder@3.16.2(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))(yaml@2.7.1)':
|
||||
'@nuxt/vite-builder@3.16.2(@types/node@22.14.0)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))(yaml@2.7.1)':
|
||||
dependencies:
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
'@rollup/plugin-replace': 6.0.2(rollup@4.39.0)
|
||||
'@vitejs/plugin-vue': 5.2.3(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@vitejs/plugin-vue-jsx': 4.1.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@vitejs/plugin-vue': 5.2.3(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@vitejs/plugin-vue-jsx': 4.1.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
autoprefixer: 10.4.21(postcss@8.5.3)
|
||||
consola: 3.4.2
|
||||
cssnano: 7.0.6(postcss@8.5.3)
|
||||
@@ -4373,9 +4382,9 @@ snapshots:
|
||||
ufo: 1.5.4
|
||||
unenv: 2.0.0-rc.15
|
||||
unplugin: 2.2.2
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-node: 3.1.1(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-plugin-checker: 0.9.1(eslint@9.23.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-node: 3.1.1(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-plugin-checker: 0.9.1(eslint@9.23.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vue: 3.5.13(typescript@5.8.2)
|
||||
vue-bundle-renderer: 2.1.1
|
||||
transitivePeerDependencies:
|
||||
@@ -4692,6 +4701,10 @@ snapshots:
|
||||
|
||||
'@types/json-schema@7.0.15': {}
|
||||
|
||||
'@types/node@22.14.0':
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
'@types/normalize-package-data@2.4.4': {}
|
||||
|
||||
'@types/parse-path@7.0.3': {}
|
||||
@@ -4847,19 +4860,19 @@ snapshots:
|
||||
- rollup
|
||||
- supports-color
|
||||
|
||||
'@vitejs/plugin-vue-jsx@4.1.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
'@vitejs/plugin-vue-jsx@4.1.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
dependencies:
|
||||
'@babel/core': 7.26.10
|
||||
'@babel/plugin-transform-typescript': 7.27.0(@babel/core@7.26.10)
|
||||
'@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10)
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vue: 3.5.13(typescript@5.8.2)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vitejs/plugin-vue@5.2.3(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
'@vitejs/plugin-vue@5.2.3(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
dependencies:
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vue: 3.5.13(typescript@5.8.2)
|
||||
|
||||
'@vue-macros/common@1.16.1(vue@3.5.13(typescript@5.8.2))':
|
||||
@@ -4934,14 +4947,14 @@ snapshots:
|
||||
|
||||
'@vue/devtools-api@6.6.4': {}
|
||||
|
||||
'@vue/devtools-core@7.7.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
'@vue/devtools-core@7.7.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))':
|
||||
dependencies:
|
||||
'@vue/devtools-kit': 7.7.2
|
||||
'@vue/devtools-shared': 7.7.2
|
||||
mitt: 3.0.1
|
||||
nanoid: 5.1.5
|
||||
pathe: 2.0.3
|
||||
vite-hot-client: 0.2.4(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite-hot-client: 0.2.4(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vue: 3.5.13(typescript@5.8.2)
|
||||
transitivePeerDependencies:
|
||||
- vite
|
||||
@@ -6360,15 +6373,15 @@ snapshots:
|
||||
dependencies:
|
||||
boolbase: 1.0.0
|
||||
|
||||
nuxt@3.16.2(@parcel/watcher@2.5.1)(db0@0.3.1)(eslint@9.23.0(jiti@2.4.2))(ioredis@5.6.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(yaml@2.7.1):
|
||||
nuxt@3.16.2(@parcel/watcher@2.5.1)(@types/node@22.14.0)(db0@0.3.1)(eslint@9.23.0(jiti@2.4.2))(ioredis@5.6.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(yaml@2.7.1):
|
||||
dependencies:
|
||||
'@nuxt/cli': 3.24.1(magicast@0.3.5)
|
||||
'@nuxt/devalue': 2.0.2
|
||||
'@nuxt/devtools': 2.3.2(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@nuxt/devtools': 2.3.2(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2))
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
'@nuxt/schema': 3.16.2
|
||||
'@nuxt/telemetry': 2.6.6(magicast@0.3.5)
|
||||
'@nuxt/vite-builder': 3.16.2(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))(yaml@2.7.1)
|
||||
'@nuxt/vite-builder': 3.16.2(@types/node@22.14.0)(eslint@9.23.0(jiti@2.4.2))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(terser@5.39.0)(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))(yaml@2.7.1)
|
||||
'@oxc-parser/wasm': 0.60.0
|
||||
'@unhead/vue': 2.0.3(vue@3.5.13(typescript@5.8.2))
|
||||
'@vue/shared': 3.5.13
|
||||
@@ -6427,6 +6440,7 @@ snapshots:
|
||||
vue-router: 4.5.0(vue@3.5.13(typescript@5.8.2))
|
||||
optionalDependencies:
|
||||
'@parcel/watcher': 2.5.1
|
||||
'@types/node': 22.14.0
|
||||
transitivePeerDependencies:
|
||||
- '@azure/app-configuration'
|
||||
- '@azure/cosmos'
|
||||
@@ -7260,6 +7274,8 @@ snapshots:
|
||||
magic-string: 0.30.17
|
||||
unplugin: 2.2.2
|
||||
|
||||
undici-types@6.21.0: {}
|
||||
|
||||
unenv@2.0.0-rc.15:
|
||||
dependencies:
|
||||
defu: 6.1.4
|
||||
@@ -7404,27 +7420,27 @@ snapshots:
|
||||
spdx-correct: 3.2.0
|
||||
spdx-expression-parse: 3.0.1
|
||||
|
||||
vite-dev-rpc@1.0.7(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
vite-dev-rpc@1.0.7(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
birpc: 2.3.0
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-hot-client: 2.0.4(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-hot-client: 2.0.4(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
|
||||
vite-hot-client@0.2.4(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
vite-hot-client@0.2.4(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
|
||||
vite-hot-client@2.0.4(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
vite-hot-client@2.0.4(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
|
||||
vite-node@3.1.1(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1):
|
||||
vite-node@3.1.1(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1):
|
||||
dependencies:
|
||||
cac: 6.7.14
|
||||
debug: 4.4.0
|
||||
es-module-lexer: 1.6.0
|
||||
pathe: 2.0.3
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- jiti
|
||||
@@ -7439,7 +7455,7 @@ snapshots:
|
||||
- tsx
|
||||
- yaml
|
||||
|
||||
vite-plugin-checker@0.9.1(eslint@9.23.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.2)(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
vite-plugin-checker@0.9.1(eslint@9.23.0(jiti@2.4.2))(optionator@0.9.4)(typescript@5.8.2)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
'@babel/code-frame': 7.26.2
|
||||
chokidar: 4.0.3
|
||||
@@ -7449,14 +7465,14 @@ snapshots:
|
||||
strip-ansi: 7.1.0
|
||||
tiny-invariant: 1.3.3
|
||||
tinyglobby: 0.2.12
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
eslint: 9.23.0(jiti@2.4.2)
|
||||
optionator: 0.9.4
|
||||
typescript: 5.8.2
|
||||
|
||||
vite-plugin-inspect@11.0.0(@nuxt/kit@3.16.2(magicast@0.3.5))(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
vite-plugin-inspect@11.0.0(@nuxt/kit@3.16.2(magicast@0.3.5))(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
ansis: 3.17.0
|
||||
debug: 4.4.0
|
||||
@@ -7466,29 +7482,30 @@ snapshots:
|
||||
perfect-debounce: 1.0.0
|
||||
sirv: 3.0.1
|
||||
unplugin-utils: 0.2.4
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-dev-rpc: 1.0.7(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite-dev-rpc: 1.0.7(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))
|
||||
optionalDependencies:
|
||||
'@nuxt/kit': 3.16.2(magicast@0.3.5)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
vite-plugin-vue-tracer@0.1.3(vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2)):
|
||||
vite-plugin-vue-tracer@0.1.3(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1))(vue@3.5.13(typescript@5.8.2)):
|
||||
dependencies:
|
||||
estree-walker: 3.0.3
|
||||
exsolve: 1.0.4
|
||||
magic-string: 0.30.17
|
||||
pathe: 2.0.3
|
||||
source-map-js: 1.2.1
|
||||
vite: 6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vite: 6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1)
|
||||
vue: 3.5.13(typescript@5.8.2)
|
||||
|
||||
vite@6.2.5(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1):
|
||||
vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(terser@5.39.0)(yaml@2.7.1):
|
||||
dependencies:
|
||||
esbuild: 0.25.2
|
||||
postcss: 8.5.3
|
||||
rollup: 4.39.0
|
||||
optionalDependencies:
|
||||
'@types/node': 22.14.0
|
||||
fsevents: 2.3.3
|
||||
jiti: 2.4.2
|
||||
terser: 5.39.0
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const pathSchema = z.object({
|
||||
hello: z.string()
|
||||
});
|
||||
|
||||
const bodySchema = z.object({
|
||||
world: z.string()
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const pathParams = await getValidatedRouterParams(event, pathSchema.parse);
|
||||
const body = await readValidatedBody(event, bodySchema.parse);
|
||||
return { risultato: `${pathParams.hello}-${body.world}` };
|
||||
});
|
||||
@@ -2,17 +2,15 @@ import { publicProcedure, router } from '~/server/trpc/init';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const appRouter = router({
|
||||
hello: publicProcedure
|
||||
.input(
|
||||
z.object({
|
||||
text: z.string(),
|
||||
}),
|
||||
)
|
||||
.query((opts) => {
|
||||
return {
|
||||
greeting: `hello ${opts.input.text}`,
|
||||
};
|
||||
hello: publicProcedure.input(
|
||||
z.object({
|
||||
text: z.string(),
|
||||
}),
|
||||
).query((opts) => {
|
||||
return {
|
||||
greeting: `hello ${opts.input.text}`,
|
||||
};
|
||||
}),
|
||||
});
|
||||
|
||||
// export type definition of API
|
||||
|
||||
389
server/utils/data.ts
Normal file
389
server/utils/data.ts
Normal file
@@ -0,0 +1,389 @@
|
||||
import { matchSorter } from "match-sorter";
|
||||
// @ts-expect-error - no types, but it's a tiny function
|
||||
import sortBy from "sort-by";
|
||||
import invariant from "tiny-invariant";
|
||||
import { Low } from "lowdb";
|
||||
import { JSONFile } from "lowdb/node";
|
||||
import { join } from "node:path";
|
||||
import { mkdir } from "node:fs/promises";
|
||||
|
||||
type ContactMutation = {
|
||||
id?: string;
|
||||
first?: string;
|
||||
last?: string;
|
||||
avatar?: string;
|
||||
twitter?: string;
|
||||
notes?: string;
|
||||
favorite?: boolean;
|
||||
};
|
||||
|
||||
export type ContactRecord = ContactMutation & {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
// Define the database schema
|
||||
type Schema = {
|
||||
records: Record<string, ContactRecord>;
|
||||
};
|
||||
|
||||
// Set up lowdb
|
||||
const initDb = async (): Promise<Low<Schema>> => {
|
||||
// Ensure the db directory exists
|
||||
const dbDir = join(process.cwd(), '.db');
|
||||
await mkdir(dbDir, { recursive: true });
|
||||
|
||||
const file = join(dbDir, 'contacts.json');
|
||||
const adapter = new JSONFile<Schema>(file);
|
||||
const defaultData: Schema = { records: {} };
|
||||
const db = new Low<Schema>(adapter, defaultData);
|
||||
|
||||
// Load existing data
|
||||
await db.read();
|
||||
|
||||
// Initialize if needed
|
||||
if (!db.data) {
|
||||
db.data = defaultData;
|
||||
}
|
||||
|
||||
return db;
|
||||
};
|
||||
|
||||
// Create a singleton instance of the database
|
||||
let dbPromise: Promise<Low<Schema>> | null = null;
|
||||
|
||||
const getDb = () => {
|
||||
if (!dbPromise) {
|
||||
dbPromise = initDb();
|
||||
}
|
||||
return dbPromise;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// This is a DB wrapper using lowdb for persistence
|
||||
const fakeContacts = {
|
||||
async getAll(): Promise<ContactRecord[]> {
|
||||
const db = await getDb();
|
||||
return Object.keys(db.data.records)
|
||||
.map((key) => db.data.records[key])
|
||||
.sort(sortBy("-createdAt", "last"));
|
||||
},
|
||||
|
||||
async get(id: string): Promise<ContactRecord | null> {
|
||||
const db = await getDb();
|
||||
return db.data.records[id] || null;
|
||||
},
|
||||
|
||||
async create(values: ContactMutation): Promise<ContactRecord> {
|
||||
const db = await getDb();
|
||||
const id = values.id || Math.random().toString(36).substring(2, 9);
|
||||
const createdAt = new Date().toISOString();
|
||||
const newContact = { id, createdAt, ...values };
|
||||
db.data.records[id] = newContact;
|
||||
await db.write();
|
||||
return newContact;
|
||||
},
|
||||
|
||||
async set(id: string, values: ContactMutation): Promise<ContactRecord> {
|
||||
const db = await getDb();
|
||||
const contact = await this.get(id);
|
||||
invariant(contact, `No contact found for ${id}`);
|
||||
const updatedContact = { ...contact, ...values };
|
||||
db.data.records[id] = updatedContact;
|
||||
await db.write();
|
||||
return updatedContact;
|
||||
},
|
||||
|
||||
async destroy(id: string): Promise<null> {
|
||||
const db = await getDb();
|
||||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
||||
if (db.data.records[id] !== undefined) delete db.data.records[id];
|
||||
await db.write();
|
||||
return null;
|
||||
},
|
||||
|
||||
// New reset function to restore the initial data
|
||||
async reset(): Promise<void> {
|
||||
const db = await getDb();
|
||||
db.data.records = {};
|
||||
await db.write();
|
||||
|
||||
// Restore initial data
|
||||
const initialContacts = getInitialContacts();
|
||||
for (const contact of initialContacts) {
|
||||
await this.create(contact);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Handful of helper functions to be called from route loaders and actions
|
||||
export async function getContacts(query?: string | null) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
let contacts = await fakeContacts.getAll();
|
||||
if (query) {
|
||||
contacts = matchSorter(contacts, query, {
|
||||
keys: ["first", "last"],
|
||||
});
|
||||
}
|
||||
return contacts.sort(sortBy("last", "createdAt"));
|
||||
}
|
||||
|
||||
export async function createEmptyContact() {
|
||||
return await fakeContacts.create({});
|
||||
}
|
||||
|
||||
export async function getContact(id: string) {
|
||||
return fakeContacts.get(id);
|
||||
}
|
||||
|
||||
export async function updateContact(id: string, updates: ContactMutation) {
|
||||
const contact = await fakeContacts.get(id);
|
||||
if (!contact) {
|
||||
throw new Error(`No contact found for ${id}`);
|
||||
}
|
||||
await fakeContacts.set(id, { ...contact, ...updates });
|
||||
return contact;
|
||||
}
|
||||
|
||||
export async function deleteContact(id: string) {
|
||||
await fakeContacts.destroy(id);
|
||||
}
|
||||
|
||||
// New function to reset the database to initial state
|
||||
export async function resetDatabase() {
|
||||
console.log("RESET DATABASE");
|
||||
await fakeContacts.reset();
|
||||
}
|
||||
|
||||
// Helper function to get initial contacts data
|
||||
function getInitialContacts() {
|
||||
return [
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/124e-400o400o2-wHVdAuNaxi8KJrgtN3ZKci.jpg",
|
||||
first: "Shruti",
|
||||
last: "Kapoor",
|
||||
twitter: "@shrutikapoor08",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/1940-400o400o2-Enh9dnYmrLYhJSTTPSw3MH.jpg",
|
||||
first: "Glenn",
|
||||
last: "Reyes",
|
||||
twitter: "@glnnrys",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/9273-400o400o2-3tyrUE3HjsCHJLU5aUJCja.jpg",
|
||||
first: "Ryan",
|
||||
last: "Florence",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/d14d-400o400o2-pyB229HyFPCnUcZhHf3kWS.png",
|
||||
first: "Oscar",
|
||||
last: "Newman",
|
||||
twitter: "@__oscarnewman",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/fd45-400o400o2-fw91uCdGU9hFP334dnyVCr.jpg",
|
||||
first: "Michael",
|
||||
last: "Jackson",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/b07e-400o400o2-KgNRF3S9sD5ZR4UsG7hG4g.jpg",
|
||||
first: "Christopher",
|
||||
last: "Chedeau",
|
||||
twitter: "@Vjeux",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/262f-400o400o2-UBPQueK3fayaCmsyUc1Ljf.jpg",
|
||||
first: "Cameron",
|
||||
last: "Matheson",
|
||||
twitter: "@cmatheson",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/820b-400o400o2-Ja1KDrBAu5NzYTPLSC3GW8.jpg",
|
||||
first: "Brooks",
|
||||
last: "Lybrand",
|
||||
twitter: "@BrooksLybrand",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/df38-400o400o2-JwbChVUj6V7DwZMc9vJEHc.jpg",
|
||||
first: "Alex",
|
||||
last: "Anderson",
|
||||
twitter: "@ralex1993",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/5578-400o400o2-BMT43t5kd2U1XstaNnM6Ax.jpg",
|
||||
first: "Kent C.",
|
||||
last: "Dodds",
|
||||
twitter: "@kentcdodds",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/c9d5-400o400o2-Sri5qnQmscaJXVB8m3VBgf.jpg",
|
||||
first: "Nevi",
|
||||
last: "Shah",
|
||||
twitter: "@nevikashah",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/2694-400o400o2-MYYTsnszbLKTzyqJV17w2q.png",
|
||||
first: "Andrew",
|
||||
last: "Petersen",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/907a-400o400o2-9TM2CCmvrw6ttmJiTw4Lz8.jpg",
|
||||
first: "Scott",
|
||||
last: "Smerchek",
|
||||
twitter: "@smerchek",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/08be-400o400o2-WtYGFFR1ZUJHL9tKyVBNPV.jpg",
|
||||
first: "Giovanni",
|
||||
last: "Benussi",
|
||||
twitter: "@giovannibenussi",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/f814-400o400o2-n2ua5nM9qwZA2hiGdr1T7N.jpg",
|
||||
first: "Igor",
|
||||
last: "Minar",
|
||||
twitter: "@IgorMinar",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/fb82-400o400o2-LbvwhTVMrYLDdN3z4iEFMp.jpeg",
|
||||
first: "Brandon",
|
||||
last: "Kish",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/fcda-400o400o2-XiYRtKK5Dvng5AeyC8PiUA.png",
|
||||
first: "Arisa",
|
||||
last: "Fukuzaki",
|
||||
twitter: "@arisa_dev",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/c8c3-400o400o2-PR5UsgApAVEADZRixV4H8e.jpeg",
|
||||
first: "Alexandra",
|
||||
last: "Spalato",
|
||||
twitter: "@alexadark",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/7594-400o400o2-hWtdCjbdFdLgE2vEXBJtyo.jpg",
|
||||
first: "Cat",
|
||||
last: "Johnson",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/5636-400o400o2-TWgi8vELMFoB3hB9uPw62d.jpg",
|
||||
first: "Ashley",
|
||||
last: "Narcisse",
|
||||
twitter: "@_darkfadr",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/6aeb-400o400o2-Q5tAiuzKGgzSje9ZsK3Yu5.JPG",
|
||||
first: "Edmund",
|
||||
last: "Hung",
|
||||
twitter: "@_edmundhung",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/30f1-400o400o2-wJBdJ6sFayjKmJycYKoHSe.jpg",
|
||||
first: "Clifford",
|
||||
last: "Fajardo",
|
||||
twitter: "@cliffordfajard0",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/6faa-400o400o2-amseBRDkdg7wSK5tjsFDiG.jpg",
|
||||
first: "Erick",
|
||||
last: "Tamayo",
|
||||
twitter: "@ericktamayo",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/feba-400o400o2-R4GE7eqegJNFf3cQ567obs.jpg",
|
||||
first: "Paul",
|
||||
last: "Bratslavsky",
|
||||
twitter: "@codingthirty",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/c315-400o400o2-spjM5A6VVfVNnQsuwvX3DY.jpg",
|
||||
first: "Pedro",
|
||||
last: "Cattori",
|
||||
twitter: "@pcattori",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/eec1-400o400o2-HkvWKLFqecmFxLwqR9KMRw.jpg",
|
||||
first: "Andre",
|
||||
last: "Landgraf",
|
||||
twitter: "@AndreLandgraf94",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/c73a-400o400o2-4MTaTq6ftC15hqwtqUJmTC.jpg",
|
||||
first: "Monica",
|
||||
last: "Powell",
|
||||
twitter: "@indigitalcolor",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/cef7-400o400o2-KBZUydbjfkfGACQmjbHEvX.jpeg",
|
||||
first: "Brian",
|
||||
last: "Lee",
|
||||
twitter: "@brian_dlee",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/f83b-400o400o2-Pyw3chmeHMxGsNoj3nQmWU.jpg",
|
||||
first: "Sean",
|
||||
last: "McQuaid",
|
||||
twitter: "@SeanMcQuaidCode",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/a9fc-400o400o2-JHBnWZRoxp7QX74Hdac7AZ.jpg",
|
||||
first: "Shane",
|
||||
last: "Walker",
|
||||
twitter: "@swalker326",
|
||||
},
|
||||
{
|
||||
avatar:
|
||||
"https://sessionize.com/image/6644-400o400o2-aHnGHb5Pdu3D32MbfrnQbj.jpg",
|
||||
first: "Jon",
|
||||
last: "Jensen",
|
||||
twitter: "@jenseng",
|
||||
},
|
||||
].map(contact => ({
|
||||
...contact,
|
||||
id: `${contact.first
|
||||
.toLowerCase()
|
||||
.split(" ")
|
||||
.join("_")}-${contact.last.toLowerCase()}`,
|
||||
}));
|
||||
}
|
||||
|
||||
// Initialize with seed data on first load
|
||||
(async () => {
|
||||
const db = await getDb();
|
||||
if (Object.keys(db.data.records).length === 0) {
|
||||
await resetDatabase();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user