Skip to content

Dzod#26

Merged
ProjectAJ14 merged 63 commits intomainfrom
dzod
Aug 4, 2025
Merged

Dzod#26
ProjectAJ14 merged 63 commits intomainfrom
dzod

Conversation

@ProjectAJ14
Copy link
Contributor

No description provided.

ProjectAJ14 and others added 28 commits July 5, 2025 20:16
- Add comprehensive error handling with codes and context
- Enhance schema base class with new validation methods
- Improve parser with better error reporting
- Add error formatting utilities for better UX
- Add advanced schemas: pipeline, discriminated union, coercion, recursive
- Add collection schemas: array, record, tuple
- Add object and enum schemas with validation
- Expand convenience schemas with new types
- Organize schema files by functional categories
- Reorganize tests into logical categories (core, schemas)
- Remove outdated basic_schemas_test.dart
- Update example app with improved UI and clipboard functionality
- Add .claude/ to gitignore for development tools
- Add 10 new string validation methods (cuid, ulid, base64, emoji, jwt, hex, json, etc.)
- Add 14 new number validation methods (step, precision, coordinates, mathematical functions)
- Implement geographic coordinate validation (latitude/longitude)
- Add mathematical validations (prime, perfect square, power of two)
- Enhance schema integration with new factory methods
… fallback strategies

- Add enhanced string coercion with formatting options and JSON support
- Implement advanced number coercion with precision and step validation
- Add smart type detection with automatic target type inference
- Implement fallback strategies for robust type conversion
- Add comprehensive error handling for coercion failures
…lidations and coercion

- Add 22 test cases for advanced string validations
- Add 35+ test cases for enhanced number validations
- Add 13 test cases for enhanced coercion system
- Achieve 100% test coverage for new validation methods
- Include edge case testing and error condition validation
Complete package rename from "zod_bhai" to "dzod" across the entire codebase.

Changes:
- Rename package directory: packages/zod_bhai/ → packages/dzod/
- Update package configuration (pubspec.yaml files)
- Update workspace configuration (melos.yaml)
- Rename main library file: zod_bhai.dart → dzod.dart
- Update all import statements (30+ files)
- Update documentation (README, CLAUDE.md, packages/README.md)
- Update class names: ZodBhaiExampleApp → DzodExampleApp
- Update display text and comments
- Fix lint issues: remove unused field and method in validation widgets

BREAKING CHANGE: Package name changed from "zod_bhai" to "dzod"
All imports must be updated from 'package:zod_bhai/zod_bhai.dart' to 'package:dzod/dzod.dart'
…d types

- Add JSON Schema generation for OpenAPI documentation support
- Implement schema composition utilities and metadata extraction
- Add branded types for nominal typing with Branded<T, B> wrapper
- Add describe() method for schema documentation and metadata
- Add readonly() method for immutable value wrapping
- Export new modules in main dzod.dart

style(dzod): fix linting issues in Flutter integration files

- Fix import ordering in json_schema.dart and schema_composition.dart
- Update widget constructors to use super.key syntax
- Standardize parameter naming from 'value' to 'input' in validation methods
- Fix library directive formatting
- Correct comment formatting in form extensions
- Move Flutter schemas from Z class to separate ZFlutter extension
- Reorganize flutter module exports in index.dart
- Remove unused utility files (clipboard_helper, form_validation_extensions)
- Update example to use toHumanReadable instead of toDisplayMessage
- Clean separation between core and Flutter-specific functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add toHumanReadable() extension to ValidationResult for clean error display
- Add details(value) extension to ValidationErrorCollection for comprehensive error info
- Update example widget to use new toHumanReadable() method
- Provides better user experience with focused validation messages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…d literal handling

- Add auto-detection of optional keys in object schemas
- Add value getter to _LiteralSchema for better access
- Improve discriminated union literal value extraction with better testing
- Enhance recursive schema validation with global context and circular detection
- Simplify error context breadcrumbs implementation
- Enhance validation result extensions formatting
- Update error system tests to match new behavior
- Fix recursive schema test depth calculation
- Remove trailing whitespace in convenience_schemas.dart
- Fix line continuation formatting in discriminated_union_schema.dart
- Add validation for empty pipeline in Z.pipeline() method
- Fix type consistency: Z.transform/refine/refineAsync now return proper Schema types
- Remove obsolete TransformStage, RefineStage, AsyncRefineStage classes
- Fix emoji validation to reject strings with whitespace/newlines
- Update hex color test to use valid hex characters
- Correct pipeline test expectations for transform schema types

Closes test failures: reduced from 13 to 6 failing tests
…N schema

- Improve ULID validation with proper Crockford's Base32 alphabet
- Enhance Base64 validation with proper padding checks
- Add comprehensive emoji validation with ZWJ sequences and skin tones
- Add metadata support to JSON schema generation
- Format convenience schemas for better readability
- Fix ULID test case to use valid Crockford's Base32 format
- Uncomment the element schema generation line in _generateArraySchema
- Fixes test failure where array schemas were returning null for items property
- Ensures proper JSON schema generation for array types
- Added 35 numbered example titles throughout README
- Improves documentation structure and referenceability
- Examples clearly labeled from "Example 1" through "Example 35"
- Covers basic types, complex types, async validation, Flutter integration,
  error handling, performance, and more major feature areas
- Updated all examples (7-13) to use correct method names and signatures
- Fixed chained method calls that aren't supported by the implementation
- Corrected constructor parameters and method signatures throughout
- Separated fluent API calls where implementation requires individual calls
- Ensured all code examples accurately reflect the working dzod API
- Fixed parameter types and naming conventions to match actual classes

Examples fixed:
- Type-safe Tuples: Fixed chaining syntax for rest() and length constraints
- Flexible Enums: Updated extend() method usage and separated operations
- Key-value Records: Corrected min/max method names and parameter types
- Discriminated Unions: Fixed extend() signature and operation separation
- Validation Pipelines: Updated method names and parameter structures
- Recursive Schemas: Fixed constructor parameters and fluent API methods
- Type Coercion: Corrected API usage to match Coerce class implementation
- Fix Example 18: Replace non-existent Flutter widget methods with actual API
- Fix Example 19: Change firstError to first property
- Fix Examples 20-21: Update error handling to use available methods
- Fix Example 23: Replace analyze() with actual introspection properties
- Fix Example 26: Update performance examples with working methods
…UI showcase

- Restructure examples into organized basic/ and complex/ directories
- Add 8 interactive validation examples covering README scenarios:
  * Basic user schema with nested objects and enums
  * String validations (13 validators: email, url, uuid, jwt, etc.)
  * Number validations (11 validators: range, precision, prime, etc.)
  * Boolean and null type validation
  * Object manipulation (pick, omit, extend, partial operations)
  * Advanced arrays (length, unique, transformations)
  * Type-safe tuples with rest elements
  * Flexible enums with case-insensitive matching

- Enhance UI architecture:
  * Add NavigationRail for seamless example switching
  * Create reusable ValidationCard and SchemaDisplay widgets
  * Fix GlobalKey conflicts between form instances
  * Update ResultDisplay to handle dynamic value types

- Add project infrastructure:
  * Web platform support with proper icons and manifest
  * Analysis options for consistent code quality
  * Updated widget tests for new app structure

- Each example features live validation, code display, and sample data
@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

❌ Patch coverage is 99.23597% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...dzod/lib/src/schemas/advanced/coercion_schema.dart 96.26% 10 Missing ⚠️
packages/dzod/lib/src/core/json_schema.dart 96.07% 8 Missing ⚠️
...dzod/lib/src/schemas/advanced/pipeline_schema.dart 97.67% 4 Missing ⚠️
packages/dzod/lib/src/core/error_utils.dart 99.61% 1 Missing ⚠️
packages/dzod/lib/src/core/parser.dart 99.15% 1 Missing ⚠️
packages/dzod/lib/src/core/schema_composition.dart 99.62% 1 Missing ⚠️
...dzod/lib/src/schemas/collections/array_schema.dart 99.43% 1 Missing ⚠️
Flag Coverage Δ
dzod 99.26% <99.23%> (?)
ns_intl_phone_input ?
timer_button ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/dzod/lib/src/convenience_schemas.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/error.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/error_codes.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/error_context.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/error_formatter.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/schema.dart 100.00% <100.00%> (ø)
packages/dzod/lib/src/core/validation_result.dart 100.00% <100.00%> (ø)
...c/schemas/advanced/discriminated_union_schema.dart 100.00% <100.00%> (ø)
...zod/lib/src/schemas/advanced/recursive_schema.dart 100.00% <100.00%> (ø)
...zod/lib/src/schemas/collections/record_schema.dart 100.00% <100.00%> (ø)
... and 14 more

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Remove "105%+ feature parity" claim from CLAUDE.md
- Add proper attribution to Zod in README
- Clean up README formatting and structure
- Update acknowledgments section
- Remove unnecessary private constructors from ValidationErrorCodeUtils
- Remove unnecessary private constructor from ErrorFormatPresets
- Improves code cleanliness and follows Dart conventions
- Add new schema_coverage_test.dart for coverage validation
- Enhance error handling tests with edge cases and fallback paths
- Add tests for ValidationError equality and hashCode methods
- Improve coverage for error formatting with custom objects
- Add tests for ErrorProcessor chain operations and statistics
- Cover TypedSchema validation failures and type mismatches
- Test coercion edge cases and JSON encoding fallbacks
- Comprehensive coverage improvements across all schema types
Implements proper constraint extraction for string, number, and array schemas
in JSON Schema generation. Adds public getters for minLength, maxLength,
pattern, format, minimum, maximum, minItems, maxItems, and other schema
constraints to enable comprehensive JSON Schema output.
Enhances circular reference detection by properly managing validation contexts
to prevent interference between nested recursive schemas. Temporarily clears
global context when delegating to nested RecursiveSchema instances.
Fixes integer coercion test expectation for rounding behavior and adds
comprehensive test coverage for JSON Schema generation edge cases, including
definitions collection and constraint extraction validation.
Updates README to reflect improved test coverage from 92% to 99.3% following
comprehensive test enhancements.
- Update main.dart with categorized navigation system
- Add preValidatedResult support to ResultDisplay widget
- Organize examples into 8 logical categories with 18+ examples
- Add basic validation examples (string, number, boolean, user schema)
- Add complex validation examples (objects, arrays, tuples, enums, records)
- Cover Examples 1-9 from README with interactive demonstrations
- Add advanced schemas (discriminated unions, pipelines, recursive, coercion)
- Add async validation (database checks, API validation)
- Add error handling (error codes, formatting)
- Add schema composition (introspection, JSON schema generation)
- Add security best practices and authentication examples
- Cover Examples 10-32 from README with full interactivity
- Apply consistent formatting to example files
- Break long lines for improved readability
- Fix indentation and spacing issues
- No functional changes
 - cli_core@0.0.2-dev.6
 - connectivity_wrapper@1.2.8
 - contact_permission@1.1.3
 - contact_permission_example@0.0.1
 - dzod@0.2.0+1
 - dzod_example@2.0.0
 - example_html_rich_text@1.1.0
 - flutter_app_for_mono_repo_hooks@0.0.1
 - flutter_package_for_mono_repo_hooks@0.0.1
 - flutter_plugin_for_mono_repo_hooks@0.0.1
 - flutter_project_with_mono_repo_hooks@0.0.1
 - html_rich_text@1.0.4
 - nonstop_cli@0.0.7+3
 - ns_firebase_utils@1.2.3
 - ns_intl_phone_input@1.0.1
 - ns_utils@1.2.3
 - timer_button@2.3.3
 - timer_button_example@1.2.0
 - connectivity_wrapper_example@0.0.2+1
 - ns_intl_phone_input_example@1.0.1
@ProjectAJ14 ProjectAJ14 merged commit b393d31 into main Aug 4, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant