Adding to existing project
Instead of create a separate package for Typeconf you can use it directly in your project.- Create a directory which will contain your configurations:
- Create a configuration model:
- Create config values file:
- Generate config types and JSON:
- Install SDK;
- Use the configuration in your app:
Best Practices for Incremental Adoption
- Start with New Features: When adding new features, use Typeconf from the start rather than converting existing code.
-
Identify High-Value Targets: Focus on areas where type-safe configuration would provide the most value:
- Complex configuration objects
- Frequently changing settings
- Areas prone to configuration errors
-
Maintain Backward Compatibility: When converting existing configurations:
Integration with Other Tools
Typeconf works well with other tools in your ecosystem:- Environment Variables: Use with
dotenv
or similar tools - CI/CD: Add config generation in your CI pipeline
- Testing: Use in your test environment for consistent configuration