AmpersandHQ / ampersand-magento2-upgrade-patch-helper

Helper script to aid upgrading magento 2 websites by detecting overrides. Now supports third party module detections
GNU Lesser General Public License v3.0
322 stars 39 forks source link

Implement 'meaningful' checks to `.js` #112

Closed convenient closed 1 year ago

convenient commented 1 year ago

Part of https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper/pull/110

Ignore Override Warning

| IGNR  | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js                                      | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/ignore.js                                                              |

In this case vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js was updated with some whitespace/comment/etc so its not really changed, so don't bother reporting on it. The IGNR entries are suppressed without --show-ignore

Redundant override

| WARN  | Redundant Override       | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js                                   | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js                                                           |

In this case vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js has been updated and is now equivalent (excluding some whitespace/comments) to app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js

The app/design override is now redundant and not necessary

Additional test case changes

The additional test cases needed updated as this file is being ignored, due to the fact its only a comment / whitespace from https://github.com/magento/magento2/commit/1697149ff4aae5c123dc073823047578cf54677d

Previously a human would have had to look at the change and work it out themselves, now its not reported.

diff -ur -N vendor_orig/magento/module-vault/view/frontend/web/js/view/payment/vault.js vendor/magento/module-vault/view/frontend/web/js/view/payment/vault.js
--- vendor_orig/magento/module-vault/view/frontend/web/js/view/payment/vault.js 2020-04-13 17:35:44.000000000 +0000
+++ vendor/magento/module-vault/view/frontend/web/js/view/payment/vault.js  2023-06-07 19:25:10.000000000 +0000
@@ -3,7 +3,7 @@
  * See COPYING.txt for license details.
  */
 /*browser:true*/
-/*global define*/
+
 /* @api */
 define([
     'underscore',

And these files are being flagged as redundant, because vendor/paypal/module-braintree-core/view/base/web/js/form-builder.js has been edited/changed and is now the same as vendor/paypal/module-braintree-core/view/frontend/web/js/form-builder.js

e676f80e153b2a8e55da763f237cabf4  vendor/paypal/module-braintree-core/view/base/web/js/form-builder.js
e676f80e153b2a8e55da763f237cabf4  vendor/paypal/module-braintree-core/view/frontend/web/js/form-builder.js