Releases: envfyjs/envfy
Releases · envfyjs/envfy
Release list
v0.6.0 – TypeScript Type Inference
Highlights
- Automatic TypeScript type inference
- Generic
validateEnv<T>() - Enum literal type inference
- Optional property inference
- Default value inference
- Improved public type exports
- Updated documentation and examples
This release focuses on improving the developer experience while maintaining full backward compatibility and zero runtime dependencies.
Add Support for Optional Environment Variables
envfy v0.4.0 Release Notes
New Features
Optional Environment Variables
Added support for optional environment variables using the new object schema.
Example:
validateEnv({
API_KEY: {
type: "string",
optional: true,
},
});Behavior:
- Missing optional variables are ignored.
- Present optional variables are still validated.
Internal Improvements
New Type System
Moved all exported types into a dedicated src/types/ directory.
New exported types:
PrimitiveTypeEnumTypeEnvOptionSchemaValueSchema
All types are now re-exported from the package entry point for cleaner imports.
Better Project Structure
Project structure is now organized as:
src/
├── errors/
├── types/
├── validators.ts
├── validateEnv.ts
└── index.ts
This separates:
- validation logic
- custom errors
- exported types
- public API
Test Improvements
Added tests for:
- Missing optional variables
- Optional variables with valid values
- Optional variables with invalid values
- Required variables still throwing when missing
Improved test isolation by cleaning all environment variables before each test.
Code Improvements
- Introduced
SchemaValuetype alias. - Fixed optional object schema validation.
- Normalized validation rules before processing.
- Improved internal type safety.
- Cleaned up validation logic for future extensibility.
Foundation for Future Versions
v0.4.0 prepares the library for upcoming features such as:
- Default values (
default) - Custom validators
- Advanced schema options
- Improved TypeScript inference