fix: bump a lot of versions, fix the broken node adapter
This commit is contained in:
parent
b39f8c0ab3
commit
33c383cf73
9 changed files with 773 additions and 875 deletions
65
package.json
65
package.json
|
|
@ -4,6 +4,7 @@
|
|||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
|
|
@ -16,55 +17,55 @@
|
|||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/kit": "^2.51.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
"@sveltejs/kit": "^2.66.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"@types/leaflet": "^1.9.15",
|
||||
"@types/node": "^25.3.2",
|
||||
"@types/sanitize-html": "^2.13.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
||||
"@typescript-eslint/parser": "^8.55.0",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"eslint-plugin-svelte": "^3.15.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-svelte": "^3.3.2",
|
||||
"svelte": "^5.50.3",
|
||||
"svelte-check": "^4.3.6",
|
||||
"svelte-preprocess": "^6.0.0",
|
||||
"@types/leaflet": "^1.9.21",
|
||||
"@types/node": "^26.0.0",
|
||||
"@types/sanitize-html": "^2.16.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
||||
"@typescript-eslint/parser": "^8.61.1",
|
||||
"eslint": "^10.5.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-svelte": "^3.19.0",
|
||||
"prettier": "^3.8.4",
|
||||
"prettier-plugin-svelte": "^4.1.1",
|
||||
"svelte": "^5.56.3",
|
||||
"svelte-check": "^4.6.0",
|
||||
"svelte-preprocess": "^6.0.5",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.7",
|
||||
"vitest": "^3.0.8"
|
||||
"typescript": "^6.0.3",
|
||||
"vite": "^8.0.16",
|
||||
"vitest": "^4.1.9"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@immich/sdk": "^2.5.6",
|
||||
"@prisma/adapter-better-sqlite3": "^7.4.2",
|
||||
"@prisma/client": "^7.4.2",
|
||||
"@sveltejs/adapter-node": "^5.5.5",
|
||||
"@immich/sdk": "^2.7.5",
|
||||
"@prisma/adapter-better-sqlite3": "^7.8.0",
|
||||
"@prisma/client": "^7.8.0",
|
||||
"@sveltejs/adapter-node": "^5.5.6",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"canvas-dither": "^1.0.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"dotenv": "^17.3.1",
|
||||
"feed": "^4.2.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"date-fns": "^4.4.0",
|
||||
"dotenv": "^17.4.2",
|
||||
"feed": "^5.2.1",
|
||||
"js-yaml": "^5.0.0",
|
||||
"just-shuffle": "^4.2.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"node-fetch": "^3.3.2",
|
||||
"prisma": "^7.4.2",
|
||||
"prisma": "^7.8.0",
|
||||
"rehype-stringify": "^10.0.1",
|
||||
"remark": "^15.0.1",
|
||||
"remark-frontmatter": "^5.0.0",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"remark-parse": "^11.0.0",
|
||||
"remark-rehype": "^11.1.1",
|
||||
"remark-rehype": "^11.1.2",
|
||||
"remark-stringify": "^11.0.0",
|
||||
"sanitize-html": "^2.14.0",
|
||||
"sass": "^1.85.1",
|
||||
"sanitize-html": "^2.17.5",
|
||||
"sass": "^1.101.0",
|
||||
"strip-markdown": "^6.0.0",
|
||||
"unified": "^11.0.5",
|
||||
"zod": "^3.24.1"
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
|
|
|
|||
1489
pnpm-lock.yaml
1489
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,8 @@ allowBuilds:
|
|||
esbuild: true
|
||||
prisma: true
|
||||
svelte-preprocess: true
|
||||
minimumReleaseAgeExclude:
|
||||
- '@sveltejs/adapter-node@5.5.6'
|
||||
onlyBuiltDependencies:
|
||||
- '@parcel/watcher'
|
||||
- '@prisma/engines'
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ export class MarkdownFile<FrontMatter = Record<string, string>> {
|
|||
private async build(): Promise<void> {
|
||||
this._html = await MarkdownBuilder.getHtml(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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import { BlogPostSet } from './BlogPostSet.js';
|
|||
import { BookReviewSet } from './BookReviewSet.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`, {
|
||||
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 {
|
||||
title: string;
|
||||
|
|
@ -41,6 +43,20 @@ export class MarkdownRepository {
|
|||
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> {
|
||||
if (forceRefresh || !this._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 blogPost = new BlogPost({
|
||||
excerpt: markdownFile.excerpt,
|
||||
html: markdownFile.html,
|
||||
title: markdownFile.frontmatter.title,
|
||||
slug: markdownFile.frontmatter.slug,
|
||||
author: markdownFile.frontmatter.author,
|
||||
date: markdownFile.frontmatter.date,
|
||||
excerpt: markdownFile.excerpt ?? '',
|
||||
html: markdownFile.html ?? '',
|
||||
title: markdownFile?.frontmatter?.title ?? '',
|
||||
slug: markdownFile?.frontmatter?.slug ?? '',
|
||||
author: markdownFile?.frontmatter?.author ?? '',
|
||||
date: MarkdownRepository.toDate(markdownFile?.frontmatter?.date),
|
||||
fileName: filename,
|
||||
tags: markdownFile.frontmatter.tags ?? [],
|
||||
tags: markdownFile?.frontmatter?.tags ?? [],
|
||||
});
|
||||
|
||||
fileImports = [...fileImports, markdownFile];
|
||||
|
|
@ -95,15 +111,15 @@ export class MarkdownRepository {
|
|||
const markdownFile = await MarkdownFile.build<BookReviewFrontmatterValues>(filename, await module());
|
||||
|
||||
const bookReview = new BookReview({
|
||||
author: markdownFile.frontmatter.author,
|
||||
title: markdownFile.frontmatter.title,
|
||||
slug: markdownFile.frontmatter.slug,
|
||||
date: markdownFile.frontmatter.date,
|
||||
author: markdownFile?.frontmatter?.author ?? '',
|
||||
title: markdownFile?.frontmatter?.title ?? '',
|
||||
slug: markdownFile?.frontmatter?.slug ?? '',
|
||||
date: MarkdownRepository.toDate(markdownFile?.frontmatter?.date ?? null),
|
||||
draft: false,
|
||||
finished: markdownFile.frontmatter.finished,
|
||||
image: markdownFile.frontmatter.image,
|
||||
score: markdownFile.frontmatter.score,
|
||||
html: markdownFile.html,
|
||||
finished: MarkdownRepository.toDate(markdownFile?.frontmatter?.finished ?? null),
|
||||
image: markdownFile?.frontmatter?.image ?? '',
|
||||
score: markdownFile?.frontmatter?.score ?? 0,
|
||||
html: markdownFile?.html ?? '',
|
||||
});
|
||||
|
||||
bookReviews = [...bookReviews, bookReview];
|
||||
|
|
@ -147,12 +163,12 @@ export class MarkdownRepository {
|
|||
const markdownFile = await MarkdownFile.build<BlogPostFrontmatterValues>(resolvedPath, contents);
|
||||
|
||||
const blogPost = new BlogPost({
|
||||
html: markdownFile.html,
|
||||
excerpt: markdownFile.excerpt,
|
||||
title: markdownFile.frontmatter?.title ?? undefined,
|
||||
slug: markdownFile.frontmatter?.slug ?? undefined,
|
||||
author: markdownFile.frontmatter?.author ?? undefined,
|
||||
date: markdownFile.frontmatter?.date ?? undefined,
|
||||
html: markdownFile.html ?? '',
|
||||
excerpt: markdownFile.excerpt ?? '',
|
||||
title: markdownFile.frontmatter?.title ?? '',
|
||||
slug: markdownFile.frontmatter?.slug ?? '',
|
||||
author: markdownFile.frontmatter?.author ?? '',
|
||||
date: markdownFile.frontmatter?.date ? new Date(markdownFile.frontmatter.date) : new Date(),
|
||||
fileName: resolvedPath,
|
||||
tags: [],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -131,9 +131,7 @@
|
|||
.algorithms__button {
|
||||
box-shadow: 5px 2px blue;
|
||||
|
||||
&:hover {
|
||||
background: var()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ dialog.confirm-dialog {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-base);
|
||||
}>
|
||||
}
|
||||
|
||||
.cms-form .field {
|
||||
gap: 0.4rem;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
import adapter from '@sveltejs/adapter-node';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
import { sveltePreprocess } from 'svelte-preprocess';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
extensions: ['.svelte', '.md'],
|
||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: [preprocess()],
|
||||
preprocess: [sveltePreprocess()],
|
||||
kit: {
|
||||
|
||||
adapter: adapter({ split: false, }),
|
||||
|
||||
adapter: adapter({
|
||||
precompress: false,
|
||||
}),
|
||||
alias: {
|
||||
$lib: '/src/lib',
|
||||
$srcPrisma: '/src/prisma',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ COPY pnpm-workspace.yaml ./
|
|||
|
||||
ENV CI=true
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm ci
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
RUN pnpm prune --prod
|
||||
|
|
@ -25,4 +25,4 @@ EXPOSE 3000
|
|||
ENV NODE_ENV=production
|
||||
VOLUME /data
|
||||
|
||||
CMD ["node", "build"]
|
||||
CMD ["node", "build"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue