Skip to content
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
15 changes: 15 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 14 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 9 additions & 12 deletions .github/workflows/lint-and-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .mise/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
17 changes: 4 additions & 13 deletions .mise/tasks/general.toml
Original file line number Diff line number Diff line change
@@ -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"]
19 changes: 19 additions & 0 deletions .mise/tasks/lint.toml
Original file line number Diff line number Diff line change
@@ -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",
]
10 changes: 9 additions & 1 deletion .mise/tasks/scripts.toml
Original file line number Diff line number Diff line change
@@ -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"
]
8 changes: 4 additions & 4 deletions .mise/tasks/vercel.toml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down