Support variable expansion in DotEnv features
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
What is the problem this feature will solve?
Sometimes it's helpful to derive the value of variables from other variables, using variable expansion.
For example, consider the following .env file:
APPLICATION_PORT: 8080
BASE_URL: http://localhost:8080
The APPLICATION_PORT and BASE_URL should have the same port. For reasons external to this issue, BASE_URL cannot be split into two variables without causing confusion.
If there are external overrides to APPLICATION_PORT, they won't remain in sync with BASE_URL.
What is the feature you are proposing to solve the problem?
Instead we could write .env files like this:
APPLICATION_PORT: 8080
BASE_URL: http://localhost:${APPLICATION_PORT}
This is already supported by at least bash, and the concept of variable expansion in environmental configuration is also common in ecosystems such as Kubernetes.
What alternatives have you considered?
- Using
dotenvx - Splitting variables up into their lowest common set
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L’issue non nomina file o test; inizia individuando l’implementazione di DotEnv di Node e la relativa copertura di test esistente. Traccia il modo in cui i valori vengono analizzati e risolti, quindi definisci test per l’espansione di ${APPLICATION_PORT} e il comportamento atteso per le sovrascritture e l’ordine. L’attività è completata quando il comportamento di espansione proposto è implementato e coperto da test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100