Skip to content

Commit 24bee5c

Browse files
committed
initial commit
0 parents  commit 24bee5c

20 files changed

+2890
-0
lines changed

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.eslintrc.cjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/** @type { import("eslint").Linter.Config } */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:svelte/recommended',
8+
'prettier'
9+
],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['@typescript-eslint'],
12+
parserOptions: {
13+
sourceType: 'module',
14+
ecmaVersion: 2020,
15+
extraFileExtensions: ['.svelte']
16+
},
17+
env: {
18+
browser: true,
19+
es2017: true,
20+
node: true
21+
},
22+
overrides: [
23+
{
24+
files: ['*.svelte'],
25+
parser: 'svelte-eslint-parser',
26+
parserOptions: {
27+
parser: '@typescript-eslint/parser'
28+
}
29+
}
30+
]
31+
};

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/dist
5+
/.svelte-kit
6+
/package
7+
.env
8+
.env.*
9+
!.env.example
10+
vite.config.js.timestamp-*
11+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore files for PNPM, NPM and YARN
2+
pnpm-lock.yaml
3+
package-lock.json
4+
yarn.lock

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8+
}

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Floating UI Svelte
2+
3+
A Floating UI wrapper for Svelte.
4+
5+
## Attribution
6+
7+
This project is maintained by [Hugo Korte](https://github.com/Hugos68), [Skeleton Labs](https://www.skeletonlabs.co/), and the [Svelte](https://svelte.dev/) community. Based on the amazing work by [Floating UI](https://github.com/floating-ui/floating-ui).
8+
9+
## Contributing
10+
11+
### Developing
12+
13+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
14+
15+
```bash
16+
npm run dev
17+
18+
# or start the server and open the app in a new browser tab
19+
npm run dev -- --open
20+
```
21+
22+
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
23+
24+
### Building
25+
26+
To build your library:
27+
28+
```bash
29+
npm run package
30+
```
31+
32+
To create a production version of your showcase app:
33+
34+
```bash
35+
npm run build
36+
```
37+
38+
You can preview the production build with `npm run preview`.
39+
40+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
41+
42+
### Publishing
43+
44+
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
45+
46+
To publish your library to [npm](https://www.npmjs.com):
47+
48+
```bash
49+
npm publish
50+
```

package.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "floating-ui-svelte",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build && npm run package",
7+
"preview": "vite preview",
8+
"package": "svelte-kit sync && svelte-package && publint",
9+
"prepublishOnly": "npm run package",
10+
"test": "npm run test:integration && npm run test:unit",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13+
"lint": "prettier --check . && eslint .",
14+
"format": "prettier --write .",
15+
"test:integration": "playwright test",
16+
"test:unit": "vitest"
17+
},
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"svelte": "./dist/index.js"
22+
}
23+
},
24+
"files": [
25+
"dist",
26+
"!dist/**/*.test.*",
27+
"!dist/**/*.spec.*"
28+
],
29+
"peerDependencies": {
30+
"svelte": "^5.0.0-next.1"
31+
},
32+
"devDependencies": {
33+
"@playwright/test": "^1.28.1",
34+
"@sveltejs/adapter-auto": "^3.0.0",
35+
"@sveltejs/kit": "^2.0.0",
36+
"@sveltejs/package": "^2.0.0",
37+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
38+
"@types/eslint": "^8.56.0",
39+
"@typescript-eslint/eslint-plugin": "^7.0.0",
40+
"@typescript-eslint/parser": "^7.0.0",
41+
"eslint": "^8.56.0",
42+
"eslint-config-prettier": "^9.1.0",
43+
"eslint-plugin-svelte": "^2.36.0-next.4",
44+
"prettier": "^3.1.1",
45+
"prettier-plugin-svelte": "^3.1.2",
46+
"publint": "^0.1.9",
47+
"svelte": "^5.0.0-next.1",
48+
"svelte-check": "^3.6.0",
49+
"tslib": "^2.4.1",
50+
"typescript": "^5.0.0",
51+
"vite": "^5.0.11",
52+
"vitest": "^1.2.0"
53+
},
54+
"svelte": "./dist/index.js",
55+
"types": "./dist/index.d.ts",
56+
"type": "module"
57+
}

playwright.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { PlaywrightTestConfig } from '@playwright/test';
2+
3+
const config: PlaywrightTestConfig = {
4+
webServer: {
5+
command: 'npm run build && npm run preview',
6+
port: 4173
7+
},
8+
testDir: 'tests',
9+
testMatch: /(.+\.)?(test|spec)\.[jt]s/
10+
};
11+
12+
export default config;

0 commit comments

Comments
 (0)