Skip to content

Commit

Permalink
Use product icons instead of 'hardcoded' icons
Browse files Browse the repository at this point in the history
- Add a tool that creates product icon fonts
- Add a product icon font of the icons in the repo
- Remove redundant icons that are already part of codicons
  • Loading branch information
DeltaRazero committed Oct 16, 2024
1 parent 25b0559 commit 628ae1e
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 7 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,42 +90,42 @@
"cmake-tools-build": {
"description": "CMake build icon",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E001"
}
},
"cmake-tools-clean-configure": {
"description": "CMake clean configure icon",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E002"
}
},
"cmake-tools-clean": {
"description": "CMake clean icon",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E003"
}
},
"cmake-tools-cmake-view-1": {
"description": "CMake view icon 1",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E004"
}
},
"cmake-tools-cmake-view-2": {
"description": "CMake view icon 2",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E005"
}
},
"cmake-tools-configure": {
"description": "CMake configure icon",
"default": {
"fontPath": "./res/product-icons.woff",
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E006"
}
}
Expand Down Expand Up @@ -3717,7 +3717,8 @@
"extensionTestsSuccessfulBuild": "yarn run pretest && node ./out/test/extension-tests/successful-build/runTest.js",
"extensionTestsSingleRoot": "yarn run pretest && node ./out/test/extension-tests/single-root-UI/runTest.js",
"extensionTestsMultiRoot": "yarn run pretest && node ./out/test/extension-tests/multi-root-UI/runTest.js",
"backendTests": "node ./node_modules/mocha/bin/_mocha -u tdd --timeout 999999 --colors -r ts-node/register -r tsconfig-paths/register ./test/backend-unit-tests/**/*.test.ts"
"backendTests": "node ./node_modules/mocha/bin/_mocha -u tdd --timeout 999999 --colors -r ts-node/register -r tsconfig-paths/register ./test/backend-unit-tests/**/*.test.ts",
"build-product-icon-font": "yarn --cwd ./tools/product-icon-font-generator/ install && yarn --cwd ./tools/product-icon-font-generator/ build && node ./tools/product-icon-font-generator/dist/index.js --source-directory ./res/product-icons/ --output-directory ./res/ --woff2"
},
"devDependencies": {
"@octokit/rest": "^18.1.1",
Expand Down
Binary file removed res/product-icons.woff
Binary file not shown.
Binary file added res/product-icons.woff2
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
159 changes: 159 additions & 0 deletions tools/product-icon-font-generator/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint",
"eslint-plugin-jsdoc",
"@typescript-eslint/eslint-plugin-tslint",
"eslint-plugin-import",
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"camelcase": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": ["PascalCase"]
}
],
"@typescript-eslint/indent": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
//"@typescript-eslint/no-namespace": "error",
//"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
//"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/semi": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
//"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/await-thenable": "error",
"arrow-body-style": "error",
"brace-style": "error",
"comma-dangle": "error",
"constructor-super": "error",
"curly": "error",
"eol-last": "error",
"eqeqeq": [
"error",
"always"
],
//"import/no-default-export": "error",
"import/no-unassigned-import": "error",
"jsdoc/no-types": "error",
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
//"no-debugger": "error",
"no-duplicate-case": "error",
//"no-duplicate-imports": "error",
"no-eval": "error",
"no-fallthrough": "error",
//"no-invalid-this": "error",
"no-irregular-whitespace": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-sparse-arrays": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-var": "error",
"one-var": [
"error",
"never"
],
"prefer-const": "error",
"prefer-object-spread": "error",
"space-in-parens": [
"error",
"never"
],
/*"spaced-comment": [
"error",
"always"
],*/
"use-isnan": "error",
"valid-typeof": "error",
"yoda": "error",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"encoding": true,
/*"file-header": [
true,
".*"
],*/
"import-spacing": true,
"match-default-export-name": true,
"no-boolean-literal-compare": true,
"no-mergeable-namespace": true,
"no-reference-import": true,
"no-unnecessary-callback-wrapper": false,
"number-literal-format": true,
"one-line": [
true,
"check-catch",
"check-finally",
"check-else",
"check-open-brace",
"check-whitespace"
],
"prefer-method-signature": true,
"prefer-while": true,
/*"typedef": [
true,
"variable-declaration",
"call-signature",
"variable-declaration-ignore-function"
],*/
"whitespace": [
true,
"check-branch",
"check-operator",
"check-separator",
"check-preblock",
"check-type"
]
}
}
]
}
};
24 changes: 24 additions & 0 deletions tools/product-icon-font-generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "product-icon-font-generator",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "tsc -p ./",
"clean": "rimraf ./dist",
"lint": "eslint src --ext ts --max-warnings 0"
},
"dependencies": {
"fontagon": "^1.1.1",
"ttf2woff2": "^6"
},
"devDependencies": {
"@types/fontagon": "^1.1.4",
"@types/node": "^20.13",
"commander": "^12.0.0",
"eslint": "^8.25.0",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.0"
}
}
Loading

0 comments on commit 628ae1e

Please sign in to comment.