Skip to content

feat(env): support multiple environment variables#15

Merged
CorentinTh merged 1 commit into
mainfrom
multiple-env
Sep 20, 2025
Merged

feat(env): support multiple environment variables#15
CorentinTh merged 1 commit into
mainfrom
multiple-env

Conversation

@CorentinTh

Copy link
Copy Markdown
Owner

No description provided.

@CorentinTh CorentinTh requested a review from Copilot September 20, 2025 23:02
@CorentinTh CorentinTh self-assigned this Sep 20, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for specifying multiple environment variables as fallbacks for a single configuration field. Instead of accepting only a single string for the env property, it now accepts either a string or an array of strings, where the first found environment variable is used.

Key changes:

  • Updated type definition to allow string arrays for environment variable names
  • Modified environment resolution logic to iterate through multiple variables and use the first found
  • Added comprehensive test coverage for the new fallback behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/figue.types.ts Updated ConfigDefinitionElement type to accept string array for env property
src/figue.ts Implemented fallback logic to find first available environment variable from array
src/figue.test.ts Added test cases covering multiple environment variable scenarios
README.md Added documentation explaining the new environment variable fallback feature
Comments suppressed due to low confidence (1)

README.md:1

  • Typo in comment: 'plateform' should be 'platform'.
<p align="center">

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/figue.ts
@CorentinTh CorentinTh merged commit a54adeb into main Sep 20, 2025
2 checks passed
@CorentinTh CorentinTh deleted the multiple-env branch September 20, 2025 23:05
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.

2 participants