-
Notifications
You must be signed in to change notification settings - Fork 12
Show links to unupgraded dependencies at the end #6
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ var fs = require('fs-extra'); | |
| var child_process = require('child_process'); | ||
| var which = require('which'); | ||
|
|
||
| var packagesRequiringUpgrade = []; | ||
|
|
||
|
|
||
| function howToInstallElm(){ | ||
| return 'Install Elm here https://guide.elm-lang.org/get_started.html#install\n' | ||
|
|
@@ -15,7 +17,28 @@ function howToInstallElmFormat(){ | |
|
|
||
| function displayHintForNonUpgradedPackage(packageName){ | ||
| process.stdout.write(`WARNING: ${packageName} has not been upgraded to 0.18 yet!\n`); | ||
| process.stdout.write(`WARNING: You can make an issue for 0.18 upgrade here: https://github.com/${packageName}\n`) | ||
| packagesRequiringUpgrade.push(packageName); | ||
| } | ||
|
|
||
| function displaySuccessMessage() { | ||
| process.stdout.write( | ||
| 'SUCCESS! Your project\'s dependencies and code have been upgraded.\n' | ||
| + 'However, your project may not yet compile due to API changes in your\n' | ||
| + 'dependencies.\n\n' | ||
| + 'See https://github.com/elm-lang/elm-platform/blob/master/upgrade-docs/0.18.md\n' | ||
| + 'and the documentation for your dependencies for more information.\n\n' | ||
| ); | ||
|
|
||
| if (packagesRequiringUpgrade.length > 0) { | ||
| process.stdout.write( | ||
| 'WARNING! Several of your dependencies have not yet been upgraded to \n' | ||
| + 'support Elm 0.18. You can create an issue to request the packages be \n' | ||
| + 'upgraded here:\n'); | ||
| packagesRequiringUpgrade.forEach(function(packageName) { | ||
| process.stdout.write(' - https://github.com/' + packageName + '/issues\n'); | ||
| }); | ||
| process.stdout.write('\n'); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fwiw, we could also automate making 0.18 upgrade PRs
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh making the PRs... Hmm.. That's a cool idea! I think if we wanted to automate the PRs, it would be better to separately just go through all the published packages and create the PRs (as an independent, one-time script), and not have elm-upgrade to that, since so many people will be running it. Also, I didn't want to automate issue creation because most likely there will already be an issue created, and I don't want all package maintainers to get a bunch of duplicate issue reports.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, that's what I did for 0.16. It was a bit trickier than because some things just couldn't be done by hand |
||
| } | ||
| } | ||
|
|
||
| function findBinary(name, message) { | ||
|
|
@@ -120,7 +143,8 @@ function main(knownUpgrades) { | |
| child_process.execFileSync(elmFormat, ['--yes', '--elm-version', '0.18', sourceDir]); | ||
| }) | ||
|
|
||
| process.stdout.write('\n\nSUCCESS! Your project\'s dependencies and code have been upgraded.\nHowever, your project may not yet compile due to API changes in your\ndependencies.\n\nSee https://github.com/elm-lang/elm-platform/blob/master/upgrade-docs/0.18.md\nand the documentation for your dependencies for more information.\n\n'); | ||
| process.stdout.write('\n\n'); | ||
| displaySuccessMessage(); | ||
| } | ||
|
|
||
| function init(){ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several -> give exact count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!