angular-modernization by bitwarden/clients
npx skills add https://github.com/bitwarden/clients --skill angular-modernization采用两步法将遗留的 Angular 组件转换为现代架构:
⚠️ 关键:只要可用,务必使用 Angular CLI 迁移。切勿手动迁移那些已有 CLI 原理图的功能。
Angular 提供了自动化的原理图,可以处理边缘情况、更新测试并确保正确性。手动迁移应仅用于 CLI 工具未涵盖的模式。
重要提示:
npx ng 运行命令。--path 选项来指定目标目录。npx ng generate @angular/core:standalone --path=<directory> --mode=convert-to-standalone
基于 NgModule → 独立架构
npx ng generate @angular/core:control-flow
*ngIf、、 → 、、
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
*ngFor*ngSwitch@if@for@switchnpx ng generate @angular/core:signal-input-migration
@Input() → 信号输入
npx ng generate @angular/core:output-migration
@Output() → 信号输出
npx ng generate @angular/core:signal-queries-migration
@ViewChild、@ContentChild 等 → 信号查询
npx ng generate @angular/core:inject-migration
构造函数注入 → inject() 函数
npx ng generate @angular/core:self-closing-tag
将模板更新为自闭合语法
npx ng generate @angular/core:unused-imports
移除未使用的导入
详细示例请参阅 migration-patterns.md。
protected,内部使用的用 private)npm run lint:fix 修复代码检查和格式化问题npm run test 运行测试如果出现任何错误,请相应地进行修复。
toSignal() 将可观察对象桥接到基于信号的组件中protected - 模板可访问的成员private - 内部实现完成迁移前检查:
protected/private)每周安装量
66
代码仓库
GitHub 星标数
12.5K
首次出现
2026年1月21日
安全审计
安装于
opencode56
github-copilot56
codex55
gemini-cli55
claude-code50
amp50
Transforms legacy Angular components to modern architecture using a two-step approach:
⚠️ CRITICAL: ALWAYS use Angular CLI migrations when available. DO NOT manually migrate features that have CLI schematics.
Angular provides automated schematics that handle edge cases, update tests, and ensure correctness. Manual migration should ONLY be used for patterns not covered by CLI tools.
IMPORTANT:
npx ng.--path option to target directories.npx ng generate @angular/core:standalone --path=<directory> --mode=convert-to-standalone
NgModule-based → standalone architecture
npx ng generate @angular/core:control-flow
*ngIf, *ngFor, *ngSwitch → @if, @for, @switch
npx ng generate @angular/core:signal-input-migration
@Input() → signal inputs
npx ng generate @angular/core:output-migration
@Output() → signal outputs
npx ng generate @angular/core:signal-queries-migration
@ViewChild, @ContentChild, etc. → signal queries
npx ng generate @angular/core:inject-migration
Constructor injection → inject() function
npx ng generate @angular/core:self-closing-tag
Updates templates to self-closing syntax
npx ng generate @angular/core:unused-imports
Removes unused imports
See migration-patterns.md for detailed examples.
protected for template access, private for internal)npm run lint:fixnpm run testIf any errors occur, fix them accordingly.
toSignal() to bridge observables into signal-based componentsprotected - Template-accessible membersprivate - Internal implementationBefore completing migration:
protected/private)Weekly Installs
66
Repository
GitHub Stars
12.5K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode56
github-copilot56
codex55
gemini-cli55
claude-code50
amp50
Perl安全编程指南:输入验证、注入防护与安全编码实践
1,200 周安装