Skip to content

Releases: groschi24/zonfig

v1.1.0

16 Jan 10:23

Choose a tag to compare

Added

  • Zod 4 support with backward compatibility for Zod 3 patterns

Changed

  • Breaking: defineConfig() now returns a ConfigContainer that loads lazily
    • Config is loaded on first access, safe for containerized deployments (Docker, Coolify, Kubernetes)
    • await config.get('path') - Get a value directly
    • await config.getAll() - Get full config object
    • await config.getMasked() - Get config with secrets masked
    • await config.load() - Get underlying Config instance for watch mode
    • await config.reload() - Force reload when env vars change
    • config.isLoaded - Check if config has been loaded
  • Updated all dependencies to latest versions
  • Migrated internal schema introspection to support Zod 4's new _def structure:
    • Type detection now uses _def.type (Zod 4) with fallback to _def.typeName (Zod 3)
    • Array element extraction uses _def.element (Zod 4) with fallback to _def.type (Zod 3)
    • Constraint extraction reads direct properties (minLength, maxLength, minValue, maxValue) alongside _def.checks array
  • Updated documentation generators (markdown, JSON Schema, env-example) for Zod 4 compatibility
  • Updated schema diff utilities for Zod 4 compatibility

Fixed

  • TypeScript errors in CLI (unused variables, type assertions)
  • Array type extraction in extractSchemaInfo now correctly returns itemType for array schemas

v1.0.0

14 Jan 21:35

Choose a tag to compare

Added

Watch Mode

  • config.watch() method for hot reloading configuration
  • File system watchers for JSON, YAML, and .env files
  • Configurable debounce for rapid file changes
  • Event system with config.on() for change notifications
  • config.reload() for manual reloading
  • config.unwatch() to stop watching

Variable Interpolation

  • Support for ${VAR} syntax in config values
  • Environment variable interpolation (e.g., postgres://${DB_HOST}:${DB_PORT}/mydb)
  • Config reference interpolation (e.g., ${server.host}:${server.port})
  • Recursive resolution with automatic cycle detection
  • CircularReferenceError for circular reference detection

Secrets Masking

  • config.getMasked() method for safe logging
  • maskObject() utility function
  • isSensitiveKey() for detecting sensitive keys
  • Auto-detection of sensitive keys (password, secret, token, apiKey, etc.)
  • Customizable mask patterns and additional keys

Encrypted Configs

  • AES-256-GCM encryption with scrypt key derivation
  • encryptValue() / decryptValue() functions
  • encryptObject() / decryptObject() for bulk operations
  • isEncrypted() / hasEncryptedValues() / countEncryptedValues() utilities
  • Auto-decrypt support in defineConfig() with decrypt option
  • Environment variable key support (ZONFIG_ENCRYPTION_KEY)

Schema Migrations

  • diffSchemas() for comparing schema versions
  • generateMigrationReport() for markdown reports
  • validateConfigAgainstChanges() for config validation
  • applyAutoMigrations() for automatic migrations
  • Breaking change detection (removed fields, type changes)

Interactive CLI

  • zonfig init -i with interactive prompts
  • zonfig check for configuration health checks
  • zonfig show for tree view of configuration
  • zonfig show --list-paths for listing all config paths
  • zonfig show --masked for hiding sensitive values
  • zonfig encrypt / zonfig decrypt commands
  • zonfig migrate for schema migration reports

Documentation Website

  • Full documentation site at zonfig.dev
  • Interactive examples and guides
  • API reference documentation
  • Docker support for self-hosting

Changed

  • Improved CLI help messages and error handling
  • Better TypeScript type inference for config values

Fixed

  • Fixed duplicate paths CLI option conflict
  • Fixed vitest compatibility in test suite