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

fix(misc): update package.json only if needed #2332

Merged
merged 1 commit into from Jan 29, 2020

Conversation

juristr
Copy link
Member

@juristr juristr commented Jan 17, 2020

Adjusts the schematic to only touch the package.json if really required.

ISSUES CLOSED: #2317

@FrozenPandaz could you give this a look.

Two open questions related to this:

  • the verification of whether the package.json should be touched could be moved directly to the ast-utils.ts class and integrated in the addDepsToPackageJson. Let me know what you think about that.
  • how do we test this? Just verifying the schematic result tree for the package.json in the unit test doesn't really work. Alternatively we could add an e2e and verify the log output. that would work for sure

Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the verification of whether the package.json should be touched could be moved directly to the ast-utils.ts class and integrated in the addDepsToPackageJson

Can we move it there please?

how do we test this?

The host should have a list of actions that will be performed:

https://github.com/nrwl/nx/blob/master/packages/workspace/src/utils/rules/format-files.ts#L26

We can make sure that UPDATE package.json is not in that list after running this Rule

@juristr juristr force-pushed the fix-misleading-packagejson-log branch from 8e72fbb to 86ad9df Compare January 21, 2020 11:31
@vsavkin
Copy link
Member

vsavkin commented Jan 26, 2020

@juristr needs rebasing, other than that looks good.

@juristr
Copy link
Member Author

juristr commented Jan 26, 2020

@vsavkin I'm probably gonna make a small modification here tomorrow that might avoid the need to change the API of the addDepsToPackageJson to avoid having to pass the Tree & thus change all those other files.

@juristr juristr force-pushed the fix-misleading-packagejson-log branch from 86ad9df to 09a16f5 Compare January 27, 2020 11:41
Adjusts the schematic to only touch the package.json if really required

ISSUES CLOSED: nrwl#2317
@juristr juristr force-pushed the fix-misleading-packagejson-log branch from 09a16f5 to 7c67221 Compare January 27, 2020 15:15
@FrozenPandaz FrozenPandaz merged commit c213ae1 into nrwl:master Jan 29, 2020
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

library schematics outputs misleading info about "UPDATE package.json"
3 participants