From 1f498414751ecdb60dcb5fb75da0a53fd8583634 Mon Sep 17 00:00:00 2001 From: sutne Date: Sun, 18 Jan 2026 14:16:01 +0100 Subject: [PATCH] chore: migrate to use mise replacing VSCode tasks, and handling dev environment --- .github/CODEOWNERS | 2 +- .github/workflows/build-and-deploy.yaml | 3 ++ .github/workflows/lint-and-format.yaml | 3 ++ .gitignore | 3 +- .mise/config.toml | 11 +++++++ .mise/tasks/general.toml | 16 ++++++++++ .vscode/tasks.json | 40 ------------------------- README.md | 20 +++++++++++++ biome.json | 2 +- package.json | 4 +-- 10 files changed, 57 insertions(+), 47 deletions(-) create mode 100644 .mise/config.toml create mode 100644 .mise/tasks/general.toml delete mode 100644 .vscode/tasks.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f2b8f21..a32985f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @sutne \ No newline at end of file +* @sutne diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml index 2c31003..22a4398 100644 --- a/.github/workflows/build-and-deploy.yaml +++ b/.github/workflows/build-and-deploy.yaml @@ -12,6 +12,9 @@ jobs: - name: Setup Node uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm - name: Install Dependencies run: npm ci diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index 4b33205..59f4704 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -12,6 +12,9 @@ jobs: - name: Setup Node uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm - name: Install Dependencies run: npm ci diff --git a/.gitignore b/.gitignore index 242ebb3..3d759a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .env .DS_Store -.vscode/* -!.vscode/tasks.json +.vscode node_modules dist diff --git a/.mise/config.toml b/.mise/config.toml new file mode 100644 index 0000000..db238b3 --- /dev/null +++ b/.mise/config.toml @@ -0,0 +1,11 @@ +[tools] +node = "24" + +[task_config] +includes = [".mise/tasks/general.toml"] + +[settings] +experimental = true + +[hooks] +postinstall = ["mise run install-dependencies"] diff --git a/.mise/tasks/general.toml b/.mise/tasks/general.toml new file mode 100644 index 0000000..15418d3 --- /dev/null +++ b/.mise/tasks/general.toml @@ -0,0 +1,16 @@ +[install-dependencies] + description = "Install dependencies" + run = "npm install" + +[serve] + description = "Serve api with hot reloading on changes" + depends = "install-dependencies" + run = "npx vite --open --host" + +[clean] + description = "Remove all untracked or safe to remove files" + run = "git clean -fdx" + +[format] + description = "Format all files" + run = ["mise fmt", "npm run check"] diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 7d7accb..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - // More info: https://code.visualstudio.com/docs/editor/tasks - "version": "2.0.0", - "tasks": [ - { - "label": "Install", - "icon": { - "id": "desktop-download", - "color": "terminal.ansiYellow" - }, - "type": "shell", - "command": "rm -rf node_modules dist && npm install", - "presentation": { - "panel": "dedicated", - "reveal": "always", - "showReuseMessage": false, - "focus": false, - "clear": true, - "echo": true - } - }, - { - "label": "Develop", - "icon": { - "id": "debug", - "color": "terminal.ansiBlue" - }, - "type": "shell", - "command": "npm install && npm start", - "presentation": { - "panel": "dedicated", - "reveal": "always", - "showReuseMessage": false, - "focus": false, - "clear": true, - "echo": true - } - } - ] -} diff --git a/README.md b/README.md index 718b155..745fa8b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,27 @@ +## Development +### Configuration + +To setup the dev environment: + +1. Install [mise][mise], make sure to also: + - add auto-activation for your shell + - add autocompletion (if it wasn't done automatically) +2. Run `mise install` + +### Running + +Once the dev environment is configured, serve the app with: + +```sh +mise serve +``` + +> To show all available commands write `mise run` and hit **tab**. [on-push-main-action]: https://github.com/sutne/sutne.github.io/actions/workflows/on-push-main.yaml [on-push-main-action-badge]: https://github.com/sutne/sutne.github.io/actions/workflows/on-push-main.yaml/badge.svg +[mise]: https://mise.jdx.dev/getting-started.html diff --git a/biome.json b/biome.json index 0dff04b..b2720f2 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "vcs": { "enabled": true, "clientKind": "git", diff --git a/package.json b/package.json index bb64a42..0a137f2 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,7 @@ "private": true, "type": "module", "scripts": { - "start": "vite --open --host", - "check": "biome check", - "fix": "biome check --write --unsafe --diagnostic-level=error", + "check": "biome check --write --diagnostic-level=error", "compile": "tsc -b", "build": "vite build" },