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/.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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a861df6..96fec422 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', '**/prettier.config.cjs', '**/tsconfig.json', '**/knip.json', '**/vitest.config.ts', '**/vitest.setup.ts') }} - name: Lint - run: pnpm run lint + run: pnpm run lint --cache-strategy content - name: Typecheck run: pnpm run tsc:check - name: Test 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/.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' 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..f0cfa651 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", @@ -27,13 +27,13 @@ "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 .", - "knip": "knip", - "lint": "eslint .", + "format": "prettier --write . --cache --cache-location '.cache/prettier/'", + "format:check": "pnpm run format --check", + "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", - "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", @@ -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.2", + "pnpm": "^10.12.4" }, "pnpm": { "peerDependencyRules": { diff --git a/tsconfig.json b/tsconfig.json index 796f7b3c..7db6843e 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, 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'],