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

Revamp as a v2 Ember addon #44

Merged
merged 7 commits into from Apr 3, 2024
Merged

Revamp as a v2 Ember addon #44

merged 7 commits into from Apr 3, 2024

Conversation

mixonic
Copy link
Member

@mixonic mixonic commented Apr 3, 2024

This package provides three things:

  • Fonts
  • Images
  • Some SCSS styles

None of that requires the build steps inherent in this library being a full-blown Ember addon. Modern v2 Ember addons provide all the capability we need.

This patch converts the library to a v2 Ember addon.

Note that this package is also used by several applications at Addepar which are not Ember applications. The slimmer profile of a v2 addon decreases their dependency size and complexity.

Finally, this PR also includes woff2 format files for the included fonts. woff2 fonts are a modern standard and should be the default. SCSS files are updated to make woff2 the default.

@mixonic mixonic requested review from aschenoni and a team April 3, 2024 01:29
Copy link
Member

@bantic bantic left a comment

Choose a reason for hiding this comment

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

This is a great cleanup, thank you for taking it on.

Choose a reason for hiding this comment

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

Where did you get the Tiempos woff2s from? Is that an official release or did you run through a converter?

I think design-tokens is currently using woff but we could look to use these woff2s instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran them through a converter based on https://github.com/papandreou/fontverter

import * as fontverter from 'fontverter';
import { readdirSync, readFileSync, writeFileSync } from 'fs';
import * as url from 'url';
import path from 'path';

for (const file of readdirSync(url.fileURLToPath(new URL('.', import.meta.url)), { withFileTypes: true })) {
  if (file.name.endsWith('woff')) {
    const converted = await fontverter.convert(readFileSync(path.join(file.path, file.name)), 'woff2');
    writeFileSync(file.name.replace('.woff', '.woff2'), converted);
  }
}

package.json Show resolved Hide resolved
@mixonic
Copy link
Member Author

mixonic commented Apr 3, 2024

I discussed with further with @addepar-davidlin on Slack. Taking the approvals and moving it on to the next steps.

@mixonic mixonic merged commit 152cb91 into master Apr 3, 2024
@delete-merged-branch delete-merged-branch bot deleted the mixonic/v1 branch April 3, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants