CLI generates items in unexpected workspace directories
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- angular, typescript
调研方向
首先,在多项目 workspace 中重现 ng generate component component1 命令,比较从项目根目录生成与从 src/app 或 src/lib 生成的结果。完成的标准是:从项目根目录生成时,项目项会放置在预期的项目源目录下,并且无需显式路径即可解析模块。
由索引模型根据 Issue 内容生成。
描述
🐞 Bug report
Command
- generate
Description
In a multi-project workspace, ng generate creates items (components, etc.) based on the current directory, rather than [ProjectRoot]/src/app or [ProjectRoot/src/lib.
In a single-project workspace, the CLI knows to place items inside of src.... However, in a multi-project workspace with a projects/... directory structure, the developer must navigate to src/app or src/lib prior to generating the item, or specify its location, such as:
cd ./projects/app1/src/app
ng generate component component1
or
cd ./projects/app1
ng generate component src/app/component1 -module src/app/app
The expectation would be to navigate to the root of the project, then generate items in the same manner as a single-project workspace, such as:
cd ./projects/app1
ng generate component component1
Ideally, developers would not have to worry about where they are within the project directory structure or having to specify the location of the module (particularly in default module configurations).
🌍 Your Environment
Angular CLI: 12.2.2
Node: 14.16.0
Package Manager: npm 7.21.0
OS: win32 x64
Angular: 12.2.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1202.2
@angular-devkit/build-angular 12.2.2
@angular-devkit/core 12.2.2
@angular-devkit/schematics 12.2.2
@schematics/angular 12.2.2
ng-packagr 12.2.0
rxjs 6.6.7
typescript 4.3.5
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 16 小时 35 分钟
- 30 天内合并 PR
- 176
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
-
area: @angular/build gemini-triaged
难度 4/5 3-5 天 新手友好度 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 已指派 1 人 ·
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
supermomonga/zcode-acp#24 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
growthbook/growthbook#7100 ·
-
triage
难度 1/5 1-3 小时 新手友好度 88/100