Skip to content

Commit

Permalink
chore: migrate web app to sveltekit (#265)
Browse files Browse the repository at this point in the history
Refs: closes #264

## Summary

Migrate web app to SvelteKit.

## Changes

- Replace Svelte with SvelteKit
- Update ESLint to v9
- Add `eslint-plugin-simple-import-sort` plugin for sorting imports
automatically
  • Loading branch information
joaotomaspinheiro authored Jul 28, 2024
1 parent 88be493 commit 1c2d4fd
Show file tree
Hide file tree
Showing 184 changed files with 3,409 additions and 24,562 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bin
# Generated files
*.gen.go
web/api
web/.svelte-kit

# Logs
logs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Or, if the goal is to run each application independently, see the following step

### Web App

The web application can be found in the `web` directory. It uses [Svelte](https://svelte.dev/).
The web application can be found in the `web` directory. It uses [SvelteKit](https://kit.svelte.dev/).

The web application contains several scripts to lint, build and run the project. To check the available scripts, run the following command inside the `web` directory:

Expand Down
2 changes: 1 addition & 1 deletion cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ignorePaths:
- server/database/scripts
- server/deployments
- server/config.yml
- web/public
- web/static
- web/src/locales
ignoreRegExpList:
- "import\\s*\\((.|[\r\n])*?\\)" # Ignore go multiline imports.
Expand Down
70 changes: 70 additions & 0 deletions web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import simpleImportSort from "eslint-plugin-simple-import-sort";
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.Config[]} */
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: {
svelteConfig,
parser: ts.parser,
svelteFeatures: {
experimentalGenerics: true,
},
},
},
},
{
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
"simple-import-sort/imports": [
"error",
{
groups: [
// Side effect imports.
["^\\u0000"],
// Svelte imports.
["^svelte"],
// Node.js builtins prefixed with `node:`.
["^node:"],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports and other imports such as Svelte-style `$lib`.
// Anything not matched in another group.
["^"],
// Relative imports.
// Anything that starts with a dot.
["^\\."],
],
},
],
"simple-import-sort/exports": "error",
},
},
{
ignores: [".svelte-kit/", "dist/"],
},
];
14 changes: 0 additions & 14 deletions web/index.html

This file was deleted.

Loading

0 comments on commit 1c2d4fd

Please sign in to comment.