Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CLI generates items in unexpected workspace directories

オープン
#21,660 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
angular, typescript
領域
cli, tooling

調査の方向性

まず、複数プロジェクトのワークスペースで ng generate component component1 コマンドを再現し、プロジェクトルートから生成した場合と src/app または src/lib から生成した場合を比較します。プロジェクトルートからの生成で、想定されるプロジェクトのソースディレクトリ配下に項目が配置され、明示的なパスを指定しなくてもモジュールが解決されれば完了です。

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

説明

area: @angular/cli freq1: low severity2: inconvenient type: bug/fix

🐞 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
平均マージ
17時間 25分
マージ済み PR(30日)
183

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angular-cli のほかの issue

angular/angular-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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