mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
chore(survey): update dependencies (#718)
* fix(survey): import Migrator from kysely/migration
kysely 0.29 moved Migrator, Migration and MigrationProvider out of the
package root and into the kysely/migration subpath export, so the
self-hosted Node entrypoint died at startup with "Migrator is not a
constructor" and served every request against an unmigrated database.
packages/sql-tools already imports from the subpath; this brings the
survey backend in line.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
* chore(deps): update survey.immich.app dependencies to latest
Brings every dependency of the survey app and its backend up to the
newest release published on npm, and aligns the app with the TypeScript
setup the rest of the monorepo already uses.
Majors:
- vite 7 -> 8 with @sveltejs/vite-plugin-svelte 6 -> 7 (the plugin's
peer range requires vite 8 and svelte >= 5.46.4); every other app in
the workspace was already on this pair
- typescript ^5.9.2 -> the workspace convention of
typescript -> npm:@typescript/typescript6 plus @typescript/native ->
npm:typescript@7. @sveltejs/kit, svelte-check and typescript-eslint
all cap their typescript peer below 7, so TS 6 stays the tooling
compiler and TS 7 native is installed alongside it
- @types/node 24 -> 26
- backend: @hono/node-server 1 -> 2 (drops Node 18, removes the Vercel
adapter; neither is used here), better-sqlite3 12 -> 13 (Node-API
rewrite, same JS API) and @types/better-sqlite3 7 -> 9
Everything else is a minor or patch bump: @sveltejs/kit 2.70.3, svelte
5.56.9, vitest 4.1.11, eslint 10.8.1, tailwindcss 4.3.3, wrangler
4.124.0, hono 4.13.3, playwright 1.62.1, and the rest.
@cloudflare/workers-types and @sveltejs/kit were published inside pnpm's
minimumReleaseAge window, so they need an explicit exemption for
`pnpm install --frozen-lockfile` to accept the lockfile. The entries can
be dropped once those versions age out.
Only the two survey importers changed in the lockfile; the other 15
workspace projects resolve identically.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
* chore(survey): build the Docker image on node 24
better-sqlite3 13 declares engines node >= 22 and the repo sets
engine-strict, so `pnpm install` in the image no longer resolves on
node:20-slim. node 24 matches the version .mise/config.toml pins for
CI and local development.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
* chore(deps): keep survey deps inside pnpm's minimumReleaseAge window
@sveltejs/kit 2.70.3 and @cloudflare/workers-types 5.20260819.1 were
published within pnpm's minimum release age, so accepting them required
a minimumReleaseAgeExclude entry for `pnpm install --frozen-lockfile` to
pass. Step both back one release instead and drop the exemption, leaving
pnpm-workspace.yaml untouched. 2.70.2 is also what the other apps in the
workspace resolve to.
Also declares kysely and @immich/kysely-adapter-cloudflare on the
backend. Both are imported by backend/src but were only ever resolved
through the frontend's node_modules, so any install that did not also
include the frontend could not resolve them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
* fix(survey): repair the Docker build
The image had not been buildable for a while. Each of these failed the
build on its own:
- `--filter survey...` matches no project; the app is survey.immich.app,
so the frontend stage installed nothing and the build that followed
had no node_modules
- the manifest for futo-backups-survey was still copied in, but that app
was removed in 7d9d2d3, so COPY aborted on a missing path. Neither it
nor the datasets manifest is needed: pnpm --filter installs fine
without unrelated workspace manifests, so both are gone along with the
comment that justified them
- the backend stage never received apps/survey.immich.app/shared, which
backend/src imports, so esbuild could not resolve it
- the esbuild bundle is ESM but inlines CommonJS dependencies, and
esbuild's ESM output replaces require with a stub that throws. ws hit
it on `require("events")` and the server died on startup. build:node
now restores a real require via createRequire, and the Dockerfile
calls that script instead of repeating the flags
Adds a .dockerignore so COPY stops dragging the host's pnpm symlink farm
and stale build output into the context, and marks the backend package
as ESM, which is what it already is and what its bundle needs to avoid
being reparsed at every start.
Verified by replaying every stage's COPY and RUN outside Docker: both
builders complete, and the resulting payload boots, applies migrations,
serves the built frontend and records a survey response through
better-sqlite3.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
* fix(lint): pin tsconfigRootDir in both eslint configs
The survey app is the only workspace project with its own flat config,
and ESLint 10 resolves a config per linted file, so a root `pnpm lint`
loads that config alongside this one. typescript-eslint records a
candidate tsconfigRootDir for every config file it is loaded from and
throws rather than guess once there is more than one, failing 215 files
across the survey app, ui.immich.app, bin and packages with "No
tsconfigRootDir was set, and multiple candidate TSConfigRootDirs are
present".
Aliasing the survey app's typescript to @typescript/typescript6 is what
surfaced it: the app used to resolve its own typescript-eslint instance
against typescript 5.9, so the two configs registered their candidates
in separate module state. Now both configs share one instance and see
each other's candidate.
Pinning tsconfigRootDir explicitly in each config is what the error
asks for and keeps each config anchored to its own directory.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aAfftndexMEN2j2os6yEv
---------
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b91935ed1c
commit
10e376848a
@@ -0,0 +1,10 @@
|
||||
# Build/dev output that the images produce themselves. Without this, COPY drags
|
||||
# the host's pnpm symlink farm and stale build artifacts into the build context.
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
**/build
|
||||
**/dist
|
||||
**/.wrangler
|
||||
**/test-results
|
||||
**/playwright-report
|
||||
.git
|
||||
@@ -1,34 +1,29 @@
|
||||
FROM node:20-slim@sha256:2cf067cfed83d5ea958367df9f966191a942351a2df77d6f0193e162b5febfc0 AS frontend-builder
|
||||
FROM node:24-slim@sha256:3638d9a6fe4030bd716be989438248074489337ba3275657f93595428be4fc03 AS frontend-builder
|
||||
# pnpm version is pinned via the root package.json "packageManager" field
|
||||
ENV COREPACK_ENABLE_STRICT=1
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
# pnpm --frozen-lockfile fails unless every package.json referenced by
|
||||
# pnpm-workspace.yaml exists, hence the unrelated app manifests below.
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY apps/survey.immich.app/package.json apps/survey.immich.app/
|
||||
COPY apps/survey.immich.app/backend/package.json apps/survey.immich.app/backend/
|
||||
COPY apps/datasets.immich.app/backend/package.json apps/datasets.immich.app/backend/
|
||||
COPY apps/futo-backups-survey.immich.app/backend/package.json apps/futo-backups-survey.immich.app/backend/
|
||||
COPY common/ common/
|
||||
RUN pnpm install --frozen-lockfile --filter survey...
|
||||
RUN pnpm install --frozen-lockfile --filter survey.immich.app...
|
||||
COPY apps/survey.immich.app/ apps/survey.immich.app/
|
||||
RUN cd apps/survey.immich.app && pnpm run build
|
||||
|
||||
FROM node:20-slim@sha256:2cf067cfed83d5ea958367df9f966191a942351a2df77d6f0193e162b5febfc0 AS backend-builder
|
||||
FROM node:24-slim@sha256:3638d9a6fe4030bd716be989438248074489337ba3275657f93595428be4fc03 AS backend-builder
|
||||
ENV COREPACK_ENABLE_STRICT=1
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY apps/survey.immich.app/package.json apps/survey.immich.app/
|
||||
COPY apps/survey.immich.app/backend/package.json apps/survey.immich.app/backend/
|
||||
COPY apps/datasets.immich.app/backend/package.json apps/datasets.immich.app/backend/
|
||||
COPY apps/futo-backups-survey.immich.app/backend/package.json apps/futo-backups-survey.immich.app/backend/
|
||||
RUN pnpm install --frozen-lockfile --filter survey-backend...
|
||||
COPY apps/survey.immich.app/shared/ apps/survey.immich.app/shared/
|
||||
COPY apps/survey.immich.app/backend/ apps/survey.immich.app/backend/
|
||||
RUN cd apps/survey.immich.app/backend && npx esbuild src/server.ts --bundle --platform=node --format=esm --outdir=dist --external:better-sqlite3 --external:pg
|
||||
RUN cd apps/survey.immich.app/backend && pnpm run build:node
|
||||
|
||||
FROM node:20-slim@sha256:2cf067cfed83d5ea958367df9f966191a942351a2df77d6f0193e162b5febfc0
|
||||
FROM node:24-slim@sha256:3638d9a6fe4030bd716be989438248074489337ba3275657f93595428be4fc03
|
||||
ENV COREPACK_ENABLE_STRICT=1
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "survey-backend",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "wrangler dev",
|
||||
"deploy": "wrangler deploy",
|
||||
@@ -9,28 +10,31 @@
|
||||
"build": "pnpm build:workers",
|
||||
"build:workers": "wrangler build --config wrangler-do.jsonc && mv dist/index.js dist/sessions.js && wrangler build",
|
||||
"start": "tsx src/server.ts",
|
||||
"build:node": "esbuild src/server.ts --bundle --platform=node --format=esm --outdir=dist --external:better-sqlite3 --external:pg",
|
||||
"build:node": "esbuild src/server.ts --bundle --platform=node --format=esm --outdir=dist --external:better-sqlite3 --external:pg --banner:js=\"import { createRequire as topLevelCreateRequire } from 'node:module'; const require = topLevelCreateRequire(import.meta.url);\"",
|
||||
"load-test": "tsx scripts/load-test.ts",
|
||||
"test:integration": "vitest run",
|
||||
"test:integration:watch": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^5.0.0",
|
||||
"@hono/node-server": "^1.19.12",
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"@types/pg": "^8.20.0",
|
||||
"@cloudflare/workers-types": "^5.20260818.1",
|
||||
"@hono/node-server": "^2.1.1",
|
||||
"@types/better-sqlite3": "^9.6.0",
|
||||
"@types/pg": "^8.23.1",
|
||||
"@types/ws": "^8.18.1",
|
||||
"esbuild": "^0.28.0",
|
||||
"hono": "^4.12.9",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.9.2",
|
||||
"vitest": "^4.1.0",
|
||||
"wrangler": "^4.75.0",
|
||||
"ws": "^8.20.0"
|
||||
"esbuild": "^0.28.2",
|
||||
"hono": "^4.13.3",
|
||||
"tsx": "^4.23.12",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
||||
"vitest": "^4.1.11",
|
||||
"wrangler": "^4.124.0",
|
||||
"ws": "^8.21.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"itty-router": "^5.0.18",
|
||||
"better-sqlite3": "^12.8.0",
|
||||
"pg": "^8.20.0"
|
||||
"@immich/kysely-adapter-cloudflare": "^0.1.0",
|
||||
"itty-router": "^5.0.24",
|
||||
"kysely": "^0.29.5",
|
||||
"better-sqlite3": "^13.0.3",
|
||||
"pg": "^8.23.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Migrator, type Migration, type MigrationProvider, sql, type Kysely } from 'kysely';
|
||||
import { sql, type Kysely } from 'kysely';
|
||||
// kysely 0.29 moved the migrator out of the root entry point.
|
||||
import { Migrator, type Migration, type MigrationProvider } from 'kysely/migration';
|
||||
import { readdir, readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import type { Database } from './db';
|
||||
|
||||
@@ -20,7 +20,7 @@ services:
|
||||
volumes:
|
||||
- survey-data:/data
|
||||
restart: unless-stopped
|
||||
# node:20-slim ships neither wget nor curl, so probe /api/auth/me (200 when
|
||||
# node:24-slim ships neither wget nor curl, so probe /api/auth/me (200 when
|
||||
# healthy, authenticated or not) with Node's built-in fetch.
|
||||
healthcheck:
|
||||
test:
|
||||
|
||||
@@ -13,6 +13,12 @@ export default [
|
||||
...svelte.configs.prettier,
|
||||
{
|
||||
languageOptions: {
|
||||
// See the matching note in the root eslint.config.ts: typescript-eslint
|
||||
// cannot infer a tsconfigRootDir when two flat configs are loaded in one
|
||||
// process, so each one pins its own.
|
||||
parserOptions: {
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
|
||||
@@ -17,43 +17,44 @@
|
||||
"test:e2e": "playwright test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.0",
|
||||
"@playwright/test": "^1.58.2",
|
||||
"@sveltejs/adapter-static": "^3.0.8",
|
||||
"@sveltejs/kit": "^2.43.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@playwright/test": "^1.62.1",
|
||||
"@sveltejs/adapter-static": "^3.0.10",
|
||||
"@sveltejs/kit": "^2.70.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@types/d3-cloud": "^1.2.9",
|
||||
"@types/d3-selection": "^3.0.11",
|
||||
"@types/node": "^24.13.3",
|
||||
"@types/oidc-provider": "^9.5.0",
|
||||
"dotenv": "^17.3.1",
|
||||
"eslint": "^10.0.0",
|
||||
"@types/node": "^26.2.0",
|
||||
"@types/oidc-provider": "^9.11.1",
|
||||
"dotenv": "^17.4.2",
|
||||
"eslint": "^10.8.1",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-svelte": "^3.12.4",
|
||||
"globals": "^17.0.0",
|
||||
"oidc-provider": "^9.7.1",
|
||||
"svelte": "^5.39.5",
|
||||
"svelte-check": "^4.3.2",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript-eslint": "^8.44.1",
|
||||
"vite": "^7.1.7",
|
||||
"vitest": "^4.0.12"
|
||||
"eslint-plugin-svelte": "^3.23.0",
|
||||
"globals": "^17.11.0",
|
||||
"oidc-provider": "^9.11.3",
|
||||
"svelte": "^5.56.9",
|
||||
"svelte-check": "^4.7.6",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
||||
"typescript-eslint": "^8.67.0",
|
||||
"vite": "^8.2.1",
|
||||
"vitest": "^4.1.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@immich/kysely-adapter-cloudflare": "^0.1.0",
|
||||
"@immich/ui": "^0.85.0",
|
||||
"@mdi/js": "^7.4.47",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"chart.js": "^4.4.8",
|
||||
"chart.js": "^4.5.1",
|
||||
"chartjs-adapter-date-fns": "^3.0.0",
|
||||
"d3-cloud": "^1.2.9",
|
||||
"d3-selection": "^3.0.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"date-fns": "^4.4.0",
|
||||
"jspdf": "^4.2.1",
|
||||
"kysely": "^0.29.0",
|
||||
"kysely": "^0.29.5",
|
||||
"qrcode": "^1.5.4",
|
||||
"svelte-dnd-action": "^0.9.69"
|
||||
"svelte-dnd-action": "^0.9.78"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,13 @@ export default defineConfig([
|
||||
eslintPluginUnicorn.configs.recommended,
|
||||
{
|
||||
languageOptions: {
|
||||
// apps/survey.immich.app has its own flat config, and ESLint loads it in
|
||||
// the same process as this one. typescript-eslint records a candidate
|
||||
// tsconfigRootDir per config file it is loaded from and refuses to guess
|
||||
// once there is more than one, so both configs pin theirs explicitly.
|
||||
parserOptions: {
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
|
||||
Generated
+491
-509
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user