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

Wrong schematics for component #1617

Closed
lares83 opened this issue Jul 24, 2019 · 3 comments · Fixed by #1644
Closed

Wrong schematics for component #1617

lares83 opened this issue Jul 24, 2019 · 3 comments · Fixed by #1644
Labels
community This is a good first issue for contributing outdated type: bug

Comments

@lares83
Copy link

lares83 commented Jul 24, 2019

Prerequisites

Generate scss files when create a new component

Current Behavior

Generating components generate css file instead of scss

Steps to Reproduce

Create new workspace using npx create-nx-workspace@latest app-test.
Select the following answers:

Which stylesheet format would you like to use? SASS(.scss)  [ http://sass-lang.com   ]
What to create in the new workspace (You can create other applications and libraries at any point using 'ng g') angular [a workspace with a single Angular application]

After you install all dependencies, create new component using the following command
ng g c test

The following files are being created:

CREATE apps/app-test/src/app/test/test.component.css (0 bytes)
CREATE apps/app-test/src/app/test/test.component.html (19 bytes)
CREATE apps/app-test/src/app/test/test.component.spec.ts (614 bytes)
CREATE apps/app-test/src/app/test/test.component.ts (266 bytes)
UPDATE apps/app-test/src/app/app.module.ts (450 bytes)

Which is wrong because it should generate test.component.scss instead of css.

I've noticed that in angular.json the following schema has been generated

"schematics": {
      "@nrwl/workspace:component": {
          "style": "scss"
        }
 },

When I change it to

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

It starts working fine.

Context

Please provide any relevant information about your setup:

  • version of Nx used
    8.3.0

-version of npx
10.2.0

Angular CLI: 8.1.1
Node: 10.15.3
OS: darwin x64
Angular: 8.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.1
@angular-devkit/build-angular     0.800.6
@angular-devkit/build-optimizer   0.800.6
@angular-devkit/build-webpack     0.800.6
@angular-devkit/core              8.1.1
@angular-devkit/schematics        8.1.1
@angular/cli                      8.1.1
@ngtools/webpack                  8.0.6
@schematics/angular               8.1.1
@schematics/update                0.801.1
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0
@lares83 lares83 changed the title Wrong schema for component scss Wrong schematics for component Jul 24, 2019
@FrozenPandaz FrozenPandaz added community This is a good first issue for contributing type: bug labels Jul 27, 2019
@FrozenPandaz
Copy link
Collaborator

Good catch. The offending line is here:

fixedProject.schematics[`@nrwl/workspace:${type}`] =

Would somebody like to contribute a fix?

@mehrad-rafigh
Copy link
Contributor

@FrozenPandaz I would love to contribute!

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants