Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
/lib/
/test/
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ Displays the file size of the bundled library (dist/bundled.js) in bytes.

### icons

Generates icon list for the documentation site
Generates icon list for the documentation site. The output of this script should
replace the `List of icons` section inside
the `vscode-elements.github.io/src/content/docs/components/icon.mdx` so the docs stay in sync with the latest Codicon set.

### vscode-data

Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
"@lit/context": "^1.1.3",
"lit": "^3.2.1"
},
"peerDependencies": {
"@vscode/codicons": ">=0.0.40"
},
"devDependencies": {
"@awmottaz/prettier-plugin-void-html": "^2.0.0",
"@bendera/wds-plugin-directory-index": "^0.5.0",
Expand Down
13 changes: 8 additions & 5 deletions scripts/generateIconList.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import fs from 'fs';
import prettier from 'prettier';

fs.readFile(
'./node_modules/@vscode/codicons/src/template/mapping.json',
'utf-8',
(err, data) => {
async (err, data) => {
if (err) {
throw err;
}

const iconMap = JSON.parse(data);
const keys = Object.keys(iconMap).sort();
const raw = keys
.map((k) => `<vscode-icon name="${k}" title="${k}"></vscode-icon>`)
.join('\n');
const formatted = await prettier.format(raw, {parser: 'html'});

keys.forEach((k) => {
// eslint-disable-next-line no-undef
console.log(`<vscode-icon name="${k}" title="${k}"></vscode-icon>`);
});
// eslint-disable-next-line no-undef
console.log(formatted);
}
);