From 82fe934598ab18f42648c3629dbee1e6d15ac55e Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 11:39:11 +0000 Subject: [PATCH 01/14] feat: eslint cache location --- .gitignore | 3 +++ .prettierignore | 1 + package.json | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5fb79853..7f76ebbb 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ Thumbs.db # Coverage directory used by tools like istanbul coverage *.lcov + +# custom cache +.cache diff --git a/.prettierignore b/.prettierignore index 2800b618..d0bb8fad 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,4 +5,5 @@ example/ payload-examples/ tsconfig.tsnode.json __generated__/ +.cache .changeset/*.md diff --git a/package.json b/package.json index 3e08ad2d..e597302d 100644 --- a/package.json +++ b/package.json @@ -30,10 +30,10 @@ "format": "prettier --write .", "format:check": "prettier --check .", "knip": "knip", - "lint": "eslint .", + "lint": "eslint --cache --cache-location '.cache/eslint/' .", "lint:debug": "pnpm run lint --debug", "lint:fix": "pnpm run lint --fix", - "lint:ls": "DEBUG=eslint:cli-engine pnpm run lint", + "lint:ls": "DEBUG=eslint:eslint pnpm run lint", "release": "pnpm run all && changeset publish", "start": "node -r dotenv/config ./dist/index.js", "test": "vitest run", From 48b9bc8ea7f276977e8dc9adb25777818bcb0ccb Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 11:39:26 +0000 Subject: [PATCH 02/14] ci: enable custom cache --- .github/workflows/test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a861df6..403eb506 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,8 +23,14 @@ jobs: - uses: andykenward/github-actions/setup-pnpm@32471b1e0a5df8a09500a54b1254e3f0f881e52d #v1.0.3 with: node-version: 20 + - name: Cache + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3 + with: + path: | + ~/.cache/ + key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js') }} - name: Lint - run: pnpm run lint + run: pnpm run lint -cache-strategy content - name: Typecheck run: pnpm run tsc:check - name: Test From a47d45b1e798b6132bf8d7042a4f7e39015833ff Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 11:43:41 +0000 Subject: [PATCH 03/14] feat: prettier cache --- .github/workflows/test.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 403eb506..d4373100 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: with: path: | ~/.cache/ - key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js') }} + key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs') }} - name: Lint run: pnpm run lint -cache-strategy content - name: Typecheck diff --git a/package.json b/package.json index e597302d..e164dacf 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "codegen:watch": "pnpm run codegen --watch", "deployments:delete": "tsx bin/deployments/index.ts", "download": "tsx bin/download/index.ts", - "format": "prettier --write .", - "format:check": "prettier --check .", + "format": "prettier --write . --cache --cache-location '.cache/prettier/'", + "format:check": "pnpm run format --check", "knip": "knip", "lint": "eslint --cache --cache-location '.cache/eslint/' .", "lint:debug": "pnpm run lint --debug", From f392a7e351ab0c8b28080a3ce95704c41ac8ed03 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 12:36:43 +0000 Subject: [PATCH 04/14] chore: devcontainer updates --- .devcontainer/devcontainer.json | 10 +++++----- package.json | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5cb83e20..1cdea343 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,16 +17,16 @@ } }, "postCreateCommand": "sed -i '/^ZSH_THEME/c\\ZSH_THEME=\"bira\"' ~/.zshrc && pnpm i && pre-commit install", - "updateContentCommand": "pnpm i && pre-commit install", + "updateContentCommand": "rm -rf .cache && pnpm i && pre-commit install", "features": { - "ghcr.io/devcontainers-contrib/features/act:1": {}, + "ghcr.io/devcontainers-extra/features/act:1": {}, "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, "ghcr.io/devcontainers/features/node:1": { - "version": "20.18.2", - "pnpmVersion": "10.2.1" + "version": "20.19.3", + "pnpmVersion": "10.12.4" }, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers-contrib/features/pre-commit:2": {} + "ghcr.io/devcontainers-extra/features/pre-commit:2": {} } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. diff --git a/package.json b/package.json index e164dacf..09eecb71 100644 --- a/package.json +++ b/package.json @@ -89,10 +89,10 @@ "peerDependencies": { "wrangler": "^4.13.2" }, - "packageManager": "pnpm@10.11.0", + "packageManager": "pnpm@10.12.4", "engines": { - "node": "^20.11.0", - "pnpm": "^10.2.1" + "node": "^20.19.3", + "pnpm": "^10.12.4" }, "pnpm": { "peerDependencyRules": { From c4f67c061f3c748eb878616754e990646b6dc794 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 12:38:58 +0000 Subject: [PATCH 05/14] chore: remove pre-commit prettier as DOA --- .pre-commit-config.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1097e86f..ac15536a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,11 +14,3 @@ repos: rev: v1.0.0 hooks: - id: check-json5 - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - additional_dependencies: - - prettier@3.5.3 - - '@ianvs/prettier-plugin-sort-imports@4.4.1' - - 'prettier-plugin-packagejson@2.5.10' From 347a9ed31733329b31366d76bbbcf9625a2b2a3a Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 12:39:21 +0000 Subject: [PATCH 06/14] feat: typescript cache --- .github/workflows/test.yml | 2 +- tsconfig.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4373100..b6b4b4a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: with: path: | ~/.cache/ - key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs') }} + key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs', '**/tsconfig.json') }} - name: Lint run: pnpm run lint -cache-strategy content - name: Typecheck diff --git a/tsconfig.json b/tsconfig.json index 796f7b3c..06d6c80d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { + "tsBuildInfoFile": "./.cache/.tsbuildinfo", "allowJs": true, + "incremental": true, "verbatimModuleSyntax": true, "noEmit": true, "resolveJsonModule": true, From be2e15433ea23a8553062b7267499dad5c8b5951 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 12:39:30 +0000 Subject: [PATCH 07/14] ci: node version --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cf6ca9a1..0278cb51 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,7 +29,7 @@ jobs: languages: ${{ matrix.language }} - uses: andykenward/github-actions/setup-pnpm@32471b1e0a5df8a09500a54b1254e3f0f881e52d #v1.0.3 with: - node-version: 20.x + node-version: 20 - name: Rebuild the dist/ directory run: pnpm run build - name: Perform CodeQL Analysis From db6e0dbc812abd268e32cce8bd2688d485555976 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:10:43 +0000 Subject: [PATCH 08/14] fix: cache directory --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 06d6c80d..7db6843e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { - "tsBuildInfoFile": "./.cache/.tsbuildinfo", + "tsBuildInfoFile": ".cache/.tsbuildinfo", "allowJs": true, "incremental": true, "verbatimModuleSyntax": true, From 940e9579b718d17d016908f3c6507d6affbe66f6 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:11:12 +0000 Subject: [PATCH 09/14] cli: update all --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09eecb71..ff244ca9 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "exports": "./dist/deploy/index.js", "scripts": { "act:d": "act -j delete --secret-file .env", - "all": "pnpm run knip && pnpm run codegen && pnpm run codegen:events && pnpm run tsc:ls && pnpm run format && pnpm run lint:ls && pnpm run test && pnpm run build", + "all": "pnpm run knip && pnpm run codegen && pnpm run codegen:events && pnpm run tsc:check && pnpm run format && pnpm run lint && pnpm run test && pnpm run build", "build": "rm -rf ./dist/* && node ./esbuild.config.js", "changeset": "changeset", "codegen": "graphql-codegen-esm --config graphql.config.ts", From a6d6445ed0278670696cbb1a8f696bd1c7cd0be8 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:28:39 +0000 Subject: [PATCH 10/14] feat: knip cache --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff244ca9..3e467416 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "download": "tsx bin/download/index.ts", "format": "prettier --write . --cache --cache-location '.cache/prettier/'", "format:check": "pnpm run format --check", - "knip": "knip", + "knip": "knip --cache --cache-location '.cache/knip'", "lint": "eslint --cache --cache-location '.cache/eslint/' .", "lint:debug": "pnpm run lint --debug", "lint:fix": "pnpm run lint --fix", From 072ece3eb84738db4e7e845a1abdb26431af1c5b Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:28:50 +0000 Subject: [PATCH 11/14] feat: vitest cache --- vitest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vitest.config.ts b/vitest.config.ts index 498c4a22..8100ddb2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,6 +7,7 @@ import path from 'node:path' import {defaultExclude, defineConfig} from 'vitest/config' export default defineConfig({ + cacheDir: '.cache/.vitest', test: { environment: 'node', setupFiles: ['vitest.setup.ts'], From 9c0c44f467a9fac8b0306f4a29a0fe0610c2c1e4 Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:29:04 +0000 Subject: [PATCH 12/14] ci: update cache key hash --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6b4b4a0..e6f1610c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: with: path: | ~/.cache/ - key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs', '**/tsconfig.json') }} + key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs', '**/tsconfig.json', '**/knip.json', '**/vitest.config.ts', '**/vitest.setup.ts') }} - name: Lint run: pnpm run lint -cache-strategy content - name: Typecheck From 2fd3bc54315df1733bdb0690577ab1f4cf129ceb Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:31:14 +0000 Subject: [PATCH 13/14] ci: fix lint --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6f1610c..96fec422 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: ~/.cache/ key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.js', '**/prettier.config.cjs', '**/tsconfig.json', '**/knip.json', '**/vitest.config.ts', '**/vitest.setup.ts') }} - name: Lint - run: pnpm run lint -cache-strategy content + run: pnpm run lint --cache-strategy content - name: Typecheck run: pnpm run tsc:check - name: Test From 1db851992d53a10d1a328eae4a82764534df755f Mon Sep 17 00:00:00 2001 From: Andy Kenward Date: Sat, 5 Jul 2025 13:31:25 +0000 Subject: [PATCH 14/14] fix: engine node --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e467416..f0cfa651 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ }, "packageManager": "pnpm@10.12.4", "engines": { - "node": "^20.19.3", + "node": "^20.19.2", "pnpm": "^10.12.4" }, "pnpm": {