Fix critical TypeScript, build, and linter issues #2788
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.
This PR addresses several critical issues that were preventing the project from building and passing type checks:
🔧 Build Issues Fixed
Session Password Configuration: The build was failing with "Password string too short (min 32 characters required)" during prerendering. Updated the default session password in
config.ts
to meet the 32+ character requirement for iron-webcrypto.🔍 TypeScript Issues Fixed
Zod Validation Types: Fixed complex type constraint issues in
apollo/validation.ts
by simplifying the approach:Properties<T>
type mapping that was causing generic constraint errorsSignupInputSchema
andLoginInputSchema
Import Issues: Fixed missing
AnyZodObject
export by replacing it with the correctZodObject
type inserver/utils/validation.ts
.Form Type Safety: Enhanced type safety in the login form by adding computed properties to properly cast form field values for naive-ui component compatibility.
🧹 Linter & Test Fixes
Code Formatting: Fixed Prettier formatting issues in modified files.
Test Snapshots: Updated test snapshots to match the new Zod error format:
origin
field instead ofexact
andtype
fieldsUnused Imports: Removed unused
ZodRawShape
import that was flagged by oxlint.✅ Verification
All critical checks now pass:
pnpm build
- Builds successfully without errorspnpm typecheck
- No TypeScript errorspnpm lint
- No linting errors (warnings are acceptable)pnpm test:unit
- All unit tests pass (19/19)The changes are minimal and surgical, focusing only on fixing the blocking issues without altering working functionality.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.