Skip to content

bug: not generate files to the defaultProject #11111

Closed
@sandangel

Description

@sandangel

Versions

➜ ng -v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.0.7
Node: 10.3.0
OS: linux x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, elements
... forms, http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.7
@angular-devkit/build-angular      0.6.7
@angular-devkit/build-ng-packagr   0.6.7
@angular-devkit/build-optimizer    0.6.7
@angular-devkit/core               0.6.7
@angular-devkit/schematics         0.6.7
@angular/cdk                       6.2.1
@angular/cli                       6.0.7
@angular/flex-layout               6.0.0-beta.15
@angular/material                  6.2.1
@angular/pwa                       0.7.0-beta.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.7
@schematics/angular                0.6.7
@schematics/update                 0.6.7
ng-packagr                         3.0.1
rxjs                               6.2.0
typescript                         2.7.2
webpack                            4.8.3

Repro steps

ng new test-proj
ng g application test-app
// edit angular.json defaultProject -> test-app

ng g c test-comp         
CREATE src/app/test-comp/test-comp.component.css (0 bytes)
CREATE src/app/test-comp/test-comp.component.html (28 bytes)
CREATE src/app/test-comp/test-comp.component.spec.ts (643 bytes)
CREATE src/app/test-comp/test-comp.component.ts (280 bytes)
UPDATE src/app/app.module.ts (406 bytes)

Observed behavior

<!-- Normally this includes a stack trace and some more information. -->

ref: #10352 , #10327
cli always generate schematics (pwa,component...) to the project under src/ folder

Desired behavior

please consider using the defaultProject for single project command like ng generate, ng add... I'm still experiencing the generated files go into the project under src/ folder instead of the project under projects/defaultProject/src/

Mention any other details that might be useful (optional)

I also see an regression that the generated component nolonger be added to the nearest NgModule, but always be added to the app.module.ts. Should I create another issue for that?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions