emkore 0.3.3 
emkore: ^0.3.3 copied to clipboard
Clean Architecture core library for Dart with use cases, entities, validation, authorization, and interceptor pipelines.
CHANGELOG #
0.3.3 #
π Perfect Pub.dev Score Achievement #
- Official Lints Integration: Added 
lints: ^6.0.0for pub.flutter-io.cn compliance- Replaced custom analysis rules with official Dart lints package
 - Ensures consistent code quality standards across Dart ecosystem
 
 - Static Analysis Perfection: Fixed all 6 remaining lint issues for 160/160 pub.flutter-io.cn score
- Added curly braces to if statements in example repository (4 fixes)
 - Added missing 
@overrideannotation toapiDefinitionproperty - Replaced 
.where().whereType()with.whereType()in JSON class for better performance 
 - Zero Analysis Issues: All static analysis now passes with 0 warnings
 
π§ Code Quality #
- Consistent Formatting: Applied dart format across all modified files
 - Production Standards: Code now meets official Dart style guidelines
 
0.3.2 #
π Bug Fixes #
- Static Analysis: Fixed pub.flutter-io.cn static analysis issues for perfect 50/50 score
- Added missing braces around if statement in AuthorizationInterceptor
 - Simplified documentation to avoid HTML angle bracket interpretation
 - Added missing documentation for Actor class properties
 
 - Documentation: Enhanced Actor class with property documentation
 
0.3.1 #
π Pub.dev Score Improvements #
- Comprehensive Example: Added 
example/example.dartdemonstrating complete CRUD workflow- Real-world usage patterns with entities, use cases, and repositories
 - Complete error handling and validation demonstrations
 - Multitenancy and authorization examples
 - Money value objects and type-safe JSON handling
 - Working example that can be run with 
dart run example/example.dart 
 - Optimized Package Description: Shortened description to meet pub.flutter-io.cn requirements (60-180 characters)
 - Fixed Import Paths: Corrected relative imports in e2e test after file reorganization
 
π§ Code Quality #
- Clean Static Analysis: All analysis issues resolved
 - Proper Code Formatting: Applied consistent formatting across all files
 
0.3.0 #
ποΈ Major Architecture Refactoring #
- 
Removed Repository Dependencies: Eliminated SQLite3 and HTTP dependencies to keep core library lightweight
- Removed 
SqliteThreeRepositoryand all SQLite3-related code - Removed 
RestRepositoryand HTTP client functionality - Core library now focuses purely on architectural abstractions
 - BREAKING: Applications using these repositories must implement their own storage solutions
 
 - Removed 
 - 
Unit of Work Enhancement: Moved UnitOfWork from mixin to dedicated type system
- Relocated from 
lib/src/common/mixin/tolib/src/common/type/unit_of_work.type.dart - Improved interfaces for better transaction management and repository access
 - Enhanced multitenancy support with per-tenant repository isolation
 
 - Relocated from 
 
π Enhanced Documentation & Developer Experience #
- 
Comprehensive README: Complete rewrite with practical examples and architectural guidance
- Added step-by-step tutorial with complete code examples
 - Enhanced project structure recommendations with naming conventions
 - Added JSON handling best practices and validation patterns
 - Included Unit of Work pattern examples and interceptor usage
 
 - 
Improved Documentation Structure: Reorganized all documentation
- Moved 
CLAUDE.mdtodoc/development-guide.mdwith enhanced content - Renamed 
doc/PERMISSIONS.mdtodoc/permissions-guide.mdfor consistency - Added foundational concepts at beginning of README for better onboarding
 
 - Moved 
 - 
Enhanced API Examples: All examples now demonstrate production patterns
- Use case outputs return DTOs/JSON instead of entities
 - Proper JSON handling with type-safe helper methods
 - Complete validation examples with enum support
 - Unit of Work pattern as recommended architecture
 
 
π§ Code Quality & Best Practices #
- 
JSON Type Safety: Eliminated all direct JSON casting in favor of helper methods
- Fixed all examples to use 
json.getString(),json.getInt(), etc. - Added comprehensive JSON method documentation
 - Enhanced validation with proper enum handling
 
 - Fixed all examples to use 
 - 
Naming Convention Standards: Established comprehensive naming guidelines
- Use case names: snake_case for actions and resources
 - Resource names: Always singular (user, order, document)
 - Class naming patterns: 
[Action][Resource]Usecase,[Action][Resource]Interactor - File structure: 
repository/[resource]/[storage-type]/[resource].repository.dart 
 - 
Example Implementation: Complete working example with in-memory repositories
- Full CRUD operations with proper validation and error handling
 - Multitenancy demonstration with business ID isolation
 - E2E test coverage for all functionality
 - Unit of Work pattern implementation
 
 
π Bug Fixes & Improvements #
- 
Export Completeness: Added missing exports for public API
- Added 
CommonActiontypedef andisCommonAction()function exports - Verified all public classes and interfaces are properly exported
 
 - Added 
 - 
Abstract Use Case Clarity: Enhanced documentation for inherited methods
- Clarified that 
performExecuteis inherited from base class - Removed redundant method declarations from use case interfaces
 - Added clear documentation about interceptor usage patterns
 
 - Clarified that 
 
π Documentation Enhancements #
- Architecture Documentation: Added detailed naming conventions and project structure
- Complete class naming patterns with examples
 - File organization best practices
 - Resource naming consistency (singular forms)
 - Snake_case conventions for use case names
 
 
0.2.5 #
π Architecture Changes #
- Restored AuthorizationInterceptor: Moved authorization logic back from usecase to dedicated interceptor
- Added new 
AuthorizationInterceptorclass for comprehensive permission checking - Supports all constraint validation: scope, status, time, and resource restrictions
 - Integrates with 
InterceptorContextfor access to actor permissions and usecase metadata - Provides better separation of concerns between business logic and authorization
 
 - Added new 
 
π§ Technical Improvements #
- Simplified Usecase Logic: Removed authorization complexity from abstract usecase implementation
 - Enhanced UnitOfWork: Updated unit of work interfaces with better tenant isolation support
 - Export Cleanup: Fixed incorrect export reference in main library file
 
π Bug Fixes #
- Library Exports: Fixed undefined export reference for 
UnitOfWorkMixinin main library 
0.2.4 #
π Enhanced Features #
- 
Enhanced Interceptor Context: Added comprehensive context information to interceptors
- Added 
InterceptorContextclass providing actor, usecase name, required permissions, and metadata - All interceptor methods now receive context: 
beforeExecute(),afterExecute(), andonError() - Added 
nameproperty toInterceptorinterface for better identification in logs 
 - Added 
 - 
New Example Interceptors: Added production-ready interceptor implementations
AuditLogInterceptor: Comprehensive audit logging with timestamps and permissionsPerformanceInterceptor: Execution time tracking with configurable slow operation warnings- Updated 
LoggerInterceptor: Enhanced with actor information and usecase details 
 
π§ Technical Improvements #
- Consistent Output Formatting: All interceptors now prefix their output with 
[InterceptorName] - Extensible Metadata: Added metadata map to 
InterceptorContextfor future extensibility - Performance Optimized: Context creation uses only data already available in usecase execution
 
π Breaking Changes #
- Interceptor Interface Update: All interceptor methods now require 
InterceptorContextparameter- Migration: Update custom interceptors to include context parameter in all methods
 - Benefit: Rich context information for cross-cutting concerns like logging, metrics, and auditing
 
 
0.2.3 #
π Bug Fixes #
- Boolean Validator: Fixed boolean validation to properly handle true/false values
 - ResourceScope Naming: Fixed naming consistency in ResourceScope enum values
 
0.2.2 #
π Enhanced Features #
- ValidatorBuilder: Replaced static 
Validatorsclass with fluentValidatorBuilderAPI- Chainable validation methods: 
string(),number(),list(),enumField(),dateTime(),money() - Convenience methods: 
email(),uuid(),entityId()with built-in patterns - Custom validation support with 
custom()method - Nested object validation with 
object()method - Automatic JSON Schema Generation: Extract schemas from validation rules for API documentation
 - Field-Specific Error Mapping: Enhanced error handling with field-to-error mapping for better UI integration
 
 - Chainable validation methods: 
 
π§ͺ Testing #
- Comprehensive ValidatorBuilder Tests: Added extensive test coverage including field error mapping, schema generation, and nested validation
 - Production-Grade Error Handling: Tests verify proper error accumulation and field-specific error extraction
 
π Documentation #
- Complete Validation Guide: Added comprehensive documentation at 
doc/validation-guide.md- Basic usage patterns and API reference
 - Input class patterns with schema generation examples
 - Nested validation and UI integration patterns
 - Migration guide from old 
Validatorsclass - Advanced patterns and best practices
 
 
π§ Breaking Changes #
- Validators Class Removed: The static 
Validatorsclass has been replaced withValidatorBuilder- Migration: Replace 
Validators.method()calls withValidatorBuilder().method().build() - Benefit: Better composition, field error mapping, and automatic schema generation
 
 - Migration: Replace 
 
0.2.1 #
π Enhanced Features #
- Resource-Specific Permissions: Added 
resourceIdconstraint toResourceConstraintsfor granting access to specific resource instances- Enable permissions like "update document doc_12345" or "delete post post_abc123"
 - Follows existing constraint patterns with exact string matching
 - Full JSON serialization/deserialization support
 
 
π§ͺ Testing #
- Comprehensive Test Coverage: Added tests for resourceId constraint validation including success and failure scenarios
 - Authorization Logic: Tests verify resourceId matching and mismatch behaviors
 
π Documentation #
- Updated Permission Documentation: Enhanced docs with resourceId examples and usage patterns
 - JSON Examples: Added resource-specific permission examples to documentation
 
0.2.0 #
ποΈ Breaking Changes #
- Authorization Architecture Consolidation: Removed 
AuthorizationInterceptorclass and moved all sophisticated authorization logic directly intoUsecaseclass- All constraint validation (scope hierarchy, status filtering, time windows, business/team scoping) now happens automatically in use cases
 - Provides better integration with use-case-specific 
requiredPermissions - Eliminates architectural split-brain between interceptor and use case authorization
 - BREAKING: Applications using 
AuthorizationInterceptordirectly must remove those references 
 
π Enhanced Features #
- Consolidated Authorization: Single source of truth for all permission validation with full constraint support
 - Comprehensive Test Coverage: Added extensive tests for constraint validation including scope hierarchy, status filtering, and time-based access control
 
π§ Technical Improvements #
- Simplified Architecture: Cleaner mental model with authorization happening in one place
 - Better Error Reporting: Enhanced 
AuthorizationExceptionwith detailed missing permission information - JSON Serialization: Fixed optional field handling in 
PermissionandResourceConstraintsdeserialization 
0.1.1 #
π Enhanced Features #
- JSON Class Enhancement: Transformed JSON from simple type alias to comprehensive class with full Map interface
- Added 
fromString()andfromBlob()static constructors with error handling - Added 
toJsonString()with pretty printing support - Added type-safe getters: 
getString(),getInt(),getDouble(),getBool(),getList<T>(),getJSON() - Added validation methods: 
hasKey(),isValid,isEmptyJSON - Added deep operations: 
deepCopy(),merge(),mergeDeep() 
 - Added 
 
π§ Technical Improvements #
- Code Quality: Replaced Flutter lints with appropriate Dart-only analysis rules
 - Architecture: Refactored JSON class to use MapMixin for proper Map interface implementation
 - Compatibility: Fixed all breaking changes across SystemFields mixin and API definitions
 - JSON Integration: Updated Permission and ResourceConstraints to use enhanced JSON class with type-safe getters
 
π Bug Fixes #
- Fixed entity ID validation test to use proper 4-hex-character prefix format
 - Resolved type compatibility issues after JSON class enhancement
 
0.1.0 #
π New Features #
- Authorization System: Added comprehensive permission-based authorization framework
- Added 
Permissionclass with resource/action-based access control - Added 
ResourceConstraintswith scope, status, time, and businessId restrictions - Added 
AuthorizationInterceptorfor use case-level access control - Added 
AuthorizationExceptionfor authorization failures 
 - Added 
 - Enhanced Usecase Framework: Built-in authorization checking in all use cases
 - JSON Serialization: Full JSON serialization support for Permission and ResourceConstraints
 
π§ͺ Testing #
- Added comprehensive test suite covering all core functionality
 - Tests for Permission/ResourceConstraints serialization
 - Tests for Validators (required, email, length, UUID, entityId, etc.)
 - Tests for InMemoryRepository CRUD operations
 - Tests for Entity implementation and copy operations
 - Tests for Usecase authorization flow
 
π οΈ Improvements #
- Updated Permission type system with JSON parsers
 - Removed wildcard support for permissions (more explicit control)
 - Enhanced validation framework
 
0.0.9 #
- Turned SystemFields into a class (was a mixin).
 - Made execute/performExecute parameters named instead of positional.
 
0.0.8 #
- Made Entity extendable.
 
0.0.7 #
- Added 
DTOabstract class tolib/src/common/abstract.dto.dart. 
0.0.6 #
- Changed Entity to be asbtract interface class.
 
0.0.5 #
- Added abstract base class Entity.
 - Added 
JSONtype alias forMap<String, Object?>inlib/src/common/type/json.type.dart. - Updated 
CHANGELOG.mdto reflect the new type alias addition.