From ecb9f576e2cadf1679d802dad8342d3d24997a80 Mon Sep 17 00:00:00 2001 From: dankeboy36 Date: Tue, 18 Nov 2025 11:57:04 +0100 Subject: [PATCH] chore: declare codicons as peer dep Closes: vscode-elements/elements#557 Signed-off-by: dankeboy36 --- .gitignore | 1 + README.md | 4 +++- package-lock.json | 20 ++++++++++++-------- package.json | 5 ++++- scripts/generateIconList.js | 13 ++++++++----- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index df34a5706..816160c9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store node_modules /lib/ /test/ diff --git a/README.md b/README.md index a09214db1..bb35b5781 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package-lock.json b/package-lock.json index d27e605ea..f4441760a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@typescript-eslint/eslint-plugin": "^8.29.0", "@typescript-eslint/parser": "^8.29.0", "@vscode-elements/webview-playground": "^1.6.0", - "@vscode/codicons": "^0.0.40", + "@vscode/codicons": "^0.0.42", "@web/dev-server": "^0.4.6", "@web/dev-server-esbuild": "^1.0.4", "@web/dev-server-legacy": "^2.1.1", @@ -60,6 +60,9 @@ "ts-lit-plugin": "^2.0.2", "typescript": "^5.8.2", "wireit": "^0.14.11" + }, + "peerDependencies": { + "@vscode/codicons": ">=0.0.40" } }, "node_modules/@awmottaz/prettier-plugin-void-html": { @@ -4056,10 +4059,11 @@ "dev": true }, "node_modules/@vscode/codicons": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.40.tgz", - "integrity": "sha512-R8sEDXthD86JHsk3xERrMcTN6sMovbk1AXYB5/tGoEYCE8DWwya6al5VLrAmQYXC1bQhUHIfHALj8ijQUs11cQ==", - "dev": true + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.42.tgz", + "integrity": "sha512-PlWPUA32rdiJE6250ltFGMzM3GyC1L9OaryDGOpxiMU0H9lBtEJrSFxpRvefdgJuQRcyUenGFTYzFuFbR9qzjg==", + "dev": true, + "license": "CC-BY-4.0" }, "node_modules/@vscode/web-custom-data": { "version": "0.4.8", @@ -16160,9 +16164,9 @@ "dev": true }, "@vscode/codicons": { - "version": "0.0.40", - "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.40.tgz", - "integrity": "sha512-R8sEDXthD86JHsk3xERrMcTN6sMovbk1AXYB5/tGoEYCE8DWwya6al5VLrAmQYXC1bQhUHIfHALj8ijQUs11cQ==", + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.42.tgz", + "integrity": "sha512-PlWPUA32rdiJE6250ltFGMzM3GyC1L9OaryDGOpxiMU0H9lBtEJrSFxpRvefdgJuQRcyUenGFTYzFuFbR9qzjg==", "dev": true }, "@vscode/web-custom-data": { diff --git a/package.json b/package.json index cc70fff99..03b110d03 100644 --- a/package.json +++ b/package.json @@ -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": "^1.8.0", "@bendera/wds-plugin-directory-index": "^0.5.0", @@ -152,7 +155,7 @@ "@typescript-eslint/eslint-plugin": "^8.29.0", "@typescript-eslint/parser": "^8.29.0", "@vscode-elements/webview-playground": "^1.6.0", - "@vscode/codicons": "^0.0.40", + "@vscode/codicons": "^0.0.42", "@web/dev-server": "^0.4.6", "@web/dev-server-esbuild": "^1.0.4", "@web/dev-server-legacy": "^2.1.1", diff --git a/scripts/generateIconList.js b/scripts/generateIconList.js index 690183b80..26ccd9155 100644 --- a/scripts/generateIconList.js +++ b/scripts/generateIconList.js @@ -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) => ``) + .join('\n'); + const formatted = await prettier.format(raw, {parser: 'html'}); - keys.forEach((k) => { - // eslint-disable-next-line no-undef - console.log(``); - }); + // eslint-disable-next-line no-undef + console.log(formatted); } );