feat(config): allow dotenv options in framework config#150
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the framework’s env loading configuration by allowing users to pass through a limited set of dotenv options (via KoalaConfig.environment.dotenv and loadEnvConfig(env, options)), while preserving Koala’s framework-managed env file ordering.
Changes:
- Introduces
KoalaConfig.environment.dotenvandKoalaDotenvOptions(typed fromdotenvoptions). - Reworks the env config loader into
src/config/config-loader.tswith option support and updated/expanded tests. - Updates internal imports/exports from
@/Configto@/config, and cleansdist/before building.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/function-first-routing.e2e.test.ts | Updates import path for koalaDefaultConfig to the new config module. |
| src/routing/verify-routing-mode.ts | Switches KoalaConfig import to @/config. |
| src/index.ts | Re-exports config module from the new @/config entry. |
| src/config/koala-config.ts | Adds KoalaDotenvOptions and KoalaConfig.environment.dotenv. |
| src/config/default-config.ts | Points default config typing at the new koala-config definition. |
| src/config/config-loader.ts | Adds option-aware env loader preserving file ordering. |
| src/config/config-loader.test.ts | Adds/updates tests for file ordering, option propagation, and expansion behavior. |
| src/application/create-application.ts | Switches KoalaConfig import to @/config. |
| src/application/create-application.test.ts | Switches koalaDefaultConfig import to @/config. |
| src/Testing/TestAgentFactory.ts | Switches KoalaConfig import to @/config. |
| src/Config/index.ts | Re-exports new config modules from the legacy Config entry. |
| src/Config/ConfigLoader.ts | Removes legacy loader implementation (moved/replaced under src/config). |
| src/Config/ConfigLoader.test.ts | Removes legacy loader tests (replaced under src/config). |
| package.json | Updates build script to clear dist before building. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends env loading configuration without changing the existing bootstrap architecture.
It adds optional dotenv customization through
KoalaConfig.environment.dotenv, while keepingloadEnvConfig(...)explicit and preserving Koala’s framework-managed env file order.Docs
Related docs PR: koala-ts/koala-ts.github.io#17