Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(icons-to-woff.js): enforce deterministic output #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaidjohnson
Copy link

Ensure builds with the same set of inputs results in an identical font hash for deterministic builds.

Improves solution proposed in #53

Notes:

  • Added unit test coverage to icons-to-woff.js to verify this fix actually worked. Needed to write a few additional tests to ensure 100% coverage of that file.
  • error option passed to Svgicons2svgfont was removed because it's not a supported property of that project. This issue was highlighted when unit test coverage was added to icons-to-woff.js and the line coverage could not be met.

@@ -21,10 +21,7 @@ module.exports = function createIconFont (fs, icons, options) {
name: options.name,
normalize: true,
fontHeight: options.enforcedSvgHeight ? options.enforcedSvgHeight : undefined,
log: function () {},
error: /** @param {any} err */function (err) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error property does not appear to be a supported option in svgicons2svgfont. I wasn't able to find a valid code path in that project that would call this function, so to support 100% test coverage, I opted to drop it here. The .on('error') callback on the stream below is sufficient for handling all errors raised by svgicons2svgfont.

Ensure builds with the same set of inputs results in an identical font hash for deterministic
builds.

re jantimon#53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant