Skip to content

Commit

Permalink
feat: update @vscode/codicons to 0.36 (#2010)
Browse files Browse the repository at this point in the history
Exposes several new icons. Added ability to exclude icons from vscode. 

Exclude `repo-fetch` due to it not being convertible to a single shape
path with svgo.

Rounded rects don't convert with
https://github.com/svg/svgo/blob/main/plugins/convertShapeToPath.js
  • Loading branch information
dsmmcken authored May 15, 2024
1 parent 37fe009 commit 3a6a439
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@types/shell-quote": "^1.7.1",
"@types/shortid": "0.0.29",
"@vitejs/plugin-react-swc": "^3.3.0",
"@vscode/codicons": "0.0.33",
"@vscode/codicons": "0.0.36",
"chokidar-cli": "^2.1.0",
"cross-env": "^7.0.2",
"eslint": "^8.29.0",
Expand Down
11 changes: 10 additions & 1 deletion packages/icons/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const OUTPUT_SIZE = 512;
const codiconFolder = { dir: path.resolve(BUILD_DIR, 'svg/vs'), prefix: 'vs' };
const dhiconFolder = { dir: path.resolve(BUILD_DIR, 'svg/dh'), prefix: 'dh' };

const EXCLUDED_ICONS = [
'repo-fetch', // excluded because rounded rects can't be converted to a single path by svgo
];

function getPrefixedName(name, prefix) {
return (
prefix.toLowerCase() +
Expand Down Expand Up @@ -47,7 +51,12 @@ async function getFiles(src) {
const files = await getFilesInFolder(src.dir);
const contents = await Promise.all(
files
.filter(file => file.slice(file.length - 1) !== '.svg')
.filter(
file =>
// file is svg and not in excluded list
file.endsWith('.svg') &&
EXCLUDED_ICONS.indexOf(file.slice(0, -4)) === -1
)
.map(async file => {
const name = file.slice(0, -4);
return {
Expand Down
Binary file modified tests/styleguide.spec.ts-snapshots/icons-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/styleguide.spec.ts-snapshots/icons-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/styleguide.spec.ts-snapshots/icons-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3a6a439

Please sign in to comment.