JPeer264 / node-rcs-core

Rename css selectors across all files
MIT License
37 stars 7 forks source link

Better error reporting #94

Closed X-Ryl669 closed 5 years ago

X-Ryl669 commented 5 years ago

The idea here is to concatenate all warning found while using the code and spit out the warning at the end of the process once instead of for each warning found.

This also answers the question about "where" the warning happened (source file that triggered the warning), in addition to the current "what". I'm capturing the source location in the front end and transmit it down to the warnings array.

This requires some patch in rename-css-selectors I'll commit as soon as the version is updated in the other PR.

This gives such report now:

WARNING: The following selectors were not found in the rename table, but appears in the compressed map. In order to avoid that some other selectors are used instead, they were appended with '_conflict'. You need to fix this either by:

- Creating a CSS rule with the selector name and re-run the process, or
- Excluding the selectors so it's not renamed, or
- Adding the value to the reserved selectors table so it's not used as a possible short name

The failing selector are:
 - 'v' found in:
    js/ex.js(98):     $('#nvsd ul.edit li input[name=v]').value(val);
 - 'l' found in:
    js/sensor.min.js(23): $('#lc').on('click', function(e){cancel(e);saveVal('l')...

WARNING: You shouldn't run this software on minified files as it'll be hard to debug errors whenever they happens.
coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 5821dd721bdde5e425d722306d9939892aa8380e on X-Ryl669:BetterErrorReporting into 2815d48e6caa619a7cb38a5d014af7b762e6de6f on JPeer264:master.

X-Ryl669 commented 5 years ago

Ok, that's step 2 here. This use the PR from node-rename-css-selectors#44 to get source file name. Please merge this one before I can work on rebasing #95.