angular / angular/angular-cli

Add new "common" schematic to share configurations for all schematics at once

Ouverte
#33,221 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area: @angular-devkit/schematics gemini-triaged
Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
14 h 23 min
PR mergées (30 j)
162

Description

### Command

generate

### Description

Implement an internal artifact to commonize the configuration of schematics so that all schematics can share a common configuration by default, and override on a per-artifact basis if needed. Currently, all configurations are duplicated, and while not that annoying to deal with for a single collection, it can quickly add up when using several collections.

### Describe the solution you'd like

Actual :
```json
{
"schematics": {
"@schematics/angular:component": { "skipSelector": true },
"@schematics/angular:directive": { "skipSelector": true },
"@schematics/angular:pipe": { "skipSelector": true }
}
}
```
Proposed :
```json
{
"schematics": {
"@schematics/angular:common": { "skipSelector": true }
}
}
```

This new `common` schematic would contain either
- only fields that are common to all artifacts
- All fields possible, even if not applicable to certain artifacts

Resolving would follow this pattern :
- Look for common artifact schematic value
- If existing, apply value
- If all fields are possible : also check if value is applicable to artifact
- Look for direct artifact schematic value
- Override value

### Describe alternatives you've considered

Doing it by hand as already done today is the only solution

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la commande generate et le chemin de résolution de la configuration des schematics. Comparez la configuration commune proposée avec la configuration actuelle par artefact, puis définissez comment les valeurs communes s’appliquent et comment les valeurs directes de l’artefact les remplacent. Le travail est terminé lorsque les schematics peuvent hériter de valeurs par défaut partagées tout en conservant les remplacements propres à chaque artefact.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
cli
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.