-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: upgrade tools and implement svelte store for item list
- restructure src folder and component organization - implement items store for better state management - upgrade to Bun and add lint/typecheck to GitHub actions - replace Prettier with ESLint for formatting and linting - add Iconify with Tabler icon pack - simplify component logic and fix Item tests
- Loading branch information
Showing
36 changed files
with
1,081 additions
and
7,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
// Disable the default formatter, use eslint instead | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
|
||
// Auto fix | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.organizeImports": "never" | ||
}, | ||
|
||
// Silent the stylistic rules in you IDE, but still auto fix them | ||
"eslint.rules.customizations": [ | ||
{ "rule": "style/*", "severity": "warn" }, | ||
{ "rule": "format/*", "severity": "warn" }, | ||
{ "rule": "*-indent", "severity": "warn" }, | ||
{ "rule": "*-spacing", "severity": "warn" }, | ||
{ "rule": "*-spaces", "severity": "warn" }, | ||
{ "rule": "*-order", "severity": "warn" }, | ||
{ "rule": "*-dangle", "severity": "warn" }, | ||
{ "rule": "*-newline", "severity": "warn" }, | ||
{ "rule": "*quotes", "severity": "warn" }, | ||
{ "rule": "*semi", "severity": "warn" } | ||
], | ||
|
||
// Enable eslint for all supported languages | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"html", | ||
"markdown", | ||
"json", | ||
"jsonc", | ||
"yaml", | ||
"toml", | ||
"xml", | ||
"gql", | ||
"graphql", | ||
"astro", | ||
"css", | ||
"less", | ||
"scss", | ||
"pcss", | ||
"postcss", | ||
"svelte" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,72 @@ | ||
# create-svelte | ||
# Bun bun bun | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). | ||
More info: [Bun Docs](https://bun.sh/docs) | ||
|
||
## Creating a project | ||
>[!TIP] | ||
> just `bun` can be used as shorthand for pretty much all of its commands. | ||
If you're seeing this, you've probably already done this step. Congrats! | ||
## Install | ||
|
||
### Install all dependencies | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
bun i | ||
``` | ||
|
||
### Install a specific package | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
```bash | ||
bun i <package> | ||
``` | ||
|
||
## Developing | ||
#### Flags | ||
|
||
- `-g` to install globally | ||
- `-D` to install as a dev dependency | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
## Development | ||
|
||
```bash | ||
npm run dev | ||
bun dev | ||
``` | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
## Build | ||
|
||
```bash | ||
bun build | ||
``` | ||
|
||
## Building | ||
## Running | ||
|
||
To create a production version of your app: | ||
### Scripts | ||
|
||
```bash | ||
npm run build | ||
bun run <script> | ||
``` | ||
|
||
You can preview the production build with `npm run preview`. | ||
Example: `bun lint` | ||
|
||
### Binaries | ||
|
||
```bash | ||
bunx <binary> | ||
``` | ||
|
||
`bun run` also works | ||
|
||
Example: `bun eslint` | ||
|
||
>[!NOTE] | ||
> To use the Bun runtime (instead of Node.js), pass `--bun` to the command: `bunx --bun vite dev` | ||
### Files | ||
|
||
```bash | ||
bun run <file> | ||
``` | ||
|
||
Example: `bun src/index.ts` | ||
|
||
## `ni` | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||
To forget about package managers: [antfu/ni](https://github.com/antfu-collective/ni?tab=readme-ov-file#ni) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,11 @@ | ||
import js from '@eslint/js'; | ||
import ts from 'typescript-eslint'; | ||
import svelte from 'eslint-plugin-svelte'; | ||
import prettier from 'eslint-config-prettier'; | ||
import globals from 'globals'; | ||
import antfu from '@antfu/eslint-config' | ||
|
||
/** @type {import('eslint').Linter.FlatConfig[]} */ | ||
export default [ | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...svelte.configs['flat/recommended'], | ||
prettier, | ||
...svelte.configs['flat/prettier'], | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node | ||
} | ||
} | ||
}, | ||
{ | ||
files: ['**/*.svelte'], | ||
languageOptions: { | ||
parserOptions: { | ||
parser: ts.parser | ||
} | ||
} | ||
}, | ||
{ | ||
ignores: ['build/', '.svelte-kit/', 'dist/'] | ||
} | ||
]; | ||
export default antfu({ | ||
svelte: true, | ||
rules: { | ||
'svelte/valid-compile': 'off', | ||
'no-console': 'off', | ||
'svelte/html-quotes': ['warn', { prefer: 'double' }], | ||
'curly': ['warn', 'multi-or-nest', 'consistent'], | ||
}, | ||
}) |
Oops, something went wrong.