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

Add @nrwl/workspace does not update stylePreprocessorOptions.includePaths #1468

Closed
jonrimmer opened this issue Jun 7, 2019 · 7 comments
Closed
Assignees
Labels
community This is a good first issue for contributing outdated type: bug

Comments

@jonrimmer
Copy link

Expected Behavior

When I use ng add @nrwl/workspace, my app's sources are moved into ./apps. All the paths in angular.json should be updated to reflect this.

Current Behavior

If my project is using the build.options.stylePreprocessorOptions.includePaths config, this does not get updated. E.g.

  "build": {
    "options": {
      "stylePreprocessorOptions": {
        "includePaths": [ "src/assets/styles" ]
      }
    }
  }

This include path is left alone by the add schematic.

Failure Information (for bugs)

After running ng app @nrwl/workspace, the include path should be updated to apps/{appName}/src/assets/styles.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. ng new nx-test
  2. Edit angular.json and add a style include path referening ./src or a subpath of it.
  3. ng add @nrwl/workspace

Context

Nx: 8.1.0.
Angular CLI: 8

@FrozenPandaz FrozenPandaz self-assigned this Jun 7, 2019
@FrozenPandaz FrozenPandaz added community This is a good first issue for contributing type: bug labels Jun 7, 2019
@FrozenPandaz
Copy link
Collaborator

Thank you for reporting this. If someone from the community would like to work on this, the code is here:

https://github.com/nrwl/nx/blob/master/packages/workspace/src/schematics/ng-add/ng-add.ts#L117

matheo added a commit to matheo/nx that referenced this issue Jun 8, 2019
@matheo
Copy link
Contributor

matheo commented Jun 8, 2019

@FrozenPandaz I migrated a CLI project recently (after upgrading it to Angular 8) and I fixed many issues that I had in the process. I built the workspace package locally and fixed it step by step until I got my app updated. I've opened #1476 including this path update.

@jonrimmer it would be nice if you build my PR locally (yarn install and yarn build) and link or copy the resulting package (at dist/packages/workspace) to replace the @nrwl/workspace of your project, and run ng add @nrwl/workspace with it to see if your project gets some new tsconfigs for your app after that, and the styles path fixed of course!

@jonr-elsewhen
Copy link

@matheo Tried it, but It does not work.

Problem seems to be this line: matheo@227ba7e#diff-a9ea54d30f3a734ae12a67708517088cR394

You are trying to rename the app's tsConfig—e.g. src/tsconfig.app.json—to tsconfig.json. This will fail if there is already a tsConfig.json in the project root, which there almost always is, as it is this file that tsconfig.app.json and tsconfig.spec.json usually extend.

@matheo
Copy link
Contributor

matheo commented Jun 11, 2019

@jonr-elsewhen hmm, I will fix that, my old CLI project had only one tsconfig 👍

@mehrad-rafigh
Copy link
Contributor

@matheo Any progress on this?

@matheo
Copy link
Contributor

matheo commented Aug 30, 2019

@mehrad-rafigh perhaps you can help me to finish this.
I haven't the time to figure the different scenarios and its configurations,
with a clear picture I may finish this :)

matheo added a commit to matheo/nx that referenced this issue Oct 20, 2019
matheo added a commit to matheo/nx that referenced this issue Oct 20, 2019
matheo added a commit to matheo/nx that referenced this issue Oct 20, 2019
@vsavkin vsavkin closed this as completed in 48dae93 Nov 3, 2019
vsavkin added a commit that referenced this issue Nov 4, 2019
Doginal pushed a commit to Doginal/nx that referenced this issue Nov 7, 2019
Doginal pushed a commit to Doginal/nx that referenced this issue Nov 7, 2019
@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

No branches or pull requests

5 participants