Skip to content

Commit c850121

Browse files
committed
Initial commit
1 parent a453a73 commit c850121

18 files changed

+3262
-2
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
/.svelte-kit
7+
/build
8+
/dist
9+
10+
# OS
11+
.DS_Store
12+
Thumbs.db
13+
14+
# Env
15+
.env
16+
.env.*
17+
!.env.example
18+
!.env.test
19+
20+
# Vite
21+
vite.config.js.timestamp-*
22+
vite.config.ts.timestamp-*

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

.prettierrc

+8
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

+58-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
1-
# tiny-svelte-fsm
2-
A minimalistic finite state machine library for Svelte 5
1+
# create-svelte
2+
3+
Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
4+
5+
Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
6+
7+
## Creating a project
8+
9+
If you're seeing this, you've probably already done this step. Congrats!
10+
11+
```bash
12+
# create a new project in the current directory
13+
npm create svelte@latest
14+
15+
# create a new project in my-app
16+
npm create svelte@latest my-app
17+
```
18+
19+
## Developing
20+
21+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22+
23+
```bash
24+
npm run dev
25+
26+
# or start the server and open the app in a new browser tab
27+
npm run dev -- --open
28+
```
29+
30+
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31+
32+
## Building
33+
34+
To build your library:
35+
36+
```bash
37+
npm run package
38+
```
39+
40+
To create a production version of your showcase app:
41+
42+
```bash
43+
npm run build
44+
```
45+
46+
You can preview the production build with `npm run preview`.
47+
48+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
49+
50+
## Publishing
51+
52+
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/)).
53+
54+
To publish your library to [npm](https://www.npmjs.com):
55+
56+
```bash
57+
npm publish
58+
```

eslint.config.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import js from '@eslint/js';
2+
import ts from 'typescript-eslint';
3+
import svelte from 'eslint-plugin-svelte';
4+
import prettier from 'eslint-config-prettier';
5+
import globals from 'globals';
6+
7+
/** @type {import('eslint').Linter.FlatConfig[]} */
8+
export default [
9+
js.configs.recommended,
10+
...ts.configs.recommended,
11+
...svelte.configs['flat/recommended'],
12+
prettier,
13+
...svelte.configs['flat/prettier'],
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.browser,
18+
...globals.node
19+
}
20+
}
21+
},
22+
{
23+
files: ['**/*.svelte'],
24+
languageOptions: {
25+
parserOptions: {
26+
parser: ts.parser
27+
}
28+
}
29+
},
30+
{
31+
ignores: ['build/', '.svelte-kit/', 'dist/']
32+
}
33+
];

package.json

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

0 commit comments

Comments
 (0)