env_builder_cli 1.4.0 copy "env_builder_cli: ^1.4.0" to clipboard
env_builder_cli: ^1.4.0 copied to clipboard

A Flutter CLI tool to automate the creation and maintenance of the env Flutter package from multiple .env files.

1.4.0 #

🔗 Compatibilité Flutter (correctif majeur) #

  • Utilisable en dev_dependency avec le dernier Flutter : suppression de la contrainte analyzer: ^12.1.0, qui exigeait meta ^1.18.0 alors que le SDK Flutter épingle meta 1.17.0. Depuis la 1.2.0, flutter pub get échouait avec version solving failed dès que le paquet était ajouté à un projet Flutter (installation via dart pub global activate non affectée).

🧹 Nettoyage des dépendances #

  • Retrait de 6 dépendances déclarées mais jamais importées par le code : analyzer, build, build_runner, source_gen, cli_util, xml. build_runner reste invoqué en sous-processus (dart run build_runner build) dans le paquet env généré, qui déclare sa propre dépendance — aucun changement de comportement.
  • Aucune modification d'API ni du code généré.

⬆️ Mise à jour des dépendances #

  • Dépendances du CLI : image ^4.8.0 → ^4.9.1, test ^1.31.0 → ^1.31.2 (les autres étaient déjà à jour).
  • Paquet env généré ([yaml_manager.dart]) : envied / envied_generator ^1.3.1 → ^1.3.8, build_runner ^2.10.3 → ^2.15.1, flutter_lints ^5.0.0 → ^6.0.0.
  • Paquet app_assets généré (commande assets) : flutter_svg ^2.2.3 → ^2.3.0, image ^4.5.4 → ^4.9.1, vector_graphics ^1.1.19 → ^1.2.3.
  • Projet d'exemple : build_runner ^2.4.8 → ^2.15.1, flutter_lints ^5.0.0 → ^6.0.0.
  • Toutes les versions ont été validées contre Flutter 3.41.9 / Dart 3.11.5.

🧰 Exemple & qualité de code #

  • Exemple réparé : flutter analyze passe désormais sans erreur (16 problèmes pré-existants corrigés) — main.dart appelait AppFlavor.production() alors que le paquet env généré n'expose que .development(), custom_env_package n'était pas déclaré en dépendance de l'app, et widget_test.dart était le test compteur par défaut important package:example/main.dart (nom de paquet inexistant). Il est remplacé par un vrai smoke test — 2 tests passent.
  • Doc comment de bibliothèque : le fichier app_assets.dart généré déclare maintenant library;, ce qui supprime l'avertissement dangling_library_doc_comments dans les projets utilisateurs.
  • Formatage : l'ensemble des sources est repassé au dart format du style « tall » (Dart 3.7+). Aucun changement fonctionnel.

1.3.1 #

🐛 Bug Fixes #

  • Code Generator Fix: Fixed malformed template string in code_generator.dart that caused invalid Dart syntax in generated envied classes, preventing build_runner from succeeding
  • Dart Identifier Sanitization: Enhanced toCamelCase function to sanitize environment variable keys, ensuring generated field names are valid Dart identifiers (handles hyphens, dots, and numeric prefixes)

🔧 Technical Improvements #

  • Template Correction: Corrected the static field assignment template from invalid _\${''}Env$className to proper _Env$className reference
  • Identifier Validation: Added logic to replace invalid characters and prefix numeric-starting identifiers with underscore

1.3.0 #

🎨 Interactive CLI with Colors & Real-time Feedback #

  • Colored Output System: Complete CLI colorization with ANSI escape codes for better UX
  • Real-time Progress: Live feedback during build processes with progress indicators
  • Enhanced Error Handling: Contextual error messages with visual cues (✗ errors, ⚠ warnings, ✓ success)
  • Color Control: New --no-color flag to disable colored output for CI/CD environments
  • Unicode Icons: Added visual indicators (→ steps, ⏳ progress, ℹ info, 🔍 debug)

🚀 Performance Optimizations (EnvFileParser) #

  • Cache Hit Optimization: O(1) cache access with UnmodifiableMapView (-44% performance improvement)
  • LRU Cache Management: Automatic memory-bounded cache with 100MB limit and eviction
  • Memory Safety: Prevents memory leaks with intelligent cache size management
  • Statistics API: New getCacheStats() method for monitoring cache performance
  • Optimized Quote Handling: Improved parsing performance for quoted values

🧪 Testing & Quality #

  • Optimization Tests: 15 new tests for EnvFileParser performance and cache functionality
  • Total Test Coverage: 88 tests (up from 73) covering all new features
  • Cache Performance Tests: Benchmark tests ensuring cache hit speed improvements
  • Memory Management Tests: Tests for LRU eviction and memory limits

🔧 Technical Improvements #

  • CliColors Utility: Centralized color management system with automatic ANSI detection
  • CliLogger Class: Enhanced logging with multiple log levels and visual feedback
  • Error Context: Improved error messages with file paths and operation context
  • Backward Compatibility: All changes maintain compatibility with existing projects
  • Code Quality: Better separation of concerns with dedicated CLI utilities

📚 Documentation Updates #

  • Color Support: Updated README.md with color output examples
  • Performance Metrics: Added benchmark results and optimization details
  • CLI Usage: Enhanced command documentation with new flags and options

1.2.0 #

🚀 Performance Optimizations #

  • Code Generation: Replaced 150+ sequential string operations with bulk templates (-98% overhead)
  • File Caching: Added intelligent file-level caching with timestamp invalidation (-65-75% on multi-builds)
  • Asset Parallelization: Converted sequential asset processing to parallel execution (+30% on asset-heavy projects)
  • Memory Efficiency: Optimized string buffer usage and reduced memory allocations

🔒 Security Enhancements #

  • Random Salt Generation: Each encrypted file now uses unique 128-bit random salt (vs fixed salt)
  • Password Validation: Added minimum 8-character password requirement
  • Enhanced Encryption: Improved AES-256 implementation with better key derivation
  • Security Documentation: Comprehensive security practices added to SECURITY.md

🧪 Testing & Quality #

  • Comprehensive Test Suite: Added 73 tests covering all functionality (up from ~20)
  • Crypto Tests: 17 tests for encryption/decryption with various scenarios
  • Asset Tests: 26 tests for asset generation and parallelization
  • Cache Tests: 10 tests for caching functionality
  • Error Handling Tests: 20 tests for edge cases and error conditions

📚 Documentation & Future Planning #

  • Future Roadmap: Added prioritized optimization recommendations in README.md
  • Security Best Practices: Detailed encryption and key management guidelines
  • Performance Guidelines: Recommendations for optimal usage patterns

🔧 Technical Improvements #

  • Error Handling: Enhanced error messages and graceful failure handling
  • Code Quality: Improved maintainability with better separation of concerns
  • Backward Compatibility: All changes maintain compatibility with existing projects
  • Cross-Platform: Verified compatibility across Windows, macOS, and Linux

1.1.6+1 #

  • Some changes in README.md file

1.1.6 #

  • Added assets command (env_builder assets) for encrypting and embedding assets directly in Dart code
  • Support for images (PNG, JPG, GIF, WebP), videos (MP4, WebM, MOV, AVI, MKV), and SVGs
  • Asset compression and SVG minification
  • Encryption options: XOR (fast, lightweight) or AES (secure)
  • Generated widget helpers for images, SVGs, and video controllers
  • Flutter_gen compatible API

1.1.5 #

  • Refactored command structure: made apk and aab commands top-level instead of subcommands of build

1.1.4 #

  • Added APK build command (env_builder apk) for building Flutter APKs with release obfuscation
  • Added AAB build command (env_builder aab) for building Flutter AABs with release obfuscation

1.1.3 #

  • --output-dir: Custom output directory (default: env)
  • --no-encrypt: Skip encryption of sensitive variables
  • --verbose: Detailed output during build process

1.1.2 #

  • Refactored code structure for improved maintainability
  • Updated example package structure
  • Modified the env package generation's command

1.1.1 #

  • Ask a user if he want to encrypt .env files in his env package
  • Bug fixed

1.1.0 #

  • Added environment file encryption/decryption with AES
  • Improved error handling for invalid/corrupted files
  • Updated README with usage examples

1.0.0+1 #

  • README modified.
  • LICENSE changed.

1.0.0 #

  • Initial version.
6
likes
160
points
179
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter CLI tool to automate the creation and maintenance of the env Flutter package from multiple .env files.

Repository (GitHub)
View/report issues
Contributing

License

Apache-2.0 (license)

Dependencies

args, crypto, encrypt, image, path, universal_io, yaml, yaml_edit

More

Packages that depend on env_builder_cli