-
Notifications
You must be signed in to change notification settings - Fork 62
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import webfont from 'webfont'; | ||
import fs from 'fs/promises'; | ||
import { GlyphData } from 'webfont/dist/src/types'; | ||
import prettier from 'prettier'; | ||
|
||
/** Icons to include in the generated icon font */ | ||
const INCLUDED_ICONS = ['connection-active', 'connection-inactive']; | ||
|
@@ -40,14 +41,19 @@ async function main(): Promise<void> { | |
}); | ||
|
||
// Prints out the VSCode configuration package.json | ||
console.info( | ||
JSON.stringify( | ||
{ | ||
icons: iconsConfig, | ||
}, | ||
undefined, | ||
2 | ||
) | ||
const currentConfiguration = JSON.parse( | ||
await fs.readFile('./package.json', 'utf8') | ||
); | ||
|
||
currentConfiguration.contributes.icons = iconsConfig; | ||
|
||
const prettierConfig = await prettier.resolveConfig('./.prettierrc.json'); | ||
await fs.writeFile( | ||
'./package.json', | ||
prettier.format(JSON.stringify(currentConfiguration), { | ||
...prettierConfig, | ||
parser: 'json-stringify', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
||
}) | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
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.