Skip to content

Commit

Permalink
Updated packages!
Browse files Browse the repository at this point in the history
  • Loading branch information
Guibi1 committed Jan 16, 2024
1 parent 2ae02d1 commit 7721c19
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 46 deletions.
Binary file modified bun.lockb
Binary file not shown.
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"generate": "drizzle-kit generate:mysql",
"push": "drizzle-kit push:mysql",
"studio": "drizzle-kit studio"
},
"devDependencies": {
"@skeletonlabs/skeleton": "^2.0.0",
"@skeletonlabs/tw-plugin": "^0.1.0",
"@types/node": "^20.5.1",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"@skeletonlabs/skeleton": "^2.7.1",
"@skeletonlabs/tw-plugin": "^0.3.1",
"@types/node": "^20.11.4",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"dotenv": "^16.3.1",
"drizzle-kit": "^0.19.13",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"drizzle-kit": "^0.20.13",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^3.0.2",
"prettier-plugin-organize-imports": "^3.2.3",
"prettier-plugin-svelte": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.3",
"vite-plugin-tailwind-purgecss": "^0.1.3"
"mysql2": "^3.7.0",
"prettier": "^3.2.2",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.11",
"vite-plugin-tailwind-purgecss": "^0.2.0"
},
"dependencies": {
"@dicebear/collection": "^6.0.4",
"@dicebear/core": "^6.0.4",
"@floating-ui/dom": "^1.5.1",
"@google-cloud/storage": "^7.0.1",
"@lucia-auth/adapter-mysql": "^2.0.0",
"@planetscale/database": "^1.10.0",
"@sveltejs/adapter-vercel": "^3.0.3",
"@sveltejs/kit": "^1.22.6",
"@tailwindcss/forms": "^0.5.4",
"autoprefixer": "^10.4.15",
"@floating-ui/dom": "^1.5.4",
"@google-cloud/storage": "^7.7.0",
"@lucia-auth/adapter-mysql": "^2.1.0",
"@planetscale/database": "^1.13.0",
"@sveltejs/adapter-vercel": "^4.0.5",
"@sveltejs/kit": "^2.3.3",
"@tailwindcss/forms": "^0.5.7",
"autoprefixer": "^10.4.16",
"chalk": "^5.3.0",
"cheerio": "1.0.0-rc.12",
"classnames": "^2.3.2",
"dayjs": "^1.11.9",
"drizzle-orm": "^0.28.2",
"lucia": "^2.3.0",
"sharp": "^0.32.5",
"svelte": "^4.2.0",
"svelte-check": "^3.5.0",
"sveltekit-api-fetch": "^3.2.0",
"sveltekit-superforms": "^1.6.0",
"tailwindcss": "^3.3.3",
"vite": "^4.4.9",
"zod": "^3.22.2"
"classnames": "^2.5.1",
"dayjs": "^1.11.10",
"drizzle-orm": "^0.29.3",
"lucia": "^2.7.6",
"sharp": "^0.33.2",
"svelte": "^4.2.8",
"svelte-check": "^3.6.3",
"sveltekit-api-fetch": "^3.3.0",
"sveltekit-superforms": "^1.13.3",
"tailwindcss": "^3.4.1",
"vite": "^5.0.11",
"zod": "^3.22.4"
},
"trustedDependencies": [
"sharp"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Carousel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// Function to read image files and update the images and files arrays
function readImages(filelist: FileList) {
for (let file of filelist) {
for (let file of Array.from(filelist)) {
if (file.type !== "image/png" && file.type !== "image/jpeg") return;
if (images.length >= maxImagesCount) return;
let reader = new FileReader();
Expand Down
1 change: 1 addition & 0 deletions src/lib/server/lucia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const conn = connect({
});

export const auth = lucia({
//@ts-expect-error Lucia's planetscale version doesn't match
adapter: planetscale(conn, {
user: "users",
key: "user_key",
Expand Down
3 changes: 1 addition & 2 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Dayjs } from "dayjs";
import type { InferModel } from "drizzle-orm";
import type { User } from "lucia";
import type { booksTable } from "./server/schemas/books";

Expand All @@ -15,7 +14,7 @@ export interface Group {
/**
* Represents a book to be sold
*/
export type Book = InferModel<typeof booksTable>;
export type Book = typeof booksTable.$inferSelect;

/**
* Represents a user's schedule
Expand Down
2 changes: 1 addition & 1 deletion src/lib/zod_schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const omnivoxLoginSchema = z.object({
*/
export const imageSchema = z
.instanceof(File)
.refine((file: File) => file?.length !== 0, "Il faut un fichier")
.refine((file: File) => file?.size !== 0, "Il faut un fichier")
.refine((file) => file.size < 5000000, "Le fichier doit être plus petit que 5MB")
.refine((file) => {
if (!file?.name) return false;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/livres/(acheter)/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import type { LayoutServerLoad } from "./$types";

export const load = (async ({ locals }) => {
return {
bookCodes: db.getBookCodes(locals.user),
bookCodes: await db.getBookCodes(locals.user),
};
}) satisfies LayoutServerLoad;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const load = (async ({ params }) => {

return {
book: book,
bookUser,
bookUser: await bookUser,
school: await bookUser.then((u) => (u ? getSchool(u) : null)),
};
}) satisfies PageServerLoad;
14 changes: 10 additions & 4 deletions src/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/// <reference types="@sveltejs/kit" />
/// <reference no-default-lib="true"/>
/// <reference lib="esnext" />
/// <reference lib="webworker" />
import { build, files, prerendered, version } from "$service-worker";

const sw = /** @type {ServiceWorkerGlobalScope} */ (/** @type {unknown} */ (self));

// Create a unique cache name for this deployment
const CACHE = `cache-${version}`;

Expand All @@ -10,7 +15,7 @@ const ASSETS = [
...prerendered,
];

self.addEventListener("install", (event) => {
sw.addEventListener("install", (event) => {
// Create a new cache and add all files to it
async function addFilesToCache() {
const cache = await caches.open(CACHE);
Expand All @@ -20,7 +25,7 @@ self.addEventListener("install", (event) => {
event.waitUntil(addFilesToCache());
});

self.addEventListener("activate", (event) => {
sw.addEventListener("activate", (event) => {
// Remove previous cached data from disk
async function deleteOldCaches() {
for (const key of await caches.keys()) {
Expand All @@ -31,7 +36,7 @@ self.addEventListener("activate", (event) => {
event.waitUntil(deleteOldCaches());
});

self.addEventListener("fetch", (event) => {
sw.addEventListener("fetch", (event) => {
// ignore POST requests etc
if (event.request.method !== "GET") return;

Expand All @@ -55,10 +60,11 @@ self.addEventListener("fetch", (event) => {

return response;
} catch {
return cache.match("/offline");
// return cache.match(event.request);
return cache.match("/offline");
}
}

// @ts-expect-error Might be undefined but its expected if there is no cache and no network
event.respondWith(respond());
});
4 changes: 2 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import adapter from "@sveltejs/adapter-vercel";
import { vitePreprocess } from "@sveltejs/kit/vite";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
preprocess: [vitePreprocess()],
kit: {
adapter: adapter(),
alias: {
Expand Down

0 comments on commit 7721c19

Please sign in to comment.