Skip to content

Conversation

@clemyan
Copy link
Member

@clemyan clemyan commented Jan 4, 2026

What's the problem this PR addresses?

Environment variable expansion in config files supports neither nested expansions and robust escaping (e.g. it is impossible to make a config \ followed by the value of an environment variable)

Fixes #6937
Fixes #6998
Supercedes/closes #7005

How did you fix it?

Implement a PDA-like parser to generate the expanded value that:

  • Supports nested expansions
    • Unset variables without fallback nested inside unused fallbacks do not throw
  • Supports escaping \, $, and }; allowing representation of any desired string/expansion
  • Rejects unclosed expansion and unknown expansion syntax (for forward compatibility)

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

clemyan and others added 2 commits January 4, 2026 05:41
- Full escape support for special syntax
- Nested environment variable substitution
Co-authored-by: pvcresin <[email protected]>
@clemyan clemyan force-pushed the clemyan/config-env branch from f43af81 to 41a1e5e Compare January 4, 2026 05:42
@clemyan
Copy link
Member Author

clemyan commented Jan 7, 2026

Oops I botched the docs 😅

@clemyan clemyan force-pushed the clemyan/config-env branch from 41a1e5e to 40e2fc7 Compare January 7, 2026 10:54
@pvcresin
Copy link

pvcresin commented Jan 15, 2026

@arcanis I really need this feature right now, would you be able to check it? 🙇

@clemyan
Copy link
Member Author

clemyan commented Jan 15, 2026

@pvcresin You can try it now using yarn set version from sources --branch 7033

@pvcresin
Copy link

@clemyan I see. Thank you very much for informing me.

@pvcresin
Copy link

@arcanis I apologize for having mentioned you.

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.

[Feature] Support recursive environment variable fallback in .yarnrc.yml [Bug?]: Nested environment variables not processed correctly

3 participants