[PR #8892] [MERGED] fix: turbo caching, enforce lockfile integrity, expand pre-commit hooks #16530

Closed
opened 2026-04-13 10:33:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8892
Author: @gustavovalverde
Created: 4/1/2026
Status: Merged
Merged: 4/2/2026
Merged by: @gustavovalverde

Base: mainHead: chore/lefthook-ci-parity


📝 Commits (1)

  • 4333993 chore: fix turbo caching, upgrade to 2.9, expand lefthook, skip publint packing

📊 Changes

25 files changed (+123 additions, -99 deletions)

View changed files

📝 .cspell/tech-terms.txt (+1 -0)
📝 .github/workflows/ci.yml (+3 -3)
📝 lefthook.yml (+11 -1)
📝 package.json (+2 -1)
📝 packages/api-key/package.json (+1 -1)
📝 packages/better-auth/package.json (+1 -1)
📝 packages/cli/package.json (+1 -1)
📝 packages/core/package.json (+1 -1)
📝 packages/drizzle-adapter/package.json (+1 -1)
📝 packages/electron/package.json (+1 -1)
📝 packages/expo/package.json (+1 -1)
📝 packages/i18n/package.json (+1 -1)
📝 packages/kysely-adapter/package.json (+1 -1)
📝 packages/memory-adapter/package.json (+1 -1)
📝 packages/mongo-adapter/package.json (+1 -1)
📝 packages/oauth-provider/package.json (+1 -1)
📝 packages/passkey/package.json (+1 -1)
📝 packages/prisma-adapter/package.json (+1 -1)
📝 packages/redis-storage/package.json (+1 -1)
📝 packages/scim/package.json (+1 -1)

...and 5 more files

📄 Description

Summary

The build and lint infrastructure had structural problems: turbo caching was misconfigured (wrong inputs/outputs, redundant global dependencies, missing tsconfig.base.json), publint ran unnecessary pnpm pack subprocesses, lefthook only ran biome without --error-on-warnings, hooks were never auto-installed, and CI accepted mismatched lockfiles.

Changes

Turbo 2.8.11 → 2.9.3 with future flags:

  • globalConfiguration: globalDependencies becomes global.inputs, prepended to each task's inputs instead of a single global hash
  • affectedUsingTaskInputs: turbo --affected filters at the task level using inputs globs

turbo.json fixes:

Issue Before After
lint:types, lint:package no inputs/outputs (hashes source files, tools only read dist) inputs: ["dist/**", "package.json"], outputs: []
globalDependencies package.json, tsconfig.json, pnpm-lock.yaml, pnpm-workspace.yaml (2 redundant) tsconfig.json, tsconfig.base.json, pnpm-workspace.yaml (moved to global.inputs)
build outputs dist/**, .next/** (library packages don't use .next) dist/**, node_modules/.cache/ts/** (caches tsbuildinfo for incremental builds)
build inputs $TURBO_DEFAULT$, .env* (env not used by libraries) $TURBO_DEFAULT$, tsconfig.json, tsdown.config.*
clean, format cacheable (default) cache: false
e2e:smoke, e2e:integration cache: true cache: false (external deps make caching unreliable)

publint: --pack false added to all 19 packages (every package has "files": ["dist"], making the pnpm pack subprocess redundant)

lefthook pre-commit (all run in parallel, ~3s total):

Check Behavior
biome (with --error-on-warnings) auto-fixes staged files, re-stages
cspell spell-checks staged files
remark auto-fixes staged markdown in docs/, re-stages
lockfile validation runs pnpm install --frozen-lockfile when package.json or lockfile staged

CI: --frozen-lockfile added to all install steps (3 jobs)

Other: "prepare": "lefthook install --reset-hooks-path" auto-installs hooks on pnpm install


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8892 **Author:** [@gustavovalverde](https://github.com/gustavovalverde) **Created:** 4/1/2026 **Status:** ✅ Merged **Merged:** 4/2/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `chore/lefthook-ci-parity` --- ### 📝 Commits (1) - [`4333993`](https://github.com/better-auth/better-auth/commit/433399317d80daa628dcc2633b475999f4434b4e) chore: fix turbo caching, upgrade to 2.9, expand lefthook, skip publint packing ### 📊 Changes **25 files changed** (+123 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/tech-terms.txt` (+1 -0) 📝 `.github/workflows/ci.yml` (+3 -3) 📝 `lefthook.yml` (+11 -1) 📝 `package.json` (+2 -1) 📝 `packages/api-key/package.json` (+1 -1) 📝 `packages/better-auth/package.json` (+1 -1) 📝 `packages/cli/package.json` (+1 -1) 📝 `packages/core/package.json` (+1 -1) 📝 `packages/drizzle-adapter/package.json` (+1 -1) 📝 `packages/electron/package.json` (+1 -1) 📝 `packages/expo/package.json` (+1 -1) 📝 `packages/i18n/package.json` (+1 -1) 📝 `packages/kysely-adapter/package.json` (+1 -1) 📝 `packages/memory-adapter/package.json` (+1 -1) 📝 `packages/mongo-adapter/package.json` (+1 -1) 📝 `packages/oauth-provider/package.json` (+1 -1) 📝 `packages/passkey/package.json` (+1 -1) 📝 `packages/prisma-adapter/package.json` (+1 -1) 📝 `packages/redis-storage/package.json` (+1 -1) 📝 `packages/scim/package.json` (+1 -1) _...and 5 more files_ </details> ### 📄 Description ## Summary The build and lint infrastructure had structural problems: turbo caching was misconfigured (wrong inputs/outputs, redundant global dependencies, missing tsconfig.base.json), publint ran unnecessary pnpm pack subprocesses, lefthook only ran biome without --error-on-warnings, hooks were never auto-installed, and CI accepted mismatched lockfiles. ## Changes **Turbo 2.8.11 → 2.9.3** with future flags: - `globalConfiguration`: `globalDependencies` becomes `global.inputs`, prepended to each task's inputs instead of a single global hash - `affectedUsingTaskInputs`: `turbo --affected` filters at the task level using `inputs` globs **turbo.json fixes:** | Issue | Before | After | |---|---|---| | lint:types, lint:package | no inputs/outputs (hashes source files, tools only read dist) | `inputs: ["dist/**", "package.json"]`, `outputs: []` | | globalDependencies | `package.json, tsconfig.json, pnpm-lock.yaml, pnpm-workspace.yaml` (2 redundant) | `tsconfig.json, tsconfig.base.json, pnpm-workspace.yaml` (moved to `global.inputs`) | | build outputs | `dist/**, .next/**` (library packages don't use .next) | `dist/**, node_modules/.cache/ts/**` (caches tsbuildinfo for incremental builds) | | build inputs | `$TURBO_DEFAULT$, .env*` (env not used by libraries) | `$TURBO_DEFAULT$, tsconfig.json, tsdown.config.*` | | clean, format | cacheable (default) | `cache: false` | | e2e:smoke, e2e:integration | `cache: true` | `cache: false` (external deps make caching unreliable) | **publint:** `--pack false` added to all 19 packages (every package has `"files": ["dist"]`, making the pnpm pack subprocess redundant) **lefthook pre-commit** (all run in parallel, ~3s total): | Check | Behavior | |---|---| | biome (with `--error-on-warnings`) | auto-fixes staged files, re-stages | | cspell | spell-checks staged files | | remark | auto-fixes staged markdown in `docs/`, re-stages | | lockfile validation | runs `pnpm install --frozen-lockfile` when package.json or lockfile staged | **CI:** `--frozen-lockfile` added to all install steps (3 jobs) **Other:** `"prepare": "lefthook install --reset-hooks-path"` auto-installs hooks on `pnpm install` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:33:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16530