diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a76e3fe..47aa088 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,9 @@ jobs: - name: Lint changelog fragments run: bun run changelog:lint + - name: Lint stats (formatting) + run: bun run lint:stats + - name: Enforce pull request changelog fragments (`skip-changelog` label bypass) if: github.event_name == 'pull_request' run: bun run changelog:pr-check --base-ref "origin/${{ github.base_ref }}" --head-ref "HEAD" --labels "${{ join(github.event.pull_request.labels.*.name, ',') }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d3603b..8913a47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,13 +29,19 @@ jobs: path: | ~/.bun/install/cache node_modules + stats/node_modules vendor/subminer-yomitan/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/subminer-yomitan/package-lock.json') }} + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'stats/bun.lock', 'vendor/subminer-yomitan/package-lock.json') }} restore-keys: | ${{ runner.os }}-bun- - name: Install dependencies - run: bun install --frozen-lockfile + run: | + bun install --frozen-lockfile + cd stats && bun install --frozen-lockfile + + - name: Lint stats (formatting) + run: bun run lint:stats - name: Build (TypeScript check) run: bun run typecheck diff --git a/Makefile b/Makefile index b9d34f6..a4217da 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-windows install-plugin uninstall uninstall-linux uninstall-macos uninstall-windows print-dirs pretty ensure-bun generate-config generate-example-config dev-start dev-start-macos dev-watch dev-watch-macos dev-toggle dev-stop +.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-windows install-plugin uninstall uninstall-linux uninstall-macos uninstall-windows print-dirs pretty lint ensure-bun generate-config generate-example-config dev-start dev-start-macos dev-watch dev-watch-macos dev-toggle dev-stop APP_NAME := subminer THEME_SOURCE := assets/themes/subminer.rasi @@ -74,6 +74,7 @@ help: " uninstall-macos Remove macOS install artifacts" \ " uninstall-windows Remove Windows mpv plugin artifacts" \ " print-dirs Show resolved install locations" \ + " lint Lint stats (format check)" \ "" \ "Variables:" \ " PREFIX=... Override wrapper install prefix (default: $$HOME/.local)" \ @@ -112,6 +113,10 @@ ensure-bun: pretty: ensure-bun @bun run format:src + @bun run format:stats + +lint: ensure-bun + @bun run lint:stats build: @printf '%s\n' "[INFO] Detected platform: $(PLATFORM)" diff --git a/package.json b/package.json index 9b962c6..8ef2a10 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,12 @@ "format:check": "prettier --check .", "format:src": "bash scripts/prettier-scope.sh --write", "format:check:src": "bash scripts/prettier-scope.sh --check", + "format:stats": "bun x prettier --write stats/index.html stats/package.json stats/src stats/tsconfig.json stats/vite.config.ts", + "format:check:stats": "bun x prettier --check stats/index.html stats/package.json stats/src stats/tsconfig.json stats/vite.config.ts", + "typecheck:stats": "cd stats && bun x tsc --noEmit -p tsconfig.json", + "lint:stats": "bun run format:check:stats", + "lint:stats:typecheck": "bun run typecheck:stats", + "lint": "bun run lint:stats", "docs:dev": "bun run --cwd docs-site docs:dev", "docs:build": "bun run --cwd docs-site docs:build", "docs:preview": "bun run --cwd docs-site docs:preview",