Repository navigation
Migrate chipsandcode to Vercel and the current Svelte stack - #45
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves chipsandcode from Cloudflare Pages/Workers KV to a single SvelteKit deployment on Vercel, with Neon Postgres for saved experiments. Existing lesson routes, shared experiment IDs, simulator behavior, local drafts, ZIP downloads and PWA support are retained. The migration branch stays separate from main until the production cutover is prepared.
Upgrades to Svelte 5.57.3, SvelteKit 3.1.1, Vite 8.3.5, compatible TypeScript 6.0.3, Node.js 24 and Monaco 0.57.0. Bits UI replaces the obsolete menu library; Tailwind/daisyUI presentation stays on its existing major versions for the later redesign. Cypress compilation and editor input/button semantics are updated for the new stack.
The API authorizes the requested experiment, hashes anonymous session tokens, uses atomic writes, rejects cross-origin mutations and returns safe JSON failures. Data export/import preserves legacy IDs, timestamps and ownership, rejects ambiguous/incomplete records, refuses to overwrite nonempty tables and verifies imported content.
docs/vercel-migration.mdcovers project settings, isolated databases, migration rehearsal, domain cutover, thesis-subdomain scope and rollback after new writes.Security: upgrades Zod to 4.6.7 and DOMPurify to 3.4.17. Monaco vendors the older sanitizer, so a Vite alias replaces that browser code as well as overriding the npm dependency. The build cleans generated output and verifies that the patched sanitizer is present and the vendored copy absent. Runtime audit reports no high/critical findings; six low upstream deepmerge-chain findings remain documented in the runbook.
Validation: clean npm ci; type checking (0 errors/warnings); Cypress TypeScript check; 201 passing unit tests and 1 pre-existing todo (95.1% line, 92.3% branch coverage); production and repeated builds; Vercel output with nodejs24.x, manifest and service worker, and no API precache URLs. GitHub CI confirms install, application and Cypress type checks, unit tests, production build, and all 20 Cypress browser tests pass (run 41496282663).
Draft pending hosted verification: the owner will create the Vercel project and provision its database. No production data, DNS or live hosting changed. Live persistence, legacy-cookie ownership on the original hostname, and installed-PWA offline checks remain required before release. Preserve Cloudflare for rollback and review browser/visual results before merging.
Additional inventory: the thesis website is
durasj/master-thesis(chipsandcode-thesis, Next.js 13.4.19 with a static export). It needs a separate Vercel project and upgrade; this PR does not move that subdomain.