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

Feature: Interactive update #1444

Merged
merged 3 commits into from
Nov 11, 2016
Merged

Feature: Interactive update #1444

merged 3 commits into from
Nov 11, 2016

Conversation

torifat
Copy link
Member

@torifat torifat commented Oct 25, 2016

This is similar to npm-check interactive update mode. It provides an easy way to update outdated packages.

$ yarn upgrade-interactive

Currently, there is no test with this PR. But, If someone can guide me with some scenarios, I will write them, Thanks.

screenshot 2016-10-25 20 55 29

@cpojer
Copy link
Contributor

cpojer commented Oct 26, 2016

This is great, I think we should add this to Yarn.

rx-lite@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102"

rx@^4.1.0:
Copy link
Member

Choose a reason for hiding this comment

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

rx is very large, I wonder how we feel about pulling it into Yarn. How much does this increase the installed size of Yarn? (you can run scripts\build-dist.sh on Linux/Mac or scripts\build-dist.ps1 on Windows and compare the size of the dist directory before and after your change)

Copy link
Member Author

@torifat torifat Oct 26, 2016

Choose a reason for hiding this comment

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

3409098 - 2831040 = 578058 bytes increased 😭

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems it can be reduced by loading only necessary modules from rx in Inquirer.js.

https://github.com/SBoudrias/Inquirer.js/search?utf8=%E2%9C%93&q=rx

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, maybe this is okay for now and the size increase is offset by the usefulness of the feature. I'll see what others on the team think!

@Daniel15
Copy link
Member

This is probably my favourite pull request ever. Thank you! ❤️

@@ -28,7 +28,7 @@ export default ({
rm: 'remove',
show: 'info',
uninstall: 'remove',
update: 'upgrade',
udpate: 'update',

Choose a reason for hiding this comment

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

A tiny typo: 'udpate' -> 'update'

Copy link
Contributor

Choose a reason for hiding this comment

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

The typo is intentional. That file is full of misspellings and alternate commands people are used to and are used to provide corrections.

Choose a reason for hiding this comment

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

oh okay!


return ({name, current, wanted, latest, hint});
})))
.filter(({latest, current}) => latest !== current)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of chaining can we assign these to variables with descriptive names, kind of hard to follow

Copy link
Member Author

Choose a reason for hiding this comment

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

Did you mean assign the output in a variable then filter it?

const getNameFromHint = (hint) => hint ? `${hint}Dependencies` : 'dependencies';

const maxLengthArr = outdatedDeps.reduce(
(acc, dep) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this code really hard to follow, could we do the same here

@sebmck sebmck merged commit 14fe80f into yarnpkg:master Nov 11, 2016
@sebmck
Copy link
Contributor

sebmck commented Nov 11, 2016

Merged and will be available in the next release. I've renamed the command from update to upgrade-interactive because having two commands called upgrade and update is confusing. It's not the ideal name but we want to cut a release soon and I'd love to get this in. Happy to accept a PR renaming it to something else.

@AlicanC
Copy link
Contributor

AlicanC commented Nov 11, 2016

yarn upgrade -i?

@sebmck
Copy link
Contributor

sebmck commented Nov 11, 2016

Considered that but I think relegating this sort of functionality to an argument makes it seem less important. I think this feature is crazy awesome and deserving of it's own command.

@torifat
Copy link
Member Author

torifat commented Nov 11, 2016

Need to update the outdated condition. Outdated command usage semver package now.

@ccorcos
Copy link

ccorcos commented Nov 15, 2016

what do the colors indicate?

@Jessidhia
Copy link

IIUC, yellow is for packages installed at their package.json version, while red is for packages that don't even match the current package.json (e.g. not installed).

josephfrazier added a commit to josephfrazier/browser-extension that referenced this pull request Mar 10, 2017
This makes it so that `yarn upgrade` can upgrade all dependencies.
`yarn upgrade-interactive` can be used for major version bumps.

See the following:
* https://yarnpkg.com/lang/en/docs/dependency-versions/#toc-caret-ranges
* https://yarnpkg.com/docs/cli/upgrade/
* yarnpkg/yarn#1444 (comment)
stefanbuck pushed a commit to OctoLinker/OctoLinker that referenced this pull request Mar 10, 2017
This makes it so that `yarn upgrade` can upgrade all dependencies.
`yarn upgrade-interactive` can be used for major version bumps.

See the following:
* https://yarnpkg.com/lang/en/docs/dependency-versions/#toc-caret-ranges
* https://yarnpkg.com/docs/cli/upgrade/
* yarnpkg/yarn#1444 (comment)
josephfrazier added a commit to josephfrazier/octopermalinker that referenced this pull request Mar 10, 2017
This makes it so that `yarn upgrade` can upgrade all dependencies.
`yarn upgrade-interactive` can be used for major version bumps.

See the following:
* https://yarnpkg.com/lang/en/docs/dependency-versions/#toc-caret-ranges
* https://yarnpkg.com/docs/cli/upgrade/
* yarnpkg/yarn#1444 (comment)
@bobmoff
Copy link

bobmoff commented Apr 30, 2017

is there a reason for upgrade-interactive not being in the documentation? seems like a hidden gem.

@Daniel15
Copy link
Member

Daniel15 commented May 7, 2017

It's likely that it's just because nobody has written docs for it yet. Pull requests are appreciated :)

@bobmoff
Copy link

bobmoff commented May 7, 2017

@Daniel15 tried updating the documentation by cloning the website repo and running it on my dev machine, but as I have no experience with Jekyll I could not get it fully working. I updated all the places I could find but the sidebar would still not show a link to the new page so I am stuck. :(

Edit: Seems like there is something wrong with the auto-regeneration. When I manually built it, it detected all the changes and it looks ok. Will send a PR with updated docs for this awesome feature

@tommedema
Copy link

Is there a way to detect unused dependencies with yarn?

omadoww added a commit to omadoww/browser-extension that referenced this pull request Nov 20, 2024
This makes it so that `yarn upgrade` can upgrade all dependencies.
`yarn upgrade-interactive` can be used for major version bumps.

See the following:
* https://yarnpkg.com/lang/en/docs/dependency-versions/#toc-caret-ranges
* https://yarnpkg.com/docs/cli/upgrade/
* yarnpkg/yarn#1444 (comment)
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.

10 participants