Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow oveeridng nested runtime config with env #1831

Merged
merged 10 commits into from
Nov 30, 2023

Conversation

becem-gharbi
Copy link
Contributor

@becem-gharbi becem-gharbi commented Oct 16, 2023

πŸ”— Linked issue

fix #1830

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Original behaviour
Runtime config properties with object type cannot be replaced by matching env variables.

    runtimeConfig: {
        feature: { // Setting NITRO_FEATURE=false do not work
            options: {  // Setting NITRO_FEATURE_OPTIONS=false do not work
                optionA: true,
                optionB: true
            }
        }
    }

Updated behaviour
Runtime config with object properties can be replaced by matching env variables.

    runtimeConfig: {
        feature: { // Setting NITRO_FEATURE=false works
            options: {  // Setting NITRO_FEATURE_OPTIONS=false works
                optionA: true,
                optionB: true
            }
        }
    }

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

playground/routes/config.ts Outdated Show resolved Hide resolved
@BobbieGoede
Copy link
Contributor

This would be pretty useful, is there anything blocking this from being merged?

@manniL manniL requested a review from pi0 November 25, 2023 11:10
@BobbieGoede
Copy link
Contributor

Rebase/merge with main should make the tests pass again, this PR will enable more Nuxt modules to add support for more complex runtime configuration (have a PR lined up for @nuxtjs/i18n built using this code).

Don't mean to rush anyone to merge this, but if I can be of any help to move it along let me know!

@pi0 pi0 changed the title fix: Enable config objects overwrite feat: allow oveeridng nested runtime config with env Nov 30, 2023
@pi0 pi0 requested a review from manniL November 30, 2023 18:06
@pi0
Copy link
Member

pi0 commented Nov 30, 2023

Thanks for PR ❀️ and sorry for late review since i needed to properly verify changes.

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.

Runtime config objects not replaced by env variables
4 participants