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

chore: add automatic font generation and fix VSCode settings #893

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Dec 2, 2024

This just improves the icon generator script by making it automatically modify the package.json with the new icon configuration.

@@ -1,6 +1,5 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.formatOnSave": false,
Copy link
Contributor Author

@gagik gagik Dec 2, 2024

Choose a reason for hiding this comment

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

This is unrelated but could we remove this? I am not sure I see value in this. format on save override that is stated below never works for me so I always end up removing it while working on the project and it all seems fine.

@gagik gagik added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Dec 2, 2024
@gagik gagik changed the title chore: add automatic font generation and VSCode settings chore: add automatic font generation and fix VSCode settings Dec 2, 2024
'./package.json',
prettier.format(JSON.stringify(currentConfiguration), {
...prettierConfig,
parser: 'json-stringify',
Copy link
Contributor

Choose a reason for hiding this comment

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

Which exactly rules are applied here? I am wondering what is there on top of JSON.stringify(..., null, 2).

Copy link
Contributor Author

@gagik gagik Dec 3, 2024

Choose a reason for hiding this comment

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

I am pretty sure the only config being passed to prettier ends up being singleQuote: true and this gets ignored for JSON, the rest (i.e. space size 2) I assume are the prettier defaults so yeah it'd be the same as this.

So it ends up tied to our prettier config (and we have nearly nothing there so... this should be default prettier) so it just stays consistent with any style rules for our prettier formatter. This way if someone autoformats the file using VSCode there won't be inconsistencies.

@gagik gagik merged commit 2d9d5f5 into main Dec 3, 2024
8 of 9 checks passed
@gagik gagik deleted the gagik/add-icons-settings-generation branch December 3, 2024 15:24
@nirinchev
Copy link
Contributor

A bit late to the party, but I'm not a huge fan of including prettier into the font generation script. Instead, my suggestion would be to invoke it in the package.json script like:

  "generate-icon-font": "ts-node ./scripts/generate-icon-font.ts && prettier --write package.json",
  // or
  "generate-icon-font": "ts-node ./scripts/generate-icon-font.ts && reformat",

That way we keep the script less tied to the tooling we're using and any changes we decide to make to the way we format code would be confined to package.json and not some random scripts all over the repo.

It's not a blocker and not something I necessarily feel we should fix now that the PR is merged, but might be something to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants