Skip to content
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

Update cargo dependencies and migrate to svelte 5 #29

Merged
merged 7 commits into from
Nov 23, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Run NPM install
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Configure git user and email
run: |
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ edition = "2021"
strip = "symbols"

[dependencies]
anyhow = "1.0.79"
axum = "0.5.17" # The webapp framework of choice.
dotenv = "0.15.0" # For accessing env vars stored in .env
serde = { version = "1.0.137", features = ["derive"] } # For JSON serialization.
sqlx = { version = "0.6.2", features = [
"runtime-tokio-rustls",
"sqlite",
] } # For storing counts. Overkill.
tracing = "0.1.35" # For tracing, alongside tracing-appender and tracing-subscriber.
anyhow = "1.0.93"
axum = "0.5.17" # The webapp framework of choice.
dotenv = "0.15.0" # For accessing env vars stored in .env
serde = { version = "1.0.215", features = ["derive"] } # For JSON serialization.
sqlx = { version = "0.6.2", features = ["runtime-tokio-rustls", "sqlite"] } # For storing counts. Overkill.
tracing = "0.1.35" # For tracing, alongside tracing-appender and tracing-subscriber.
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
tokio = { version = "1.19.2", features = ["full"] } # tokio's used for async.
tower = "0.4.13" # Used alongside tower-http for serving files.
tokio = { version = "1.19.2", features = ["full"] } # tokio's used for async.
tower = "0.4.13" # Used alongside tower-http for serving files.
tower-http = { version = "0.3.4", features = ["full"] }

[build-dependencies]
Expand Down
3 changes: 0 additions & 3 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ use tracing_subscriber::filter::EnvFilter;

use crate::state::init_state;

#[derive(Serialize)]
struct EmptyJson {}

async fn not_found_handler() -> impl IntoResponse {
not_found()
}
Expand Down
13 changes: 0 additions & 13 deletions site/.eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions site/.eslintrc.cjs

This file was deleted.

3 changes: 1 addition & 2 deletions site/.husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd site
cd site || return 1
npm run lint
4 changes: 3 additions & 1 deletion site/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
74 changes: 74 additions & 0 deletions site/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import parser from 'svelte-eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
{
ignores: [
'**/.DS_Store',
'**/node_modules',
'build',
'.svelte-kit',
'package',
'**/.env',
'**/.env.*',
'!**/.env.example',
// Ignore files for PNPM, NPM and YARN
'**/pnpm-lock.yaml',
'**/package-lock.json',
'**/yarn.lock'
]
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
),
{
plugins: {
'@typescript-eslint': typescriptEslint
},

languageOptions: {
globals: {
...globals.browser,
...globals.node
},

parser: tsParser,
ecmaVersion: 2024,
sourceType: 'module',

parserOptions: {
extraFileExtensions: ['.svelte']
}
}
},
{
files: ['**/*.svelte'],

languageOptions: {
parser: parser,
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
parser: '@typescript-eslint/parser'
}
}
}
];
Loading
Loading