From ad07a06cfe36109465156ce4a97a3887b13b25ca Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 20 Feb 2025 07:07:42 -0800 Subject: [PATCH] Migrate to Svelte 5 (#135) * migrate to Svelte 5 * npm-test.yml add install-e2e: npx playwright install chromium nodejs-gh-pages.yml drop custom install-cmd * fix build * fix playwright tests * 2 new in site/tests/site.test.ts - Add test for 404 page handling - Add test for page metadata (title, description, OG tags) --- .github/workflows/gh-pages.yml | 1 - .github/workflows/test.yml | 1 + .pre-commit-config.yaml | 2 +- site/package.json | 44 +++++------ site/src/lib/ContributorList.svelte | 6 +- site/src/lib/Filters.svelte | 30 ++++--- site/src/lib/Person.svelte | 8 +- site/src/lib/Screenshot.svelte | 20 +++-- site/src/lib/SiteDetails.svelte | 40 ++++++---- site/src/lib/SiteList.svelte | 12 ++- site/src/lib/SitePreview.svelte | 11 ++- site/src/routes/+error.svelte | 2 +- site/src/routes/+layout.svelte | 8 +- site/src/routes/+page.svelte | 103 ++++++++++++++----------- site/src/routes/[slug]/+page.server.ts | 11 ++- site/src/routes/[slug]/+page.svelte | 26 +++---- site/tests/site.test.ts | 61 ++++++++++----- 17 files changed, 231 insertions(+), 155 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 01b20c4..a10d67b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -12,4 +12,3 @@ jobs: uses: janosh/workflows/.github/workflows/nodejs-gh-pages.yml@main with: working-directory: site - install-cmd: npm install -f diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cc05a7..d2e11aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,3 +12,4 @@ jobs: uses: janosh/workflows/.github/workflows/npm-test.yml@main with: working-directory: site + install-e2e: npx playwright install chromium diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c903c7..ff42330 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,7 +54,7 @@ repos: stages: [pre-commit, commit-msg] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.19.0 + rev: v9.20.1 hooks: - id: eslint types: [file] diff --git a/site/package.json b/site/package.json index 3d12503..87fc030 100644 --- a/site/package.json +++ b/site/package.json @@ -17,31 +17,31 @@ "test": "playwright test tests/*.test.ts" }, "devDependencies": { - "@iconify/svelte": "^4.0.2", - "@playwright/test": "^1.47.1", + "@iconify/svelte": "^4.2.0", + "@playwright/test": "^1.50.1", "@rollup/plugin-yaml": "^4.1.2", - "@stylistic/eslint-plugin": "^3.0.1", - "@sveltejs/adapter-static": "^3.0.5", - "@sveltejs/kit": "^2.5.28", - "@sveltejs/vite-plugin-svelte": "^3.1.2", - "dotenv": "^16.4.5", - "eslint": "^9.10.0", - "eslint-plugin-svelte": "^2.44.0", + "@stylistic/eslint-plugin": "^4.0.1", + "@sveltejs/adapter-static": "^3.0.8", + "@sveltejs/kit": "^2.17.2", + "@sveltejs/vite-plugin-svelte": "^5.0.3", + "dotenv": "^16.4.7", + "eslint": "^9.20.1", + "eslint-plugin-svelte": "^2.46.1", "js-yaml": "^4.1.0", - "marked": "^14.1.2", - "prettier": "^3.3.3", - "prettier-plugin-svelte": "^3.2.6", - "puppeteer": "^23.3.1", + "marked": "^15.0.7", + "prettier": "^3.5.1", + "prettier-plugin-svelte": "^3.3.3", + "puppeteer": "^24.2.1", "sharp": "^0.33.5", - "svelte": "4.2.19", - "svelte-check": "^4.0.2", - "svelte-multiselect": "^10.3.0", - "svelte-preprocess": "^6.0.2", - "svelte-zoo": "^0.4.11", - "svelte2tsx": "^0.7.19", - "typescript": "5.6.2", - "typescript-eslint": "^8.6.0", - "vite": "^5.4.6" + "svelte": "^5.20.2", + "svelte-check": "^4.1.4", + "svelte-multiselect": "11.0.0-rc.1", + "svelte-preprocess": "^6.0.3", + "svelte-zoo": "^0.4.17", + "svelte2tsx": "^0.7.34", + "typescript": "5.7.3", + "typescript-eslint": "^8.24.1", + "vite": "^6.1.1" }, "keywords": [ "sveltekit", diff --git a/site/src/lib/ContributorList.svelte b/site/src/lib/ContributorList.svelte index e1a3454..d6f2983 100644 --- a/site/src/lib/ContributorList.svelte +++ b/site/src/lib/ContributorList.svelte @@ -1,7 +1,11 @@