felangel / felangel/mason

Proposal: alternate syntax for the character `/` in file systems

Abierto
#532 15 comentarios 9 reacciones 1 asignado Reclamado por @felangel Ver en GitHub
enhancement candidate question waiting for response
Lenguaje dominante
Dart
Estrellas
1.1k
Forks
113
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

The current syntax for conditional files and folders is functional, but generates a file system representation that is really hard to understand and maintain.

### Example:
If I want a brick to generate an `android.dart` file only if the boolean parameter `android` is true, I'm supposed to name a file `{{#android}}android.dart{{/android}}`.
This has the effect of generating a directory named `{{#android}}android.dart{{` that contains a file named `android}}`

View in the MacOS finder:
![Screen Shot 2022-10-06 at 3 58 33 PM](https://user-images.githubusercontent.com/104820536/194204247-722df574-2bf2-49a0-bf1c-24006023d58d.png)

View in VSCode
![Screen Shot 2022-10-06 at 3 58 15 PM](https://user-images.githubusercontent.com/104820536/194204286-cfa16c82-677a-49e9-8c07-f0f019b436da.png)

This split in a directory and a file doesn't match at all how we think about a single file.

### Proposal
If another syntax for conditional files and folders was introduced, that doesn't include the character `/`, we could view them as regular files, which would match the mental model about them being a file.

Dummy suggestions:
- Could we use the double `##` symbol for closing tags? like `{{#android}}android.dart{{##android}}`
- Could we use another available symbol? like `{{#android}}android.dart{{^android}}`

### Migration path
If this new syntax was introduced, it could be distributed in a first step alongside the current syntax, but the current syntax would trigger a warning with a recommendation to migrate to the new syntax. Then after a few versions, the old syntax would go away.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.