felangel / felangel/mason

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

Abierto
#929 0 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
1.1k
Forks
113
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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)

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.