Support variable expansion in DotEnv features
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.3k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 283
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
El issue no nombra archivos ni pruebas; empieza por localizar la implementación de DotEnv de Node y su cobertura de pruebas existente. Traza cómo se analizan y resuelven los valores y, a continuación, define pruebas para la expansión de ${APPLICATION_PORT} y el comportamiento esperado para las sobrescrituras y el orden. La tarea estará terminada cuando el comportamiento de expansión propuesto esté implementado y cubierto por pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100