fix: bump a lot of versions, fix the broken node adapter

This commit is contained in:
wilson 2026-06-23 17:26:05 +01:00
parent b39f8c0ab3
commit 33c383cf73
9 changed files with 773 additions and 875 deletions

View file

@ -4,6 +4,7 @@
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json", "check": "svelte-check --tsconfig ./tsconfig.json",
@ -16,55 +17,55 @@
"test": "vitest" "test": "vitest"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/kit": "^2.51.0", "@sveltejs/kit": "^2.66.0",
"@sveltejs/vite-plugin-svelte": "^5.0.3", "@sveltejs/vite-plugin-svelte": "^7.1.2",
"@types/better-sqlite3": "^7.6.13", "@types/better-sqlite3": "^7.6.13",
"@types/leaflet": "^1.9.15", "@types/leaflet": "^1.9.21",
"@types/node": "^25.3.2", "@types/node": "^26.0.0",
"@types/sanitize-html": "^2.13.0", "@types/sanitize-html": "^2.16.1",
"@typescript-eslint/eslint-plugin": "^8.55.0", "@typescript-eslint/eslint-plugin": "^8.61.1",
"@typescript-eslint/parser": "^8.55.0", "@typescript-eslint/parser": "^8.61.1",
"eslint": "^9.17.0", "eslint": "^10.5.0",
"eslint-config-prettier": "^10.1.1", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.15.0", "eslint-plugin-svelte": "^3.19.0",
"prettier": "^3.4.2", "prettier": "^3.8.4",
"prettier-plugin-svelte": "^3.3.2", "prettier-plugin-svelte": "^4.1.1",
"svelte": "^5.50.3", "svelte": "^5.56.3",
"svelte-check": "^4.3.6", "svelte-check": "^4.6.0",
"svelte-preprocess": "^6.0.0", "svelte-preprocess": "^6.0.5",
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.7.2", "typescript": "^6.0.3",
"vite": "^6.0.7", "vite": "^8.0.16",
"vitest": "^3.0.8" "vitest": "^4.1.9"
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@immich/sdk": "^2.5.6", "@immich/sdk": "^2.7.5",
"@prisma/adapter-better-sqlite3": "^7.4.2", "@prisma/adapter-better-sqlite3": "^7.8.0",
"@prisma/client": "^7.4.2", "@prisma/client": "^7.8.0",
"@sveltejs/adapter-node": "^5.5.5", "@sveltejs/adapter-node": "^5.5.6",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"canvas-dither": "^1.0.1", "canvas-dither": "^1.0.1",
"date-fns": "^4.1.0", "date-fns": "^4.4.0",
"dotenv": "^17.3.1", "dotenv": "^17.4.2",
"feed": "^4.2.2", "feed": "^5.2.1",
"js-yaml": "^4.1.0", "js-yaml": "^5.0.0",
"just-shuffle": "^4.2.0", "just-shuffle": "^4.2.0",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"node-fetch": "^3.3.2", "node-fetch": "^3.3.2",
"prisma": "^7.4.2", "prisma": "^7.8.0",
"rehype-stringify": "^10.0.1", "rehype-stringify": "^10.0.1",
"remark": "^15.0.1", "remark": "^15.0.1",
"remark-frontmatter": "^5.0.0", "remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0", "remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0", "remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1", "remark-rehype": "^11.1.2",
"remark-stringify": "^11.0.0", "remark-stringify": "^11.0.0",
"sanitize-html": "^2.14.0", "sanitize-html": "^2.17.5",
"sass": "^1.85.1", "sass": "^1.101.0",
"strip-markdown": "^6.0.0", "strip-markdown": "^6.0.0",
"unified": "^11.0.5", "unified": "^11.0.5",
"zod": "^3.24.1" "zod": "^4.4.3"
}, },
"engines": { "engines": {
"node": ">=22.0.0" "node": ">=22.0.0"

File diff suppressed because it is too large Load diff

View file

@ -5,6 +5,8 @@ allowBuilds:
esbuild: true esbuild: true
prisma: true prisma: true
svelte-preprocess: true svelte-preprocess: true
minimumReleaseAgeExclude:
- '@sveltejs/adapter-node@5.5.6'
onlyBuiltDependencies: onlyBuiltDependencies:
- '@parcel/watcher' - '@parcel/watcher'
- '@prisma/engines' - '@prisma/engines'

View file

@ -41,6 +41,10 @@ export class MarkdownFile<FrontMatter = Record<string, string>> {
private async build(): Promise<void> { private async build(): Promise<void> {
this._html = await MarkdownBuilder.getHtml(this.content); this._html = await MarkdownBuilder.getHtml(this.content);
this._excerpt = await MarkdownBuilder.getExcerptFromMarkdown(this.content); this._excerpt = await MarkdownBuilder.getExcerptFromMarkdown(this.content);
this._frontmatter = MarkdownBuilder.getFrontmatter(this.content, this.fileName); const frontmatter = MarkdownBuilder.getFrontmatter(this.content, this.fileName);
if (!frontmatter) {
throw new Error(`Failed to parse frontmatter for file: ${this.fileName}`);
}
this._frontmatter = frontmatter as FrontMatter;
} }
} }

View file

@ -6,12 +6,14 @@ import { BlogPostSet } from './BlogPostSet.js';
import { BookReviewSet } from './BookReviewSet.js'; import { BookReviewSet } from './BookReviewSet.js';
import { BookReview } from './BookReview.js'; import { BookReview } from './BookReview.js';
// We have to duplicate the `../..` here because import.meta must have a static string,
// and it (rightfully) cannot have dynamic locations
const blogPostMetaGlobImport = import.meta.glob(`../../content/blog/*.md`, { const blogPostMetaGlobImport = import.meta.glob(`../../content/blog/*.md`, {
as: 'raw', query: '?raw',
import: 'default',
});
const bookReviewsMetaGlobImport = import.meta.glob(`../../content/book-reviews/*.md`, {
query: '?raw',
import: 'default',
}); });
const bookReviewsMetaGlobImport = import.meta.glob(`../../content/book-reviews/*.md`, { as: 'raw' });
interface BlogPostFrontmatterValues { interface BlogPostFrontmatterValues {
title: string; title: string;
@ -41,6 +43,20 @@ export class MarkdownRepository {
this.bookReviews = new BookReviewSet(bookReviews); this.bookReviews = new BookReviewSet(bookReviews);
} }
private static toDate(dateString: string | undefined | null): Date {
if (!dateString) {
return new Date();
}
const date = new Date(dateString);
if (isNaN(date.getTime())) {
console.warn(`[MarkdownRepository::toDate] Invalid date string: ${dateString}`);
return new Date();
}
return date;
}
public static async singleton(forceRefresh = false): Promise<MarkdownRepository> { public static async singleton(forceRefresh = false): Promise<MarkdownRepository> {
if (forceRefresh || !this._singleton) { if (forceRefresh || !this._singleton) {
console.log(`[MarkdownRepository::singleton] Building MarkdownRepository singleton.`); console.log(`[MarkdownRepository::singleton] Building MarkdownRepository singleton.`);
@ -69,14 +85,14 @@ export class MarkdownRepository {
const markdownFile = await MarkdownFile.build<BlogPostFrontmatterValues>(filename, await module()); const markdownFile = await MarkdownFile.build<BlogPostFrontmatterValues>(filename, await module());
const blogPost = new BlogPost({ const blogPost = new BlogPost({
excerpt: markdownFile.excerpt, excerpt: markdownFile.excerpt ?? '',
html: markdownFile.html, html: markdownFile.html ?? '',
title: markdownFile.frontmatter.title, title: markdownFile?.frontmatter?.title ?? '',
slug: markdownFile.frontmatter.slug, slug: markdownFile?.frontmatter?.slug ?? '',
author: markdownFile.frontmatter.author, author: markdownFile?.frontmatter?.author ?? '',
date: markdownFile.frontmatter.date, date: MarkdownRepository.toDate(markdownFile?.frontmatter?.date),
fileName: filename, fileName: filename,
tags: markdownFile.frontmatter.tags ?? [], tags: markdownFile?.frontmatter?.tags ?? [],
}); });
fileImports = [...fileImports, markdownFile]; fileImports = [...fileImports, markdownFile];
@ -95,15 +111,15 @@ export class MarkdownRepository {
const markdownFile = await MarkdownFile.build<BookReviewFrontmatterValues>(filename, await module()); const markdownFile = await MarkdownFile.build<BookReviewFrontmatterValues>(filename, await module());
const bookReview = new BookReview({ const bookReview = new BookReview({
author: markdownFile.frontmatter.author, author: markdownFile?.frontmatter?.author ?? '',
title: markdownFile.frontmatter.title, title: markdownFile?.frontmatter?.title ?? '',
slug: markdownFile.frontmatter.slug, slug: markdownFile?.frontmatter?.slug ?? '',
date: markdownFile.frontmatter.date, date: MarkdownRepository.toDate(markdownFile?.frontmatter?.date ?? null),
draft: false, draft: false,
finished: markdownFile.frontmatter.finished, finished: MarkdownRepository.toDate(markdownFile?.frontmatter?.finished ?? null),
image: markdownFile.frontmatter.image, image: markdownFile?.frontmatter?.image ?? '',
score: markdownFile.frontmatter.score, score: markdownFile?.frontmatter?.score ?? 0,
html: markdownFile.html, html: markdownFile?.html ?? '',
}); });
bookReviews = [...bookReviews, bookReview]; bookReviews = [...bookReviews, bookReview];
@ -147,12 +163,12 @@ export class MarkdownRepository {
const markdownFile = await MarkdownFile.build<BlogPostFrontmatterValues>(resolvedPath, contents); const markdownFile = await MarkdownFile.build<BlogPostFrontmatterValues>(resolvedPath, contents);
const blogPost = new BlogPost({ const blogPost = new BlogPost({
html: markdownFile.html, html: markdownFile.html ?? '',
excerpt: markdownFile.excerpt, excerpt: markdownFile.excerpt ?? '',
title: markdownFile.frontmatter?.title ?? undefined, title: markdownFile.frontmatter?.title ?? '',
slug: markdownFile.frontmatter?.slug ?? undefined, slug: markdownFile.frontmatter?.slug ?? '',
author: markdownFile.frontmatter?.author ?? undefined, author: markdownFile.frontmatter?.author ?? '',
date: markdownFile.frontmatter?.date ?? undefined, date: markdownFile.frontmatter?.date ? new Date(markdownFile.frontmatter.date) : new Date(),
fileName: resolvedPath, fileName: resolvedPath,
tags: [], tags: [],
}); });

View file

@ -131,9 +131,7 @@
.algorithms__button { .algorithms__button {
box-shadow: 5px 2px blue; box-shadow: 5px 2px blue;
&:hover {
background: var()
}
} }
.canvas-container { .canvas-container {

View file

@ -326,7 +326,7 @@ dialog.confirm-dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--spacing-base); gap: var(--spacing-base);
}> }
.cms-form .field { .cms-form .field {
gap: 0.4rem; gap: 0.4rem;

View file

@ -1,15 +1,17 @@
import adapter from '@sveltejs/adapter-node'; import adapter from '@sveltejs/adapter-node';
import preprocess from 'svelte-preprocess'; import { sveltePreprocess } from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
extensions: ['.svelte', '.md'], extensions: ['.svelte', '.md'],
// Consult https://github.com/sveltejs/svelte-preprocess // Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors // for more information about preprocessors
preprocess: [preprocess()], preprocess: [sveltePreprocess()],
kit: { kit: {
adapter: adapter({ split: false, }), adapter: adapter({
precompress: false,
}),
alias: { alias: {
$lib: '/src/lib', $lib: '/src/lib',
$srcPrisma: '/src/prisma', $srcPrisma: '/src/prisma',

View file

@ -7,7 +7,7 @@ COPY pnpm-workspace.yaml ./
ENV CI=true ENV CI=true
RUN npm i -g pnpm RUN npm i -g pnpm
RUN pnpm install --frozen-lockfile RUN pnpm ci
COPY . . COPY . .
RUN pnpm build RUN pnpm build
RUN pnpm prune --prod RUN pnpm prune --prod
@ -25,4 +25,4 @@ EXPOSE 3000
ENV NODE_ENV=production ENV NODE_ENV=production
VOLUME /data VOLUME /data
CMD ["node", "build"] CMD ["node", "build"]