felangel / felangel/mason

feat: Support for other ways for declaring file-directories in a brick

Offen
#929 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
1.1k
Forks
113
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Description

With mustache templates, file names become too long to write and manage.

Git too throws when using file long names. (Example of error below)
```error: open("bricks/generate/__brick__/{{#has_tests}}test/widgets/{{#is_schematic_widget}}{{name.snakeCase()}}/{{#needs_theme_for_widget}}{{name.snakeCase()}}_theme_test.dart{{/needs_theme_for_widget}}{{/is_schematic_widget}}{{/has_tests}}"): Filename too long```

Although this issue can be resolved by `git config core.longpaths true`, writing with this template syntax becomes difficult for very large projects.

Is there any pattern or syntax that can help with this issue? Can we keep a file that describes file folder conditions?

What if we could keep a file `__brick__` that will decide to keep directories or files?

```
├───lib/some/file.dart
├───test/some/file_test.dart
└───__brick__
```

```__brick__
// This is for keeping `test/` directory if `has_tests` is true.
{{#has_tests}}test{{/has_tests}}
```

## Additional Context

### Example of file directory structure in `__brick__/`
![Example of file directory structure in `__brick__/`](https://github.com/felangel/mason/assets/33719927/9416b7b4-fcca-4105-9db3-7d1a62ae5841)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.