Skip to content

feat(config): allow dotenv options in framework config#150

Merged
imdhemy merged 9 commits into2.xfrom
allow-passing-dot-env-configs-to-config-loader
Mar 27, 2026
Merged

feat(config): allow dotenv options in framework config#150
imdhemy merged 9 commits into2.xfrom
allow-passing-dot-env-configs-to-config-loader

Conversation

@imdhemy
Copy link
Copy Markdown
Member

@imdhemy imdhemy commented Mar 26, 2026

Q A
License GPLv3
Issue Closes #95

This PR extends env loading configuration without changing the existing bootstrap architecture.

It adds optional dotenv customization through KoalaConfig.environment.dotenv, while keeping loadEnvConfig(...) explicit and preserving Koala’s framework-managed env file order.

Docs

Related docs PR: koala-ts/koala-ts.github.io#17

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.dotenv and KoalaDotenvOptions (typed from dotenv options).
  • Reworks the env config loader into src/config/config-loader.ts with option support and updated/expanded tests.
  • Updates internal imports/exports from @/Config to @/config, and cleans dist/ 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.

Comment thread src/index.ts Outdated
Comment thread src/Config/index.ts Outdated
Comment thread package.json Outdated
@imdhemy imdhemy merged commit a00f1d6 into 2.x Mar 27, 2026
1 check passed
@imdhemy imdhemy deleted the allow-passing-dot-env-configs-to-config-loader branch March 27, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[config] allow passing dotenv configs to config loader

2 participants