add nicer text to schema error validation#177
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.26-pr.177.b92d27fPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.26-pr.177.b92d27f"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.26-pr.177.b92d27f"
}
}
Preview published to npm registry — try new features instantly! |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Code ReviewI found one issue that needs to be addressed: Invalid Zod API usage in schema.tsFile: The code uses Current code: name: z.string({
error: "App name cannot be empty"
}).min(1, "App name cannot be empty"),Issue: The Suggested fix: name: z.string().min(1, "App name cannot be empty"),This is consistent with how error messages are handled elsewhere in the codebase (see cli/src/core/project/schema.ts Lines 38 to 40 in 6c95179 Since |
here are the docs that show this is wrong https://zod.dev/error-customization?id=the-error-param |
Note
Description
This PR improves schema validation error messages by including file paths in the error output. When schema validation fails, users will now see which specific file contains the invalid data, making it easier to locate and fix configuration issues. The
SchemaValidationErrorclass has been enhanced to accept an optional file path parameter, and all call sites have been updated to provide this context.Related Issue
None
Type of Change
Changes Made
SchemaValidationErrorclass to accept an optionalfilePathparameterSchemaValidationErrorTesting
npm test)Checklist
Additional Notes
This change improves the developer experience when debugging schema validation errors by providing clear context about which file contains invalid data. The implementation is backward compatible - the file path parameter is optional, allowing the error to work without it if needed.
🤖 Generated by Claude | 2026-02-02 00:00 UTC