Skip to content

Commit ef98d90

Browse files
migrate to Svelte 5, update all deps, switch valueComponent to snippet (#19)
* initial update of root, site deps * wip update components to svelte 5 * seems functional site * update svelte-tree-view deps * fix unit tests * fix running cypress tests * fix cypress tests * refactor, remove jest-dom * fix lint * update TreeViewNode to svelte 5 * migrated TreeView with passing tests (FINALLY) * remove RootNode, restore setting theme by props * fix svelte:component into svelte 5 * wip * working snippet based custom node * add rootNode snippet prop * move tree-view vars from :root to component * switch treeMap from Map to Record to utilize proxies * clean * remove old DiffValue * update github actions * update actions * add changeset
1 parent 1b7b557 commit ef98d90

Some content is hidden

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

50 files changed

+18563
-15802
lines changed

.changeset/shaggy-gifts-search.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'svelte-tree-view': major
3+
---
4+
5+
migrate to Svelte 5, update all deps, switch valueComponent to snippet
6+
7+
BREAKING:
8+
9+
- incompatible with Svelte < 5
10+
- `valueComponent` is now `treeNode` snippet
11+
- `rootNode` snippet added
12+
- default styles not applied to `:root` anymore but `ul.svelte-tree-view`
13+
- changed `treeMap` from `Map` to `Record` to allow use of proxies

.eslintrc.json

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

.github/actions/build-test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616

1717
- name: Run tests with Cypress
1818
id: cypress
19-
uses: cypress-io/github-action@v5
19+
uses: cypress-io/github-action@v6
2020
with:
2121
browser: chrome
2222
cache-key: ${{ runner.os }}-node-${{ matrix.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
@@ -28,15 +28,15 @@ runs:
2828
working-directory: ./packages/svelte-tree-view
2929

3030
- name: Export screenshots (on failure only)
31-
uses: actions/upload-artifact@v3
31+
uses: actions/upload-artifact@v4
3232
if: failure()
3333
with:
3434
name: cypress-screenshots
3535
path: ./packages/svelte-tree-view/cypress/screenshots
3636
retention-days: 7
3737

3838
- name: Export screen recordings (on failure only)
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
if: failure()
4141
with:
4242
name: cypress-videos

.github/actions/pnpm/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
steps:
77
- name: Install pnpm
88
shell: bash
9-
run: npm i pnpm -g
9+
run: npm i pnpm@9 -g
1010

1111
- name: Setup pnpm config
1212
shell: bash

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [16.x]
16+
node-version: [22.x]
1717
steps:
1818
- name: Checkout Repo
1919
uses: actions/checkout@v3

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
node-version: [16.x]
11+
node-version: [22.x]
1212
steps:
1313
- name: Checkout Repo
1414
uses: actions/checkout@v3

.github/workflows/version-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [16.x]
15+
node-version: [22.x]
1616
steps:
1717
- name: Checkout Repo
1818
uses: actions/checkout@v3

.prettierrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
"options": {
66
"singleQuote": false
77
}
8+
},
9+
{
10+
"files": "*.svelte",
11+
"options": {
12+
"parser": "svelte"
13+
}
814
}
915
],
1016
"arrowParens": "avoid",
11-
"plugins": ["prettier-plugin-svelte"],
17+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
1218
"printWidth": 100,
1319
"semi": false,
1420
"singleQuote": true,

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ To override default styles I suggest using child or element selector to get enou
6161
<TreeView />
6262
</div>
6363
64-
<style>
64+
<style lang="postcss">
6565
.wrapper > :global(.svelte-tree-view) {
66-
...;
66+
/* ... */
6767
}
6868
/* OR */
6969
:global(ul.svelte-tree-view) {
70-
...;
70+
/* ... */
7171
}
7272
</style>
7373
```

eslint.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import prettier from 'eslint-config-prettier'
2+
import { includeIgnoreFile, fixupConfigRules } from '@eslint/compat'
3+
import js from '@eslint/js'
4+
import svelte from 'eslint-plugin-svelte'
5+
import globals from 'globals'
6+
import { fileURLToPath } from 'node:url'
7+
import tseslint from 'typescript-eslint'
8+
9+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url))
10+
11+
/** @type {import('typescript-eslint').Config} */
12+
const config = [
13+
includeIgnoreFile(gitignorePath),
14+
js.configs.recommended,
15+
...tseslint.configs.recommended,
16+
...svelte.configs.recommended,
17+
prettier,
18+
...svelte.configs.prettier,
19+
{
20+
languageOptions: {
21+
globals: { ...globals.browser, ...globals.node }
22+
},
23+
rules: {
24+
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
25+
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
26+
'no-undef': 'off'
27+
}
28+
},
29+
{
30+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
31+
languageOptions: {
32+
parserOptions: {
33+
projectService: true,
34+
extraFileExtensions: ['.svelte'],
35+
parser: tseslint.parser
36+
}
37+
}
38+
}
39+
]
40+
41+
export default config

0 commit comments

Comments
 (0)