From 59ffb58cae073af8891f4232bfaec9edb93b0218 Mon Sep 17 00:00:00 2001 From: sutne Date: Tue, 14 Apr 2026 11:58:39 +0200 Subject: [PATCH 1/3] chore: update mise tasks --- .mise/config.toml | 4 ++-- .mise/tasks/general.toml | 17 ++++------------- .mise/tasks/lint.toml | 19 +++++++++++++++++++ .mise/tasks/scripts.toml | 10 +++++++++- .mise/tasks/vercel.toml | 8 ++++---- package.json | 4 ---- 6 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 .mise/tasks/lint.toml diff --git a/.mise/config.toml b/.mise/config.toml index 035c23c..a750327 100644 --- a/.mise/config.toml +++ b/.mise/config.toml @@ -6,10 +6,10 @@ python = "3.13" _.file = ".env" [task_config] -includes = ["tasks/*.toml"] +includes = [".mise/tasks/*.toml"] [settings] experimental = true [hooks] -postinstall = ["mise run install-dependencies"] +postinstall = ["npm ci"] diff --git a/.mise/tasks/general.toml b/.mise/tasks/general.toml index bee9e93..9388ca8 100644 --- a/.mise/tasks/general.toml +++ b/.mise/tasks/general.toml @@ -1,16 +1,7 @@ -[install-dependencies] -description = "Install dependencies" -run = ["npm ci"] - -[serve] -description = "Serve api with hot reloading on changes" -depends = "install-dependencies" -run = "npx vercel dev" - [clean] description = "Remove all untracked or safe to remove files" -run = "git clean -fdx -e .env -e .vercel" +run = "git clean -fdx -e .env -e .vercel" -[format] -description = "Format all files" -run = ["mise fmt", "npm run check"] +[serve] +description = "Serve api with hot reloading on changes" +run = ["npm ci", "npx vercel dev"] diff --git a/.mise/tasks/lint.toml b/.mise/tasks/lint.toml new file mode 100644 index 0000000..f5306cf --- /dev/null +++ b/.mise/tasks/lint.toml @@ -0,0 +1,19 @@ +["lint:mise"] +description = "Format mise files" +run = "mise fmt" + +["lint:biome"] +description = "Lint and format TypeScript files" +run = "npx biome check --write --unsafe --diagnostic-level=error" + +["lint:compile"] +description = "Compile TypeScript" +run = "npx tsc --noEmit" + +[lint] +description = "Lint and format entire project" +run = [ + "mise run lint:mise", + "mise run lint:biome", + "mise run lint:compile", +] \ No newline at end of file diff --git a/.mise/tasks/scripts.toml b/.mise/tasks/scripts.toml index d8f177b..c2672b9 100644 --- a/.mise/tasks/scripts.toml +++ b/.mise/tasks/scripts.toml @@ -1,3 +1,11 @@ [get-playstation-refresh-token] description = "Run .ts script to retreive PSN refresh token." -run = "npx ts-node scripts/get_playstation_refresh_token.ts" +alias = "gprt" +run = "npx ts-node scripts/get_playstation_refresh_token.ts" + +[sync-psn-and-deploy] +description = "Deploy API with updated PLAYSTATION_REFRESH_TOKEN from local .env" +run = [ + "mise run env-upload-psn", + "mise run deploy" +] \ No newline at end of file diff --git a/.mise/tasks/vercel.toml b/.mise/tasks/vercel.toml index c2d694a..f911b10 100644 --- a/.mise/tasks/vercel.toml +++ b/.mise/tasks/vercel.toml @@ -1,15 +1,15 @@ [env-upload] description = "Upload all local .env variables to Vercel" -run = "python scripts/sync-env.py" +run = "python scripts/sync-env.py" [env-upload-psn] description = "Upload local PLAYSTATION_REFRESH_TOKEN from .env to Vercel" -run = "python scripts/sync-env.py PLAYSTATION_REFRESH_TOKEN" +run = "python scripts/sync-env.py PLAYSTATION_REFRESH_TOKEN" [env-download] description = "Download current .env production variables from Vercel" -run = "npx vercel pull --environment=production" +run = "npx vercel pull --environment=production" [deploy] description = "Deploy current local api to Vercel (also done in ci on push to main)" -run = "npx vercel deploy --prod" +run = "npx vercel deploy --prod" diff --git a/package.json b/package.json index 47460fe..a41b777 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,4 @@ { - "scripts": { - "check": "biome check --write --unsafe --diagnostic-level=error", - "compile": "tsc --noEmit" - }, "devDependencies": { "@biomejs/biome": "2.3.13", "@types/node": "^25.2.0", From 6cb92e36867cc8bd6ec2f051975a72cc57ded34b Mon Sep 17 00:00:00 2001 From: sutne Date: Tue, 14 Apr 2026 11:59:07 +0200 Subject: [PATCH 2/3] ci: update workflow to use custom setup action --- .github/actions/setup/action.yaml | 15 +++++++++++++++ .github/workflows/lint-and-format.yaml | 21 +++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 .github/actions/setup/action.yaml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 0000000..8140a3b --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -0,0 +1,15 @@ +name: "Set up environment in CI" +description: "Installs Mise, with all tools and project dependencies, with caching" + +runs: + using: "composite" + steps: + - name: Cache dependencies + id: cache-web + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: node_modules + key: "dependencies-${{ hashFiles('.mise/config.toml', 'package-lock.json') }}" + + - name: Set up Mise + uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index 87004f0..6380496 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -8,19 +8,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: 24 - cache: npm + - name: Set up environment + uses: ./.github/actions/setup - - name: Install Dependencies - run: npm ci + - name: "lint: Mise" + run: mise lint:mise - - name: Lint and Format - run: npm run check + - name: "lint: Biome" + run: mise lint:biome - - name: Compile - run: npm run compile + - name: "lint: Compile" + run: mise lint:compile From 38cf3408f77347fd3e9679db207b287c945aabf6 Mon Sep 17 00:00:00 2001 From: sutne Date: Tue, 14 Apr 2026 12:03:37 +0200 Subject: [PATCH 3/3] chore: update dependabot.yaml --- .github/dependabot.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fcbb4c8..b70b973 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,26 @@ version: 2 + updates: - package-ecosystem: "github-actions" - directory: "/" + directories: + - "/.github/workflows" + - "/.github/actions/*" + groups: + ci: + patterns: + - "*" schedule: interval: "monthly" + cooldown: + default-days: 7 - package-ecosystem: "npm" directory: "/" - schedule: - interval: "monthly" groups: dependencies: patterns: - "*" - commit-message: - prefix: "build" + schedule: + interval: "monthly" + cooldown: + default-days: 7