Skip to content

Commit 028035d

Browse files
committed
chore: upgrade to Svelte 5 and Vite 7
1 parent e8f368c commit 028035d

96 files changed

Lines changed: 5529 additions & 12842 deletions

File tree

Some content is hidden

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

package-lock.json

Lines changed: 3692 additions & 4759 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
},
3535
"type": "module",
3636
"version": "1.5.0",
37+
"overrides": {
38+
"cookie": "0.7.2"
39+
},
3740
"dependencies": {
3841
"@floating-ui/dom": "1.7.5",
3942
"@mdi/js": "7.4.47",
@@ -47,32 +50,32 @@
4750
"@eslint/js": "9.39.2",
4851
"@juggle/resize-observer": "3.4.0",
4952
"@sveltejs/adapter-static": "3.0.10",
50-
"@sveltejs/kit": "2.50.2",
51-
"@sveltejs/vite-plugin-svelte": "3.1.2",
53+
"@sveltejs/kit": "2.52.0",
54+
"@sveltejs/vite-plugin-svelte": "6.2.4",
5255
"@testing-library/jest-dom": "6.9.1",
5356
"@testing-library/svelte": "5.3.1",
5457
"@types/d3-geo": "3.1.0",
55-
"@types/node": "25.2.0",
58+
"@types/node": "25.2.3",
5659
"@vitest/browser": "4.0.18",
5760
"@vitest/coverage-istanbul": "4.0.18",
5861
"autoprefixer": "10.4.24",
5962
"eslint": "9.39.2",
6063
"eslint-config-prettier": "10.1.8",
6164
"eslint-import-resolver-typescript": "4.4.4",
62-
"eslint-plugin-svelte": "3.14.0",
65+
"eslint-plugin-svelte": "3.15.0",
6366
"globals": "17.3.0",
64-
"jsdom": "28.0.0",
67+
"jsdom": "28.1.0",
6568
"jsdom-worker": "0.3.0",
6669
"lamb-types": "0.61.16",
6770
"postcss-nested": "7.0.2",
6871
"prettier": "3.8.1",
6972
"prettier-plugin-svelte": "3.4.1",
70-
"svelte": "4.2.20",
71-
"svelte-check": "4.3.6",
73+
"svelte": "5.51.2",
74+
"svelte-check": "4.4.0",
7275
"svelte-preprocess": "6.0.3",
7376
"typescript": "5.9.3",
74-
"vite": "5.4.21",
75-
"vite-tsconfig-paths": "6.0.5",
77+
"vite": "7.3.1",
78+
"vite-tsconfig-paths": "6.1.1",
7679
"vitest": "4.0.18"
7780
}
7881
}

src/lib/components/__tests__/AppAnchor.spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
22
import { cleanup, fireEvent, render } from "@testing-library/svelte";
33
import { base } from "$app/paths";
44

5-
import { renderWithSimpleContent } from "$lib/dusk/test-helpers";
5+
import { EventCatcher, renderWithSimpleContent } from "$lib/dusk/test-helpers";
66

77
import { AppAnchor } from "..";
88

@@ -23,7 +23,7 @@ describe("AppAnchor", () => {
2323
const renderA = renderWithSimpleContent(AppAnchor, baseOptions);
2424
const anchorA = renderA.getByRole("link");
2525

26-
expect(renderA.container.firstChild).toMatchSnapshot();
26+
expect(renderA.container.firstElementChild).toMatchSnapshot();
2727
expect(anchorA).toHaveAttribute("href", `${base}${baseProps.href}`);
2828
expect(anchorA).toHaveClass("foo bar");
2929
expect(anchorA).toHaveAttribute("id", baseProps.id);
@@ -62,13 +62,12 @@ describe("AppAnchor", () => {
6262

6363
it("should forward the `onclick` event to the `Anchor`", async () => {
6464
const handler = vi.fn();
65-
const { component, getByRole } = render(AppAnchor, {
66-
...baseProps,
67-
href: "#",
65+
const { getByRole } = render(EventCatcher, {
66+
Component: AppAnchor,
67+
componentOptions: { ...baseProps, href: "#" },
68+
onClick: handler,
6869
});
6970

70-
component.$on("click", handler);
71-
7271
await fireEvent.click(getByRole("link"));
7372

7473
expect(handler).toHaveBeenCalledTimes(1);

src/lib/components/__tests__/AppAnchorButton.spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { afterEach, describe, expect, it, vi } from "vitest";
22
import { cleanup, fireEvent, render } from "@testing-library/svelte";
33
import { base } from "$app/paths";
44

5+
import { EventCatcher } from "$lib/dusk/test-helpers";
6+
57
import { AppAnchorButton } from "..";
68

79
describe("AppAnchorButton", () => {
@@ -20,7 +22,7 @@ describe("AppAnchorButton", () => {
2022
);
2123
const anchorA = getByRole("link");
2224

23-
expect(container.firstChild).toMatchSnapshot();
25+
expect(container.firstElementChild).toMatchSnapshot();
2426
expect(anchorA).toHaveAttribute("href", `${base}${baseProps.href}`);
2527
expect(anchorA).toHaveClass("foo bar");
2628
expect(anchorA).toHaveAttribute("id", baseProps.id);
@@ -52,13 +54,12 @@ describe("AppAnchorButton", () => {
5254

5355
it("should forward the `onclick` event to the `AnchorButton`", async () => {
5456
const handler = vi.fn();
55-
const { component, getByRole } = render(AppAnchorButton, {
56-
...baseProps,
57-
href: "#",
57+
const { getByRole } = render(EventCatcher, {
58+
Component: AppAnchorButton,
59+
componentOptions: { ...baseProps, href: "#" },
60+
onClick: handler,
5861
});
5962

60-
component.$on("click", handler);
61-
6263
await fireEvent.click(getByRole("link"));
6364

6465
expect(handler).toHaveBeenCalledTimes(1);

src/lib/components/__tests__/AppImage.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("AppImage", () => {
1919
const { container, getByRole, rerender } = render(AppImage, baseProps);
2020
const imgA = getByRole("img");
2121

22-
expect(container.firstChild).toMatchSnapshot();
22+
expect(container.firstElementChild).toMatchSnapshot();
2323
expect(imgA).toHaveAttribute("alt", baseProps.alt);
2424
expect(imgA).toHaveClass("foo bar");
2525
expect(imgA).toHaveAttribute("height", baseProps.height);

src/lib/components/__tests__/AppSource.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("AppSource", () => {
2929
const { container, rerender } = render(AppSource, baseProps);
3030
const source = getSourceElementIn(container);
3131

32-
expect(container.firstChild).toMatchSnapshot();
32+
expect(container.firstElementChild).toMatchSnapshot();
3333

3434
ownPairs(commonProps).forEach(([key, value]) => {
3535
expect(source).toHaveAttribute(key, value);
@@ -66,7 +66,7 @@ describe("AppSource", () => {
6666
const { container, rerender } = render(AppSource, props);
6767
const source = getSourceElementIn(container);
6868

69-
expect(container.firstChild).toMatchSnapshot();
69+
expect(container.firstElementChild).toMatchSnapshot();
7070

7171
ownPairs(commonProps).forEach(([key, value]) => {
7272
expect(source).toHaveAttribute(key, value);

src/lib/components/__tests__/BlockDetails.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("Block Details", () => {
3838
it("renders the Block Details component", () => {
3939
const { container } = render(BlockDetails, baseProps);
4040

41-
expect(container.firstChild).toMatchSnapshot();
41+
expect(container.firstElementChild).toMatchSnapshot();
4242
});
4343

4444
it("should disable the previous block link if the prev block hash is empty or if the current height is `0`", async () => {
@@ -84,6 +84,6 @@ describe("Block Details", () => {
8484

8585
await fireEvent.click(getByRole("switch"));
8686

87-
expect(container.firstChild).toMatchSnapshot();
87+
expect(container.firstElementChild).toMatchSnapshot();
8888
});
8989
});

src/lib/components/__tests__/BlocksCard.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("Blocks Card", () => {
3333
it("should render the `BlocksCard` component", () => {
3434
const { container } = render(BlocksCard, baseOptions);
3535

36-
expect(container.firstChild).toMatchSnapshot();
36+
expect(container.firstElementChild).toMatchSnapshot();
3737
});
3838

3939
it("should disable the `Show More` button is the card is in the loading state", () => {
@@ -46,7 +46,7 @@ describe("Blocks Card", () => {
4646

4747
expect(getByRole("button", { name: "Show More" })).toBeDisabled();
4848

49-
expect(container.firstChild).toMatchSnapshot();
49+
expect(container.firstElementChild).toMatchSnapshot();
5050
});
5151

5252
it("should disable the `Show More` button if there is no more data to display", async () => {
@@ -60,7 +60,7 @@ describe("Blocks Card", () => {
6060

6161
expect(getByRole("button", { name: "Show More" })).toBeDisabled();
6262

63-
expect(container.firstChild).toMatchSnapshot();
63+
expect(container.firstElementChild).toMatchSnapshot();
6464
});
6565

6666
it("should hide the `Show More` button if an error has occurred", async () => {
@@ -71,6 +71,6 @@ describe("Blocks Card", () => {
7171
props: { ...props, error: new Error("error") },
7272
});
7373

74-
expect(container.firstChild).toMatchSnapshot();
74+
expect(container.firstElementChild).toMatchSnapshot();
7575
});
7676
});

src/lib/components/__tests__/BlocksList.spec.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("Blocks List", () => {
3232
it("renders the Blocks List component", () => {
3333
const { container } = render(BlocksList, baseProps);
3434

35-
expect(container.firstChild).toMatchSnapshot();
35+
expect(container.firstElementChild).toMatchSnapshot();
3636
});
3737

3838
it("should auto-refresh relative times when the related prop is set to true", async () => {
@@ -43,22 +43,28 @@ describe("Blocks List", () => {
4343
const { container, rerender } = render(BlocksList, props);
4444
const timeElement = getTimeElement(container);
4545

46-
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"now"`);
46+
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"<!---->now<!---->"`);
4747

4848
await vi.advanceTimersByTimeAsync(timeRefreshInterval * 3);
4949

50-
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"now"`);
50+
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"<!---->now<!---->"`);
5151

5252
await rerender({ ...props, autoRefreshTime: true });
5353

54-
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"3 seconds ago"`);
54+
expect(timeElement.innerHTML).toMatchInlineSnapshot(
55+
`"<!----><!----><!---->3 seconds ago<!---->"`
56+
);
5557

5658
await vi.advanceTimersByTimeAsync(timeRefreshInterval);
5759

58-
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"4 seconds ago"`);
60+
expect(timeElement.innerHTML).toMatchInlineSnapshot(
61+
`"<!----><!----><!---->4 seconds ago<!---->"`
62+
);
5963

6064
await vi.advanceTimersByTimeAsync(timeRefreshInterval);
6165

62-
expect(timeElement.innerHTML).toMatchInlineSnapshot(`"5 seconds ago"`);
66+
expect(timeElement.innerHTML).toMatchInlineSnapshot(
67+
`"<!----><!----><!---->5 seconds ago<!---->"`
68+
);
6369
});
6470
});

src/lib/components/__tests__/BlocksTable.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ describe("Blocks Table", () => {
3131
it("should render the `BlocksTable` component", () => {
3232
const { container } = render(BlocksTable, baseOptions);
3333

34-
expect(container.firstChild).toMatchSnapshot();
34+
expect(container.firstElementChild).toMatchSnapshot();
3535
});
3636
});

0 commit comments

Comments
 (0)