~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain

photography-focused photo sharing platform

grain.social
1 collaborator
0
2

The SvelteKit app lives in web/, as knotless's does

Merged
Merged chadtmiller.com asked to merge into feature/rust from grain.social/grain:web/move

What changes

The SvelteKit app is under web/. app/ is now web/src (web/src/routes, web/src/lib, web/src/app.html, web/src/app.css, web/src/error.html, web/src/service-worker.js) and static/ is web/static, moved with git mv so history follows. Nothing inside them changes but one import path.

What points at them:

  • svelte.config.js: kit.files.src is web/src and kit.files.assets is web/static. Routes, lib ($lib), the templates, hooks, params and the service worker all default from src in this SvelteKit (2.55), so those two are enough. assets does not default from src, hence the second line.
  • hatk.config.ts: publicDir is ./web/static, where hatk serves /robots.txt from ahead of SvelteKit in production.
  • tsconfig.json: include names web/src instead of app.
  • web/src/lib/utils/formatLocation.ts re-exports from server/, which is one level further away now.
  • server/helpers/cameraName.ts, and test/{resolveRouteActor,storyViews,tid}.test.ts, import from web/src/lib (and a comment in test/galleryDetail.test.ts names that path).
  • marketing/capture-og.mjs writes og-default.jpg into web/static.
  • The "Project structure" tables in AGENTS.md and README.md say web/. The public/ row in AGENTS.md goes: there was no such directory, and the static files it described are web/static.
  • vitest.coverage.config.ts: a comment names web/src/lib.

Nothing else names these paths. The $hatk aliases, vite.config.ts, playwright.config.ts, the Dockerfile (COPY . .), .dockerignore, the justfile, the workflows, seeds/ and deploy/ had no reference to either directory. The docs/plans/ documents still say app/, because they are records of what was planned at the time.

Why

grain is being laid out like knotless, whose SvelteKit app is web/, ahead of the move off hatk.

package.json, hatk.config.ts, node_modules and server/ stay at the root for now, since hatk runs the dev server and the build from there. web/ gets its own package.json once hatk is gone.

How it was checked

npx svelte-kit sync against the new config generates .svelte-kit/tsconfig.json with $lib at ../web/src/lib and the route types under types/web/src/routes. A script resolved every relative import in web/, server/, test/, seeds/, marketing/ and deploy/ and found none broken, ./$types aside. vp fmt --check passes. check (vp check, svelte-check) and test (vitest) are left to CI.

I read hatk's dist for hard-coded paths. publicDir resolves against the config's directory. hatk build and hatk check look for src/app.html, which never existed here, and grain does not run those commands: npm run build is vp build and npm run check is vp check && svelte-check.

Shortcomings

Not run: the Docker build, the production server's static serving (robots.txt through hatk, everything else through the adapter-node build), npm run dev, and the Playwright tests. CI covers none of them. The first deploy from main should confirm that /robots.txt, /favicon.png and /manifest.json still answer.

Review

A quick look. svelte.config.js and hatk.config.ts are the parts that matter. The rest is renames.

🤖 Generated with Claude Code

Approved

This moves the SvelteKit app from app/ and static/ to web/src and web/static. It repoints svelte.config.js (kit.files.src and kit.files.assets), hatk.config.ts (publicDir), tsconfig.json, and the imports, docs and scripts that named the old paths. I searched the head branch for leftover app/ and static references. The only ones left are in docs/plans/, which you left on purpose, and unrelated hits such as the /app/node_modules mount in docker-compose.yml and an Apple store URL. The config changes look consistent with each other. I did not run the build, and the checks were not read. As you note, the Docker build, hatk's /robots.txt serving, and the Playwright tests are not covered by CI, so confirm /robots.txt, /favicon.png and /manifest.json on the first deploy.

Merged as 17d9697
Part of a stack of 2
  1. The SvelteKit app lives in web/, as knotless's does Landed as 17d9697
  2. main