angular / angular/angular-cli

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

Offen
#33,221 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: @angular-devkit/schematics gemini-triaged
Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
14 Std. 23 Min.
Gemergte PRs (30 T.)
162

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem generate-Befehl und dem Pfad zur Auflösung der Schematic-Konfiguration. Vergleiche die vorgeschlagene gemeinsame Konfiguration mit der aktuellen Konfiguration pro Artefakt und definiere anschließend, wie gemeinsame Werte angewendet werden und wie direkte Artefaktwerte sie überschreiben. Erledigt ist dies, wenn Schematics gemeinsame Standardwerte erben können und dabei Überschreibungen pro Artefakt erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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