ci: add dist declaration typecheck to CI#8702
Merged
himself65 merged 1 commit intobetter-auth:canaryfrom Mar 20, 2026
Merged
Conversation
Add `typecheck:dist` that validates package source against workspace dependencies' dist declarations instead of source (disables the `dev-source` custom condition). This catches type errors that `pnpm typecheck` misses due to `customConditions: ["dev-source"]` resolving all imports to source `.ts` files. Excludes `better-auth`, `core`, and `electron` source from the check because their `declare module` augmentations conflict with their own dist augmentations when both are visible to the compiler. Context: see better-auth#8701 for the full explanation of the `dev-source` masking issue.
|
@gustavovalverde is attempting to deploy a commit to the better-auth Team on Vercel. A member of the Team first needs to authorize it. |
@better-auth/api-key
better-auth
auth
@better-auth/core
@better-auth/drizzle-adapter
@better-auth/electron
@better-auth/expo
@better-auth/i18n
@better-auth/kysely-adapter
@better-auth/memory-adapter
@better-auth/mongo-adapter
@better-auth/oauth-provider
@better-auth/passkey
@better-auth/prisma-adapter
@better-auth/redis-storage
@better-auth/scim
@better-auth/sso
@better-auth/stripe
@better-auth/telemetry
@better-auth/test-utils
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a CI guardrail to catch TypeScript errors that only appear when consuming packages via their built dist declaration files (instead of monorepo “dev-source” resolution), preventing broken published typings from reaching users.
Changes:
- Add a root
tsconfig.dist-check.jsonthat disablescustomConditions(turning offdev-source) and typechecks source against workspace packages’ dist declarations. - Add
pnpm typecheck:distscript to run that configuration. - Run the new dist-declaration typecheck in CI after the existing build + typecheck steps.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tsconfig.dist-check.json | New TS config that clears customConditions and scopes the dist-declaration typecheck to package sources while excluding known-conflicting packages. |
| package.json | Adds typecheck:dist script invoking tsc -p tsconfig.dist-check.json. |
| .github/workflows/ci.yml | Adds a “Typecheck dist declarations” step in the typecheck job after build/typecheck. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
himself65
approved these changes
Mar 20, 2026
Merged
via the queue into
better-auth:canary
with commit Mar 20, 2026
8b54817
25 of 28 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #8701 — adds CI validation that catches dist declaration type errors before they reach consumers.
What it does
Adds a
typecheck:diststep that typechecks package source against workspace dependencies' dist.d.mtsdeclarations instead of source files. This disables thecustomConditions: ["dev-source"]condition that normally resolves all imports to source.ts.Why it's needed
The monorepo's
pnpm typecheck(tsc --build) usesdev-sourceto resolve workspace imports to source, so type errors in dist declarations are invisible. #8701 fixed 8 such errors inoauth-provider— this CI step prevents new ones.pnpm typecheckpnpm typecheck:distpnpm lint:types(attw)How it works
tsconfig.dist-check.jsonextends the base config but:customConditions(disablesdev-source)composite: false+noEmit: truebetter-auth,core,electronsource (theirdeclare moduleaugmentations conflict with their own dist when both are visible)Summary by cubic
Adds a CI step to typecheck against built dist declarations to catch type errors that
pnpm typecheckmisses due to thedev-sourcecondition. Prevents regressions like the issues found in #8701 from reaching consumers.typecheck:dist(usestsconfig.dist-check.json) and runs it in CI after Typecheck..d.mtsinstead of source.better-auth,core, andelectronsources to avoid module augmentation conflicts.Written for commit e77e56e. Summary will update on new commits.