Skip to content

Svelte 5 #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/red-crabs-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'threlte-uikit': major
---

Rewrite internals in Svelte 5, removes Svelte 4 support
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install and Build 🔧
run: |
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
prettier:
check:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,13 +16,31 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install 🔧
run: npm ci

- name: Prettier 💅
run: npm run prettier
- name: Lint 💅
run: npm run check

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install 🔧
run: npm ci

- name: Lint 💅
run: npm run lint

unit-test:
runs-on: ubuntu-latest
Expand All @@ -34,7 +52,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install 🔧
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"useTabs": false,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"printWidth": 90,
"semi": false,
"singleAttributePerLine": true,
"plugins": ["prettier-plugin-svelte"],
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# threlte-uikit

`threlte-uikit` wraps [`@pmndrs/uikit`](https://github.com/pmndrs/uikit) (the vanilla flavor) in a declarative syntax for use with [Threlte](https://threlte.xyz).
`threlte-uikit` wraps [`@pmndrs/uikit`](https://github.com/pmndrs/uikit) in a declarative syntax for use with [Threlte](https://threlte.xyz).

```
npm i threlte-uikit
Expand Down Expand Up @@ -52,9 +52,11 @@ The component internals may be accessed via the `ref` property.
Allows overriding the default properties for all UIKit components and children components of the component in which it is called.

```ts
provideDefaultProperties({
let defaultProps = $state({
margin: 10,
})

provideDefaultProperties(() => defaultProps)
```

- `provideFontFamilies()`
Expand Down
38 changes: 25 additions & 13 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
import js from '@eslint/js'
import ts from 'typescript-eslint'
import svelte from 'eslint-plugin-svelte'
import { defineConfig, globalIgnores } from 'eslint/config'
import prettier from 'eslint-config-prettier'
import svelte from 'eslint-plugin-svelte'
import globals from 'globals'
import ts from 'typescript-eslint'
import svelteConfig from './svelte.config.js'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
export default defineConfig([
globalIgnores(['dist/', '.svelte-kit/']),
prettier,
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
...svelte.configs.recommended,
...svelte.configs.prettier,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ['**/*.svelte'],
files: ['**/*.svelte', '**/*.svelte.js', '**/*.svelte.ts', '../*.svelte.config.ts'],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'], // Add support for additional file extensions, such as .svelte
parser: ts.parser,
// Specify a parser for each language, if needed:
// parser: {
// ts: ts.parser,
// js: espree, // Use espree for .js files (add: import espree from 'espree')
// typescript: ts.parser
// },

// We recommend importing and specifying svelte.config.js.
// By doing so, some rules in eslint-plugin-svelte will automatically read the configuration and adjust their behavior accordingly.
// While certain Svelte settings may be statically loaded from svelte.config.js even if you don’t specify it,
// explicitly specifying it ensures better compatibility and functionality.
svelteConfig,
},
},
},
{
ignores: ['build/', '.svelte-kit/', 'dist/'],
},
]
])
Loading