angular / angular/angular-cli

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

オープン
#33,221 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: @angular-devkit/schematics gemini-triaged
主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
14時間 23分
マージ済み PR(30日)
162

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

generate コマンドと schematic の設定解決パスから始めます。提案されている共通設定と現在のアーティファクトごとの設定を比較し、共通の値をどのように適用するか、またアーティファクトに直接指定された値でどのように上書きするかを定義します。schematics が共有されたデフォルト値を継承しつつ、アーティファクトごとの上書きを維持できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
cli
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。