Update Deno to 2.1 LTS!

This commit is contained in:
Bruno Bernardino
2024-11-30 08:13:22 +00:00
parent 7ef8220bb1
commit bbf8683004
12 changed files with 25 additions and 22 deletions

View File

@@ -35,9 +35,9 @@ spec:
value: ${db.PORT} value: ${db.PORT}
- key: POSTGRESQL_CAFILE - key: POSTGRESQL_CAFILE
scope: RUN_AND_BUILD_TIME scope: RUN_AND_BUILD_TIME
value: "" value: ''
databases: databases:
- name: db - name: db
engine: PG engine: PG
production: false production: false
version: "15" version: '15'

2
.dvmrc
View File

@@ -1 +1 @@
1.46.3 2.1.2

View File

@@ -1,10 +1,10 @@
name: "Build Docker Image" name: 'Build Docker Image'
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: branches:
- "main" - 'main'
release: release:
types: [published] types: [published]

View File

@@ -1,4 +1,4 @@
FROM denoland/deno:ubuntu-1.46.3 FROM denoland/deno:ubuntu-2.1.2
EXPOSE 8000 EXPOSE 8000

View File

@@ -19,7 +19,7 @@
}, },
"exclude": ["./_fresh/*", "./node_modules/*", "**/_fresh/*"], "exclude": ["./_fresh/*", "./node_modules/*", "**/_fresh/*"],
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
"nodeModulesDir": true, "nodeModulesDir": "auto",
"imports": { "imports": {
"/": "./", "/": "./",
"./": "./", "./": "./",
@@ -31,9 +31,9 @@
"preact/": "https://esm.sh/preact@10.23.2/", "preact/": "https://esm.sh/preact@10.23.2/",
"@preact/signals": "https://esm.sh/*@preact/signals@1.3.0", "@preact/signals": "https://esm.sh/*@preact/signals@1.3.0",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.8.0", "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.8.0",
"tailwindcss": "npm:tailwindcss@3.4.9", "tailwindcss": "npm:tailwindcss@3.4.15",
"tailwindcss/": "npm:/tailwindcss@3.4.9/", "tailwindcss/": "npm:/tailwindcss@3.4.15/",
"tailwindcss/plugin": "npm:/tailwindcss@3.4.9/plugin.js", "tailwindcss/plugin": "npm:/tailwindcss@3.4.15/plugin.js",
"std/": "https://deno.land/std@0.224.0/", "std/": "https://deno.land/std@0.224.0/",
"$std/": "https://deno.land/std@0.224.0/" "$std/": "https://deno.land/std@0.224.0/"
} }

View File

@@ -5,7 +5,7 @@ services:
ports: ports:
- 127.0.0.1:8000:8000 - 127.0.0.1:8000:8000
mem_limit: '256m' mem_limit: '256m'
user: "${UID}:${GID}" # if you run into issues with permissions for the data-files volume below, see other options at https://stackoverflow.com/a/56904335 user: '${UID}:${GID}' # if you run into issues with permissions for the data-files volume below, see other options at https://stackoverflow.com/a/56904335
env_file: env_file:
- path: .env - path: .env
required: true required: true

View File

@@ -69,7 +69,7 @@ async function getPathEntries(userId: string, path: string): Promise<Deno.DirEnt
try { try {
await Deno.stat(rootPath); await Deno.stat(rootPath);
} catch (error) { } catch (error) {
if (error.toString().includes('NotFound')) { if ((error as Error).toString().includes('NotFound')) {
await Deno.mkdir(join(rootPath, TRASH_PATH), { recursive: true }); await Deno.mkdir(join(rootPath, TRASH_PATH), { recursive: true });
} }
} }
@@ -80,7 +80,7 @@ async function getPathEntries(userId: string, path: string): Promise<Deno.DirEnt
try { try {
await Deno.stat(rootPath); await Deno.stat(rootPath);
} catch (error) { } catch (error) {
if (error.toString().includes('NotFound')) { if ((error as Error).toString().includes('NotFound')) {
await Deno.mkdir(rootPath, { recursive: true }); await Deno.mkdir(rootPath, { recursive: true });
} }
} }

View File

@@ -157,7 +157,7 @@ export async function findFeedInUrl(url: string) {
} }
} catch (error) { } catch (error) {
// This error can happen for huge responses, but that usually means the URL works // This error can happen for huge responses, but that usually means the URL works
if (error.toString().includes('RangeError: Maximum call stack size exceeded')) { if ((error as Error).toString().includes('RangeError: Maximum call stack size exceeded')) {
return url; return url;
} else { } else {
console.error(error); console.error(error);

View File

@@ -94,7 +94,7 @@ export const handler: Handlers<Data, FreshContextState> = {
return createSessionResponse(request, user, { urlToRedirectTo: `/` }); return createSessionResponse(request, user, { urlToRedirectTo: `/` });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
return await context.render({ error: error.toString(), email, formData }); return await context.render({ error: (error as Error).toString(), email, formData });
} }
}, },
}; };

View File

@@ -169,7 +169,7 @@ export const handler: Handlers<Data, FreshContextState> = {
}); });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
errorMessage = error.toString(); errorMessage = (error as Error).toString();
errorTitle = `Failed to ${actionWords.get(action) || action}!`; errorTitle = `Failed to ${actionWords.get(action) || action}!`;
return await context.render({ return await context.render({

View File

@@ -76,7 +76,7 @@ export const handler: Handlers<Data, FreshContextState> = {
}); });
} catch (error) { } catch (error) {
console.error(error); console.error(error);
return await context.render({ error: error.toString(), email, formData }); return await context.render({ error: (error as Error).toString(), email, formData });
} }
}, },
}; };

View File

@@ -7,7 +7,7 @@ h1 {
} }
a { a {
@apply text-[#51A4FB] no-underline hover:underline font-semibold; @apply text-[#51a4fb] no-underline hover:underline font-semibold;
} }
main { main {
@@ -19,7 +19,7 @@ form {
} }
.button { .button {
@apply inline-block rounded text-white bg-[#51A4FB] hover:bg-sky-400 hover:shadow-sm px-4 py-2; @apply inline-block rounded text-white bg-[#51a4fb] hover:bg-sky-400 hover:shadow-sm px-4 py-2;
} }
.button-secondary { .button-secondary {
@@ -31,10 +31,11 @@ form {
} }
.input-field { .input-field {
@apply block w-full p-2 rounded-md text-white bg-slate-700 border-transparent border focus:border-[#51A4FB] focus:bg-slate-700 outline-none focus:ring-0 shadow-sm; @apply block w-full p-2 rounded-md text-white bg-slate-700 border-transparent border focus:border-[#51a4fb]
focus:bg-slate-700 outline-none focus:ring-0 shadow-sm;
} }
.input-field[type="range"] { .input-field[type='range'] {
@apply w-auto; @apply w-auto;
} }
@@ -74,4 +75,6 @@ img.gray {
filter: invert(30%) sepia(46%) saturate(356%) hue-rotate(174deg) brightness(90%) contrast(82%); filter: invert(30%) sepia(46%) saturate(356%) hue-rotate(174deg) brightness(90%) contrast(82%);
} }
details summary::-webkit-details-marker { display:none; } details summary::-webkit-details-marker {
display: none;
}