Skip to content

Commit 669b526

Browse files
committed
Show links to unupgraded dependencies at the end
1 parent e532b8b commit 669b526

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

upgrade.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ var fs = require('fs-extra');
44
var child_process = require('child_process');
55
var which = require('which');
66

7+
var packagesRequiringUpgrade = [];
8+
79

810
function howToInstallElm(){
911
return 'Install Elm here https://guide.elm-lang.org/get_started.html#install\n'
@@ -15,7 +17,28 @@ function howToInstallElmFormat(){
1517

1618
function displayHintForNonUpgradedPackage(packageName){
1719
process.stdout.write(`WARNING: ${packageName} has not been upgraded to 0.18 yet!\n`);
18-
process.stdout.write(`WARNING: You can make an issue for 0.18 upgrade here: https://github.com/${packageName}\n`)
20+
packagesRequiringUpgrade.push(packageName);
21+
}
22+
23+
function displaySuccessMessage() {
24+
process.stdout.write(
25+
'SUCCESS! Your project\'s dependencies and code have been upgraded.\n'
26+
+ 'However, your project may not yet compile due to API changes in your\n'
27+
+ 'dependencies.\n\n'
28+
+ 'See https://github.com/elm-lang/elm-platform/blob/master/upgrade-docs/0.18.md\n'
29+
+ 'and the documentation for your dependencies for more information.\n\n'
30+
);
31+
32+
if (packagesRequiringUpgrade.length > 0) {
33+
process.stdout.write(
34+
'WARNING! Several of your dependencies have not yet been upgraded to \n'
35+
+ 'support Elm 0.18. You can create an issue to request the packages be \n'
36+
+ 'upgraded here:\n');
37+
packagesRequiringUpgrade.forEach(function(packageName) {
38+
process.stdout.write(' - https://github.com/' + packageName + '/issues\n');
39+
});
40+
process.stdout.write('\n');
41+
}
1942
}
2043

2144
function findBinary(name, message) {
@@ -120,7 +143,8 @@ function main(knownUpgrades) {
120143
child_process.execFileSync(elmFormat, ['--yes', '--elm-version', '0.18', sourceDir]);
121144
})
122145

123-
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');
146+
process.stdout.write('\n\n');
147+
displaySuccessMessage();
124148
}
125149

126150
function init(){

0 commit comments

Comments
 (0)