Skip to content

Commit d5b55a4

Browse files
committed
Merge #130: migrate to svelte 5 and update dependencies
3f22176 remove story:build from workflows (Graeme Byrne) 76d7665 fix readingTime error (Graeme Byrne) eb96c60 fix linting errors (Graeme Byrne) 7b33824 migrate to svelte 5 and update dependencies (Graeme Byrne) Pull request description: * Migrate from Svelte 4 to Svelte 5 as mentioned in this [issue](#106). * Update dependencies in `package.json` such as Vite which were preventing the successful migration to Svelte 5. * Upgrade ESLint to v9 as v8 has recently reached end of life and is no longer maintained, as mentioned [here](https://eslint.org/docs/latest/use/migrate-to-9.0.0). * Upgrade Sass as current syntax is deprecated as mentioned [here](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/) * Remove `/contributors` route as it is redundant since we now display GitHub contributors on home page and on Community page. Existing individual contributor pages have been retained and are accessible by clicking on the author's name in the blog post. * Remove Histoire as it doesn't support Vite at the minute. There is currently a [PR](histoire-dev/histoire#770) open to fix this, so Histoire can be added back later if needed. * When navigating to a new page, the site wouldn't scroll up to the top as would be expected. As found [here](sveltejs/kit#8723), this seems to be a Svelte issue. Solve this by adding the below code to the script block of routes/+layout.svelte and bind to page content: ``` import { onNavigate } from '$app/navigation'; let contentDiv: HTMLElement | null = null; onNavigate((navigation) => { return new Promise((resolve) => { const transition = document.startViewTransition(async () => { if (contentDiv) { // Fix scroll contentDiv.scrollTop = 0; } resolve(); await navigation.complete; }); }); }); ... <div id="app-container"> <Header /> <div bind:this={contentDiv} class="content"> {@render children?.()} <Footer /> </div> </div> ``` ACKs for top commit: josecelano: ACK 3f22176 Tree-SHA512: 09e1042539a441e581eb8cfd759454ac675971acfbf2a0c3fa9eb74693270add836ac2e4864077e09cf29d4cb3be4d232c0dab607685e3f813e2548504ba9cef
2 parents fb53ec8 + 3f22176 commit d5b55a4

File tree

113 files changed

+7982
-5947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+7982
-5947
lines changed

.eslintignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@ jobs:
2929

3030
- name: Build
3131
run: npm run build
32-
33-
- name: Story build
34-
run: npm run story:build

eslint.config.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import jsConfigs from '@eslint/js';
2+
import typescriptParser from '@typescript-eslint/parser';
3+
import svelteParser from 'svelte-eslint-parser';
4+
import eslintPluginPrettier from 'eslint-plugin-prettier';
5+
import eslintConfigPrettier from 'eslint-config-prettier';
6+
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
7+
8+
export default [
9+
jsConfigs.configs.recommended,
10+
11+
{
12+
languageOptions: {
13+
parser: typescriptParser,
14+
parserOptions: {
15+
ecmaVersion: 2020,
16+
sourceType: 'module',
17+
extraFileExtensions: ['.svelte']
18+
},
19+
globals: {
20+
browser: true,
21+
es2017: true,
22+
node: true,
23+
console: 'readonly'
24+
}
25+
},
26+
ignores: [
27+
'node_modules/',
28+
'build/',
29+
'.svelte-kit/',
30+
'.svelte-kit/output/',
31+
'.env',
32+
'package-lock.json'
33+
],
34+
rules: {
35+
'prettier/prettier': 'error',
36+
'no-sparse-arrays': 'off',
37+
'no-undef': 'off',
38+
'no-useless-escape': 'off',
39+
'no-empty': 'off',
40+
'no-constant-binary-expression': 'off',
41+
'no-unused-vars': 'off',
42+
'no-constant-condition': 'off',
43+
'no-cond-assign': 'off',
44+
'@typescript-eslint/require-await': 'off',
45+
'no-control-regex': 'off',
46+
'no-case-declarations': 'off',
47+
'no-self-assign': 'off',
48+
'no-async-promise-executor': 'off',
49+
'no-fallthrough': 'off',
50+
'no-prototype-builtins': 'off',
51+
'no-redeclare': 'off',
52+
'no-extra-boolean-cast': 'off'
53+
},
54+
plugins: {
55+
prettier: eslintPluginPrettier,
56+
'@typescript-eslint': typescriptEslintPlugin
57+
}
58+
},
59+
60+
{
61+
files: ['*.svelte'],
62+
languageOptions: {
63+
parser: svelteParser,
64+
parserOptions: {
65+
parser: typescriptParser
66+
}
67+
}
68+
},
69+
70+
{
71+
files: ['.svelte-kit/**'],
72+
rules: {
73+
'no-unused-vars': 'off',
74+
'no-control-regex': 'off',
75+
'no-fallthrough': 'off',
76+
'@typescript-eslint/require-await': 'off',
77+
'no-unused-labels': 'off'
78+
}
79+
},
80+
81+
eslintConfigPrettier
82+
];

histoire.config.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)