zendesk / zendesk_app_migrator

CLI tool to assist in migrating v1 App Framework apps to v2
Other
10 stars 5 forks source link

Show changed/diff summary as part of migration process #33

Open hoangtrvu opened 6 years ago

hoangtrvu commented 6 years ago

A summary of what were changed or moved during migration process would be helpful for app developers, especially if -a --auto flag was used.

Example of such summary:

* Migrate translations *
Original: /path/to/app/translations/*
Copied to: /path/to/app/v2/src/translations/*

* Migrate CSS *
Original: /path/to/app/app.css
Created: /path/to/app/v2/src/stylesheets/app.scss
Created: /path/to/app/v2/src/stylesheets/(diff|changelog).(md|txt)

*Migrate JS *
Original: /path/to/app/app.js
Created: /path/to/app/v2/src/javascripts/legacy_app.js
Created: /path/to/app/v2/src/javascripts/index.js
Created: /path/to/app/v2/src/javascripts/(diff|changelog).(md|txt)

Example of (diff|changelog).(md|txt) file:

--- /path/to/app/app.css
+++ /path/to/app/v2/src/stylesheets/app.scss
@@ -1,4 +1,6 @@
-h4 {
-  font-size: 16px;
-  margin-top: 20px;
+* {
+  h4 {
+    font-size: 16px;
+    margin-top: 20px;
+  }
 }

Other than creating (diff|changelog).(md|txt) files, Migration Helper might give app developers an Y/N option at the end of the process to print the diff to the terminal as well. Note: this might not be practical because the diff can be gigantic for non-trivial apps.