Skip to content

Commit 151eade

Browse files
committed
fix: ci tests and type errors
1 parent 4c3cc65 commit 151eade

File tree

17 files changed

+545
-435
lines changed

17 files changed

+545
-435
lines changed

app/pages/index.vue

Lines changed: 50 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ const params = useUrlSearchParams('history')
4444
// Store only category IDs (URL + state)
4545
const selectedCategories = computed<string[]>({
4646
get: () => params.categories ? (params.categories as string).split(',') : [],
47-
set: (val) => params.categories = val.length ? val.join(',') : null,
47+
set: (val) => {
48+
params.categories = val.length ? val.join(',') : null as any
49+
},
4850
})
4951
5052
const filters = computed<string[]>({
5153
get: () => params.filters ? (params.filters as string).split(',') : [],
52-
set: (val) => params.filters = val.length ? val.join(',') : null,
54+
set: (val) => {
55+
params.filters = val.length ? val.join(',') : null as any
56+
},
5357
})
5458
5559
const { locale, locales } = useI18n()
@@ -62,7 +66,7 @@ async function changeLocale(code: string) {
6266
if (code === locale.value)
6367
return
6468
65-
const path = switchLocalePath(code)
69+
const path = switchLocalePath(code as any)
6670
if (!path)
6771
return
6872
@@ -120,12 +124,12 @@ function getCategoryById(categoryId: string) {
120124
<template>
121125
<div bg-neutral-100 h-screen relative overflow-hidden>
122126
<!-- Background SVG at bottom -->
123-
<NuxtImg src="/assets/lugano.svg" alt="Lugano" h-auto w-full mx-auto op-3 flex pointer-events-none items-end absolute bottom-0 left-0 right-0 z-0/>
127+
<NuxtImg src="/assets/lugano.svg" alt="Lugano" mx-auto op-3 flex h-auto w-full pointer-events-none items-end bottom-0 left-0 right-0 absolute z-0 />
124128

125129
<!-- Language Selector -->
126130
<DevOnly>
127131
<div right-16 top-16 fixed z-50>
128-
<SelectRoot :model-value="locale" @update:modelValue="changeLocale">
132+
<SelectRoot :model-value="locale" @update:model-value="changeLocale">
129133
<SelectTrigger
130134
outline="~ 1.5 neutral-300"
131135
flex="~ items-center gap-8" shadow-sm font-medium py-8 rounded-8 bg-white cursor-pointer text-f-sm f-px-md
@@ -193,7 +197,7 @@ function getCategoryById(categoryId: string) {
193197
flex="~ items-center gap-6"
194198
@click="removeCategory(categoryId)"
195199
>
196-
<Icon :name="getCategoryById(categoryId)?.icon" size-16 />
200+
<Icon :name="getCategoryById(categoryId)?.icon || ''" size-16 />
197201
{{ getCategoryById(categoryId)?.name }}
198202
<Icon name="i-nimiq:cross" size-16 />
199203
</button>
@@ -225,45 +229,43 @@ function getCategoryById(categoryId: string) {
225229
<div
226230
v-for="i in 6"
227231
:key="`skeleton-${i}`"
228-
bg-white
229-
rounded-12
230-
overflow-hidden
232+
231233
outline="~ 1 neutral-200"
232-
shadow-sm
234+
233235
flex="~ col"
234-
animate-pulse
236+
shadow-sm rounded-12 bg-white overflow-hidden animate-pulse
235237
>
236238
<!-- Image skeleton -->
237-
<div aspect="16/9" bg-neutral-200 flex-shrink-0></div>
239+
<div aspect="16/9" bg-neutral-200 flex-shrink-0 />
238240

239241
<!-- Content skeleton -->
240242
<div f-p-md flex="~ col gap-12">
241243
<!-- Title -->
242-
<div h-20 bg-neutral-200 rounded-6 w="3/4"></div>
244+
<div rounded-6 bg-neutral-200 h-20 w="3/4" />
243245

244246
<!-- Status -->
245247
<div flex="~ gap-8">
246-
<div h-24 bg-neutral-200 rounded-full w-80></div>
247-
<div h-24 bg-neutral-200 rounded-6 w-100></div>
248+
<div rounded-full bg-neutral-200 h-24 w-80 />
249+
<div rounded-6 bg-neutral-200 h-24 w-100 />
248250
</div>
249251

250252
<!-- Address -->
251253
<div flex="~ gap-8">
252-
<div size-16 bg-neutral-200 rounded-4 flex-shrink-0 mt-2></div>
254+
<div mt-2 rounded-4 bg-neutral-200 flex-shrink-0 size-16 />
253255
<div flex="~ col gap-6 flex-1">
254-
<div h-16 bg-neutral-200 rounded-4 w-full></div>
255-
<div h-16 bg-neutral-200 rounded-4 w="2/3"></div>
256+
<div rounded-4 bg-neutral-200 h-16 w-full />
257+
<div rounded-4 bg-neutral-200 h-16 w="2/3" />
256258
</div>
257259
</div>
258260

259261
<!-- Categories -->
260262
<div flex="~ gap-6">
261-
<div h-24 bg-neutral-200 rounded-full w-80></div>
262-
<div h-24 bg-neutral-200 rounded-full w-60></div>
263+
<div rounded-full bg-neutral-200 h-24 w-80 />
264+
<div rounded-full bg-neutral-200 h-24 w-60 />
263265
</div>
264266

265267
<!-- Action -->
266-
<div h-20 bg-neutral-200 rounded-6 w-100 mt-auto pt-8></div>
268+
<div mt-auto pt-8 rounded-6 bg-neutral-200 h-20 w-100 />
267269
</div>
268270
</div>
269271
</div>
@@ -277,47 +279,32 @@ function getCategoryById(categoryId: string) {
277279
:aria-label="`View ${location.name} on Google Maps`"
278280
target="_blank"
279281
rel="noopener noreferrer"
280-
nq-hoverable
281-
p-0
282-
bg-white
283-
rounded-12
284-
overflow-hidden
282+
285283
outline="~ 1 neutral-200"
286-
block
287-
no-underline
288-
group
284+
289285
flex="~ col"
290-
h-full
286+
group p-0 rounded-12 bg-white no-underline h-full block overflow-hidden nq-hoverable
291287
>
292288
<!-- Image with Rating Overlay (16:9 aspect ratio) -->
293-
<div relative aspect="16/9" bg-neutral-200 overflow-hidden flex-shrink-0>
289+
<div aspect="16/9" bg-neutral-200 flex-shrink-0 relative overflow-hidden>
294290
<NuxtImg
295291
v-if="location.photo"
296292
:src="location.photo"
297293
:alt="`Photo of ${location.name}`"
298-
h-full
299-
w-full
300-
object-cover
301-
transition-transform
302-
duration-300
303-
group-hover:scale-105
294+
295+
h-full w-full transition-transform duration-300 object-cover group-hover:scale-105
304296
/>
305297

306298
<!-- Rating Pill Overlay -->
307299
<div
308300
v-if="location.rating"
309-
absolute
310-
top-8
311-
right-8
301+
312302
flex="~ items-center gap-4"
313303
bg="white/95"
314-
backdrop-blur-sm
304+
315305
text="neutral-900 f-sm"
316-
font-semibold
317-
px-8
318-
py-4
319-
rounded-full
320-
shadow-sm
306+
307+
shadow-sm font-semibold px-8 py-4 rounded-full right-8 top-8 absolute backdrop-blur-sm
321308
outline="1.5 offset--1.5 neutral/10"
322309
>
323310
<Icon name="i-nimiq:star" text-gold size-16 />
@@ -326,7 +313,7 @@ function getCategoryById(categoryId: string) {
326313
</div>
327314

328315
<!-- Content with consistent vertical rhythm -->
329-
<div f-p-md flex="~ col gap-12" flex-1>
316+
<div flex="~ col gap-12" flex-1 f-p-md>
330317
<!-- Name (1 line max) -->
331318
<h3
332319
text="f-lg neutral-900"
@@ -343,8 +330,7 @@ function getCategoryById(categoryId: string) {
343330
flex="~ items-center gap-8 wrap"
344331
>
345332
<span
346-
:class="[
347-
'px-8 py-4 rounded-full text-f-xs font-semibold whitespace-nowrap',
333+
class="font-semibold px-8 py-4 rounded-full whitespace-nowrap text-f-xs" :class="[
348334
location.hoursStatus.variant === 'open' && 'bg-green-400 text-green-1100 outline-1.5 outline-green-400',
349335
location.hoursStatus.variant === 'closing-soon' && 'bg-orange-400 text-orange-1100 outline-1.5 outline-orange-400',
350336
location.hoursStatus.variant === 'closed' && 'bg-neutral-200 text-neutral-800',
@@ -371,16 +357,13 @@ function getCategoryById(categoryId: string) {
371357
<div flex="~ items-start gap-8">
372358
<Icon
373359
name="i-tabler:map-pin"
374-
size-16
375-
text-neutral-700
376-
flex-shrink-0
377-
mt-2
360+
361+
text-neutral-700 mt-2 flex-shrink-0 size-16
378362
/>
379363
<p
380364
text="neutral-800 f-sm"
381-
m-0
382-
line-clamp-2
383-
flex-1
365+
366+
m-0 flex-1 line-clamp-2
384367
>
385368
{{ location.address }}
386369
</p>
@@ -429,13 +412,10 @@ function getCategoryById(categoryId: string) {
429412
:aria-label="`Visit ${location.name} website`"
430413
target="_blank"
431414
rel="noopener noreferrer"
432-
@click.stop.prevent="(e) => { window.open(location.website, '_blank') }"
433415
un-text="neutral-600 hover:neutral-900 f-sm"
434416
font-medium
435-
ml-auto
436-
transition-colors
437-
no-underline
438-
nq-arrow
417+
418+
ml-auto no-underline transition-colors nq-arrow @click.stop
439419
>
440420
Website
441421
</a>
@@ -447,33 +427,27 @@ function getCategoryById(categoryId: string) {
447427
<!-- Empty State -->
448428
<div
449429
v-if="!pending && (!locations || locations.length === 0)"
450-
bg-white
430+
451431
outline="~ 1 neutral-200"
452-
shadow-sm
453-
text-center
454-
rounded-12
455-
f-py-2xl
456-
f-px-lg
457-
f-mt-xl
432+
433+
shadow-sm text-center rounded-12 bg-white f-px-lg f-py-2xl f-mt-xl
458434
>
459435
<div
460-
size-64
461-
bg-neutral-100
462-
rounded-full
436+
463437
flex="~ items-center justify-center"
464-
mx-auto
465-
f-mb-md
438+
439+
mx-auto rounded-full bg-neutral-100 size-64 f-mb-md
466440
>
467441
<Icon
468442
name="i-nimiq:magnifying-glass"
469-
size-32
470-
text-neutral-400
443+
444+
text-neutral-400 size-32
471445
/>
472446
</div>
473447
<p text="neutral-800 f-lg" font-semibold m-0>
474448
{{ $t('empty.title') }}
475449
</p>
476-
<p text="neutral-600 f-sm" f-mt-xs m-0>
450+
<p text="neutral-600 f-sm" m-0 f-mt-xs>
477451
{{ $t('empty.subtitle') }}
478452
</p>
479453
</div>

database/docker-compose.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,20 @@ services:
88
- '${POSTGRES_PORT:-5432}:5432'
99
volumes:
1010
- db_data:/var/lib/postgresql/data
11-
- ./init.sh:/docker-entrypoint-initdb.d/init.sh
12-
- ./migrate.sh:/migrate.sh
13-
- ./migrations:/migrations:ro
11+
- ./init.sh:/docker-entrypoint-initdb.d/01-init.sh
12+
- ./migrate.sh:/docker-entrypoint-initdb.d/02-migrate.sh
13+
- ./seed.sh:/docker-entrypoint-initdb.d/03-seed.sh
14+
- ./startup.sh:/startup.sh
15+
- ./migrations:/docker-entrypoint-initdb.d/migrations:ro
1416
- ./seeds:/docker-entrypoint-initdb.d/seeds:ro
1517
environment:
1618
POSTGRES_USER: postgres
1719
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
1820
POSTGRES_DB: ${POSTGRES_DB:-postgres}
1921
env_file:
20-
- ../.env
21-
command: >
22-
bash -c "
23-
/usr/local/bin/docker-entrypoint.sh postgres &
24-
PID=$$!
25-
until pg_isready -U postgres; do sleep 1; done
26-
for migration in /migrations/*.sql; do
27-
[ -f \"$$migration\" ] && psql -U postgres -d postgres -f \"$$migration\" 2>&1 | grep -v 'already exists' || true
28-
done
29-
wait $$PID
30-
"
22+
- path: ../.env
23+
required: true
24+
command: /startup.sh
3125
healthcheck:
3226
test: [CMD-SHELL, pg_isready -U postgres]
3327
interval: 10s
@@ -48,7 +42,8 @@ services:
4842
PGRST_DB_ANON_ROLE: anon
4943
PGRST_JWT_SECRET: ${JWT_SECRET}
5044
env_file:
51-
- ../.env
45+
- path: ../.env
46+
required: true
5247

5348
# postgres-meta - Database metadata service
5449
meta:
@@ -66,7 +61,8 @@ services:
6661
PG_META_DB_USER: postgres
6762
PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
6863
env_file:
69-
- ../.env
64+
- path: ../.env
65+
required: true
7066

7167
# Kong - API Gateway
7268
kong:
@@ -85,7 +81,8 @@ services:
8581
volumes:
8682
- ./kong.yml:/home/kong/temp.yml:ro
8783
env_file:
88-
- ../.env
84+
- path: ../.env
85+
required: true
8986
entrypoint: bash -c 'eval "echo \"$$(cat /home/kong/temp.yml)\"" > /home/kong/kong.yml && /docker-entrypoint.sh kong docker-start'
9087

9188
# Supabase Studio - Dashboard
@@ -105,7 +102,8 @@ services:
105102
SUPABASE_ANON_KEY: ${ANON_KEY}
106103
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
107104
env_file:
108-
- ../.env
105+
- path: ../.env
106+
required: true
109107

110108
volumes:
111109
db_data:

database/init.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,4 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
4141
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT EXECUTE ON ROUTINES TO anon, authenticated, service_role;
4242
EOSQL
4343

44-
echo "Running Drizzle migrations..."
45-
for migration in /docker-entrypoint-initdb.d/migrations/*.sql; do
46-
if [ -f "$migration" ]; then
47-
echo "Applying migration: $(basename $migration)"
48-
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f "$migration"
49-
fi
50-
done
51-
52-
echo "Applying RLS policies..."
53-
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f /docker-entrypoint-initdb.d/seeds/rls-policies.sql
54-
55-
echo "Seeding categories..."
56-
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f /docker-entrypoint-initdb.d/seeds/categories.sql
57-
58-
echo "Seeding dummy data..."
59-
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f /docker-entrypoint-initdb.d/seeds/sources/dummy.sql
60-
61-
echo "Database initialization complete!"
44+
echo "Database initialization complete (extensions and roles only)."

0 commit comments

Comments
 (0)