Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: recompute colors only when needed (electron#773)
* refactor: use json-stable-stringify in colors.json This ensures that the generated files will only have diffs when the contents change, rather than due to arbitrary sorting of an object's properties * refactor: sort require calls * refactor: simplify color object creation * feat: if we already have color info for an app, reuse it * feat: only recalculate colors when icons change Add a revHash for the icon file & use the old color values if the revHash is unchanged since the last run. * refactor: skip redundant file loads Previously we loaded once to get the revHash, then a second time to compute the complimentary colors. Now we load it once into a buffer, then use the buffer both tasks * chore: update package-lock.json since this branch adds three new dependencies * chore: update colors file this update adds the icon file revHashes * refactor: control colors endpoints for testability * chore: fix linting * test: add tests for color script * docs: add some function comments * refactor: color script readability * chore: update package-lock * chore: update package-lock * refactor: better color error.log testing * fix: incorrect terminology in comments * fix: indentation whitespace * fix: silence incorrect linter warning * fix: hide intentional test errors The tests feed bad data into the color reader, so it logs errors. Dumping these errors during `npm run test` makes the output noisy. So instead of having an `console.error` spy, actually intercept it and test to confirm the errors the expected information. * chore: remove sinon, sinon-chai dependencies Sinon was unused after the `console.error` spy was removed. * fix: function name typo * fix: remove unused variable
- Loading branch information