angular / angular/angular-cli

Add interface to cover UpdateRecorderBase's "apply" method

未關閉
#16,003 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area: @angular-devkit/schematics feature feature: insufficient votes
主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
14 小時 23 分鐘
30 天內合併 PR
162

描述

# 🚀 Feature request

### Command (mark with an `x`)

```
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
```

### Description
Currently when writing schematics, the `HostTree` expects an `UpdateRecorderBase` for it's `commitUpdate(...)` function. This sharply limits creating custom schematic helpers, since any change needs to be done with an actual `UpdateRecorderBase`.

### Describe the solution you'd like
Include a new `UpdateRecord` interface (however you want to call it) that outlines the `UpdateRecorderBase`'s `apply()` function and remove the need for the `UpdateRecorderBase` specifically to be used with the `HostTree.commitUpdate(...)`

I have no problems cloning the repo and making the changes myself, but I would prefer some discussion around the subject to make sure it's in-line with the rest of the schematics implementations.

### Describe alternatives you've considered
I looked into implementing my own `TreeInterface`, but the `HostTree` I would base it on uses a number of "backend" specific functionality that is not exported. Not to mention it would be incredibly tedious to re-implement this very basic class, when we are only trying to extend how an update occurs against the `Tree`.

### Links
[HostTree](https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/host-tree.ts)
[UpdateRecorderBase](https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts)
[UpdateRecorder](https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/interface.ts)

貢獻指南

開啟貢獻指南

研究方向

Start by reading packages/angular_devkit/schematics/src/tree/host-tree.ts, recorder.ts, and interface.ts, focusing on HostTree.commitUpdate(...) and UpdateRecorderBase.apply(). Review the generate command's schematics usage to understand the public API boundary. Done means a new update interface can be used by commitUpdate(...) without requiring UpdateRecorderBase specifically.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
cli, tooling
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。