Open
Conversation
- Initialize SvelteKit with Svelte 5.49.2 - Create file-based routing structure: - / → Daily mode (from App.svelte) - /unlimited → Training mode (from Training.svelte) - /s/[id] → Special mode (from Special.svelte) - Update configuration files (svelte.config.js, vite.config.ts, tsconfig.json) - Update package.json with SvelteKit dependencies: - @sveltejs/kit@^2.50.2 - @sveltejs/adapter-auto@^7.0.0 - svelte@^5.49.2 - svelte-check@^4.3.6 - vite@^7.3.1 - prettier@^3.8.1, prettier-plugin-svelte@^3.4.1 - Create src/app.html from index.html with meta tags - Create src/routes/+layout.svelte for root layout - Replace svelte-share-buttons-component with native share buttons - Update src/lib/store.ts for SSR compatibility (browser checks) - Update routes to use SvelteKit navigation: - Replace './lib' imports with '' alias - Use /stores for page parameters in special route - Move document.addEventListener into onMount for SSR compatibility - Update playwright.config.ts to use 'npm run dev' - Update vitest.config.ts to use SvelteKit vite config - Remove old files: index.html, vite.config.js - All three routes verified loading correctly with Playwright
- Update existing tests to use new URL format: - tests/e2e-win.spec.ts: → - tests/e2e-lose.spec.ts: → - Add tests/smoke-tests.spec.ts with comprehensive coverage: - Daily mode loads (main page elements visible) - Unlimited mode loads (code display visible) - Special mode loads (input field visible) - Navigation between modes works (using goto from SvelteKit) - Thai keyboard present (44 keys visible) - Unlimited restart button hidden initially - Special share button hidden initially - Thai keyboard interactive (click doesn't error) - Update src/lib/Navbar.svelte navigation: - Replace window.location.href with goto() from SvelteKit - Both desktop and mobile menu navigation updated - All routes now use proper SvelteKit navigation - All 8 smoke tests passing (11.2s) - Verified all three routes load correctly - Navigation between modes works properly
- Removed document.addEventListener from module level in +page.svelte - Moved keydown event listener inside onMount lifecycle hook - This fixes the 'document is not defined' error during SSR - All three routes (/, /unlimited, /s/[id]) now work correctly - Build passes without errors
- Added import '../app.css' to src/routes/+layout.svelte - This fixes TailwindCSS not being loaded - All components now render with proper styling - Thai keyboard, header, and social icons properly sized
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolved conflicts by keeping SvelteKit migration changes: - Kept .gitignore with .svelte-kit/ and package-lock.json - Removed index.html (replaced by SvelteKit app.html) - Kept SvelteKit dependencies in package.json - Kept SvelteKit configuration in svelte.config.js - Kept all new SvelteKit-specific files (routes, config, tests) - Removed old Vite-specific files All changes from main branch (new words, fixes) were already included in the rewritten history.
d4bad60 to
18f0177
Compare
- Update vitest.config.ts to use browser conditions when running tests - Add resolve.conditions: ['browser'] to prevent SSR mode during testing - This fixes 'mount is not available on the server' errors - All 56 tests now passing The key was telling Vitest to use browser entry points instead of SSR entry points when processing Svelte components during tests.
- SvelteKit uses 'static' directory for static files, not 'public' - Renamed public/ to static/ to match SvelteKit conventions - Updated test file references from public/ to static/ - words.json now loads correctly at /words.json endpoint
- Import words.json to calculate today's actual word - Calculate date index to determine which word is today's solution - Use today's word in the test to handle variable lengths (4-10 characters) - Added console.log to show which word is being tested - Test now adapts to daily word changes automatically
- Added 'yarn svelte-kit sync' before running e2e tests - This generates the .svelte-kit/tsconfig.json required by tsconfig.json - Fixes 'Cannot find base config file' warning - Should resolve 404 errors for static files like words.json
- Fixed closeDialogs helper to properly handle both modals: - AnnouncementModal: Click the 'ปิด' (close) button specifically - Instructions modal: Click anywhere on the dialog - Updated all test calls to use the new function signature - All 9 smoke tests now passing
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.
Upgrade Svelte from v3 -> v5 and migrate to SvelteKit
https://thwordle-git-upgrade-svelte-notnarze.vercel.app