Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@schematics/angular:component not getting respected when using "defaultCollection": "@ngxs/schematics" #30

Open
kuncevic opened this issue Mar 7, 2019 · 5 comments

Comments

@kuncevic
Copy link
Member

kuncevic commented Mar 7, 2019

I'm submitting a...


[ x] Bug report  

Current behavior

have "style":"scss" in angular.json

"schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },

and

 "cli": {
    "defaultCollection": "@ngxs/schematics"
  }

ng g c xyz creating an component with css types of styles instead of scss:

CREATE src/app/xyz/xyz.component.html (22 bytes)
CREATE src/app/xyz/xyz.component.spec.ts (607 bytes)
CREATE src/app/xyz/xyz.component.ts (257 bytes)
CREATE src/app/xyz/xyz.component.css (0 bytes)

Expected behavior

component gets generated with scss styles type

CREATE src/app/xyz/xyz.component.html (22 bytes)
CREATE src/app/xyz/xyz.component.spec.ts (607 bytes)
CREATE src/app/xyz/xyz.component.ts (257 bytes)
CREATE src/app/xyz/xyz.component.scss (0 bytes)

Minimal reproduction of the problem with instructions

ng g my-app --style=scss
ng add @ngxs/schematics
ng g c xyz

What is the motivation / use case for changing the behavior?

respect the angular cli styles config:


"schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },

Environment

OS: win32 x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package Version

@ngxs/schematics: ^0.0.1-alpha.5
@angular-devkit/architect 0.13.5
@angular-devkit/build-angular 0.13.5
@angular-devkit/build-optimizer 0.13.5
@angular-devkit/build-webpack 0.13.5
@angular-devkit/core 7.3.5
@angular-devkit/schematics 7.3.5
@angular/cdk 7.3.3
@angular/cli 7.3.5
@angular/fire 5.1.1
@angular/flex-layout 7.0.0-beta.23
@angular/material 7.3.3
@angular/pwa 0.13.5
@ngtools/webpack 7.3.5
@schematics/angular 7.3.5
@schematics/update 0.13.5
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0

For Tooling issues:

  • Node version: v10.14.2
  • Platform: Mac, Windows
@eranshmil
Copy link
Member

Do you have any leads on how to fix that?

@kuncevic
Copy link
Member Author

kuncevic commented Mar 27, 2019

@eranshmil I just did remove "cli": { "defaultCollection": "@ngxs/schematics" } from my angular.json config as workaround

@johnzondr
Copy link

johnzondr commented Apr 14, 2020

i don't have "cli": { "defaultCollection": "@ngxs/schematics" } in my angular.json yet scss in styleext is no longer working for me either.

this worked for me in the past, and only broke in the past few months, perhaps upgrading to angular 9.

EDIT: angular cli works just fine. just not the angular.json schematics.

@wkjesus
Copy link

wkjesus commented Oct 23, 2020

i don't have "cli": { "defaultCollection": "@ngxs/schematics" } in my angular.json yet scss in styleext is no longer working for me either.

this worked for me in the past, and only broke in the past few months, perhaps upgrading to angular 9.

EDIT: angular cli works just fine. just not the angular.json schematics.

i found that the tags change in angular 8 & 9... try this out:
spec now skipTests
styleext now style

"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"style": "scss",
"skipTests": true,
"inlineStyle": false
},
"@schematics/angular:directive": {
"prefix": "app"
},
"@schematics/angular:service": {
"skipTests": false
}

@johnzondr
Copy link

@wkjesus this did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants