GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CLI generates items in unexpected workspace directories · Issue #21660 · angular/angular-cli

CLI generates items in unexpected workspace directories #21660

New issue
Copy link
New issue
Copy link
Open
Open
CLI generates items in unexpected workspace directories#21660
Copy link
Labels
area: @angular/clifreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity2: inconvenienttype: bug/fix
Milestone
Backlog

Description

@drullo
drullo
opened on Aug 26, 2021
Issue body actions

🐞 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


Activity

  1. alan-agius4
    added
    area: @angular/cli
    severity2: inconvenient
    type: bug/fix
    on Aug 27, 2021
  2. ngbot
    modified the milestone: needsTriage on Aug 27, 2021
  3. alan-agius4
    added
    freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
    on Aug 27, 2021
  4. ngbot
    modified the milestones: needsTriage, Backlog on Aug 27, 2021
  5. clydin
    added
    2022Q3 Fixit
    on Jun 27, 2022
  6. alan-agius4
    removed
    2022Q3 Fixit
    on Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular/clifreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity2: inconvenienttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      • BacklogNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.