Skip to content

Commit 6eb9df5

Browse files
Merge pull request #2095 from appwrite/fix-build-warnings
Fix style and clean up unused code
2 parents 63dd977 + e3bd6cd commit 6eb9df5

File tree

28 files changed

+536
-548
lines changed

28 files changed

+536
-548
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-bullseye as base
1+
FROM node:20-bullseye AS base
22

33
ARG PUBLIC_APPWRITE_ENDPOINT
44
ENV PUBLIC_APPWRITE_ENDPOINT ${PUBLIC_APPWRITE_ENDPOINT}
@@ -60,13 +60,13 @@ COPY pnpm-lock.yaml pnpm-lock.yaml
6060
RUN npm i -g corepack@latest
6161
RUN corepack enable
6262

63-
FROM base as build
63+
FROM base AS build
6464

6565
COPY . .
6666
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
6767
RUN NODE_OPTIONS=--max_old_space_size=16384 pnpm run build
6868

69-
FROM base as final
69+
FROM base AS final
7070

7171
# Install fontconfig
7272
COPY ./local-fonts /usr/share/fonts

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"pnpm": {
116116
"onlyBuiltDependencies": [
117117
"@parcel/watcher",
118+
"@tailwindcss/oxide",
118119
"core-js",
119120
"esbuild",
120121
"sharp",

src/lib/components/PreFooter.svelte

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,29 +136,16 @@
136136
flex-basis: 5rem !important;
137137
}
138138
139-
.web-strip-plans-item-wrapper {
140-
gap: 2.65rem;
141-
}
142-
143139
@media (min-width: 1024px) and (max-width: 1224px) {
144140
.web-strip-plans-info {
145141
flex-basis: 1rem !important;
146142
}
147-
148-
.web-strip-plans-item-wrapper {
149-
gap: 1.25rem !important;
150-
inline-size: 100% !important;
151-
}
152143
}
153144
154145
@media (max-width: 1024px) {
155146
.web-strip-plans-info {
156147
flex-basis: 3rem !important;
157148
}
158-
159-
.web-strip-plans-item-wrapper {
160-
gap: 1.25rem !important;
161-
}
162149
}
163150
164151
.web-pre-footer-bg {

src/routes/(init)/init/(components)/event-carousel.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@
9898
on:emblaInit={onEmblaInit}
9999
>
100100
<div class="embla__container flex">
101-
{#each events as _}
101+
{#each events as { poster, title }}
102102
<div
103103
class="embla__slide bg-card/90 mr-4 min-w-0 [flex:0_0_33%] items-center rounded-lg p-4"
104104
>
105-
<img src={_.poster} class="m-auto rounded-t" />
106-
<h3 class="mt-0.5 text-base font-medium">{_.title}</h3>
105+
<img alt={title} src={poster} class="m-auto rounded-t" />
106+
<h3 class="mt-0.5 text-base font-medium">{title}</h3>
107107
</div>
108108
{/each}
109109
</div>

src/routes/(init)/init/(utils)/contributions.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { APPWRITE_DB_INIT_ID, APPWRITE_COL_INIT_ID } from '$env/static/private';
2-
import { DOMParser, parseHTML } from 'linkedom';
3-
4-
import type { TicketData } from './tickets';
1+
import { APPWRITE_COL_INIT_ID, APPWRITE_DB_INIT_ID } from '$env/static/private';
2+
import { parseHTML } from 'linkedom';
53
import { z } from 'zod';
64
import { createInitServerClient } from './appwrite';
5+
import type { TicketData } from './tickets';
76

87
const contributionsSchema = z.array(z.array(z.number()));
98
export type ContributionsMatrix = z.infer<typeof contributionsSchema>;

src/routes/(init)/init/+page.server.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import { redirect, type Action, type Actions } from '@sveltejs/kit';
1+
import { redirect, type Actions } from '@sveltejs/kit';
22
import { getTicketByUser } from './(utils)/tickets';
3-
import { OAuthProvider } from 'appwrite';
4-
import { Account, Client } from 'node-appwrite';
5-
import { PUBLIC_APPWRITE_ENDPOINT, PUBLIC_APPWRITE_PROJECT_INIT_ID } from '$env/static/public';
63
import { loginGithub } from './(utils)/auth';
74

85
export const prerender = false;

src/routes/(init)/init/tickets/[username]/+page.server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { getTicketDocByUsername } from '../../(utils)/tickets';
22
import { error, redirect, type Actions } from '@sveltejs/kit';
33
import { getTicketContributions } from '../../(utils)/contributions';
4-
import { OAuthProvider } from 'appwrite';
5-
import { Account, Client } from 'node-appwrite';
6-
import { PUBLIC_APPWRITE_ENDPOINT, PUBLIC_APPWRITE_PROJECT_INIT_ID } from '$env/static/public';
74
import { loginGithub } from '../../(utils)/auth';
85

96
export const ssr = true;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Client, Account } from 'node-appwrite';
2+
3+
async function getLoggedInUser(context) {
4+
const session = cookies().get('custom-session-cookie');
5+
if (!session) return;
6+
7+
const client = new Client()
8+
.setEndpoint(import.meta.env.PUBLIC_APPWRITE_ENDPOINT)
9+
.setProject(import.meta.env.PUBLIC_APPWRITE_PROJECT_ID);
10+
11+
client.setSession(session.value);
12+
const account = new Account(client);
13+
14+
return account.get();
15+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Client, Account } from 'node-appwrite';
2+
import { cookies } from 'next/headers';
3+
4+
async function getLoggedInUser() {
5+
const session = cookies().get('custom-session-cookie');
6+
if (!session) return;
7+
8+
const client = new Client()
9+
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT)
10+
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID);
11+
12+
client.setSession(session.value);
13+
const account = new Account(client);
14+
15+
return account.get();
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Client, Account } from 'node-appwrite';
2+
import { H3Event, getCookie } from 'h3';
3+
4+
async function getLoggedInUser(event) {
5+
const session = getCookie(event, 'custom-session-cookie');
6+
if (!session) return;
7+
8+
const client = new Client()
9+
.setEndpoint(process.env.PUBLIC_APPWRITE_ENDPOINT)
10+
.setProject(process.env.PUBLIC_APPWRITE_PROJECT_ID);
11+
12+
client.setSession(session.value);
13+
const account = new Account(client);
14+
15+
return account.get();
16+
}

0 commit comments

Comments
 (0)