Skip to content

Commit 347d7b1

Browse files
authored
Update core and blocks to SvelteKit v2 (#451)
1 parent c0a6999 commit 347d7b1

30 files changed

+4635
-1835
lines changed

.github/actions/setup/action.yml

-32
This file was deleted.

.github/workflows/ci.yml

+10-18
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ jobs:
1717
- name: Install 🔧
1818
uses: viamrobotics/js-config/.github/actions/setup@0006127efb3f62669f662ca31c555a49a034935e
1919

20+
- name: Install Playwright Browsers
21+
run: pnpm -C packages/legacy playwright-install --with-deps
22+
2023
- name: Build 🏗️
2124
run: pnpm run build
2225

2326
- name: Lint and type check 💅
2427
run: pnpm run check
2528

29+
- name: Run tests
30+
run: pnpm run test
31+
2632
- name: Upload npm @viamrobotics/prime artifacts
2733
uses: actions/upload-artifact@v3
2834
with:
@@ -46,22 +52,8 @@ jobs:
4652
with:
4753
path: packages/storybook/prime
4854

49-
test:
50-
timeout-minutes: 20
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v3
54-
55-
- name: Install 🔧
56-
uses: viamrobotics/js-config/.github/actions/setup@0006127efb3f62669f662ca31c555a49a034935e
57-
58-
- name: Install Playwright Browsers
59-
run: pnpm -C packages/legacy playwright-install --with-deps
60-
61-
- name: Run tests
62-
run: pnpm run test
63-
64-
- uses: actions/upload-artifact@v3
55+
- name: Upload Playwright test artifacts
56+
uses: actions/upload-artifact@v3
6557
if: ${{ always() }}
6658
with:
6759
name: playwright-report
@@ -70,7 +62,7 @@ jobs:
7062

7163
deploy-npm:
7264
if: ${{ github.repository == 'viamrobotics/prime' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
73-
needs: [build, test]
65+
needs: build
7466
runs-on: ubuntu-latest
7567
steps:
7668
- uses: actions/checkout@v3
@@ -105,7 +97,7 @@ jobs:
10597

10698
deploy-pages:
10799
if: ${{ github.repository == 'viamrobotics/prime' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
108-
needs: [build, test]
100+
needs: build
109101
runs-on: ubuntu-latest
110102

111103
permissions:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"homepage": "http://viamrobotics.github.io/prime",
77
"repository": "git://github.com/viamrobotics/prime.git",
8-
"packageManager": "pnpm@8.7.5",
8+
"packageManager": "pnpm@8.13.0+sha256.fbcf256db6d06bc189e31df34b3ed61220f3ba9f78a2ca8fe7be0fce4670dbd3",
99
"scripts": {
1010
"build": "pnpm -r --aggregate-output build",
1111
"check": "pnpm -r --aggregate-output check",

packages/blocks/.eslintrc.cjs

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ module.exports = {
1919
node: true,
2020
},
2121
rules: {
22-
// @todo(mp APP-2482): move to js-config
23-
'sonarjs/no-duplicate-string': 'off',
24-
'no-undef-init': 'off',
25-
'unicorn/no-useless-undefined': 'off',
22+
// TODO(mc, 2023-12-15): remove overrides, fix issues
23+
'@typescript-eslint/no-non-null-assertion': 'warn',
24+
'sonarjs/no-duplicate-string': 'warn',
2625
},
2726
};

packages/blocks/package.json

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@viamrobotics/prime-blocks",
3-
"version": "0.0.22",
3+
"version": "0.0.23",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -45,47 +45,46 @@
4545
"maplibre-gl": "^3.3.0"
4646
},
4747
"devDependencies": {
48-
"@sveltejs/adapter-auto": "^2.1.0",
49-
"@sveltejs/kit": "^1.22.6",
50-
"@sveltejs/package": "^2.2.1",
51-
"@sveltejs/vite-plugin-svelte": "^2.4.5",
52-
"@testing-library/dom": "^9.3.1",
53-
"@testing-library/jest-dom": "^6.0.0",
54-
"@testing-library/svelte": "^4.0.3",
55-
"@threlte/core": "^7.0.6",
56-
"@threlte/extras": "^8.0.6",
57-
"@types/testing-library__jest-dom": "^5.14.9",
48+
"@sveltejs/adapter-auto": "^3.0.0",
49+
"@sveltejs/kit": "^2.0.3",
50+
"@sveltejs/package": "^2.2.3",
51+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
52+
"@testing-library/dom": "^9.3.3",
53+
"@testing-library/jest-dom": "^6.1.5",
54+
"@testing-library/svelte": "^4.0.5",
55+
"@threlte/core": "^7.0.12",
56+
"@threlte/extras": "^8.0.10",
5857
"@types/three": "^0.159.0",
59-
"@typescript-eslint/eslint-plugin": "^6.7.0",
60-
"@typescript-eslint/parser": "^6.7.0",
61-
"@viamrobotics/eslint-config": "^0.2.4",
62-
"@viamrobotics/prettier-config": "^0.3.2",
58+
"@typescript-eslint/eslint-plugin": "^6.15.0",
59+
"@typescript-eslint/parser": "^6.15.0",
60+
"@viamrobotics/eslint-config": "^0.3.0",
61+
"@viamrobotics/prettier-config": "^0.3.4",
6362
"@viamrobotics/prime-core": "workspace:*",
64-
"@viamrobotics/three": "^0.0.3",
63+
"@viamrobotics/three": "^0.0.4",
6564
"@viamrobotics/typescript-config": "^0.1.0",
66-
"autoprefixer": "^10.4.15",
65+
"autoprefixer": "^10.4.16",
6766
"classnames": "^2.3.2",
68-
"concurrently": "^8.2.0",
69-
"eslint": "^8.49.0",
70-
"eslint-config-prettier": "^9.0.0",
71-
"eslint-plugin-sonarjs": "^0.21.0",
72-
"eslint-plugin-svelte": "^2.33.1",
67+
"concurrently": "^8.2.2",
68+
"eslint": "^8.56.0",
69+
"eslint-config-prettier": "^9.1.0",
70+
"eslint-plugin-sonarjs": "^0.23.0",
71+
"eslint-plugin-svelte": "^2.35.1",
7372
"eslint-plugin-tailwindcss": "^3.13.0",
74-
"eslint-plugin-unicorn": "^48.0.1",
75-
"jsdom": "^22.1.0",
76-
"postcss": "^8.4.28",
77-
"prettier": "^3.0.3",
78-
"prettier-plugin-svelte": "^3.0.3",
79-
"prettier-plugin-tailwindcss": "^0.5.4",
80-
"publint": "^0.2.0",
81-
"svelte": "^4.2.0",
82-
"svelte-check": "^3.5.0",
83-
"tailwindcss": "^3.3.3",
73+
"eslint-plugin-unicorn": "^49.0.0",
74+
"jsdom": "^23.0.1",
75+
"postcss": "^8.4.32",
76+
"prettier": "^3.1.1",
77+
"prettier-plugin-svelte": "^3.1.2",
78+
"prettier-plugin-tailwindcss": "^0.5.9",
79+
"publint": "^0.2.6",
80+
"svelte": "^4.2.8",
81+
"svelte-check": "^3.6.2",
82+
"tailwindcss": "^3.3.7",
8483
"three": "^0.159.0",
85-
"tslib": "^2.6.1",
86-
"typescript": "^5.2.2",
87-
"vite": "^4.4.9",
88-
"vitest": "^0.33.0"
84+
"tslib": "^2.6.2",
85+
"typescript": "^5.3.3",
86+
"vite": "^5.0.10",
87+
"vitest": "^1.1.0"
8988
},
9089
"svelte": "./dist/index.js",
9190
"types": "./dist/index.d.ts",

packages/blocks/src/vitest.setup.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { expect, afterEach } from 'vitest';
1+
import { afterEach } from 'vitest';
22
import { cleanup } from '@testing-library/svelte';
3-
import matchers from '@testing-library/jest-dom/matchers';
4-
5-
expect.extend(matchers);
3+
import '@testing-library/jest-dom/vitest';
64

75
afterEach(() => {
86
cleanup();

packages/blocks/svelte.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import adapter from '@sveltejs/adapter-auto';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
2+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {

packages/blocks/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"./.svelte-kit/tsconfig.json"
55
],
66
"compilerOptions": {
7-
"types": ["svelte", "vite/client", "vitest"],
7+
// NOTE(mc, 2023-12-15): node resolution required to import Three.js examples
8+
"moduleResolution": "node",
9+
"types": ["svelte", "vite/client", "vitest", "@testing-library/jest-dom"],
810
"noEmit": true
911
}
1012
}

packages/core/.eslintrc.cjs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
/** @type {import('node:path')} */
34
const path = require('node:path');
45

56
module.exports = {
@@ -19,8 +20,8 @@ module.exports = {
1920
node: true,
2021
},
2122
rules: {
22-
// TODO(mc, 2023-09-15): add to js-config
23-
'no-void': ['error', { allowAsStatement: true }],
23+
// TODO(mc, 2023-12-15): remove overrides, fix issues
24+
'@typescript-eslint/no-non-null-assertion': 'warn',
2425
},
2526
overrides: [
2627
{
@@ -30,5 +31,11 @@ module.exports = {
3031
'sonarjs/no-duplicate-string': 'off',
3132
},
3233
},
34+
{
35+
files: ['.eslintrc.cjs', '.prettierrc.cjs'],
36+
rules: {
37+
'@typescript-eslint/no-unsafe-assignment': 'off',
38+
},
39+
},
3340
],
3441
};

packages/core/.prettierrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22

3+
/** @type {import('node:path')} */
34
const path = require('node:path');
5+
6+
/** @type {import('@viamrobotics/prettier-config/svelte')} */
47
const baseConfig = require('@viamrobotics/prettier-config/svelte');
58

69
module.exports = {

packages/core/package.json

+40-41
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@viamrobotics/prime-core",
3-
"version": "0.0.73",
3+
"version": "0.0.74",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -37,53 +37,52 @@
3737
"svelte": ">=4.0.0 <5"
3838
},
3939
"dependencies": {
40-
"@floating-ui/dom": "^1.5.1",
41-
"@mdi/js": "^7.2.96",
40+
"@floating-ui/dom": "^1.5.3",
41+
"@mdi/js": "^7.3.67",
4242
"classnames": "^2.3.2",
43-
"lodash": "^4.17.21",
44-
"nanoid": "^4.0.2",
43+
"lodash-es": "^4.17.21",
44+
"nanoid": "^5.0.4",
4545
"prism-themes": "^1.9.0",
4646
"prismjs": "^1.29.0"
4747
},
4848
"devDependencies": {
49-
"@sveltejs/adapter-auto": "^2.1.0",
50-
"@sveltejs/kit": "^1.22.6",
51-
"@sveltejs/package": "^2.2.1",
52-
"@sveltejs/vite-plugin-svelte": "^2.4.5",
53-
"@testing-library/dom": "^9.3.1",
54-
"@testing-library/jest-dom": "^6.0.0",
55-
"@testing-library/svelte": "^4.0.3",
56-
"@testing-library/user-event": "^14.4.3",
57-
"@types/lodash": "^4.14.197",
58-
"@types/prismjs": "^1.26.0",
59-
"@types/testing-library__jest-dom": "^5.14.9",
60-
"@typescript-eslint/eslint-plugin": "^6.7.0",
61-
"@typescript-eslint/parser": "^6.7.0",
62-
"@viamrobotics/eslint-config": "^0.2.4",
63-
"@viamrobotics/prettier-config": "^0.3.2",
49+
"@sveltejs/adapter-auto": "^3.0.0",
50+
"@sveltejs/kit": "^2.0.3",
51+
"@sveltejs/package": "^2.2.3",
52+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
53+
"@testing-library/dom": "^9.3.3",
54+
"@testing-library/jest-dom": "^6.1.5",
55+
"@testing-library/svelte": "^4.0.5",
56+
"@testing-library/user-event": "^14.5.1",
57+
"@types/lodash-es": "^4.17.12",
58+
"@types/prismjs": "^1.26.3",
59+
"@typescript-eslint/eslint-plugin": "^6.15.0",
60+
"@typescript-eslint/parser": "^6.15.0",
61+
"@viamrobotics/eslint-config": "^0.3.0",
62+
"@viamrobotics/prettier-config": "^0.3.4",
6463
"@viamrobotics/typescript-config": "^0.1.0",
65-
"autoprefixer": "^10.4.15",
66-
"concurrently": "^8.2.0",
67-
"eslint": "^8.49.0",
68-
"eslint-config-prettier": "^9.0.0",
69-
"eslint-plugin-sonarjs": "^0.21.0",
70-
"eslint-plugin-svelte": "^2.33.1",
64+
"autoprefixer": "^10.4.16",
65+
"concurrently": "^8.2.2",
66+
"eslint": "^8.56.0",
67+
"eslint-config-prettier": "^9.1.0",
68+
"eslint-plugin-sonarjs": "^0.23.0",
69+
"eslint-plugin-svelte": "^2.35.1",
7170
"eslint-plugin-tailwindcss": "^3.13.0",
72-
"eslint-plugin-unicorn": "^48.0.1",
73-
"jsdom": "^22.1.0",
74-
"postcss": "^8.4.28",
75-
"prettier": "^3.0.3",
76-
"prettier-plugin-svelte": "^3.0.3",
77-
"prettier-plugin-tailwindcss": "^0.5.4",
78-
"publint": "^0.2.0",
79-
"svelte": "^4.2.0",
80-
"svelte-check": "^3.5.0",
81-
"tailwindcss": "^3.3.3",
82-
"tslib": "^2.6.1",
83-
"type-fest": "^4.4.0",
84-
"typescript": "^5.2.2",
85-
"vite": "^4.4.9",
86-
"vitest": "^0.33.0"
71+
"eslint-plugin-unicorn": "^49.0.0",
72+
"jsdom": "^23.0.1",
73+
"postcss": "^8.4.32",
74+
"prettier": "^3.1.1",
75+
"prettier-plugin-svelte": "^3.1.2",
76+
"prettier-plugin-tailwindcss": "^0.5.9",
77+
"publint": "^0.2.6",
78+
"svelte": "^4.2.8",
79+
"svelte-check": "^3.6.2",
80+
"tailwindcss": "^3.3.7",
81+
"tslib": "^2.6.2",
82+
"type-fest": "^4.8.3",
83+
"typescript": "^5.3.3",
84+
"vite": "^5.0.10",
85+
"vitest": "^1.1.0"
8786
},
8887
"svelte": "./dist/index.js",
8988
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)