Incremental Adoption
Learn how to gradually adopt Typeconf in your existing TypeScript project
Typeconf is designed to be adopted gradually in your existing TypeScript projects. This guide will show you how to introduce Typeconf step by step without having to rewrite your entire codebase or change your habits too much.
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 values file:
- Generate config types and JSON:
- 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
Was this page helpful?