felangel / felangel/mason

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

Open
#532 15 comments 9 reactions 1 assignee Claimed by @felangel View on GitHub
enhancement candidate question waiting for response
Dominant language
Dart
Stars
1.1k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.