Skip to main content

Current Version: 1.0.7

This project follows Semantic Versioning and Keep a Changelog format.

[1.0.7] - 2025-12-31

Added

Typed Path Autocomplete

IDE autocomplete for object paths

Path Utility Types

Path<T>, NumericPath<T>, StringPath<T>
🎯 Typed Path Autocomplete
  • createRuleHelpers<T>() now accepts generic type for path autocomplete
  • IDE will suggest valid paths like 'user.name', 'order.total'
  • Type-safe: numeric operators only accept numeric paths
📦 New Utility Types
  • Path<T> - All valid dot-notation paths
  • PathValue<T, P> - Get value type at path
  • NumericPath<T>, StringPath<T>, BooleanPath<T>, ArrayPath<T>

Changed

  • Consolidated RuleHelpers types into single generic class
  • Backward compatible: untyped usage works as before

[1.0.6] - 2025-12-25

Added

  • TypeScript declaration files with improved JSDoc

Changed

  • Extended in, notIn, oneOf to accept string paths for dynamic array lookup

[1.0.5] - 2025-12-20

Fixed

  • Type definition fixes and alignment with implementation

[1.0.4] - 2025-12-15

Fixed

🐛 Type Definition Fixes
  • evaluateExpr now returns EvaluationResult with success property
  • RuleHelpers comparison methods treat options as optional
  • PathResolver.resolve method name aligned with implementation
  • Added flags property to StringOptions for regex

Changed

  • Removed unsupported caseInsensitive and trim from type options
  • Added persistence config type for StatefulRuleEngine

[1.0.3] - 2025-12-09

Added

Stateful Rule Engine

Event-driven state tracking

State Change Operators

6 new operators for detecting changes
🔄 Stateful Rule Engine
  • StatefulRuleEngine class for state tracking and event-driven evaluation
  • Event system: triggered, untriggered, changed, evaluated
  • History storage with configurable size limits
  • Batch evaluation with evaluateBatch()
📈 State Change Operators
  • changed, changedBy, changedFrom, changedTo, increased, decreased

Changed

  • Bundle size optimized: ESM/CJS reduced by 62% (~45KB, 11KB gzipped)

[1.0.2] - 2025-08-20

Added

New String Length Validation Helpers
  • validation.minLength(path, minLength) - Validates minimum string length
  • validation.maxLength(path, maxLength) - Validates maximum string length
  • validation.lengthRange(path, min, max) - Validates string length range
  • validation.exactLength(path, length) - Validates exact string length
Development Tools
  • Claude Code integration context (CLAUDE.md)
  • Comprehensive test coverage expansion with 382+ new test cases
  • Enhanced basic core functionality tests
  • Expanded logical operator test coverage
  • Comprehensive string operator validation

Changed

  • Improved CI/CD pipeline with Claude Code Review workflow
  • Enhanced test suite organization with better edge case coverage:
    • Empty string handling
    • Boundary condition testing
    • Very long string validation
    • Comprehensive string length scenarios

Fixed

  • Various code quality improvements
  • Better error handling and validation coverage

[1.0.0] - 2025-08-12

🎉 First stable release of Rule Engine JS

Core Features

Engine
  • High-performance rule evaluation with caching
  • Dynamic field comparison support
  • Built-in security protections
  • TypeScript definitions
  • Zero external dependencies
Operators
// Comparison
eq, neq, gt, gte, lt, lte

// Logical
and, or, not

// String
contains, startsWith, endsWith, regex

// Array
in, notIn

// Special
between, isNull, isNotNull

Performance

  • LRU caching for expressions and path resolution
  • Performance metrics tracking
  • Bundle size < 25KB gzipped
  • Multiple output formats (UMD, ESM, CommonJS)

Developer Experience

  • Rule helpers for clean, readable syntax
  • Comprehensive error handling with detailed context
  • Extensive test coverage (>90%)
  • Complete TypeScript support
  • Field comparison helpers for dynamic rules

Security

  • Prototype pollution protection
  • Function access prevention
  • Safe path resolution
  • Configurable security settings

Build System

  • Optimized Rollup configuration
  • Multiple output formats
  • Bundle size analysis
  • Quality checks integration

[0.9.0] - Development Phase

Added

  • Core engine architecture
  • Basic operator implementations
  • Initial testing framework

Changed

  • Refined API design based on testing

Fixed

  • Various bug fixes during development

Version History

Generic RuleHelpers<T> with IDE path autocomplete support
Extended operators to accept string paths for array lookup
Type definition fixes and alignment
Fixed type definition mismatches
StatefulRuleEngine with state change operators and event system
String length validation helpers and expanded test coverage
First stable release with complete feature set

v1.0.0 Highlights

Key Features:
  • Zero Dependencies: Lightweight with no external dependencies
  • High Performance: Intelligent caching with LRU eviction
  • Type Safe: Full TypeScript support with comprehensive type definitions
  • Secure: Built-in protection against common security vulnerabilities
  • Flexible: Support for dynamic field comparison and custom operators
  • Developer Friendly: Clean API with helper functions for rule construction
Use Cases:
  • User access control and permissions
  • Business rule validation
  • Form validation with dynamic dependencies
  • Content filtering and recommendations
  • Dynamic pricing and discount logic
  • Workflow and approval processes
Quick Start:
import { createRuleEngine, createRuleHelpers } from 'rule-engine-js';

const engine = createRuleEngine();
const rules = createRuleHelpers();

const rule = rules.and(
  rules.gte('user.age', 18),
  rules.eq('user.status', 'active'),
  rules.in('user.role', ['admin', 'user'])
);

const result = engine.evaluateExpr(rule, userData);

Migration Guides

No breaking changesNew typed path autocomplete:
interface MyContext {
  user: { name: string; age: number };
}

// With type - get IDE autocomplete
const rules = createRuleHelpers<MyContext>();
rules.gte('user.age', 18); // ✓ autocomplete

// Without type - works as before
const rules = createRuleHelpers();
rules.gte('any.path', 18);

Contributing to Changelog

When contributing, please follow these guidelines:
  1. Add entries under [Unreleased] for new changes
  2. Use standard categories:
    • Added - New features
    • Changed - Changes in existing functionality
    • Deprecated - Soon-to-be removed features
    • Removed - Removed features
    • Fixed - Bug fixes
    • Security - Vulnerability fixes
  3. Format: - Brief description of change (#PR-number)
  4. Move entries to dated release when releasing

Support