felangel / felangel/mason

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

Đang mở
#532 15 bình luận 9 reaction 1 người được giao Được @felangel nhận Xem trên GitHub
enhancement candidate question waiting for response
Ngôn ngữ chính
Dart
Star
1.1k
Fork
113
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.