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

feat(upgrade, add): Separately log added/upgraded dependencies #5227

Merged
merged 7 commits into from
Jan 30, 2018

Conversation

kaylie-alexa
Copy link
Member

Implementation of feature https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-show-updated-packages-only.md

When adding or upgrading dependencies, group them into directly required ones vs.
transitive ones so that version shown is clearer to the end user.

https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-show-updated-packages-only.md

Summary

screen shot 2018-01-15 at 4 12 30 pm

Test plan

Added a test in upgrade.js

…transitive

When adding or upgrading dependencies, group the dependencies into directly required ones vs.
transitive ones so that version shown is clearer to the end user.

https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-show-updated-packages-only.md
@buildsize
Copy link

buildsize bot commented Jan 16, 2018

This change will increase the build size from 10.44 MB to 10.44 MB, an increase of 3.25 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 904.54 KB 904.81 KB 282 bytes (0%)
yarn-[version].js 3.93 MB 3.93 MB 1.2 KB (0%)
yarn-legacy-[version].js 4.08 MB 4.08 MB 1.38 KB (0%)
yarn-v[version].tar.gz 909.99 KB 910.21 KB 220 bytes (0%)
yarn_[version]all.deb 672.19 KB 672.38 KB 194 bytes (0%)

Copy link
Contributor

@rally25rs rally25rs left a comment

Choose a reason for hiding this comment

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

One change I think we should make (the key passed to the reporter.tree( and an optional suggestion on the test.

expect(lastLines[0]).not.toEqual('success Saved lockfile.');
expect(lastLines[1]).toEqual('success Saved 1 new dependency.');
expect(lastLines[2]).toContain(pkg);
expect(lastLines[3]).toContain('Done');
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if converting this test to a "snapshot" would be easier than trying to maintain this "index of line of output" approach...

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking that too, great idea

Copy link
Member Author

Choose a reason for hiding this comment

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

So I had to make the tests not run concurrently (otherwise the snapshots would match random stdout depending on the order the commands ran) and still slice the output (remove yarn version and the time it took to complete the command), but I think the change is still worthwhile for developer experience.

const directRequireDependencies = trees.filter(({name}) => resolverPatterns.has(name));

this.reporter.info(this.reporter.lang('directDependencies'));
this.reporter.tree('newDependencies', directRequireDependencies);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want different keys instead of reusing 'newDependencies' for the 2 calls to .tree(. It doesn't matter for the console-reporter, but if you --json to use the json-reporter, this key could be used to differentiate the two trees if parsing the json output. Maybe change this one to 'newDirectDependencies'.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, that's what it was used for! Will fix :)

@albybarber
Copy link

34966402-3d81da90-fa10-11e7-955e-3dddcfeb0519_png__640x1768_

Thoughts?

@arcanis arcanis merged commit d68b6c9 into yarnpkg:master Jan 30, 2018
agoldis added a commit to agoldis/yarn that referenced this pull request Feb 2, 2018
…readdir_files

* upstream/master: (34 commits)
  feat(upgrade, add): Separately log added/upgraded dependencies (yarnpkg#5227)
  feat(publish): Publish command uses publishConfig.access in package.json (yarnpkg#5290)
  fix(CLI): Use process exit instead of exitCode for node < 4 (yarnpkg#5291)
  feat(cli): error on missing workspace directory (yarnpkg#5206) (yarnpkg#5222)
  feat: better error when package is not found (yarnpkg#5213)
  Allow scoped package as alias source (yarnpkg#5229)
  fix(cli): Use correct directory for upgrade-interactive (yarnpkg#5272)
  nohoist baseline implementation (yarnpkg#4979)
  1.4.1
  1.4.0
  Show current version, when new version is not supplied on "yarn publish" (yarnpkg#4947)
  fix(install): use node-gyp from homebrew npm (yarnpkg#4994)
  Fix transient symlinks overriding direct ones v2 (yarnpkg#5016)
  fix(auth): Fixes authentication conditions and logic with registries (yarnpkg#5216)
  chore(package): move devDeps to appropriate place (yarnpkg#5166)
  fix(resolution) Eliminate "missing peerDep" warning when dep exists at root level. (yarnpkg#5088)
  fix(cli): improve guessing of package names that contain a dot (yarnpkg#5102) (yarnpkg#5135)
  feat(cli): include notice with license when generating disclaimer (yarnpkg#5072) (yarnpkg#5111)
  feat(cli): group by license in licenses list (yarnpkg#5074) (yarnpkg#5110)
  feat(cli): improve error message when file resolver can't find file (yarnpkg#5134) (yarnpkg#5145)
  ...
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

Successfully merging this pull request may close these issues.

4 participants