From 9dfe4a1791b95b648c149eb39b8a14ee56fff6a7 Mon Sep 17 00:00:00 2001 From: PKief Date: Tue, 29 Sep 2020 13:03:58 +0200 Subject: [PATCH] Prettifiy source code --- .eslintrc.js | 76 - .eslintrc.json | 45 + .github/FUNDING.yml | 2 +- .github/workflows/build.yml | 2 +- .prettierrc | 6 + .travis.yml | 2 +- CONTRIBUTING.md | 26 +- LICENSE.md | 2 +- appveyor.yml | 2 +- package-lock.json | 15 + package.json | 3 +- package.nls.de.json | 68 +- package.nls.es.json | 62 +- package.nls.fr.json | 62 +- package.nls.json | 68 +- package.nls.nl.json | 68 +- package.nls.pl.json | 66 +- package.nls.pt-BR.json | 62 +- package.nls.pt-PT.json | 62 +- package.nls.ru.json | 62 +- package.nls.zh-CN.json | 62 +- src/commands/activate.ts | 27 +- src/commands/explorerArrows.ts | 66 +- src/commands/folderColor.ts | 108 +- src/commands/folders.ts | 52 +- src/commands/grayscale.ts | 67 +- src/commands/iconPacks.ts | 79 +- src/commands/index.ts | 27 +- src/commands/opacity.ts | 46 +- src/commands/restoreConfig.ts | 18 +- src/commands/saturation.ts | 46 +- src/extension.ts | 29 +- src/helpers/changeDetection.ts | 66 +- src/helpers/customIcons.ts | 6 +- src/helpers/fileConfig.ts | 44 +- src/helpers/index.ts | 73 +- src/helpers/objects.ts | 65 +- src/helpers/versioning.ts | 58 +- src/i18n/index.ts | 61 +- src/i18n/lang-de.ts | 96 +- src/i18n/lang-en.ts | 95 +- src/i18n/lang-es.ts | 77 +- src/i18n/lang-fr.ts | 77 +- src/i18n/lang-nl.ts | 96 +- src/i18n/lang-pl.ts | 94 +- src/i18n/lang-pt-br.ts | 77 +- src/i18n/lang-pt-pt.ts | 77 +- src/i18n/lang-ru.ts | 76 +- src/i18n/lang-uk.ts | 38 +- src/i18n/lang-zh-cn.ts | 76 +- src/icons/fileIcons.ts | 2235 ++++++++++------- src/icons/folderIcons.ts | 768 ++++-- src/icons/generator/fileGenerator.ts | 244 +- src/icons/generator/folderGenerator.ts | 383 ++- src/icons/generator/iconOpacity.ts | 123 +- src/icons/generator/iconSaturation.ts | 151 +- src/icons/generator/jsonGenerator.ts | 217 +- src/icons/generator/languageGenerator.ts | 126 +- src/icons/languageIcons.ts | 219 +- src/messages/outdated.ts | 36 +- src/messages/reload.ts | 34 +- src/messages/start.ts | 11 +- src/messages/update.ts | 50 +- src/messages/welcome.ts | 49 +- src/models/i18n/translation.ts | 94 +- src/models/iconConfiguration.ts | 64 +- src/models/icons/defaultIcon.ts | 24 +- src/models/icons/files/fileIcon.ts | 60 +- src/models/icons/files/fileTypes.ts | 16 +- src/models/icons/folders/folderIcon.ts | 50 +- src/models/icons/folders/folderTheme.ts | 32 +- src/models/icons/iconJsonOptions.ts | 36 +- src/models/icons/iconPack.ts | 14 +- .../icons/languages/languageIdentifier.ts | 38 +- .../scripts/contributors/contributor.ts | 38 +- .../contributors/contributorsConfig.ts | 12 +- src/scripts/contributors/contributors.css | 28 +- src/scripts/contributors/index.ts | 190 +- src/scripts/helpers/screenshots.ts | 38 +- src/scripts/helpers/similarity.ts | 66 +- src/scripts/helpers/titleCase.ts | 5 +- .../icons/checks/checkIconAvailability.ts | 223 +- .../icons/checks/checkIconConflicts.ts | 196 +- src/scripts/icons/checks/checkIconUsage.ts | 159 +- src/scripts/icons/generateJson.ts | 4 +- src/scripts/preview/index.ts | 34 +- src/scripts/preview/preview.ts | 125 +- src/scripts/preview/style.css | 47 +- src/test/runTest.ts | 26 +- src/test/spec/i18n/i18n.spec.ts | 58 +- src/test/spec/icons/fileIcons.spec.ts | 431 ++-- src/test/spec/icons/folderIcons.spec.ts | 742 +++--- src/test/spec/icons/languageIcons.spec.ts | 306 ++- src/test/spec/index.ts | 48 +- tsconfig.json | 35 +- webpack.config.js | 60 +- 96 files changed, 5997 insertions(+), 4588 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json create mode 100644 .prettierrc diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index d6fdb1104e..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,76 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - ], - "rules": { - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "variable", - "format": ["camelCase"] - } - ], - "@typescript-eslint/indent": "error", - "@typescript-eslint/member-delimiter-style": [ - "error", - { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/quotes": [ - "error", - "single" - ], - "@typescript-eslint/semi": [ - "error", - "always" - ], - "@typescript-eslint/type-annotation-spacing": "error", - "camelcase": "error", - "eol-last": "error", - "prefer-const": "error", - "eqeqeq": [ - "error", - "smart" - ], - "id-blacklist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - ], - "id-match": "error", - "no-eval": "error", - "no-trailing-spaces": "error", - "no-underscore-dangle": "error", - "no-unsafe-finally": "error", - "no-var": "error", - "spaced-comment": "error", - "comma-spacing": "error", - "array-bracket-spacing": ["error", "never"], - "prefer-arrow-callback": "error" - } -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000..ae0f090fe5 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,45 @@ +{ + "extends": ["prettier"], + "env": { + "browser": true, + "es6": true, + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "rules": { + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "format": ["camelCase"] + } + ], + "@typescript-eslint/prefer-namespace-keyword": "error", + "no-trailing-spaces": "error", + "camelcase": "error", + "prefer-const": "error", + "eqeqeq": ["error", "smart"], + "id-blacklist": [ + "error", + "any", + "Number", + "number", + "String", + "string", + "Boolean", + "boolean", + "Undefined" + ], + "id-match": "error", + "no-eval": "error", + "no-underscore-dangle": "error", + "no-unsafe-finally": "error", + "no-var": "error", + "spaced-comment": "error" + } +} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 9ba5422ca4..7a13ec2728 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -custom: ["https://paypal.me/philippkief"] +custom: ['https://paypal.me/philippkief'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbd05555b8..93981afe2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,4 +41,4 @@ jobs: npm test npm run vscode:prepublish env: - DISPLAY: ":99.0" + DISPLAY: ':99.0' diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..0a725205c8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true +} diff --git a/.travis.yml b/.travis.yml index 98b0ea6cef..4fd8844d81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ install: cache: directories: - - "node_modules" + - 'node_modules' script: - npm test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb0d0694c9..c6026d4f37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,44 +4,52 @@ - [Create issues](#create-issues) - [Add new icons](#add-new-icons) - - [Icon color](#icon-color) - - [Free software to create/edit SVG icons](#free-software-to-createedit-svg-icons) - - [Use icons from here](#use-icons-from-here) + - [Icon color](#icon-color) + - [Free software to create/edit SVG icons](#free-software-to-createedit-svg-icons) + - [Use icons from here](#use-icons-from-here) - [Add translations](#add-translations) - [Update API](#update-api) ## Create issues + You need an icon for a specific file ending? No problem, just follow these guidelines: + - describe the file ending (e.g. '.xml') and the language (e.g. XML) - show an example image of the icon or link to official website ## Add new icons + 1. Create icon as SVG 2. Copy icon to `icons`-folder 3. Edit the icon configuration files under `src/icons` folder: - - fileIcons.ts - - folderIcons.ts - - languageIcons.ts + - fileIcons.ts + - folderIcons.ts + - languageIcons.ts ### Icon color + Choose your icon colors from the [material design colors](https://material.google.com/style/color.html#color-color-palette). ### Free software to create/edit SVG icons + - [Inkscape](https://inkscape.org/en/) ### Use icons from here + - [Material Design Icons](https://materialdesignicons.com/) - - download them as SVG and edit the icons e.g. with Inkscape -- you can use any other source **as long as the icons are free to use!** This icon theme is absolutely non-commercial, but you should always check the license of your sources! + - download them as SVG and edit the icons e.g. with Inkscape +- you can use any other source **as long as the icons are free to use!** This icon theme is absolutely non-commercial, but you should always check the license of your sources! ## Add translations + - Create or edit the translations in the `src/i18n` directory. - Create or edit the `package.nls.*.json` files in the root folder ## Update API + 1. Install node dependencies with `npm install` 2. Open project with VS Code 3. Press `F5` or run `Launch Extension` in the debug window -4. Run tests with `Launch Tests` \ No newline at end of file +4. Run tests with `Launch Tests` diff --git a/LICENSE.md b/LICENSE.md index 31a85bc626..5d178d2688 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -5,4 +5,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/appveyor.yml b/appveyor.yml index e33a9755ef..caa16f17aa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,4 +17,4 @@ build: off test_script: - node --version - npm --version - - npm test \ No newline at end of file + - npm test diff --git a/package-lock.json b/package-lock.json index 0c39fc5793..936c05fa71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1841,6 +1841,15 @@ } } }, + "eslint-config-prettier": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", + "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, "eslint-scope": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", @@ -2625,6 +2634,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", diff --git a/package.json b/package.json index 13cfd0da25..a699774514 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "compile:watch": "webpack --mode none --watch", "contributors": "ts-node ./src/scripts/contributors/index.ts", "generateJson": "ts-node ./src/scripts/icons/generateJson.ts", - "lint": "eslint -c .eslintrc.js --ext .ts ./src/**/*.ts", + "lint": "eslint -c .eslintrc.json --ext .ts ./src/**/*.ts", "postcompile": "npm run generateJson && npm run check", "pretest": "npm run build && tsc -p ./", "preview": "ts-node ./src/scripts/preview", @@ -216,6 +216,7 @@ "@typescript-eslint/parser": "^4.1.0", "clean-webpack-plugin": "^3.0.0", "eslint": "^7.8.1", + "eslint-config-prettier": "^6.12.0", "glob": "^7.1.6", "mocha": "^8.1.3", "puppeteer": "^5.2.1", diff --git a/package.nls.de.json b/package.nls.de.json index 4a9b1c88d7..a5c25d2b0c 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -1,35 +1,35 @@ { - "command.activateIcons": "Material Icons: Icon Theme aktivieren", - "command.toggleIconPacks": "Material Icons: Icon Packs konfigurieren", - "command.changeFolderTheme": "Material Icons: Ordner Thema auswählen", - "command.changeFolderColor": "Material Icons: Ordner Farbe ändern", - "command.restoreDefaultConfig": "Material Icons: Standard Einstellungen wiederherstellen", - "command.toggleExplorerArrows": "Material Icons: Explorer Pfeilsymbole umschalten", - "command.changeOpacity": "Material Icons: Deckkraft verändern", - "command.toggleGrayscale": "Material Icons: Graustufen umschalten", - "command.changeSaturation": "Material Icons: Sättigung verändern", - "configuration.title": "Material Icons", - "configuration.files.associations": "Benutzerdefinierte Datei Icons konfigurieren.", - "configuration.folders.associations": "Benutzerdefinierte Ordner Icons konfigurieren.", - "configuration.languages.associations": "Benutzerdefinierte Language Icons konfigurieren.", - "configuration.showWelcomeMessage": "Willkommensnachricht nach der ersten Installation anzeigen.", - "configuration.showUpdateMessage": "Nachricht bei Aktualisierungen anzeigen.", - "configuration.showReloadMessage": "Nachricht zum Neustarten anzeigen.", - "configuration.activeIconPack": "Icon-Pack auswählen, die bestimme Icons aktivieren.", - "configuration.activeIconPack.angular": "Icons für Angular", - "configuration.activeIconPack.angular_ngrx": "Icons für Angular und Ngrx", - "configuration.activeIconPack.react": "Icons für React", - "configuration.activeIconPack.react_redux": "Icons für React und Redux", - "configuration.activeIconPack.vue": "Icons für Vue.", - "configuration.activeIconPack.vue_vuex": "Icons für Vue und Vuex.", - "configuration.activeIconPack.nest": "Icons für NestJS.", - "configuration.activeIconPack.none": "Kein Icon-Pack aktiviert.", - "configuration.folders.theme": "Art der Ordner Icons auswählen.", - "configuration.folders.theme.specific": "Spezifische Ordner Icons auswählen.", - "configuration.folders.theme.classic": "Klassische Ordner Icons auswählen.", - "configuration.folders.theme.none": "Keine Ordner Icons.", - "configuration.folders.color": "Farbe der Ordner Icons verändern.", - "configuration.hidesExplorerArrows": "Pfeile vor den Ordnern deaktivieren.", - "configuration.opacity": "Deckkraft der Icons anpassen.", - "configuration.saturation": "Sättigung der Icons anpassen." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Icon Theme aktivieren", + "command.toggleIconPacks": "Material Icons: Icon Packs konfigurieren", + "command.changeFolderTheme": "Material Icons: Ordner Thema auswählen", + "command.changeFolderColor": "Material Icons: Ordner Farbe ändern", + "command.restoreDefaultConfig": "Material Icons: Standard Einstellungen wiederherstellen", + "command.toggleExplorerArrows": "Material Icons: Explorer Pfeilsymbole umschalten", + "command.changeOpacity": "Material Icons: Deckkraft verändern", + "command.toggleGrayscale": "Material Icons: Graustufen umschalten", + "command.changeSaturation": "Material Icons: Sättigung verändern", + "configuration.title": "Material Icons", + "configuration.files.associations": "Benutzerdefinierte Datei Icons konfigurieren.", + "configuration.folders.associations": "Benutzerdefinierte Ordner Icons konfigurieren.", + "configuration.languages.associations": "Benutzerdefinierte Language Icons konfigurieren.", + "configuration.showWelcomeMessage": "Willkommensnachricht nach der ersten Installation anzeigen.", + "configuration.showUpdateMessage": "Nachricht bei Aktualisierungen anzeigen.", + "configuration.showReloadMessage": "Nachricht zum Neustarten anzeigen.", + "configuration.activeIconPack": "Icon-Pack auswählen, die bestimme Icons aktivieren.", + "configuration.activeIconPack.angular": "Icons für Angular", + "configuration.activeIconPack.angular_ngrx": "Icons für Angular und Ngrx", + "configuration.activeIconPack.react": "Icons für React", + "configuration.activeIconPack.react_redux": "Icons für React und Redux", + "configuration.activeIconPack.vue": "Icons für Vue.", + "configuration.activeIconPack.vue_vuex": "Icons für Vue und Vuex.", + "configuration.activeIconPack.nest": "Icons für NestJS.", + "configuration.activeIconPack.none": "Kein Icon-Pack aktiviert.", + "configuration.folders.theme": "Art der Ordner Icons auswählen.", + "configuration.folders.theme.specific": "Spezifische Ordner Icons auswählen.", + "configuration.folders.theme.classic": "Klassische Ordner Icons auswählen.", + "configuration.folders.theme.none": "Keine Ordner Icons.", + "configuration.folders.color": "Farbe der Ordner Icons verändern.", + "configuration.hidesExplorerArrows": "Pfeile vor den Ordnern deaktivieren.", + "configuration.opacity": "Deckkraft der Icons anpassen.", + "configuration.saturation": "Sättigung der Icons anpassen." +} diff --git a/package.nls.es.json b/package.nls.es.json index 6e85b5e186..dec6d4274f 100644 --- a/package.nls.es.json +++ b/package.nls.es.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icon Theme: Activar los iconos", - "command.toggleIconPacks": "Material Icons: Configurar paquetes de iconos", - "command.changeFolderTheme": "Material Icons: Personalizar iconos de carpetas", - "command.changeFolderColor": "Material Icons: Cambiar color de carpeta", - "command.restoreDefaultConfig": "Material Icons: Restaurar la configuración predeterminada", - "command.toggleExplorerArrows": "Material Icons: Deshabilitar flechas delante de carpetas", - "command.changeOpacity": "Material Icons: Cambiar la opacidad", - "configuration.title": "Material Icons", - "configuration.files.associations": "Configurar asociaciones personalizadas de iconos de archivos.", - "configuration.folders.associations": "Configurar asociaciones personalizadas de iconos de carpetas.", - "configuration.languages.associations": "Configurar asociaciones personalizadas de iconos de idioma.", - "configuration.showWelcomeMessage": "Mostrar mensaje de bienvenida después de la primera instalación.", - "configuration.showUpdateMessage": "Mostrar mensaje al actualizar.", - "configuration.showReloadMessage": "Mostrar mensaje de reinicio.", - "configuration.activeIconPack": "Seleccione un paquete de iconos que permita iconos específicos.", - "configuration.activeIconPack.angular": "Iconos de Angular.", - "configuration.activeIconPack.angular_ngrx": "Iconos de Angular y ngrx.", - "configuration.activeIconPack.react": "Iconos de React.", - "configuration.activeIconPack.react_redux": "Iconos de React y Redux.", - "configuration.activeIconPack.vue": "Iconos de Vue.", - "configuration.activeIconPack.vue_vuex": "Iconos de Vue y Vuex.", - "configuration.activeIconPack.nest": "Iconos de NestJS.", - "configuration.activeIconPack.none": "No hay ningún paquete de iconos activo.", - "configuration.folders.theme": "Seleccione el tipo de iconos de carpeta.", - "configuration.folders.theme.specific": "Seleccione iconos de carpeta específicos.", - "configuration.folders.theme.classic": "Seleccione iconos de carpetas clásicas.", - "configuration.folders.theme.none": "Sin iconos de carpeta.", - "configuration.folders.color": "Cambia el color de las carpetas.", - "configuration.hidesExplorerArrows": "Deshabilitar flechas delante de carpetas.", - "configuration.opacity": "Cambia la opacidad de los iconos." -} \ No newline at end of file + "command.activateIcons": "Material Icon Theme: Activar los iconos", + "command.toggleIconPacks": "Material Icons: Configurar paquetes de iconos", + "command.changeFolderTheme": "Material Icons: Personalizar iconos de carpetas", + "command.changeFolderColor": "Material Icons: Cambiar color de carpeta", + "command.restoreDefaultConfig": "Material Icons: Restaurar la configuración predeterminada", + "command.toggleExplorerArrows": "Material Icons: Deshabilitar flechas delante de carpetas", + "command.changeOpacity": "Material Icons: Cambiar la opacidad", + "configuration.title": "Material Icons", + "configuration.files.associations": "Configurar asociaciones personalizadas de iconos de archivos.", + "configuration.folders.associations": "Configurar asociaciones personalizadas de iconos de carpetas.", + "configuration.languages.associations": "Configurar asociaciones personalizadas de iconos de idioma.", + "configuration.showWelcomeMessage": "Mostrar mensaje de bienvenida después de la primera instalación.", + "configuration.showUpdateMessage": "Mostrar mensaje al actualizar.", + "configuration.showReloadMessage": "Mostrar mensaje de reinicio.", + "configuration.activeIconPack": "Seleccione un paquete de iconos que permita iconos específicos.", + "configuration.activeIconPack.angular": "Iconos de Angular.", + "configuration.activeIconPack.angular_ngrx": "Iconos de Angular y ngrx.", + "configuration.activeIconPack.react": "Iconos de React.", + "configuration.activeIconPack.react_redux": "Iconos de React y Redux.", + "configuration.activeIconPack.vue": "Iconos de Vue.", + "configuration.activeIconPack.vue_vuex": "Iconos de Vue y Vuex.", + "configuration.activeIconPack.nest": "Iconos de NestJS.", + "configuration.activeIconPack.none": "No hay ningún paquete de iconos activo.", + "configuration.folders.theme": "Seleccione el tipo de iconos de carpeta.", + "configuration.folders.theme.specific": "Seleccione iconos de carpeta específicos.", + "configuration.folders.theme.classic": "Seleccione iconos de carpetas clásicas.", + "configuration.folders.theme.none": "Sin iconos de carpeta.", + "configuration.folders.color": "Cambia el color de las carpetas.", + "configuration.hidesExplorerArrows": "Deshabilitar flechas delante de carpetas.", + "configuration.opacity": "Cambia la opacidad de los iconos." +} diff --git a/package.nls.fr.json b/package.nls.fr.json index bf9bdf4ae9..48ef15d7e7 100644 --- a/package.nls.fr.json +++ b/package.nls.fr.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icons: Activer les icônes", - "command.toggleIconPacks": "Material Icons: Configurer les Packs d'icônes", - "command.changeFolderTheme": "Material Icons: Changer le thème du dossier", - "command.restoreDefaultConfig": "Material Icons: Restaurer le paramètre par défaut", - "command.toggleExplorerArrows": "Material Icons: Configurer les flèches devant les dossiers", - "command.changeFolderColor": "Material Icons: Changer la couleur du dossier", - "command.changeOpacity": "Material Icons: Changer l'opacité", - "configuration.title": "Material Icons", - "configuration.files.associations": "Configurer des associations d'icônes de fichiers personnalisés.", - "configuration.folders.associations": "Configurer des associations d'icônes de dossier personnalisées.", - "configuration.languages.associations": "Configurer des associations d'icônes de langue personnalisées.", - "configuration.showWelcomeMessage": "Afficher le message de bienvenue après l'installation initiale", - "configuration.showUpdateMessage": "Afficher le message de mise à jour.", - "configuration.showReloadMessage": "Afficher le message de redémarrage.", - "configuration.activeIconPack": "Sélectionner un pack d'icônes qui active des icônes spécifiques.", - "configuration.activeIconPack.angular": "Icônes pour Angular.", - "configuration.activeIconPack.angular_ngrx": "Icônes pour Angular et ngrx.", - "configuration.activeIconPack.react": "Icônes pour React.", - "configuration.activeIconPack.react_redux": "Icônes pour React et Redux.", - "configuration.activeIconPack.vue": "Icônes pour Vue.", - "configuration.activeIconPack.vue_vuex": "Icônes pour Vue et Vuex.", - "configuration.activeIconPack.nest": "Icônes pour NestJS.", - "configuration.activeIconPack.none": "Aucun pack d'icônes n'est actif.", - "configuration.folders.theme": "Sélectionner le type d'icônes de dossier.", - "configuration.folders.theme.specific": "Sélectionner des icônes de dossiers spécifiques.", - "configuration.folders.theme.classic": "Sélectionner les icônes des dossiers classiques.", - "configuration.folders.theme.none": "Pas d'icônes de dossier.", - "configuration.folders.color": "Changer la couleur des icônes du dossier.", - "configuration.hidesExplorerArrows": "Désactiver les flèches devant les dossiers.", - "configuration.opacity": "Ajuster l'opacité des icônes." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Activer les icônes", + "command.toggleIconPacks": "Material Icons: Configurer les Packs d'icônes", + "command.changeFolderTheme": "Material Icons: Changer le thème du dossier", + "command.restoreDefaultConfig": "Material Icons: Restaurer le paramètre par défaut", + "command.toggleExplorerArrows": "Material Icons: Configurer les flèches devant les dossiers", + "command.changeFolderColor": "Material Icons: Changer la couleur du dossier", + "command.changeOpacity": "Material Icons: Changer l'opacité", + "configuration.title": "Material Icons", + "configuration.files.associations": "Configurer des associations d'icônes de fichiers personnalisés.", + "configuration.folders.associations": "Configurer des associations d'icônes de dossier personnalisées.", + "configuration.languages.associations": "Configurer des associations d'icônes de langue personnalisées.", + "configuration.showWelcomeMessage": "Afficher le message de bienvenue après l'installation initiale", + "configuration.showUpdateMessage": "Afficher le message de mise à jour.", + "configuration.showReloadMessage": "Afficher le message de redémarrage.", + "configuration.activeIconPack": "Sélectionner un pack d'icônes qui active des icônes spécifiques.", + "configuration.activeIconPack.angular": "Icônes pour Angular.", + "configuration.activeIconPack.angular_ngrx": "Icônes pour Angular et ngrx.", + "configuration.activeIconPack.react": "Icônes pour React.", + "configuration.activeIconPack.react_redux": "Icônes pour React et Redux.", + "configuration.activeIconPack.vue": "Icônes pour Vue.", + "configuration.activeIconPack.vue_vuex": "Icônes pour Vue et Vuex.", + "configuration.activeIconPack.nest": "Icônes pour NestJS.", + "configuration.activeIconPack.none": "Aucun pack d'icônes n'est actif.", + "configuration.folders.theme": "Sélectionner le type d'icônes de dossier.", + "configuration.folders.theme.specific": "Sélectionner des icônes de dossiers spécifiques.", + "configuration.folders.theme.classic": "Sélectionner les icônes des dossiers classiques.", + "configuration.folders.theme.none": "Pas d'icônes de dossier.", + "configuration.folders.color": "Changer la couleur des icônes du dossier.", + "configuration.hidesExplorerArrows": "Désactiver les flèches devant les dossiers.", + "configuration.opacity": "Ajuster l'opacité des icônes." +} diff --git a/package.nls.json b/package.nls.json index b961373e42..88ad8e1bac 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,35 +1,35 @@ { - "command.activateIcons": "Material Icons: Activate Icon Theme", - "command.toggleIconPacks": "Material Icons: Configure Icon Packs", - "command.changeFolderTheme": "Material Icons: Change Folder Theme", - "command.changeFolderColor": "Material Icons: Change Folder Color", - "command.restoreDefaultConfig": "Material Icons: Restore Default Configuration", - "command.toggleExplorerArrows": "Material Icons: Toggle Explorer Arrows", - "command.changeOpacity": "Material Icons: Change Opacity", - "command.toggleGrayscale": "Material Icons: Toggle Grayscale", - "command.changeSaturation": "Material Icons: Change Saturation", - "configuration.title": "Material Icons", - "configuration.files.associations": "Set custom file icon associations.", - "configuration.folders.associations": "Set custom folder icon associations.", - "configuration.languages.associations": "Set custom language icon associations.", - "configuration.showWelcomeMessage": "Show the welcome message after first installation.", - "configuration.showUpdateMessage": "Show the update message after each update.", - "configuration.showReloadMessage": "Show restart notification.", - "configuration.activeIconPack": "Select an icon pack that enables specific icons.", - "configuration.activeIconPack.angular": "Icons for Angular.", - "configuration.activeIconPack.angular_ngrx": "Icons for Angular and ngrx.", - "configuration.activeIconPack.react": "Icons for React.", - "configuration.activeIconPack.react_redux": "Icons for React and Redux.", - "configuration.activeIconPack.vue": "Icons for Vue.", - "configuration.activeIconPack.vue_vuex": "Icons for Vue and Vuex.", - "configuration.activeIconPack.nest": "Icons for NestJS.", - "configuration.activeIconPack.none": "No icon pack enabled.", - "configuration.folders.theme": "Set the type for the folder icons.", - "configuration.folders.theme.specific": "Select specific folder icons.", - "configuration.folders.theme.classic": "Select classic folder icons.", - "configuration.folders.theme.none": "No folder icons.", - "configuration.folders.color": "Change the color of the folder icons.", - "configuration.hidesExplorerArrows": "Hide explorer arrows before folder.", - "configuration.opacity": "Change the opacity of the icons.", - "configuration.saturation": "Change the saturation of the icons." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Activate Icon Theme", + "command.toggleIconPacks": "Material Icons: Configure Icon Packs", + "command.changeFolderTheme": "Material Icons: Change Folder Theme", + "command.changeFolderColor": "Material Icons: Change Folder Color", + "command.restoreDefaultConfig": "Material Icons: Restore Default Configuration", + "command.toggleExplorerArrows": "Material Icons: Toggle Explorer Arrows", + "command.changeOpacity": "Material Icons: Change Opacity", + "command.toggleGrayscale": "Material Icons: Toggle Grayscale", + "command.changeSaturation": "Material Icons: Change Saturation", + "configuration.title": "Material Icons", + "configuration.files.associations": "Set custom file icon associations.", + "configuration.folders.associations": "Set custom folder icon associations.", + "configuration.languages.associations": "Set custom language icon associations.", + "configuration.showWelcomeMessage": "Show the welcome message after first installation.", + "configuration.showUpdateMessage": "Show the update message after each update.", + "configuration.showReloadMessage": "Show restart notification.", + "configuration.activeIconPack": "Select an icon pack that enables specific icons.", + "configuration.activeIconPack.angular": "Icons for Angular.", + "configuration.activeIconPack.angular_ngrx": "Icons for Angular and ngrx.", + "configuration.activeIconPack.react": "Icons for React.", + "configuration.activeIconPack.react_redux": "Icons for React and Redux.", + "configuration.activeIconPack.vue": "Icons for Vue.", + "configuration.activeIconPack.vue_vuex": "Icons for Vue and Vuex.", + "configuration.activeIconPack.nest": "Icons for NestJS.", + "configuration.activeIconPack.none": "No icon pack enabled.", + "configuration.folders.theme": "Set the type for the folder icons.", + "configuration.folders.theme.specific": "Select specific folder icons.", + "configuration.folders.theme.classic": "Select classic folder icons.", + "configuration.folders.theme.none": "No folder icons.", + "configuration.folders.color": "Change the color of the folder icons.", + "configuration.hidesExplorerArrows": "Hide explorer arrows before folder.", + "configuration.opacity": "Change the opacity of the icons.", + "configuration.saturation": "Change the saturation of the icons." +} diff --git a/package.nls.nl.json b/package.nls.nl.json index 79301b48f7..2f26c262cc 100644 --- a/package.nls.nl.json +++ b/package.nls.nl.json @@ -1,35 +1,35 @@ { - "command.activateIcons": "Material Icons: Activeer Icon Thema", - "command.toggleIconPacks": "Material Icons: Configureer Icon Packs", - "command.changeFolderTheme": "Material Icons: Verander Folder Thema", - "command.changeFolderColor": "Material Icons: Verander Folder Kleur", - "command.restoreDefaultConfig": "Material Icons: Zet Standaard Configuratie Terug", - "command.toggleExplorerArrows": "Material Icons: Configureer Folder Pijlen", - "command.changeOpacity": "Material Icons: Verander Doorzichtbaarheid", - "command.toggleGrayscale": "Material Icons: Zet Grijstinten Aan Of Uit", - "command.changeSaturation": "Material Icons: Verander Saturatie", - "configuration.title": "Material Icons", - "configuration.files.associations": "Stel eigen bestandsiconen in.", - "configuration.folders.associations": "Stel eigen foldericonen in.", - "configuration.languages.associations": "Stel eigen taaliconen in.", - "configuration.showWelcomeMessage": "Laat het welkomstbericht zien na de eerste installatie.", - "configuration.showUpdateMessage": "Laat het updatebericht zien na elke update.", - "configuration.showReloadMessage": "Laat de herstartnotificatie zien.", - "configuration.activeIconPack": "Selecteer een iconpakket dat bepaalde icons inschakelt.", - "configuration.activeIconPack.angular": "Icons voor Angular.", - "configuration.activeIconPack.angular_ngrx": "Icons voor Angular en ngrx.", - "configuration.activeIconPack.react": "Icons voor React.", - "configuration.activeIconPack.react_redux": "Icons for React en Redux.", - "configuration.activeIconPack.vue": "Icons voor Vue.", - "configuration.activeIconPack.vue_vuex": "Icons voor Vue en Vuex.", - "configuration.activeIconPack.nest": "Icons voor NestJS.", - "configuration.activeIconPack.none": "Geen iconpakket ingeschakeld.", - "configuration.folders.theme": "Kies het type foldericons.", - "configuration.folders.theme.specific": "Selecteer bepaalde foldericons.", - "configuration.folders.theme.classic": "Selecteer klassieke foldericons.", - "configuration.folders.theme.none": "Geen foldericons.", - "configuration.folders.color": "Verander de kleur van de foldericons.", - "configuration.hidesExplorerArrows": "Verberg verkenner pijlen voor de folder.", - "configuration.opacity": "Verander de doorzichtbaarheid van de icons.", - "configuration.saturation": "Verander de saturatie van de icons." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Activeer Icon Thema", + "command.toggleIconPacks": "Material Icons: Configureer Icon Packs", + "command.changeFolderTheme": "Material Icons: Verander Folder Thema", + "command.changeFolderColor": "Material Icons: Verander Folder Kleur", + "command.restoreDefaultConfig": "Material Icons: Zet Standaard Configuratie Terug", + "command.toggleExplorerArrows": "Material Icons: Configureer Folder Pijlen", + "command.changeOpacity": "Material Icons: Verander Doorzichtbaarheid", + "command.toggleGrayscale": "Material Icons: Zet Grijstinten Aan Of Uit", + "command.changeSaturation": "Material Icons: Verander Saturatie", + "configuration.title": "Material Icons", + "configuration.files.associations": "Stel eigen bestandsiconen in.", + "configuration.folders.associations": "Stel eigen foldericonen in.", + "configuration.languages.associations": "Stel eigen taaliconen in.", + "configuration.showWelcomeMessage": "Laat het welkomstbericht zien na de eerste installatie.", + "configuration.showUpdateMessage": "Laat het updatebericht zien na elke update.", + "configuration.showReloadMessage": "Laat de herstartnotificatie zien.", + "configuration.activeIconPack": "Selecteer een iconpakket dat bepaalde icons inschakelt.", + "configuration.activeIconPack.angular": "Icons voor Angular.", + "configuration.activeIconPack.angular_ngrx": "Icons voor Angular en ngrx.", + "configuration.activeIconPack.react": "Icons voor React.", + "configuration.activeIconPack.react_redux": "Icons for React en Redux.", + "configuration.activeIconPack.vue": "Icons voor Vue.", + "configuration.activeIconPack.vue_vuex": "Icons voor Vue en Vuex.", + "configuration.activeIconPack.nest": "Icons voor NestJS.", + "configuration.activeIconPack.none": "Geen iconpakket ingeschakeld.", + "configuration.folders.theme": "Kies het type foldericons.", + "configuration.folders.theme.specific": "Selecteer bepaalde foldericons.", + "configuration.folders.theme.classic": "Selecteer klassieke foldericons.", + "configuration.folders.theme.none": "Geen foldericons.", + "configuration.folders.color": "Verander de kleur van de foldericons.", + "configuration.hidesExplorerArrows": "Verberg verkenner pijlen voor de folder.", + "configuration.opacity": "Verander de doorzichtbaarheid van de icons.", + "configuration.saturation": "Verander de saturatie van de icons." +} diff --git a/package.nls.pl.json b/package.nls.pl.json index 72952e3c25..30f7b4a856 100644 --- a/package.nls.pl.json +++ b/package.nls.pl.json @@ -1,35 +1,35 @@ { - "command.activateIcons": "Material Icons: Aktywuj motyw ikon", - "command.toggleIconPacks": "Material Icons: Skonfiguruj paczki ikon", - "command.changeFolderTheme": "Material Icons: Zmień motyw folderów", - "command.changeFolderColor": "Material Icons: Zmień kolor folderów", - "command.restoreDefaultConfig": "Material Icons: Przywróć domyślne ustawienia", - "command.toggleExplorerArrows": "Material Icons: Ukryj strzałki przy folderach", - "command.changeOpacity": "Material Icons: Zmień przezroczystość", - "command.toggleGrayscale": "Material Icons: Przełącz czarno-białe ikony", - "command.changeSaturation": "Material Icons: Zmień nasycenie ikon", - "configuration.title": "Material Icons", - "configuration.files.associations": "Ustaw niestandardowe ikony plików.", - "configuration.folders.associations": "Ustaw niestandardowe ikony folderów.", - "configuration.languages.associations": "Ustaw niestandardowe ikony języków.", - "configuration.showWelcomeMessage": "Wyświetl wiadomość powitalną przy pierwszej instalacji.", - "configuration.showUpdateMessage": "Wyświetl wiadomość po każdej aktualizacji.", - "configuration.showReloadMessage": "Wyświetl wiadomość o restarcie.", - "configuration.activeIconPack": "Wybierz paczkę dla niektórych ikon.", - "configuration.activeIconPack.angular": "Ikony dla Angulara.", - "configuration.activeIconPack.angular_ngrx": "Ikony dla Angulara i ngrx.", - "configuration.activeIconPack.react": "Ikony dla Reacta.", - "configuration.activeIconPack.react_redux": "Ikony dla Reacta i Reduxa.", - "configuration.activeIconPack.vue": "Ikony dla Vue.", - "configuration.activeIconPack.vue_vuex": "Ikony dla Vue i Vuex.", - "configuration.activeIconPack.nest": "Ikony dla NestJS.", - "configuration.activeIconPack.none": "Brak włączonej paczki ikon.", - "configuration.folders.theme": "Wybierz typ ikon folderów.", - "configuration.folders.theme.specific": "Wybierz ikony folderów.", - "configuration.folders.theme.classic": "Wybierz klasyczne ikony folderów.", - "configuration.folders.theme.none": "Brak ikon folderów.", - "configuration.folders.color": "Zmień kolor ikon folderów.", - "configuration.hidesExplorerArrows": "Ukryj strzałki przy folderach.", - "configuration.opacity": "Zmień przezroczystość ikon.", - "configuration.saturation": "Zmień nasycenie ikon." + "command.activateIcons": "Material Icons: Aktywuj motyw ikon", + "command.toggleIconPacks": "Material Icons: Skonfiguruj paczki ikon", + "command.changeFolderTheme": "Material Icons: Zmień motyw folderów", + "command.changeFolderColor": "Material Icons: Zmień kolor folderów", + "command.restoreDefaultConfig": "Material Icons: Przywróć domyślne ustawienia", + "command.toggleExplorerArrows": "Material Icons: Ukryj strzałki przy folderach", + "command.changeOpacity": "Material Icons: Zmień przezroczystość", + "command.toggleGrayscale": "Material Icons: Przełącz czarno-białe ikony", + "command.changeSaturation": "Material Icons: Zmień nasycenie ikon", + "configuration.title": "Material Icons", + "configuration.files.associations": "Ustaw niestandardowe ikony plików.", + "configuration.folders.associations": "Ustaw niestandardowe ikony folderów.", + "configuration.languages.associations": "Ustaw niestandardowe ikony języków.", + "configuration.showWelcomeMessage": "Wyświetl wiadomość powitalną przy pierwszej instalacji.", + "configuration.showUpdateMessage": "Wyświetl wiadomość po każdej aktualizacji.", + "configuration.showReloadMessage": "Wyświetl wiadomość o restarcie.", + "configuration.activeIconPack": "Wybierz paczkę dla niektórych ikon.", + "configuration.activeIconPack.angular": "Ikony dla Angulara.", + "configuration.activeIconPack.angular_ngrx": "Ikony dla Angulara i ngrx.", + "configuration.activeIconPack.react": "Ikony dla Reacta.", + "configuration.activeIconPack.react_redux": "Ikony dla Reacta i Reduxa.", + "configuration.activeIconPack.vue": "Ikony dla Vue.", + "configuration.activeIconPack.vue_vuex": "Ikony dla Vue i Vuex.", + "configuration.activeIconPack.nest": "Ikony dla NestJS.", + "configuration.activeIconPack.none": "Brak włączonej paczki ikon.", + "configuration.folders.theme": "Wybierz typ ikon folderów.", + "configuration.folders.theme.specific": "Wybierz ikony folderów.", + "configuration.folders.theme.classic": "Wybierz klasyczne ikony folderów.", + "configuration.folders.theme.none": "Brak ikon folderów.", + "configuration.folders.color": "Zmień kolor ikon folderów.", + "configuration.hidesExplorerArrows": "Ukryj strzałki przy folderach.", + "configuration.opacity": "Zmień przezroczystość ikon.", + "configuration.saturation": "Zmień nasycenie ikon." } diff --git a/package.nls.pt-BR.json b/package.nls.pt-BR.json index d004a6eb04..02ca8d89dd 100644 --- a/package.nls.pt-BR.json +++ b/package.nls.pt-BR.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icons: Ativar tema de ícones", - "command.toggleIconPacks": "Material Icons: Configurar pacote de ícones", - "command.changeFolderTheme": "Material Icons: Alterar tema das pastas", - "command.changeFolderColor": "Material Icons: Alterar cor das pastas", - "command.restoreDefaultConfig": "Material Icons: Restaurar configuração padrão", - "command.toggleExplorerArrows": "Material Icons: Ocultar as setas ao lado das pastas", - "command.changeOpacity": "Material Icons: Alterar a opacidade", - "configuration.title": "Material Icons", - "configuration.files.associations": "Definir ícones para associações de arquivos customizadas.", - "configuration.folders.associations": "Definir ícones para associações de pastas customizadas.", - "configuration.languages.associations": "Definir ícones para associações de idiomas customizadas.", - "configuration.showWelcomeMessage": "Mostrar mensagem de bem-vindo após a primeira instalação.", - "configuration.showUpdateMessage": "Mostrar mensagem de atualização após cada atualização.", - "configuration.showReloadMessage": "Mostrar mensagem da reinicialização.", - "configuration.activeIconPack": "Selecione um pacote de ícones que habilitam ícones específicos.", - "configuration.activeIconPack.angular": "Ícones para Angular.", - "configuration.activeIconPack.angular_ngrx": "Ícones para Angular e ngrx.", - "configuration.activeIconPack.react": "Ícones para React.", - "configuration.activeIconPack.react_redux": "Ícones para React e ngrx.", - "configuration.activeIconPack.vue": "Ícones para Vue.", - "configuration.activeIconPack.vue_vuex": "Ícones para Vue e Vuex.", - "configuration.activeIconPack.nest": "Ícones para NestJS.", - "configuration.activeIconPack.none": "Nenhum pacote de ícones ativado.", - "configuration.folders.theme": "Definir o tipo dos ícones das pastas.", - "configuration.folders.theme.specific": "Selecione ícones de pastas específicas.", - "configuration.folders.theme.classic": "Selecione ícones de pastas clássicas.", - "configuration.folders.theme.none": "Nenhum ícone de pasta.", - "configuration.folders.color": "Alterar a cor dos ícones das pastas.", - "configuration.hidesExplorerArrows": "Ocultar as setas ao lado das pastas no explorador de arquivos.", - "configuration.opacity": "Alterar a opacidade dos ícones." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Ativar tema de ícones", + "command.toggleIconPacks": "Material Icons: Configurar pacote de ícones", + "command.changeFolderTheme": "Material Icons: Alterar tema das pastas", + "command.changeFolderColor": "Material Icons: Alterar cor das pastas", + "command.restoreDefaultConfig": "Material Icons: Restaurar configuração padrão", + "command.toggleExplorerArrows": "Material Icons: Ocultar as setas ao lado das pastas", + "command.changeOpacity": "Material Icons: Alterar a opacidade", + "configuration.title": "Material Icons", + "configuration.files.associations": "Definir ícones para associações de arquivos customizadas.", + "configuration.folders.associations": "Definir ícones para associações de pastas customizadas.", + "configuration.languages.associations": "Definir ícones para associações de idiomas customizadas.", + "configuration.showWelcomeMessage": "Mostrar mensagem de bem-vindo após a primeira instalação.", + "configuration.showUpdateMessage": "Mostrar mensagem de atualização após cada atualização.", + "configuration.showReloadMessage": "Mostrar mensagem da reinicialização.", + "configuration.activeIconPack": "Selecione um pacote de ícones que habilitam ícones específicos.", + "configuration.activeIconPack.angular": "Ícones para Angular.", + "configuration.activeIconPack.angular_ngrx": "Ícones para Angular e ngrx.", + "configuration.activeIconPack.react": "Ícones para React.", + "configuration.activeIconPack.react_redux": "Ícones para React e ngrx.", + "configuration.activeIconPack.vue": "Ícones para Vue.", + "configuration.activeIconPack.vue_vuex": "Ícones para Vue e Vuex.", + "configuration.activeIconPack.nest": "Ícones para NestJS.", + "configuration.activeIconPack.none": "Nenhum pacote de ícones ativado.", + "configuration.folders.theme": "Definir o tipo dos ícones das pastas.", + "configuration.folders.theme.specific": "Selecione ícones de pastas específicas.", + "configuration.folders.theme.classic": "Selecione ícones de pastas clássicas.", + "configuration.folders.theme.none": "Nenhum ícone de pasta.", + "configuration.folders.color": "Alterar a cor dos ícones das pastas.", + "configuration.hidesExplorerArrows": "Ocultar as setas ao lado das pastas no explorador de arquivos.", + "configuration.opacity": "Alterar a opacidade dos ícones." +} diff --git a/package.nls.pt-PT.json b/package.nls.pt-PT.json index 71d2e291f9..811b737c28 100644 --- a/package.nls.pt-PT.json +++ b/package.nls.pt-PT.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icons: Habilitar tema de ícones", - "command.toggleIconPacks": "Material Icons: Configurar pacote de ícones", - "command.changeFolderTheme": "Material Icons: Alterar tema dos directórios", - "command.changeFolderColor": "Material Icons: Alterar cor dos directórios", - "command.restoreDefaultConfig": "Material Icons: Restaurar configuração padrão", - "command.toggleExplorerArrows": "Material Icons: Esconder as setas ao lado dos directórios", - "command.changeOpacity": "Material Icons: Alterar a opacidade", - "configuration.title": "Material Icons", - "configuration.files.associations": "Definir ícones para associações de ficheiros peronslizados.", - "configuration.folders.associations": "Definir ícones para associações de directórios personalizados.", - "configuration.languages.associations": "Definir ícones para associações de idiomas personalizados.", - "configuration.showWelcomeMessage": "Exibir mensagem de boas-vindas após a primeira instalação.", - "configuration.showUpdateMessage": "Exibir mensagem de actualização após cada actualização.", - "configuration.showReloadMessage": "Exibir mensagem da reinicialização.", - "configuration.activeIconPack": "Selecciona um pacote de ícones que habilitam ícones específicos.", - "configuration.activeIconPack.angular": "Ícones para Angular.", - "configuration.activeIconPack.angular_ngrx": "Ícones para Angular e ngrx.", - "configuration.activeIconPack.react": "Ícones para React.", - "configuration.activeIconPack.react_redux": "Ícones para React e ngrx.", - "configuration.activeIconPack.vue": "Ícones para Vue.", - "configuration.activeIconPack.vue_vuex": "Ícones para Vue e Vuex.", - "configuration.activeIconPack.nest": "Ícones para NestJS.", - "configuration.activeIconPack.none": "Nenhum pacote de ícones ativado.", - "configuration.folders.theme": "Definir o formato dos ícones dos directórios.", - "configuration.folders.theme.specific": "Selecciona ícones de pastas específicas.", - "configuration.folders.theme.classic": "Selecciona ícones de pastas clássicas.", - "configuration.folders.theme.none": "Nenhum ícone de pasta.", - "configuration.folders.color": "Alterar a cor dos ícones dos directórios.", - "configuration.hidesExplorerArrows": "Esconder as setas ao lado dos directórios no explorador de ficheiros.", - "configuration.opacity": "Alterar a opacidade dos ícones." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Habilitar tema de ícones", + "command.toggleIconPacks": "Material Icons: Configurar pacote de ícones", + "command.changeFolderTheme": "Material Icons: Alterar tema dos directórios", + "command.changeFolderColor": "Material Icons: Alterar cor dos directórios", + "command.restoreDefaultConfig": "Material Icons: Restaurar configuração padrão", + "command.toggleExplorerArrows": "Material Icons: Esconder as setas ao lado dos directórios", + "command.changeOpacity": "Material Icons: Alterar a opacidade", + "configuration.title": "Material Icons", + "configuration.files.associations": "Definir ícones para associações de ficheiros peronslizados.", + "configuration.folders.associations": "Definir ícones para associações de directórios personalizados.", + "configuration.languages.associations": "Definir ícones para associações de idiomas personalizados.", + "configuration.showWelcomeMessage": "Exibir mensagem de boas-vindas após a primeira instalação.", + "configuration.showUpdateMessage": "Exibir mensagem de actualização após cada actualização.", + "configuration.showReloadMessage": "Exibir mensagem da reinicialização.", + "configuration.activeIconPack": "Selecciona um pacote de ícones que habilitam ícones específicos.", + "configuration.activeIconPack.angular": "Ícones para Angular.", + "configuration.activeIconPack.angular_ngrx": "Ícones para Angular e ngrx.", + "configuration.activeIconPack.react": "Ícones para React.", + "configuration.activeIconPack.react_redux": "Ícones para React e ngrx.", + "configuration.activeIconPack.vue": "Ícones para Vue.", + "configuration.activeIconPack.vue_vuex": "Ícones para Vue e Vuex.", + "configuration.activeIconPack.nest": "Ícones para NestJS.", + "configuration.activeIconPack.none": "Nenhum pacote de ícones ativado.", + "configuration.folders.theme": "Definir o formato dos ícones dos directórios.", + "configuration.folders.theme.specific": "Selecciona ícones de pastas específicas.", + "configuration.folders.theme.classic": "Selecciona ícones de pastas clássicas.", + "configuration.folders.theme.none": "Nenhum ícone de pasta.", + "configuration.folders.color": "Alterar a cor dos ícones dos directórios.", + "configuration.hidesExplorerArrows": "Esconder as setas ao lado dos directórios no explorador de ficheiros.", + "configuration.opacity": "Alterar a opacidade dos ícones." +} diff --git a/package.nls.ru.json b/package.nls.ru.json index 1d510ede5c..4fc12e20ae 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icons: Активировать иконки темы", - "command.toggleIconPacks": "Material Icons: Настроить набор иконок", - "command.changeFolderTheme": "Material Icons: Изменить тему папки", - "command.changeFolderColor": "Material Icons: Изменить цвет папки", - "command.restoreDefaultConfig": "Material Icons: Восстановить настройки по умолчанию", - "command.toggleExplorerArrows": "Material Icons: Скрыть стрелки проводника перед папкой", - "command.changeOpacity": "Material Icons: Изменение непрозрачности", - "configuration.title": "Material Icons", - "configuration.files.associations": "Настройка пользовательских ассоциаций значков файлов.", - "configuration.folders.associations": "Настройка пользовательских ассоциаций значков папок.", - "configuration.languages.associations": "Настройка ассоциаций значков пользовательского языка.", - "configuration.showWelcomeMessage": "Показывать приветственное сообщение после первой установки.", - "configuration.showUpdateMessage": "Показывать сообщение об обновлении после каждого обновления.", - "configuration.showReloadMessage": "Показывать сообщение перезагрузки.", - "configuration.activeIconPack": "Выберите набор значков, которые включают определенные значки.", - "configuration.activeIconPack.angular": "Иконки для Angular.", - "configuration.activeIconPack.angular_ngrx": "Иконки для Angular и ngrx.", - "configuration.activeIconPack.react": "Иконки для React.", - "configuration.activeIconPack.react_redux": "Иконки для React и Redux.", - "configuration.activeIconPack.vue": "Иконки для Vue.", - "configuration.activeIconPack.vue_vuex": "Иконки для Vue и Vuex.", - "configuration.activeIconPack.nest": "Иконки для NestJS.", - "configuration.activeIconPack.none": "Папка с иконками не включена.", - "configuration.folders.theme": "Установить тип иконок для папок.", - "configuration.folders.theme.specific": "Выберите конкретные значки папок.", - "configuration.folders.theme.classic": "Выберите классические значки папок.", - "configuration.folders.theme.none": "Нет значков папок.", - "configuration.folders.color": "Изменение цвета иконок папок.", - "configuration.hidesExplorerArrows": "Скрыть стрелки проводника перед папкой.", - "configuration.opacity": "Измените прозрачность значков." -} \ No newline at end of file + "command.activateIcons": "Material Icons: Активировать иконки темы", + "command.toggleIconPacks": "Material Icons: Настроить набор иконок", + "command.changeFolderTheme": "Material Icons: Изменить тему папки", + "command.changeFolderColor": "Material Icons: Изменить цвет папки", + "command.restoreDefaultConfig": "Material Icons: Восстановить настройки по умолчанию", + "command.toggleExplorerArrows": "Material Icons: Скрыть стрелки проводника перед папкой", + "command.changeOpacity": "Material Icons: Изменение непрозрачности", + "configuration.title": "Material Icons", + "configuration.files.associations": "Настройка пользовательских ассоциаций значков файлов.", + "configuration.folders.associations": "Настройка пользовательских ассоциаций значков папок.", + "configuration.languages.associations": "Настройка ассоциаций значков пользовательского языка.", + "configuration.showWelcomeMessage": "Показывать приветственное сообщение после первой установки.", + "configuration.showUpdateMessage": "Показывать сообщение об обновлении после каждого обновления.", + "configuration.showReloadMessage": "Показывать сообщение перезагрузки.", + "configuration.activeIconPack": "Выберите набор значков, которые включают определенные значки.", + "configuration.activeIconPack.angular": "Иконки для Angular.", + "configuration.activeIconPack.angular_ngrx": "Иконки для Angular и ngrx.", + "configuration.activeIconPack.react": "Иконки для React.", + "configuration.activeIconPack.react_redux": "Иконки для React и Redux.", + "configuration.activeIconPack.vue": "Иконки для Vue.", + "configuration.activeIconPack.vue_vuex": "Иконки для Vue и Vuex.", + "configuration.activeIconPack.nest": "Иконки для NestJS.", + "configuration.activeIconPack.none": "Папка с иконками не включена.", + "configuration.folders.theme": "Установить тип иконок для папок.", + "configuration.folders.theme.specific": "Выберите конкретные значки папок.", + "configuration.folders.theme.classic": "Выберите классические значки папок.", + "configuration.folders.theme.none": "Нет значков папок.", + "configuration.folders.color": "Изменение цвета иконок папок.", + "configuration.hidesExplorerArrows": "Скрыть стрелки проводника перед папкой.", + "configuration.opacity": "Измените прозрачность значков." +} diff --git a/package.nls.zh-CN.json b/package.nls.zh-CN.json index 955dca1270..c9d9f76010 100644 --- a/package.nls.zh-CN.json +++ b/package.nls.zh-CN.json @@ -1,32 +1,32 @@ { - "command.activateIcons": "Material Icons: 激活Material Icons文件图标主题", - "command.toggleIconPacks": "Material Icons: 选择一个图标包", - "command.changeFolderTheme": "Material Icons: 切换文件夹图标", - "command.changeFolderColor": "Material Icons: 更改文件夹颜色", - "command.restoreDefaultConfig": "Material Icons: 恢复默认设置", - "command.toggleExplorerArrows": "Material Icons: 隐藏文件夹箭头", - "command.changeOpacity": "Material Icons: 改变不透明度", - "configuration.title": "Material Icons", - "configuration.files.associations": "设置自定义文件图标关联。", - "configuration.folders.associations": "设置自定义文件夹图标关联。", - "configuration.languages.associations": "定义自定义语言映射的图标。", - "configuration.showWelcomeMessage": "首次安装后显示欢迎信息。", - "configuration.showUpdateMessage": "更新后显示升级信息。", - "configuration.showReloadMessage": "显示重启消息。", - "configuration.activeIconPack": "选择一个图标包。", - "configuration.activeIconPack.angular": "Angular的图标。", - "configuration.activeIconPack.angular_ngrx": "Angular和ngrx的图标。", - "configuration.activeIconPack.react": "React的图标。", - "configuration.activeIconPack.react_redux": "React和Redux的图标。", - "configuration.activeIconPack.vue": "Vue的图标。", - "configuration.activeIconPack.vue_vuex": "Vue和Vuex的图标。", - "configuration.activeIconPack.nest": "NestJS的图标。", - "configuration.activeIconPack.none": "没有启用图标包。", - "configuration.folders.theme": "设置文件夹图标的类型。", - "configuration.folders.theme.specific": "选择特定文件夹图标。", - "configuration.folders.theme.classic": "选择经典文件夹图标。", - "configuration.folders.theme.none": "没有文件夹图标。", - "configuration.folders.color": "更改文件夹图标的颜色。", - "configuration.hidesExplorerArrows": "隐藏该文件夹旁边的箭头。", - "configuration.opacity": "更改图标的透明度。" -} \ No newline at end of file + "command.activateIcons": "Material Icons: 激活Material Icons文件图标主题", + "command.toggleIconPacks": "Material Icons: 选择一个图标包", + "command.changeFolderTheme": "Material Icons: 切换文件夹图标", + "command.changeFolderColor": "Material Icons: 更改文件夹颜色", + "command.restoreDefaultConfig": "Material Icons: 恢复默认设置", + "command.toggleExplorerArrows": "Material Icons: 隐藏文件夹箭头", + "command.changeOpacity": "Material Icons: 改变不透明度", + "configuration.title": "Material Icons", + "configuration.files.associations": "设置自定义文件图标关联。", + "configuration.folders.associations": "设置自定义文件夹图标关联。", + "configuration.languages.associations": "定义自定义语言映射的图标。", + "configuration.showWelcomeMessage": "首次安装后显示欢迎信息。", + "configuration.showUpdateMessage": "更新后显示升级信息。", + "configuration.showReloadMessage": "显示重启消息。", + "configuration.activeIconPack": "选择一个图标包。", + "configuration.activeIconPack.angular": "Angular的图标。", + "configuration.activeIconPack.angular_ngrx": "Angular和ngrx的图标。", + "configuration.activeIconPack.react": "React的图标。", + "configuration.activeIconPack.react_redux": "React和Redux的图标。", + "configuration.activeIconPack.vue": "Vue的图标。", + "configuration.activeIconPack.vue_vuex": "Vue和Vuex的图标。", + "configuration.activeIconPack.nest": "NestJS的图标。", + "configuration.activeIconPack.none": "没有启用图标包。", + "configuration.folders.theme": "设置文件夹图标的类型。", + "configuration.folders.theme.specific": "选择特定文件夹图标。", + "configuration.folders.theme.classic": "选择经典文件夹图标。", + "configuration.folders.theme.none": "没有文件夹图标。", + "configuration.folders.color": "更改文件夹图标的颜色。", + "configuration.hidesExplorerArrows": "隐藏该文件夹旁边的箭头。", + "configuration.opacity": "更改图标的透明度。" +} diff --git a/src/commands/activate.ts b/src/commands/activate.ts index 62f59bfe5a..0d75cdcf58 100644 --- a/src/commands/activate.ts +++ b/src/commands/activate.ts @@ -4,21 +4,26 @@ import * as i18n from './../i18n'; /** Activate the icon theme by changing the settings for the iconTheme. */ export const activateIcons = () => { - return setIconTheme(); + return setIconTheme(); }; /** Set the icon theme in the config. */ const setIconTheme = async () => { - // global user config - try { - await helpers.getConfig().update('workbench.iconTheme', 'material-icon-theme', true); + // global user config + try { + await helpers + .getConfig() + .update('workbench.iconTheme', 'material-icon-theme', true); - // local workspace config - if (helpers.getConfig().inspect('workbench.iconTheme').workspaceValue !== undefined) { - helpers.getConfig().update('workbench.iconTheme', 'material-icon-theme'); - } - vscode.window.showInformationMessage(i18n.translate('activated')); - } catch (error) { - console.error(error); + // local workspace config + if ( + helpers.getConfig().inspect('workbench.iconTheme').workspaceValue !== + undefined + ) { + helpers.getConfig().update('workbench.iconTheme', 'material-icon-theme'); } + vscode.window.showInformationMessage(i18n.translate('activated')); + } catch (error) { + console.error(error); + } }; diff --git a/src/commands/explorerArrows.ts b/src/commands/explorerArrows.ts index 0a97060e78..a9f528f029 100644 --- a/src/commands/explorerArrows.ts +++ b/src/commands/explorerArrows.ts @@ -4,50 +4,50 @@ import * as i18n from '../i18n'; /** Command to toggle the explorer arrows. */ export const toggleExplorerArrows = async () => { - try { - const status = checkArrowStatus(); - const response = await showQuickPickItems(status); - return handleQuickPickActions(response); - } catch (error) { - console.error(error); - } + try { + const status = checkArrowStatus(); + const response = await showQuickPickItems(status); + return handleQuickPickActions(response); + } catch (error) { + console.error(error); + } }; /** Show QuickPick items to select preferred configuration for the explorer arrows. */ const showQuickPickItems = (status: boolean) => { - const on: vscode.QuickPickItem = { - description: i18n.translate('toggleSwitch.on'), - detail: i18n.translate('explorerArrows.enable'), - label: !status ? '\u2714' : '\u25FB' - }; - const off: vscode.QuickPickItem = { - description: i18n.translate('toggleSwitch.off'), - detail: i18n.translate('explorerArrows.disable'), - label: status ? '\u2714' : '\u25FB' - }; - return vscode.window.showQuickPick([on, off], { - placeHolder: i18n.translate('explorerArrows.toggle'), - ignoreFocusOut: false, - matchOnDescription: true - }); + const on: vscode.QuickPickItem = { + description: i18n.translate('toggleSwitch.on'), + detail: i18n.translate('explorerArrows.enable'), + label: !status ? '\u2714' : '\u25FB', + }; + const off: vscode.QuickPickItem = { + description: i18n.translate('toggleSwitch.off'), + detail: i18n.translate('explorerArrows.disable'), + label: status ? '\u2714' : '\u25FB', + }; + return vscode.window.showQuickPick([on, off], { + placeHolder: i18n.translate('explorerArrows.toggle'), + ignoreFocusOut: false, + matchOnDescription: true, + }); }; /** Handle the actions from the QuickPick. */ const handleQuickPickActions = (value: vscode.QuickPickItem) => { - if (!value || !value.description) return; - switch (value.description) { - case i18n.translate('toggleSwitch.on'): { - return helpers.setThemeConfig('hidesExplorerArrows', false, true); - } - case i18n.translate('toggleSwitch.off'): { - return helpers.setThemeConfig('hidesExplorerArrows', true, true); - } - default: - return; + if (!value || !value.description) return; + switch (value.description) { + case i18n.translate('toggleSwitch.on'): { + return helpers.setThemeConfig('hidesExplorerArrows', false, true); + } + case i18n.translate('toggleSwitch.off'): { + return helpers.setThemeConfig('hidesExplorerArrows', true, true); } + default: + return; + } }; /** Are the arrows enabled? */ export const checkArrowStatus = (): boolean => { - return helpers.getMaterialIconsJSON().hidesExplorerArrows; + return helpers.getMaterialIconsJSON().hidesExplorerArrows; }; diff --git a/src/commands/folderColor.ts b/src/commands/folderColor.ts index 2bc74c5afc..7c74050b22 100644 --- a/src/commands/folderColor.ts +++ b/src/commands/folderColor.ts @@ -4,84 +4,90 @@ import * as helpers from './../helpers'; import * as i18n from './../i18n'; interface FolderColor { - label: string; - hex: string; + label: string; + hex: string; } const iconPalette: FolderColor[] = [ - { label: 'Grey (Default)', hex: '#90a4ae' }, - { label: 'Blue', hex: '#42a5f5' }, - { label: 'Green', hex: '#7CB342' }, - { label: 'Teal', hex: '#26A69A' }, - { label: 'Red', hex: '#EF5350' }, - { label: 'Orange', hex: '#FF7043' }, - { label: 'Yellow', hex: '#FDD835' }, - { label: 'Custom Color', hex: 'Custom HEX Code' }, + { label: 'Grey (Default)', hex: '#90a4ae' }, + { label: 'Blue', hex: '#42a5f5' }, + { label: 'Green', hex: '#7CB342' }, + { label: 'Teal', hex: '#26A69A' }, + { label: 'Red', hex: '#EF5350' }, + { label: 'Orange', hex: '#FF7043' }, + { label: 'Yellow', hex: '#FDD835' }, + { label: 'Custom Color', hex: 'Custom HEX Code' }, ]; /** Command to toggle the folder icons. */ export const changeFolderColor = async () => { - try { - const status = checkFolderColorStatus(); - const response = await showQuickPickItems(status); - handleQuickPickActions(response); - } catch (error) { - console.error(error); - } + try { + const status = checkFolderColorStatus(); + const response = await showQuickPickItems(status); + handleQuickPickActions(response); + } catch (error) { + console.error(error); + } }; /** Show QuickPick items to select preferred color for the folder icons. */ const showQuickPickItems = (currentColor: string) => { - const options = iconPalette.map((color): vscode.QuickPickItem => ({ - description: color.label, - label: isColorActive(color, currentColor) ? '\u2714' : '\u25FB' - })); + const options = iconPalette.map( + (color): vscode.QuickPickItem => ({ + description: color.label, + label: isColorActive(color, currentColor) ? '\u2714' : '\u25FB', + }) + ); - return vscode.window.showQuickPick(options, { - placeHolder: i18n.translate('folders.color'), - ignoreFocusOut: false, - matchOnDescription: true - }); + return vscode.window.showQuickPick(options, { + placeHolder: i18n.translate('folders.color'), + ignoreFocusOut: false, + matchOnDescription: true, + }); }; /** Handle the actions from the QuickPick. */ const handleQuickPickActions = (value: vscode.QuickPickItem) => { - if (!value || !value.description) return; - if (value.description === 'Custom Color') { - vscode.window.showInputBox({ - placeHolder: i18n.translate('folders.hexCode'), - ignoreFocusOut: true, - validateInput: validateColorInput - }).then(value => setColorConfig(value)); - } else { - const hexCode = iconPalette.find(c => c.label === value.description).hex; - setColorConfig(hexCode); - } + if (!value || !value.description) return; + if (value.description === 'Custom Color') { + vscode.window + .showInputBox({ + placeHolder: i18n.translate('folders.hexCode'), + ignoreFocusOut: true, + validateInput: validateColorInput, + }) + .then((value) => setColorConfig(value)); + } else { + const hexCode = iconPalette.find((c) => c.label === value.description).hex; + setColorConfig(hexCode); + } }; const validateColorInput = (colorInput: string) => { - if (!validateHEXColorCode(colorInput)) { - return i18n.translate('folders.wrongHexCode'); - } - return undefined; + if (!validateHEXColorCode(colorInput)) { + return i18n.translate('folders.wrongHexCode'); + } + return undefined; }; /** Check status of the folder color */ export const checkFolderColorStatus = (): string => { - const defaultOptions = getDefaultIconOptions(); - const config = helpers.getMaterialIconsJSON(); - return config.options.folders.color ?? defaultOptions.folders.color; + const defaultOptions = getDefaultIconOptions(); + const config = helpers.getMaterialIconsJSON(); + return config.options.folders.color ?? defaultOptions.folders.color; }; const setColorConfig = (value: string) => { - if (value) { - helpers.setThemeConfig('folders.color', value.toLowerCase(), true); - } + if (value) { + helpers.setThemeConfig('folders.color', value.toLowerCase(), true); + } }; const isColorActive = (color: FolderColor, currentColor: string): boolean => { - if (color.label === 'Custom Color') { - return !iconPalette.some(c => c.hex.toLowerCase() === currentColor.toLowerCase()); - } - return color.hex.toLowerCase() === currentColor.toLowerCase(); + if (color.label === 'Custom Color') { + return !iconPalette.some( + (c) => c.hex.toLowerCase() === currentColor.toLowerCase() + ); + } + return color.hex.toLowerCase() === currentColor.toLowerCase(); }; diff --git a/src/commands/folders.ts b/src/commands/folders.ts index c7f9aabb03..7e7611515a 100644 --- a/src/commands/folders.ts +++ b/src/commands/folders.ts @@ -5,37 +5,49 @@ import * as i18n from './../i18n'; /** Command to toggle the folder icons. */ export const changeFolderTheme = async () => { - try { - const status = checkFolderIconsStatus(); - const response = await showQuickPickItems(status); - handleQuickPickActions(response); - } catch (error) { - console.error(error); - } + try { + const status = checkFolderIconsStatus(); + const response = await showQuickPickItems(status); + handleQuickPickActions(response); + } catch (error) { + console.error(error); + } }; /** Show QuickPick items to select preferred configuration for the folder icons. */ const showQuickPickItems = (activeTheme: string) => { - const options = folderIcons.map((theme): vscode.QuickPickItem => ({ - description: helpers.capitalizeFirstLetter(theme.name), - detail: theme.name === 'none' ? i18n.translate('folders.disabled') : i18n.translate('folders.theme.description', helpers.capitalizeFirstLetter(theme.name)), - label: theme.name === activeTheme ? '\u2714' : '\u25FB' - })); + const options = folderIcons.map( + (theme): vscode.QuickPickItem => ({ + description: helpers.capitalizeFirstLetter(theme.name), + detail: + theme.name === 'none' + ? i18n.translate('folders.disabled') + : i18n.translate( + 'folders.theme.description', + helpers.capitalizeFirstLetter(theme.name) + ), + label: theme.name === activeTheme ? '\u2714' : '\u25FB', + }) + ); - return vscode.window.showQuickPick(options, { - placeHolder: i18n.translate('folders.toggleIcons'), - ignoreFocusOut: false, - matchOnDescription: true - }); + return vscode.window.showQuickPick(options, { + placeHolder: i18n.translate('folders.toggleIcons'), + ignoreFocusOut: false, + matchOnDescription: true, + }); }; /** Handle the actions from the QuickPick. */ const handleQuickPickActions = (value: vscode.QuickPickItem) => { - if (!value || !value.description) return; - return helpers.setThemeConfig('folders.theme', value.description.toLowerCase(), true); + if (!value || !value.description) return; + return helpers.setThemeConfig( + 'folders.theme', + value.description.toLowerCase(), + true + ); }; /** Are the folder icons enabled? */ export const checkFolderIconsStatus = (): string => { - return helpers.getMaterialIconsJSON().options.folders.theme; + return helpers.getMaterialIconsJSON().options.folders.theme; }; diff --git a/src/commands/grayscale.ts b/src/commands/grayscale.ts index c52b1d32f2..0d46578cb5 100644 --- a/src/commands/grayscale.ts +++ b/src/commands/grayscale.ts @@ -4,51 +4,50 @@ import * as i18n from './../i18n'; /** Command to toggle grayscale. */ export const toggleGrayscale = async () => { - try { - const status = checkGrayscaleStatus(); - const response = await showQuickPickItems(status); - handleQuickPickActions(response); - } catch (error) { - console.error(error); - } + try { + const status = checkGrayscaleStatus(); + const response = await showQuickPickItems(status); + handleQuickPickActions(response); + } catch (error) { + console.error(error); + } }; /** Show QuickPick items to select preferred configuration for grayscale icons. */ const showQuickPickItems = (status: boolean) => { - const on: vscode.QuickPickItem = { - description: i18n.translate('toggleSwitch.on'), - detail: i18n.translate('grayscale.enable'), - label: status ? '\u2714' : '\u25FB' - }; - const off: vscode.QuickPickItem = { - description: i18n.translate('toggleSwitch.off'), - detail: i18n.translate('grayscale.disable'), - label: !status ? '\u2714' : '\u25FB' - }; - return vscode.window.showQuickPick( - [on, off], { - placeHolder: i18n.translate('grayscale.toggle'), - ignoreFocusOut: false, - matchOnDescription: true - }); + const on: vscode.QuickPickItem = { + description: i18n.translate('toggleSwitch.on'), + detail: i18n.translate('grayscale.enable'), + label: status ? '\u2714' : '\u25FB', + }; + const off: vscode.QuickPickItem = { + description: i18n.translate('toggleSwitch.off'), + detail: i18n.translate('grayscale.disable'), + label: !status ? '\u2714' : '\u25FB', + }; + return vscode.window.showQuickPick([on, off], { + placeHolder: i18n.translate('grayscale.toggle'), + ignoreFocusOut: false, + matchOnDescription: true, + }); }; /** Handle the actions from the QuickPick. */ const handleQuickPickActions = (value: vscode.QuickPickItem) => { - if (!value || !value.description) return; - switch (value.description) { - case i18n.translate('toggleSwitch.on'): { - return helpers.setThemeConfig('saturation', 0, true); - } - case i18n.translate('toggleSwitch.off'): { - return helpers.setThemeConfig('saturation', 1, true); - } - default: - return; + if (!value || !value.description) return; + switch (value.description) { + case i18n.translate('toggleSwitch.on'): { + return helpers.setThemeConfig('saturation', 0, true); + } + case i18n.translate('toggleSwitch.off'): { + return helpers.setThemeConfig('saturation', 1, true); } + default: + return; + } }; /** Is grayscale icons enabled? */ export const checkGrayscaleStatus = (): boolean => { - return helpers.getMaterialIconsJSON().options.saturation === 0; + return helpers.getMaterialIconsJSON().options.saturation === 0; }; diff --git a/src/commands/iconPacks.ts b/src/commands/iconPacks.ts index 71d6492ea8..0f4e25055e 100644 --- a/src/commands/iconPacks.ts +++ b/src/commands/iconPacks.ts @@ -5,61 +5,70 @@ import * as i18n from './../i18n'; /** Command to toggle the icons packs */ export const toggleIconPacks = async () => { - try { - const activeIconPack = getActiveIconPack(); - const response = await showQuickPickItems(activeIconPack); - handleQuickPickActions(response); - } catch (error) { - console.error(error); - } + try { + const activeIconPack = getActiveIconPack(); + const response = await showQuickPickItems(activeIconPack); + handleQuickPickActions(response); + } catch (error) { + console.error(error); + } }; /** Show QuickPick items to select preferred configuration for the icon packs. */ const showQuickPickItems = (activePack: string) => { - const packs = [...getAllIconPacks().sort(), 'none']; - const options = packs.map((pack): vscode.QuickPickItem => { - const packLabel = helpers.toTitleCase(pack.replace('_', ' + ')); - const active = isPackActive(activePack, pack); - const iconPacksDeactivated = pack === 'none' && activePack === ''; + const packs = [...getAllIconPacks().sort(), 'none']; + const options = packs.map( + (pack): vscode.QuickPickItem => { + const packLabel = helpers.toTitleCase(pack.replace('_', ' + ')); + const active = isPackActive(activePack, pack); + const iconPacksDeactivated = pack === 'none' && activePack === ''; - return { - description: packLabel, - detail: i18n.translate(`iconPacks.${pack === 'none' ? 'disabled' : 'description'}`, packLabel), - label: iconPacksDeactivated ? '\u2714' : active ? '\u2714' : '\u25FB' - }; - }); + return { + description: packLabel, + detail: i18n.translate( + `iconPacks.${pack === 'none' ? 'disabled' : 'description'}`, + packLabel + ), + label: iconPacksDeactivated ? '\u2714' : active ? '\u2714' : '\u25FB', + }; + } + ); - return vscode.window.showQuickPick(options, { - placeHolder: i18n.translate('iconPacks.selectPack'), - ignoreFocusOut: false, - matchOnDescription: true, - matchOnDetail: true - }); + return vscode.window.showQuickPick(options, { + placeHolder: i18n.translate('iconPacks.selectPack'), + ignoreFocusOut: false, + matchOnDescription: true, + matchOnDetail: true, + }); }; /** Handle the actions from the QuickPick. */ const handleQuickPickActions = (value: vscode.QuickPickItem) => { - if (!value || !value.description) return; - const decision = value.description.replace(' + ', '_').toLowerCase(); + if (!value || !value.description) return; + const decision = value.description.replace(' + ', '_').toLowerCase(); - helpers.setThemeConfig('activeIconPack', decision === 'none' ? '' : decision, true); + helpers.setThemeConfig( + 'activeIconPack', + decision === 'none' ? '' : decision, + true + ); }; const getActiveIconPack = (): string => { - return helpers.getMaterialIconsJSON().options.activeIconPack; + return helpers.getMaterialIconsJSON().options.activeIconPack; }; /** Get all packs that can be used in this icon theme. */ export const getAllIconPacks = () => { - const packs: string[] = []; - for (const item in IconPack) { - if (isNaN(Number(item))) { - packs.push(IconPack[item].toLowerCase()); - } + const packs: string[] = []; + for (const item in IconPack) { + if (isNaN(Number(item))) { + packs.push(IconPack[item].toLowerCase()); } - return packs; + } + return packs; }; const isPackActive = (activePack: string, pack: string) => { - return activePack.toLowerCase() === pack.toLowerCase(); + return activePack.toLowerCase() === pack.toLowerCase(); }; diff --git a/src/commands/index.ts b/src/commands/index.ts index 89151c91f6..98f96fdce7 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -10,18 +10,21 @@ import { restoreDefaultConfig } from './restoreConfig'; import { changeSaturation } from './saturation'; const commands = { - activateIcons, - toggleIconPacks, - changeFolderTheme, - changeFolderColor, - restoreDefaultConfig, - toggleExplorerArrows, - changeOpacity, - toggleGrayscale, - changeSaturation, + activateIcons, + toggleIconPacks, + changeFolderTheme, + changeFolderColor, + restoreDefaultConfig, + toggleExplorerArrows, + changeOpacity, + toggleGrayscale, + changeSaturation, }; -export const registered = Object.keys(commands).map(commandName => { - const callCommand = () => commands[commandName](); - return vscode.commands.registerCommand(`material-icon-theme.${commandName}`, callCommand); +export const registered = Object.keys(commands).map((commandName) => { + const callCommand = () => commands[commandName](); + return vscode.commands.registerCommand( + `material-icon-theme.${commandName}`, + callCommand + ); }); diff --git a/src/commands/opacity.ts b/src/commands/opacity.ts index 0b01797496..e8afb66051 100644 --- a/src/commands/opacity.ts +++ b/src/commands/opacity.ts @@ -5,42 +5,42 @@ import * as i18n from './../i18n'; /** Command to toggle the folder icons. */ export const changeOpacity = async () => { - try { - const currentOpacityValue = getCurrentOpacityValue(); - const response = Number(await showInput(currentOpacityValue)); - return setOpacityConfig(response); - } catch (error) { - console.error(error); - } + try { + const currentOpacityValue = getCurrentOpacityValue(); + const response = Number(await showInput(currentOpacityValue)); + return setOpacityConfig(response); + } catch (error) { + console.error(error); + } }; /** Show input to enter the opacity value. */ const showInput = (opacity: number) => { - return vscode.window.showInputBox({ - placeHolder: i18n.translate('opacity.inputPlaceholder'), - ignoreFocusOut: true, - value: String(opacity), - validateInput: validateOpacityInput - }); + return vscode.window.showInputBox({ + placeHolder: i18n.translate('opacity.inputPlaceholder'), + ignoreFocusOut: true, + value: String(opacity), + validateInput: validateOpacityInput, + }); }; /** Validate the opacity value which was inserted by the user. */ const validateOpacityInput = (opacityInput: string) => { - if (!validateOpacityValue(+opacityInput)) { - return i18n.translate('opacity.wrongValue'); - } - return undefined; + if (!validateOpacityValue(+opacityInput)) { + return i18n.translate('opacity.wrongValue'); + } + return undefined; }; /** Get the current value of the opacity of the icons. */ export const getCurrentOpacityValue = (): number => { - const defaultOptions = getDefaultIconOptions(); - const config = helpers.getMaterialIconsJSON(); - return config.options.opacity ?? defaultOptions.opacity; + const defaultOptions = getDefaultIconOptions(); + const config = helpers.getMaterialIconsJSON(); + return config.options.opacity ?? defaultOptions.opacity; }; const setOpacityConfig = (opacity: number) => { - if (opacity !== undefined) { - return helpers.setThemeConfig('opacity', opacity, true); - } + if (opacity !== undefined) { + return helpers.setThemeConfig('opacity', opacity, true); + } }; diff --git a/src/commands/restoreConfig.ts b/src/commands/restoreConfig.ts index 4f1652388c..d2d7164750 100644 --- a/src/commands/restoreConfig.ts +++ b/src/commands/restoreConfig.ts @@ -2,13 +2,13 @@ import * as helpers from './../helpers'; /** Restore all configurations to default. */ export const restoreDefaultConfig = () => { - helpers.setThemeConfig('activeIconPack', undefined, true); - helpers.setThemeConfig('folders.theme', undefined, true); - helpers.setThemeConfig('folders.color', undefined, true); - helpers.setThemeConfig('hidesExplorerArrows', undefined, true); - helpers.setThemeConfig('opacity', undefined, true); - helpers.setThemeConfig('saturation', undefined, true); - helpers.setThemeConfig('files.associations', undefined, true); - helpers.setThemeConfig('folders.associations', undefined, true); - helpers.setThemeConfig('languages.associations', undefined, true); + helpers.setThemeConfig('activeIconPack', undefined, true); + helpers.setThemeConfig('folders.theme', undefined, true); + helpers.setThemeConfig('folders.color', undefined, true); + helpers.setThemeConfig('hidesExplorerArrows', undefined, true); + helpers.setThemeConfig('opacity', undefined, true); + helpers.setThemeConfig('saturation', undefined, true); + helpers.setThemeConfig('files.associations', undefined, true); + helpers.setThemeConfig('folders.associations', undefined, true); + helpers.setThemeConfig('languages.associations', undefined, true); }; diff --git a/src/commands/saturation.ts b/src/commands/saturation.ts index f78eeea43b..5f03d8b5ac 100644 --- a/src/commands/saturation.ts +++ b/src/commands/saturation.ts @@ -5,42 +5,42 @@ import * as i18n from './../i18n'; /** Command to toggle the folder icons. */ export const changeSaturation = async () => { - try { - const currentSaturationValue = getCurrentSaturationValue(); - const response = Number(await showInput(currentSaturationValue)); - setSaturationConfig(response); - } catch (error) { - console.error(error); - } + try { + const currentSaturationValue = getCurrentSaturationValue(); + const response = Number(await showInput(currentSaturationValue)); + setSaturationConfig(response); + } catch (error) { + console.error(error); + } }; /** Show input to enter the saturation value. */ const showInput = (saturation: number) => { - return vscode.window.showInputBox({ - placeHolder: i18n.translate('saturation.inputPlaceholder'), - ignoreFocusOut: true, - value: String(saturation), - validateInput: validateSaturationInput - }); + return vscode.window.showInputBox({ + placeHolder: i18n.translate('saturation.inputPlaceholder'), + ignoreFocusOut: true, + value: String(saturation), + validateInput: validateSaturationInput, + }); }; /** Validate the saturation value which was inserted by the user. */ const validateSaturationInput = (saturationInput: string) => { - if (!validateSaturationValue(+saturationInput)) { - return i18n.translate('saturation.wrongValue'); - } - return undefined; + if (!validateSaturationValue(+saturationInput)) { + return i18n.translate('saturation.wrongValue'); + } + return undefined; }; /** Get the current value of the saturation of the icons. */ export const getCurrentSaturationValue = (): number => { - const defaultOptions = getDefaultIconOptions(); - const config = helpers.getMaterialIconsJSON(); - return config.options.saturation ?? defaultOptions.saturation; + const defaultOptions = getDefaultIconOptions(); + const config = helpers.getMaterialIconsJSON(); + return config.options.saturation ?? defaultOptions.saturation; }; const setSaturationConfig = (saturation: number) => { - if (saturation !== undefined) { - return helpers.setThemeConfig('saturation', saturation, true); - } + if (saturation !== undefined) { + return helpers.setThemeConfig('saturation', saturation, true); + } }; diff --git a/src/extension.ts b/src/extension.ts index 4b3f028345..1e89b94747 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -12,24 +12,23 @@ import { showStartMessages } from './messages/start'; * It initializes the core functionality of the extension. */ export const activate = async (context: vscode.ExtensionContext) => { - try { - await i18n.initTranslations(); - const status = await checkThemeStatus(context.globalState); - showStartMessages(status); + try { + await i18n.initTranslations(); + const status = await checkThemeStatus(context.globalState); + showStartMessages(status); - // Subscribe to the extension commands - context.subscriptions.push(...commands.registered); + // Subscribe to the extension commands + context.subscriptions.push(...commands.registered); - // Initially trigger the config change detection - detectConfigChanges(); + // Initially trigger the config change detection + detectConfigChanges(); - // Observe changes in the config - vscode.workspace.onDidChangeConfiguration(detectConfigChanges); - } catch (error) { - console.error(error); - } + // Observe changes in the config + vscode.workspace.onDidChangeConfiguration(detectConfigChanges); + } catch (error) { + console.error(error); + } }; /** This method is called when the extension is deactivated */ -export const deactivate = () => { -}; +export const deactivate = () => {}; diff --git a/src/helpers/changeDetection.ts b/src/helpers/changeDetection.ts index 2b0c735929..c3efab9fb0 100644 --- a/src/helpers/changeDetection.ts +++ b/src/helpers/changeDetection.ts @@ -5,17 +5,17 @@ import { getObjectPropertyValue, setObjectPropertyValue } from './objects'; /** Compare the workspace and the user configurations with the current setup of the icons. */ export const detectConfigChanges = () => { - const changes = compareConfigs(); + const changes = compareConfigs(); - // if there's nothing to update - if (Object.keys(changes.updatedConfigs).length === 0) return; + // if there's nothing to update + if (Object.keys(changes.updatedConfigs).length === 0) return; - try { - // update icon json file with new options - createIconFile(changes.updatedConfigs, changes.updatedJSONConfig); - } catch (error) { - console.error(error); - } + try { + // update icon json file with new options + createIconFile(changes.updatedConfigs, changes.updatedJSONConfig); + } catch (error) { + console.error(error); + } }; /** @@ -23,27 +23,37 @@ export const detectConfigChanges = () => { * The current configuration state is read from the icons json file. * @returns List of configurations that needs to be updated. */ -const compareConfigs = (): { updatedConfigs: IconJsonOptions; updatedJSONConfig: IconJsonOptions } => { - const configs = Object.keys(getConfigProperties()) - .map(c => c.split('.').slice(1).join('.')) - // remove configurable notification messages - .filter((c) => !/show(Welcome|Update|Reload)Message/g.test(c)); +const compareConfigs = (): { + updatedConfigs: IconJsonOptions; + updatedJSONConfig: IconJsonOptions; +} => { + const configs = Object.keys(getConfigProperties()) + .map((c) => c.split('.').slice(1).join('.')) + // remove configurable notification messages + .filter((c) => !/show(Welcome|Update|Reload)Message/g.test(c)); - const json = getMaterialIconsJSON(); - return configs.reduce((result, configName) => { - try { - const themeConfig = getThemeConfig(configName); - const configValue = themeConfig.globalValue ?? themeConfig.defaultValue; - const currentState = getObjectPropertyValue(json.options, configName); + const json = getMaterialIconsJSON(); + return configs.reduce( + (result, configName) => { + try { + const themeConfig = getThemeConfig(configName); + const configValue = themeConfig.globalValue ?? themeConfig.defaultValue; + const currentState = getObjectPropertyValue(json.options, configName); - if (JSON.stringify(configValue) !== JSON.stringify(currentState)) { - setObjectPropertyValue(json.options, configName, configValue); - setObjectPropertyValue(result.updatedConfigs, configName, configValue); - } - } catch (error) { - console.error(error); + if (JSON.stringify(configValue) !== JSON.stringify(currentState)) { + setObjectPropertyValue(json.options, configName, configValue); + setObjectPropertyValue( + result.updatedConfigs, + configName, + configValue + ); } + } catch (error) { + console.error(error); + } - return result; - }, { updatedConfigs: {}, updatedJSONConfig: json.options }); + return result; + }, + { updatedConfigs: {}, updatedJSONConfig: json.options } + ); }; diff --git a/src/helpers/customIcons.ts b/src/helpers/customIcons.ts index d358930814..c08e81b9f7 100644 --- a/src/helpers/customIcons.ts +++ b/src/helpers/customIcons.ts @@ -2,7 +2,7 @@ import { IconJsonOptions } from '../models'; import * as path from 'path'; export const getCustomIconPaths = (options: IconJsonOptions) => { - return Object.values(options.files.associations) - .filter(v => v.match(/^[.\/]+/)) // <- custom dirs have a relative path to the dist folder - .map(v => path.dirname(path.join(__dirname, v))); + return Object.values(options.files.associations) + .filter((v) => v.match(/^[.\/]+/)) // <- custom dirs have a relative path to the dist folder + .map((v) => path.dirname(path.join(__dirname, v))); }; diff --git a/src/helpers/fileConfig.ts b/src/helpers/fileConfig.ts index db639a7205..80d9d8fd66 100644 --- a/src/helpers/fileConfig.ts +++ b/src/helpers/fileConfig.ts @@ -6,29 +6,31 @@ import { IconJsonOptions } from '../models'; * @param config Icon Configuration object */ export const getFileConfigHash = (options: IconJsonOptions) => { - try { - const defaults = getDefaultIconOptions(); - let fileConfigString = ''; - if (options.saturation !== defaults.saturation || - options.opacity !== defaults.opacity || - options.folders.color !== defaults.folders.color - ) { - fileConfigString += `~${getHash(JSON.stringify(options))}`; - } - return fileConfigString; - - } catch (error) { - console.error(error); + try { + const defaults = getDefaultIconOptions(); + let fileConfigString = ''; + if ( + options.saturation !== defaults.saturation || + options.opacity !== defaults.opacity || + options.folders.color !== defaults.folders.color + ) { + fileConfigString += `~${getHash(JSON.stringify(options))}`; } + return fileConfigString; + } catch (error) { + console.error(error); + } }; const getHash = (value: string) => { - let hash = 0, i, chr; - if (value.length === 0) return hash; - for (i = 0; i < value.length; i++) { - chr = value.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; - hash |= 0; // Convert to 32bit integer - } - return hash; + let hash = 0, + i, + chr; + if (value.length === 0) return hash; + for (i = 0; i < value.length; i++) { + chr = value.charCodeAt(i); + hash = (hash << 5) - hash + chr; + hash |= 0; // Convert to 32bit integer + } + return hash; }; diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 56442eacf0..186854413e 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -7,26 +7,35 @@ import * as reloadMessages from './../messages/reload'; /** Get configuration of vs code. */ export const getConfig = (section?: string) => { - return vscode.workspace.getConfiguration(section); + return vscode.workspace.getConfiguration(section); }; /** Get list of configuration entries of package.json */ export const getConfigProperties = (): { [config: string]: any } => { - return vscode.extensions.getExtension('PKief.material-icon-theme').packageJSON.contributes.configuration.properties; + return vscode.extensions.getExtension('PKief.material-icon-theme').packageJSON + .contributes.configuration.properties; }; /** Update configuration of vs code. */ -export const setConfig = (section: string, value: any, global: boolean = false) => { - return getConfig().update(section, value, global); +export const setConfig = ( + section: string, + value: any, + global: boolean = false +) => { + return getConfig().update(section, value, global); }; export const getThemeConfig = (section: string) => { - return getConfig('material-icon-theme').inspect(section); + return getConfig('material-icon-theme').inspect(section); }; /** Set the config of the theme. */ -export const setThemeConfig = (section: string, value: any, global: boolean = false) => { - return getConfig('material-icon-theme').update(section, value, global); +export const setThemeConfig = ( + section: string, + value: any, + global: boolean = false +) => { + return getConfig('material-icon-theme').update(section, value, global); }; /** @@ -34,48 +43,58 @@ export const setThemeConfig = (section: string, value: any, global: boolean = fa * @param{boolean} global false by default */ export const isThemeActivated = (global: boolean = false): boolean => { - return global ? getConfig().inspect('workbench.iconTheme').globalValue === 'material-icon-theme' - : getConfig().inspect('workbench.iconTheme').workspaceValue === 'material-icon-theme'; + return global + ? getConfig().inspect('workbench.iconTheme').globalValue === + 'material-icon-theme' + : getConfig().inspect('workbench.iconTheme').workspaceValue === + 'material-icon-theme'; }; /** Is the theme not visible for the user? */ export const isThemeNotVisible = (): boolean => { - const config = getConfig().inspect('workbench.iconTheme'); - return (!isThemeActivated(true) && config.workspaceValue === undefined) || // no workspace and not global - (!isThemeActivated() && config.workspaceValue !== undefined); + const config = getConfig().inspect('workbench.iconTheme'); + return ( + (!isThemeActivated(true) && config.workspaceValue === undefined) || // no workspace and not global + (!isThemeActivated() && config.workspaceValue !== undefined) + ); }; /** Return the path of the extension in the file system. */ -export const getExtensionPath = () => vscode.extensions.getExtension('PKief.material-icon-theme').extensionPath; +export const getExtensionPath = () => + vscode.extensions.getExtension('PKief.material-icon-theme').extensionPath; /** Get the configuration of the icons as JSON Object */ export const getMaterialIconsJSON = (): IconConfiguration => { - const iconJSONPath = path.join(getExtensionPath(), 'dist', iconJsonName); + const iconJSONPath = path.join(getExtensionPath(), 'dist', iconJsonName); - try { - const data = fs.readFileSync(iconJSONPath, 'utf8'); - return JSON.parse(data); - } catch (error) { - console.error(error); - return undefined; - } + try { + const data = fs.readFileSync(iconJSONPath, 'utf8'); + return JSON.parse(data); + } catch (error) { + console.error(error); + return undefined; + } }; /** Reload vs code window */ export const promptToReload = () => { - return reloadMessages.showConfirmToReloadMessage().then(result => { - if (result) reloadWindow(); - }); + return reloadMessages.showConfirmToReloadMessage().then((result) => { + if (result) reloadWindow(); + }); }; const reloadWindow = () => { - return vscode.commands.executeCommand('workbench.action.reloadWindow'); + return vscode.commands.executeCommand('workbench.action.reloadWindow'); }; /** Capitalize the first letter of a string */ -export const capitalizeFirstLetter = (name: string): string => name.charAt(0).toUpperCase() + name.slice(1); +export const capitalizeFirstLetter = (name: string): string => + name.charAt(0).toUpperCase() + name.slice(1); /** TitleCase all words in a string */ export const toTitleCase = (str) => { - return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()); + return str.replace( + /\w\S*/g, + (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() + ); }; diff --git a/src/helpers/objects.ts b/src/helpers/objects.ts index 98e9a076b5..6620a0d982 100644 --- a/src/helpers/objects.ts +++ b/src/helpers/objects.ts @@ -4,27 +4,27 @@ * Source: http://stackoverflow.com/a/6491621/6942210 */ export const getObjectPropertyValue = (obj: Object, path: string) => { - const pathArray = path - .replace(/\[(\w+)\]/g, '.$1') // convert indexes to properties - .replace(/^\./, '') // strip a leading dot - .split('.'); // separate paths in array + const pathArray = path + .replace(/\[(\w+)\]/g, '.$1') // convert indexes to properties + .replace(/^\./, '') // strip a leading dot + .split('.'); // separate paths in array - /** Avoid errors in the getValue function. */ - const isObject = (object) => { - return object === Object(object); - }; + /** Avoid errors in the getValue function. */ + const isObject = (object) => { + return object === Object(object); + }; - let result = JSON.parse(JSON.stringify(obj)); + let result = JSON.parse(JSON.stringify(obj)); - for (let i = 0; i < pathArray.length; ++i) { - const k = pathArray[i]; - if (isObject(result) && k in result) { - result = result[k]; - } else { - return; - } + for (let i = 0; i < pathArray.length; ++i) { + const k = pathArray[i]; + if (isObject(result) && k in result) { + result = result[k]; + } else { + return; } - return result; + } + return result; }; /** @@ -34,15 +34,26 @@ export const getObjectPropertyValue = (obj: Object, path: string) => { * @param value Value to be set for the given property * Source: https://stackoverflow.com/a/13719799/6942210 */ -export const setObjectPropertyValue = (obj: Object, path: string | string[], value: any) => { - if (typeof path === 'string') { - path = path.split('.'); - } +export const setObjectPropertyValue = ( + obj: Object, + path: string | string[], + value: any +) => { + if (typeof path === 'string') { + path = path.split('.'); + } - if (path.length > 1) { - const e = path.shift(); - setObjectPropertyValue(obj[e] = Object.prototype.toString.call(obj[e]) === '[object Object]' ? obj[e] : {}, path, value); - } else { - obj[path[0]] = value; - } + if (path.length > 1) { + const e = path.shift(); + setObjectPropertyValue( + (obj[e] = + Object.prototype.toString.call(obj[e]) === '[object Object]' + ? obj[e] + : {}), + path, + value + ); + } else { + obj[path[0]] = value; + } }; diff --git a/src/helpers/versioning.ts b/src/helpers/versioning.ts index 68a2c476ed..d2921d1184 100644 --- a/src/helpers/versioning.ts +++ b/src/helpers/versioning.ts @@ -3,56 +3,60 @@ import * as vscode from 'vscode'; import * as helpers from './index'; export enum ThemeStatus { - neverUsedBefore, - updated, - current + neverUsedBefore, + updated, + current, } /** Check the current status of the theme */ export const checkThemeStatus = async (state: vscode.Memento) => { - try { - // get the version from the state - const stateVersion = state.get('material-icon-theme.version'); - const packageVersion = getCurrentExtensionVersion(); + try { + // get the version from the state + const stateVersion = state.get('material-icon-theme.version'); + const packageVersion = getCurrentExtensionVersion(); - // check if the theme was used before - if (stateVersion === undefined) { - await updateExtensionVersionInMemento(state); - return themeIsAlreadyActivated() ? ThemeStatus.updated : ThemeStatus.neverUsedBefore; - } - // compare the version in the state with the package version - else if (semver.lt(stateVersion, packageVersion)) { - await updateExtensionVersionInMemento(state); - return ThemeStatus.updated; - } - else { - return ThemeStatus.current; - } + // check if the theme was used before + if (stateVersion === undefined) { + await updateExtensionVersionInMemento(state); + return themeIsAlreadyActivated() + ? ThemeStatus.updated + : ThemeStatus.neverUsedBefore; } - catch (error) { - console.error(error); + // compare the version in the state with the package version + else if (semver.lt(stateVersion, packageVersion)) { + await updateExtensionVersionInMemento(state); + return ThemeStatus.updated; + } else { + return ThemeStatus.current; } + } catch (error) { + console.error(error); + } }; /** Check if the theme was used before */ const themeIsAlreadyActivated = () => { - return helpers.isThemeActivated() || helpers.isThemeActivated(true); + return helpers.isThemeActivated() || helpers.isThemeActivated(true); }; /** Update the version number to the current version in the memento. */ const updateExtensionVersionInMemento = (state: vscode.Memento) => { - return state.update('material-icon-theme.version', getCurrentExtensionVersion()); + return state.update( + 'material-icon-theme.version', + getCurrentExtensionVersion() + ); }; /** Get the current version of the extension */ const getCurrentExtensionVersion = (): string => { - return vscode.extensions.getExtension('PKief.material-icon-theme').packageJSON.version; + return vscode.extensions.getExtension('PKief.material-icon-theme').packageJSON + .version; }; /** * Check if the current version of VS Code * supports new features. -*/ + */ export const checkVersionSupport = (supportedVersion: string): boolean => { - return !semver.lt(vscode.version, supportedVersion); + return !semver.lt(vscode.version, supportedVersion); }; diff --git a/src/i18n/index.ts b/src/i18n/index.ts index c2ebb5498d..6be54ebf3f 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -2,8 +2,7 @@ import * as vscode from 'vscode'; import { getObjectPropertyValue } from '../helpers/objects'; // Get current language of the vs code workspace -export const getCurrentLanguage = (): string => - vscode.env.language; +export const getCurrentLanguage = (): string => vscode.env.language; let currentTranslation; let fallbackTranslation; // default: en @@ -11,27 +10,27 @@ const placeholder = '%'; /** Initialize the translations */ export const initTranslations = async () => { - try { - currentTranslation = await loadTranslation(getCurrentLanguage()); - fallbackTranslation = await loadTranslation('en'); - } catch (error) { - console.error(error); - } + try { + currentTranslation = await loadTranslation(getCurrentLanguage()); + fallbackTranslation = await loadTranslation('en'); + } catch (error) { + console.error(error); + } }; /** Load the required translation */ const loadTranslation = async (language: string) => { - try { - return await getTranslationObject(language); - } catch (error) { - return await getTranslationObject('en'); - } + try { + return await getTranslationObject(language); + } catch (error) { + return await getTranslationObject('en'); + } }; /** Get the translation object of the separated translation files */ const getTranslationObject = async (language: string) => { - const lang = await import(/* webpackMode: "eager" */ `./lang-${language}`); - return lang.translation; + const lang = await import(/* webpackMode: "eager" */ `./lang-${language}`); + return lang.translation; }; /** @@ -40,10 +39,16 @@ const getTranslationObject = async (language: string) => { * With optional parameters you can configure both the translations * and the fallback (required for testing purposes). * */ -export const getTranslationValue = (key: string, translations = currentTranslation, fallback = fallbackTranslation) => { - return getObjectPropertyValue(translations, key) - || getObjectPropertyValue(fallback, key) - || undefined; +export const getTranslationValue = ( + key: string, + translations = currentTranslation, + fallback = fallbackTranslation +) => { + return ( + getObjectPropertyValue(translations, key) || + getObjectPropertyValue(fallback, key) || + undefined + ); }; /** @@ -51,10 +56,10 @@ export const getTranslationValue = (key: string, translations = currentTranslati * It helps to translate a word instantly. */ export const translate = (key: string, words?: string | string[]) => { - const translation = getTranslationValue(key); + const translation = getTranslationValue(key); - if (!words) return translation; - return replace(translation, words); + if (!words) return translation; + return replace(translation, words); }; /** @@ -63,12 +68,12 @@ export const translate = (key: string, words?: string | string[]) => { * parameters ('words'). */ export const replace = (value: string = '', words: string | string[]) => { - let translation: string = value; + let translation: string = value; - const values: string[] = [].concat(words); - values.forEach((e, i) => { - translation = translation.replace(placeholder.concat(i), e); - }); + const values: string[] = [].concat(words); + values.forEach((e, i) => { + translation = translation.replace(placeholder.concat(i), e); + }); - return translation; + return translation; }; diff --git a/src/i18n/lang-de.ts b/src/i18n/lang-de.ts index 010981c739..421e7e6678 100644 --- a/src/i18n/lang-de.ts +++ b/src/i18n/lang-de.ts @@ -1,52 +1,54 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme wurde installiert.', - 'howToActivate': 'Wie Icons aktivieren?', - 'activate': 'Aktivieren', - 'activated': 'Material Icon Theme ist jetzt aktiviert.', - 'neverShowAgain': 'Nicht mehr zeigen', - 'themeUpdated': 'Das Material Icon Theme wurde aktualisiert.', - 'readChangelog': 'Änderungsprotokoll lesen', - 'iconPacks': { - 'selectPack': 'Icon Pack auswählen', - 'description': 'Das \'%0\' Icon Pack auswählen', - 'disabled': 'Icon Packs deaktivieren', + themeInstalled: 'Material Icon Theme wurde installiert.', + howToActivate: 'Wie Icons aktivieren?', + activate: 'Aktivieren', + activated: 'Material Icon Theme ist jetzt aktiviert.', + neverShowAgain: 'Nicht mehr zeigen', + themeUpdated: 'Das Material Icon Theme wurde aktualisiert.', + readChangelog: 'Änderungsprotokoll lesen', + iconPacks: { + selectPack: 'Icon Pack auswählen', + description: "Das '%0' Icon Pack auswählen", + disabled: 'Icon Packs deaktivieren', + }, + folders: { + toggleIcons: 'Wähle ein Ordner Design', + color: 'Wähle eine Ordner Farbe', + hexCode: 'Gebe einen HEX Farbcode ein', + wrongHexCode: 'Ungültiger HEX Farbcode', + disabled: 'Keine Ordner Icons', + theme: { + description: "Wähle das '%0' Design", }, - 'folders': { - 'toggleIcons': 'Wähle ein Ordner Design', - 'color': 'Wähle eine Ordner Farbe', - 'hexCode': 'Gebe einen HEX Farbcode ein', - 'wrongHexCode': 'Ungültiger HEX Farbcode', - 'disabled': 'Keine Ordner Icons', - 'theme': { - 'description': 'Wähle das \'%0\' Design' - }, - }, - 'opacity': { - 'inputPlaceholder': 'Wert der Deckkraft (zwischen 0 und 1)', - 'wrongValue': 'Der Wert muss zwischen 0 und 1 liegen!', - }, - 'toggleSwitch': { - 'on': 'EIN', - 'off': 'AUS' - }, - 'explorerArrows': { - 'toggle': 'Pfeile im Explorer anpassen', - 'enable': 'Explorer Pfeile anzeigen', - 'disable': 'Explorer Pfeile ausblenden' - }, - 'grayscale': { - 'toggle': 'Schaltet graustufige Icons um', - 'enable': 'Aktiviert graustufige Icons', - 'disable': 'Deaktiviert graustufige Icons' - }, - 'saturation': { - 'inputPlaceholder': 'Wert der Sättigung (zwischen 0 und 1)', - 'wrongValue': 'Der Wert muss zwischen 0 und 1 liegen!', - }, - 'confirmReload': 'VS Code muss neu gestartet werden, um die Änderungen an den Icons zu aktivieren.', - 'reload': 'Neu starten', - 'outdatedVersion': 'VS Code muss aktualisiert werden, um diesen Befehl auszuführen.', - 'updateVSCode': 'VS Code aktualisieren' + }, + opacity: { + inputPlaceholder: 'Wert der Deckkraft (zwischen 0 und 1)', + wrongValue: 'Der Wert muss zwischen 0 und 1 liegen!', + }, + toggleSwitch: { + on: 'EIN', + off: 'AUS', + }, + explorerArrows: { + toggle: 'Pfeile im Explorer anpassen', + enable: 'Explorer Pfeile anzeigen', + disable: 'Explorer Pfeile ausblenden', + }, + grayscale: { + toggle: 'Schaltet graustufige Icons um', + enable: 'Aktiviert graustufige Icons', + disable: 'Deaktiviert graustufige Icons', + }, + saturation: { + inputPlaceholder: 'Wert der Sättigung (zwischen 0 und 1)', + wrongValue: 'Der Wert muss zwischen 0 und 1 liegen!', + }, + confirmReload: + 'VS Code muss neu gestartet werden, um die Änderungen an den Icons zu aktivieren.', + reload: 'Neu starten', + outdatedVersion: + 'VS Code muss aktualisiert werden, um diesen Befehl auszuführen.', + updateVSCode: 'VS Code aktualisieren', }; diff --git a/src/i18n/lang-en.ts b/src/i18n/lang-en.ts index f4ec770979..9b6a8ac8a7 100644 --- a/src/i18n/lang-en.ts +++ b/src/i18n/lang-en.ts @@ -1,52 +1,53 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme has been installed.', - 'howToActivate': 'How to activate icons', - 'activate': 'Activate', - 'activated': 'Material Icon Theme is active.', - 'neverShowAgain': 'Never show again', - 'themeUpdated': 'Material Icon Theme has been updated.', - 'readChangelog': 'Read changelog', - 'iconPacks': { - 'selectPack': 'Select an icon pack', - 'description': 'Select the \'%0\' icon pack', - 'disabled': 'Disable icon packs', + themeInstalled: 'Material Icon Theme has been installed.', + howToActivate: 'How to activate icons', + activate: 'Activate', + activated: 'Material Icon Theme is active.', + neverShowAgain: 'Never show again', + themeUpdated: 'Material Icon Theme has been updated.', + readChangelog: 'Read changelog', + iconPacks: { + selectPack: 'Select an icon pack', + description: "Select the '%0' icon pack", + disabled: 'Disable icon packs', + }, + folders: { + toggleIcons: 'Pick a folder theme', + color: 'Choose a folder color', + hexCode: 'Insert a HEX color code', + wrongHexCode: 'Invalid HEX color code!', + disabled: 'No folder icons', + theme: { + description: "Select the '%0' folder theme", }, - 'folders': { - 'toggleIcons': 'Pick a folder theme', - 'color': 'Choose a folder color', - 'hexCode': 'Insert a HEX color code', - 'wrongHexCode': 'Invalid HEX color code!', - 'disabled': 'No folder icons', - 'theme': { - 'description': 'Select the \'%0\' folder theme' - } - }, - 'opacity': { - 'inputPlaceholder': 'Opacity value (between 0 and 1)', - 'wrongValue': 'The value must be between 0 and 1!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': 'Toggle folder arrows', - 'enable': 'Show folder arrows', - 'disable': 'Hide folder arrows' - }, - 'confirmReload': 'You have to restart VS Code to activate the changes to the icons.', - 'reload': 'Restart', - 'outdatedVersion': 'You have to update VS Code to use this command.', - 'updateVSCode': 'Update VS Code', - 'grayscale': { - 'toggle': 'Toggle grayscale icons', - 'enable': 'Enable grayscale icons', - 'disable': 'Disable grayscale icons' - }, - 'saturation': { - 'inputPlaceholder': 'Saturation value (between 0 and 1)', - 'wrongValue': 'The value must be between 0 and 1!', - } + }, + opacity: { + inputPlaceholder: 'Opacity value (between 0 and 1)', + wrongValue: 'The value must be between 0 and 1!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: 'Toggle folder arrows', + enable: 'Show folder arrows', + disable: 'Hide folder arrows', + }, + confirmReload: + 'You have to restart VS Code to activate the changes to the icons.', + reload: 'Restart', + outdatedVersion: 'You have to update VS Code to use this command.', + updateVSCode: 'Update VS Code', + grayscale: { + toggle: 'Toggle grayscale icons', + enable: 'Enable grayscale icons', + disable: 'Disable grayscale icons', + }, + saturation: { + inputPlaceholder: 'Saturation value (between 0 and 1)', + wrongValue: 'The value must be between 0 and 1!', + }, }; diff --git a/src/i18n/lang-es.ts b/src/i18n/lang-es.ts index 2dee638ffc..a66b47016e 100644 --- a/src/i18n/lang-es.ts +++ b/src/i18n/lang-es.ts @@ -1,43 +1,44 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme se ha instalado.', - 'howToActivate': 'Cómo activar los iconos', - 'activate': 'Activar', - 'activated': 'Material Icon Theme está activado.', - 'neverShowAgain': 'No mostrar más', - 'themeUpdated': 'Material Icon Theme se ha actualizado.', - 'readChangelog': 'Leer changelog', - 'iconPacks': { - 'selectPack': 'Seleccione un paquete de iconos', - 'description': 'Seleccione el paquete de iconos \'%0\'', - 'disabled': 'Desactivar paquetes de iconos', + themeInstalled: 'Material Icon Theme se ha instalado.', + howToActivate: 'Cómo activar los iconos', + activate: 'Activar', + activated: 'Material Icon Theme está activado.', + neverShowAgain: 'No mostrar más', + themeUpdated: 'Material Icon Theme se ha actualizado.', + readChangelog: 'Leer changelog', + iconPacks: { + selectPack: 'Seleccione un paquete de iconos', + description: "Seleccione el paquete de iconos '%0'", + disabled: 'Desactivar paquetes de iconos', + }, + folders: { + toggleIcons: 'Cambiar activación de iconos de carpetas', + color: 'Elija un color de carpeta', + hexCode: 'Insertar un código de color HEX', + wrongHexCode: 'Código de color HEX inválido!', + disabled: 'Sin iconos de carpeta', + theme: { + description: "Iconos de carpeta '%0'", }, - 'folders': { - 'toggleIcons': 'Cambiar activación de iconos de carpetas', - 'color': 'Elija un color de carpeta', - 'hexCode': 'Insertar un código de color HEX', - 'wrongHexCode': 'Código de color HEX inválido!', - 'disabled': 'Sin iconos de carpeta', - 'theme': { - 'description': 'Iconos de carpeta \'%0\'' - } - }, - 'opacity': { - 'inputPlaceholder': 'Valor de opacidad (entre 0 y 1)', - 'wrongValue': 'El valor debe estar entre 0 y 1!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': 'Conmutar las flechas de carpetas', - 'enable': 'Mostrar flechas de carpeta', - 'disable': 'Ocultar las flechas de carpetas' - }, - 'confirmReload': 'Debe reiniciar VS Code para activar los cambios en los iconos.', - 'reload': 'Reiniciar', - 'outdatedVersion': 'Debe actualizar VS Code para utilizar este comando.', - 'updateVSCode': 'Actualizar VS Code' + }, + opacity: { + inputPlaceholder: 'Valor de opacidad (entre 0 y 1)', + wrongValue: 'El valor debe estar entre 0 y 1!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: 'Conmutar las flechas de carpetas', + enable: 'Mostrar flechas de carpeta', + disable: 'Ocultar las flechas de carpetas', + }, + confirmReload: + 'Debe reiniciar VS Code para activar los cambios en los iconos.', + reload: 'Reiniciar', + outdatedVersion: 'Debe actualizar VS Code para utilizar este comando.', + updateVSCode: 'Actualizar VS Code', }; diff --git a/src/i18n/lang-fr.ts b/src/i18n/lang-fr.ts index 112730cfef..169087a08d 100644 --- a/src/i18n/lang-fr.ts +++ b/src/i18n/lang-fr.ts @@ -1,43 +1,44 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme a été installé.', - 'howToActivate': 'Comment activer les icônes', - 'activate': 'Activer', - 'activated': 'Material Icon Theme est actif.', - 'neverShowAgain': 'Ne plus afficher', - 'themeUpdated': 'Material Icon Theme a été mis à jour.', - 'readChangelog': 'Lire la liste des changements', - 'iconPacks': { - 'selectPack': 'Sélectionnez un pack d\'icônes', - 'description': 'Sélectionner le pack d\'icônes \'%0\'', - 'disabled': 'Désactiver les paquets d\'icônes', + themeInstalled: 'Material Icon Theme a été installé.', + howToActivate: 'Comment activer les icônes', + activate: 'Activer', + activated: 'Material Icon Theme est actif.', + neverShowAgain: 'Ne plus afficher', + themeUpdated: 'Material Icon Theme a été mis à jour.', + readChangelog: 'Lire la liste des changements', + iconPacks: { + selectPack: "Sélectionnez un pack d'icônes", + description: "Sélectionner le pack d'icônes '%0'", + disabled: "Désactiver les paquets d'icônes", + }, + folders: { + toggleIcons: 'Basculer les icônes de dossiers', + color: 'Choisissez une couleur de dossier', + hexCode: 'Insérer un code couleur HEX', + wrongHexCode: 'Code couleur HEX non valide!', + disabled: 'Aucune icônes de dossiers', + theme: { + description: "Icônes de dossiers '%0'", }, - 'folders': { - 'toggleIcons': 'Basculer les icônes de dossiers', - 'color': 'Choisissez une couleur de dossier', - 'hexCode': 'Insérer un code couleur HEX', - 'wrongHexCode': 'Code couleur HEX non valide!', - 'disabled': 'Aucune icônes de dossiers', - 'theme': { - 'description': 'Icônes de dossiers \'%0\'' - } - }, - 'opacity': { - 'inputPlaceholder': 'Valeur d\'opacité (entre 0 et 1)', - 'wrongValue': 'La valeur doit être comprise entre 0 et 1!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': 'Basculer les flèches du dossier', - 'enable': 'Afficher les flèches du dossier', - 'disable': 'Cacher les flèches de dossier' - }, - 'confirmReload': 'Veuillez redémarrer VS Code pour activer les icônes', - 'reload': 'Redémarrer', - 'outdatedVersion': 'Vous devez mettre VS Code à jour pour utiliser cette commande.', - 'updateVSCode': 'Mettre VS Code à jour.' + }, + opacity: { + inputPlaceholder: "Valeur d'opacité (entre 0 et 1)", + wrongValue: 'La valeur doit être comprise entre 0 et 1!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: 'Basculer les flèches du dossier', + enable: 'Afficher les flèches du dossier', + disable: 'Cacher les flèches de dossier', + }, + confirmReload: 'Veuillez redémarrer VS Code pour activer les icônes', + reload: 'Redémarrer', + outdatedVersion: + 'Vous devez mettre VS Code à jour pour utiliser cette commande.', + updateVSCode: 'Mettre VS Code à jour.', }; diff --git a/src/i18n/lang-nl.ts b/src/i18n/lang-nl.ts index 2e61afd956..2d230bc440 100644 --- a/src/i18n/lang-nl.ts +++ b/src/i18n/lang-nl.ts @@ -1,52 +1,54 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Thema is geïnstalleerd.', - 'howToActivate': 'Hoe je icons activeert', - 'activate': 'Activeer', - 'activated': 'Material Icon Thema is actief.', - 'neverShowAgain': 'Nooit meer laten zien', - 'themeUpdated': 'Material Icon Thema is geüpdated.', - 'readChangelog': 'Lees de changelog', - 'iconPacks': { - 'selectPack': 'Selecteer een iconpakket', - 'description': 'Selecteer het \'%0\' iconpakket', - 'disabled': 'Zet iconpaketten uit', + themeInstalled: 'Material Icon Thema is geïnstalleerd.', + howToActivate: 'Hoe je icons activeert', + activate: 'Activeer', + activated: 'Material Icon Thema is actief.', + neverShowAgain: 'Nooit meer laten zien', + themeUpdated: 'Material Icon Thema is geüpdated.', + readChangelog: 'Lees de changelog', + iconPacks: { + selectPack: 'Selecteer een iconpakket', + description: "Selecteer het '%0' iconpakket", + disabled: 'Zet iconpaketten uit', + }, + folders: { + toggleIcons: 'Kies een folderthema', + color: 'Kies een folderkleur', + hexCode: 'Voeg een HEX kleurcode in', + wrongHexCode: 'Ongeldige HEX kleurcode!', + disabled: 'Geen foldericons', + theme: { + description: "Selecteer het '%0' folderthema", }, - 'folders': { - 'toggleIcons': 'Kies een folderthema', - 'color': 'Kies een folderkleur', - 'hexCode': 'Voeg een HEX kleurcode in', - 'wrongHexCode': 'Ongeldige HEX kleurcode!', - 'disabled': 'Geen foldericons', - 'theme': { - 'description': 'Selecteer het \'%0\' folderthema' - } - }, - 'opacity': { - 'inputPlaceholder': 'Doorzichtbaarheidswaarde (tussen 0 en 1)', - 'wrongValue': 'De waarde moet tussen de 0 en 1 zijn!', - }, - 'toggleSwitch': { - 'on': 'AAN', - 'off': 'UIT' - }, - 'explorerArrows': { - 'toggle': 'Zet folderpijlen aan of uit', - 'enable': 'Laat folderpijlen zien', - 'disable': 'Verberg folderpijlen' - }, - 'confirmReload': 'Je moet VS Code herstarten om de veranderingen in icons te activeren.', - 'reload': 'Herstart', - 'outdatedVersion': 'Je moet VS Code updaten om dit commando te kunnen gebruiken.', - 'updateVSCode': 'Update VS Code', - 'grayscale': { - 'toggle': 'Zet grijsgetinte icons aan of uit', - 'enable': 'Zet grijsgetinte icons aan', - 'disable': 'Zet grijsgetinte icons uit' - }, - 'saturation': { - 'inputPlaceholder': 'Saturatiewaarde (tussen 0 en 1)', - 'wrongValue': 'De waarde moet tussen de 0 en 1 zijn!', - } + }, + opacity: { + inputPlaceholder: 'Doorzichtbaarheidswaarde (tussen 0 en 1)', + wrongValue: 'De waarde moet tussen de 0 en 1 zijn!', + }, + toggleSwitch: { + on: 'AAN', + off: 'UIT', + }, + explorerArrows: { + toggle: 'Zet folderpijlen aan of uit', + enable: 'Laat folderpijlen zien', + disable: 'Verberg folderpijlen', + }, + confirmReload: + 'Je moet VS Code herstarten om de veranderingen in icons te activeren.', + reload: 'Herstart', + outdatedVersion: + 'Je moet VS Code updaten om dit commando te kunnen gebruiken.', + updateVSCode: 'Update VS Code', + grayscale: { + toggle: 'Zet grijsgetinte icons aan of uit', + enable: 'Zet grijsgetinte icons aan', + disable: 'Zet grijsgetinte icons uit', + }, + saturation: { + inputPlaceholder: 'Saturatiewaarde (tussen 0 en 1)', + wrongValue: 'De waarde moet tussen de 0 en 1 zijn!', + }, }; diff --git a/src/i18n/lang-pl.ts b/src/i18n/lang-pl.ts index 9c73ed3064..67687b114f 100644 --- a/src/i18n/lang-pl.ts +++ b/src/i18n/lang-pl.ts @@ -1,52 +1,52 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Motyw Material Icon został zainstalowany.', - 'howToActivate': 'Jak aktywować ikony', - 'activate': 'Aktywuj', - 'activated': 'Motyw Material Icon jest aktywny.', - 'neverShowAgain': 'Nigdy więcej nie pokazuj', - 'themeUpdated': 'Motyw Material Icon został zaktualizowany.', - 'readChangelog': 'Przeczytaj listę zmian', - 'iconPacks': { - 'selectPack': 'Wybierz paczkę ikon', - 'description': 'Wybierz paczkę ikon \'%0\'', - 'disabled': 'Wyłącz paczki ikon', + themeInstalled: 'Motyw Material Icon został zainstalowany.', + howToActivate: 'Jak aktywować ikony', + activate: 'Aktywuj', + activated: 'Motyw Material Icon jest aktywny.', + neverShowAgain: 'Nigdy więcej nie pokazuj', + themeUpdated: 'Motyw Material Icon został zaktualizowany.', + readChangelog: 'Przeczytaj listę zmian', + iconPacks: { + selectPack: 'Wybierz paczkę ikon', + description: "Wybierz paczkę ikon '%0'", + disabled: 'Wyłącz paczki ikon', + }, + folders: { + toggleIcons: 'Wybierz motyw folderów', + color: 'Wybierz kolor folderów', + hexCode: 'Podaj kolor w formacie HEX', + wrongHexCode: 'Nieprawidłowy kolor HEX!', + disabled: 'Brak ikon folderów', + theme: { + description: "Wybierz motyw folderów '%0'", }, - 'folders': { - 'toggleIcons': 'Wybierz motyw folderów', - 'color': 'Wybierz kolor folderów', - 'hexCode': 'Podaj kolor w formacie HEX', - 'wrongHexCode': 'Nieprawidłowy kolor HEX!', - 'disabled': 'Brak ikon folderów', - 'theme': { - 'description': 'Wybierz motyw folderów \'%0\'' - } - }, - 'opacity': { - 'inputPlaceholder': 'Wartość przezroczystości (pomiędzy 0 a 1)', - 'wrongValue': 'Wartość musi być pomiędzy 0 i 1!', - }, - 'toggleSwitch': { - 'on': 'WŁĄCZONE', - 'off': 'WYŁĄCZONE' - }, - 'explorerArrows': { - 'toggle': 'Przełącz strzałki przy folderach', - 'enable': 'Pokaż strzałki przy folderach', - 'disable': 'Schowaj strzałki przy folderach' - }, - 'confirmReload': 'Musisz zrestartować VS Code, aby uaktywnić zmiany ikon.', - 'reload': 'Restartuj', - 'outdatedVersion': 'Musisz zaktualizować VS Code, aby użyć tej komendy.', - 'updateVSCode': 'Zaktualizuj VS Code', - 'grayscale': { - 'toggle': 'Przełącz czarno-białe ikony', - 'enable': 'Włącz czarno-białe ikony', - 'disable': 'Wyłącz czarno-białe ikony' - }, - 'saturation': { - 'inputPlaceholder': 'Wartość nasycenia (pomiędzy 0 a 1)', - 'wrongValue': 'Wartość musi być pomiędzy 0 i 1!', - } + }, + opacity: { + inputPlaceholder: 'Wartość przezroczystości (pomiędzy 0 a 1)', + wrongValue: 'Wartość musi być pomiędzy 0 i 1!', + }, + toggleSwitch: { + on: 'WŁĄCZONE', + off: 'WYŁĄCZONE', + }, + explorerArrows: { + toggle: 'Przełącz strzałki przy folderach', + enable: 'Pokaż strzałki przy folderach', + disable: 'Schowaj strzałki przy folderach', + }, + confirmReload: 'Musisz zrestartować VS Code, aby uaktywnić zmiany ikon.', + reload: 'Restartuj', + outdatedVersion: 'Musisz zaktualizować VS Code, aby użyć tej komendy.', + updateVSCode: 'Zaktualizuj VS Code', + grayscale: { + toggle: 'Przełącz czarno-białe ikony', + enable: 'Włącz czarno-białe ikony', + disable: 'Wyłącz czarno-białe ikony', + }, + saturation: { + inputPlaceholder: 'Wartość nasycenia (pomiędzy 0 a 1)', + wrongValue: 'Wartość musi być pomiędzy 0 i 1!', + }, }; diff --git a/src/i18n/lang-pt-br.ts b/src/i18n/lang-pt-br.ts index eca8a190be..a242456ff1 100644 --- a/src/i18n/lang-pt-br.ts +++ b/src/i18n/lang-pt-br.ts @@ -1,43 +1,44 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'O Material Icon Theme foi instalado.', - 'howToActivate': 'Como ativar os ícones', - 'activate': 'Ativar', - 'activated': 'O Material Icon Theme está ativo.', - 'neverShowAgain': 'Não mostrar novamente', - 'themeUpdated': 'O Material Icon Theme foi atualizado.', - 'readChangelog': 'Ler changelog', - 'iconPacks': { - 'selectPack': 'Selecione um pacote de ícones', - 'description': 'Selecionar o pacote de ícones \'%0\'', - 'disabled': 'Desabilitar pacotes de ícones', + themeInstalled: 'O Material Icon Theme foi instalado.', + howToActivate: 'Como ativar os ícones', + activate: 'Ativar', + activated: 'O Material Icon Theme está ativo.', + neverShowAgain: 'Não mostrar novamente', + themeUpdated: 'O Material Icon Theme foi atualizado.', + readChangelog: 'Ler changelog', + iconPacks: { + selectPack: 'Selecione um pacote de ícones', + description: "Selecionar o pacote de ícones '%0'", + disabled: 'Desabilitar pacotes de ícones', + }, + folders: { + toggleIcons: 'Escolha um tema para as pastas', + color: 'Escolha uma cor para as pastas', + hexCode: 'Insira um código de cor hexadecimal', + wrongHexCode: 'Código de cor hexadecimal inválido!', + disabled: 'Nenhum ícone de pasta', + theme: { + description: "Selecionar o tema para pastas '%0'", }, - 'folders': { - 'toggleIcons': 'Escolha um tema para as pastas', - 'color': 'Escolha uma cor para as pastas', - 'hexCode': 'Insira um código de cor hexadecimal', - 'wrongHexCode': 'Código de cor hexadecimal inválido!', - 'disabled': 'Nenhum ícone de pasta', - 'theme': { - 'description': 'Selecionar o tema para pastas \'%0\'' - } - }, - 'opacity': { - 'inputPlaceholder': 'Valor de opacidade (entre 0 e 1)', - 'wrongValue': 'O valor deve estar entre 0 e 1!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': 'Alternar setas do explorador de arquivos', - 'enable': 'Exibir setas do explorador de arquivos', - 'disable': 'Ocultar setas do explorador de arquivos' - }, - 'confirmReload': 'Você precisa reiniciar o VS Code para ativar a mudança de ícones.', - 'reload': 'Reiniciar', - 'outdatedVersion': 'Você precisa atualizar o VS Code para usar esse comando.', - 'updateVSCode': 'Atualizar VS Code' + }, + opacity: { + inputPlaceholder: 'Valor de opacidade (entre 0 e 1)', + wrongValue: 'O valor deve estar entre 0 e 1!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: 'Alternar setas do explorador de arquivos', + enable: 'Exibir setas do explorador de arquivos', + disable: 'Ocultar setas do explorador de arquivos', + }, + confirmReload: + 'Você precisa reiniciar o VS Code para ativar a mudança de ícones.', + reload: 'Reiniciar', + outdatedVersion: 'Você precisa atualizar o VS Code para usar esse comando.', + updateVSCode: 'Atualizar VS Code', }; diff --git a/src/i18n/lang-pt-pt.ts b/src/i18n/lang-pt-pt.ts index 6171020461..606a84efab 100644 --- a/src/i18n/lang-pt-pt.ts +++ b/src/i18n/lang-pt-pt.ts @@ -1,43 +1,44 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'O Material Icon Theme foi instalado.', - 'howToActivate': 'Como habilitar os ícones', - 'activate': 'Habilitar', - 'activated': 'O Material Icon Theme está habilitado.', - 'neverShowAgain': 'Não mostrar novamente', - 'themeUpdated': 'O Material Icon Theme foi atualizado.', - 'readChangelog': 'Ler registos', - 'iconPacks': { - 'selectPack': 'Seleccione um pacote de ícones', - 'description': 'Seleccionar o pacote de ícones \'%0\'', - 'disabled': 'Desabilitar pacotes de ícones', + themeInstalled: 'O Material Icon Theme foi instalado.', + howToActivate: 'Como habilitar os ícones', + activate: 'Habilitar', + activated: 'O Material Icon Theme está habilitado.', + neverShowAgain: 'Não mostrar novamente', + themeUpdated: 'O Material Icon Theme foi atualizado.', + readChangelog: 'Ler registos', + iconPacks: { + selectPack: 'Seleccione um pacote de ícones', + description: "Seleccionar o pacote de ícones '%0'", + disabled: 'Desabilitar pacotes de ícones', + }, + folders: { + toggleIcons: 'Escolhe um tema para os directórios', + color: 'Escolhe uma cor para os directórios', + hexCode: 'Insira um código de cor hexadecimal', + wrongHexCode: 'Código de cor hexadecimal inválido!', + disabled: 'Nenhum ícone do directório', + theme: { + description: "Seleccionar o tema para directórios '%0'", }, - 'folders': { - 'toggleIcons': 'Escolhe um tema para os directórios', - 'color': 'Escolhe uma cor para os directórios', - 'hexCode': 'Insira um código de cor hexadecimal', - 'wrongHexCode': 'Código de cor hexadecimal inválido!', - 'disabled': 'Nenhum ícone do directório', - 'theme': { - 'description': 'Seleccionar o tema para directórios \'%0\'' - } - }, - 'opacity': { - 'inputPlaceholder': 'Valor de opacidade (entre 0 e 1)', - 'wrongValue': 'O valor deve estar entre 0 e 1!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': 'Alternar setas do explorador de ficheiros', - 'enable': 'Exibir setas do explorador de ficheiros', - 'disable': 'Ocultar setas do explorador de ficheiros' - }, - 'confirmReload': 'Precisas reinicializar o VS Code para habilitar a alteração de ícones.', - 'reload': 'Reiniciar', - 'outdatedVersion': 'Precisas actualizar o VS Code para utilizar este comando.', - 'updateVSCode': 'Actualizar o VS Code' + }, + opacity: { + inputPlaceholder: 'Valor de opacidade (entre 0 e 1)', + wrongValue: 'O valor deve estar entre 0 e 1!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: 'Alternar setas do explorador de ficheiros', + enable: 'Exibir setas do explorador de ficheiros', + disable: 'Ocultar setas do explorador de ficheiros', + }, + confirmReload: + 'Precisas reinicializar o VS Code para habilitar a alteração de ícones.', + reload: 'Reiniciar', + outdatedVersion: 'Precisas actualizar o VS Code para utilizar este comando.', + updateVSCode: 'Actualizar o VS Code', }; diff --git a/src/i18n/lang-ru.ts b/src/i18n/lang-ru.ts index 84c0ab9f64..e41a5eee63 100644 --- a/src/i18n/lang-ru.ts +++ b/src/i18n/lang-ru.ts @@ -1,43 +1,43 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme был установлен.', - 'howToActivate': 'Как активировать иконки', - 'activate': 'Активировать', - 'activated': 'Material Icon Theme активен.', - 'neverShowAgain': 'Никогда не показывать снова', - 'themeUpdated': 'Material Icon Theme был обновлен.', - 'readChangelog': 'Читать изменения версии', - 'iconPacks': { - 'selectPack': 'Выбрать набор иконок', - 'description': 'Выбрать \'%0\' набор иконок', - 'disabled': 'Выключить набор иконок', + themeInstalled: 'Material Icon Theme был установлен.', + howToActivate: 'Как активировать иконки', + activate: 'Активировать', + activated: 'Material Icon Theme активен.', + neverShowAgain: 'Никогда не показывать снова', + themeUpdated: 'Material Icon Theme был обновлен.', + readChangelog: 'Читать изменения версии', + iconPacks: { + selectPack: 'Выбрать набор иконок', + description: "Выбрать '%0' набор иконок", + disabled: 'Выключить набор иконок', + }, + folders: { + toggleIcons: 'Выбрать тему папки', + color: 'Выбрать цвет папки', + hexCode: 'Вставить HEX-код цвета', + wrongHexCode: 'Неверный HEX-код цвета!', + disabled: 'Нет иконки для папки', + theme: { + description: "Выбрать '%0' тему папки", }, - 'folders': { - 'toggleIcons': 'Выбрать тему папки', - 'color': 'Выбрать цвет папки', - 'hexCode': 'Вставить HEX-код цвета', - 'wrongHexCode': 'Неверный HEX-код цвета!', - 'disabled': 'Нет иконки для папки', - 'theme': { - 'description': 'Выбрать \'%0\' тему папки' - } - }, - 'opacity': { - 'inputPlaceholder': 'Значение непрозрачности (от 0 до 1)', - 'wrongValue': 'Значение должно быть от 0 до 1!', - }, - 'toggleSwitch': { - 'on': 'Включить', - 'off': 'Выключить' - }, - 'explorerArrows': { - 'toggle': 'Показать/Скрыть стрелки у папок', - 'enable': 'Показать стрелки у папок', - 'disable': 'Скрыть стрелки у папок' - }, - 'confirmReload': 'Нужно перезапустить VS Code для активации иконок.', - 'reload': 'Перезагрузить', - 'outdatedVersion': 'Нужно обновить VS Code чтобы использовать эту команду.', - 'updateVSCode': 'Обновить VS Code' + }, + opacity: { + inputPlaceholder: 'Значение непрозрачности (от 0 до 1)', + wrongValue: 'Значение должно быть от 0 до 1!', + }, + toggleSwitch: { + on: 'Включить', + off: 'Выключить', + }, + explorerArrows: { + toggle: 'Показать/Скрыть стрелки у папок', + enable: 'Показать стрелки у папок', + disable: 'Скрыть стрелки у папок', + }, + confirmReload: 'Нужно перезапустить VS Code для активации иконок.', + reload: 'Перезагрузить', + outdatedVersion: 'Нужно обновить VS Code чтобы использовать эту команду.', + updateVSCode: 'Обновить VS Code', }; diff --git a/src/i18n/lang-uk.ts b/src/i18n/lang-uk.ts index 50154cdc1c..12158875b9 100644 --- a/src/i18n/lang-uk.ts +++ b/src/i18n/lang-uk.ts @@ -1,22 +1,24 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material Icon Theme був встановлений.', - 'howToActivate': 'Як активувати значки', - 'activate': 'Активувати', - 'activated': 'Material Icon Theme активований.', - 'neverShowAgain': 'Ніколи не показувати знову', - 'themeUpdated': 'Material Icon Theme був оновлений.', - 'readChangelog': 'Прочитати зміни', - 'folders': { - 'toggleIcons': 'Переключити теку icons' - }, - 'toggleSwitch': { - 'on': 'Включити', - 'off': 'Відключити' - }, - 'confirmReload': 'Необхідно перезавантажити VS Code, щоб активувати зміни значків.', - 'reload': 'Перезавантажити', - 'outdatedVersion': 'Ви повинні оновити VS Code, щоб використовувати цю команду.', - 'updateVSCode': 'Оновити VS Code' + themeInstalled: 'Material Icon Theme був встановлений.', + howToActivate: 'Як активувати значки', + activate: 'Активувати', + activated: 'Material Icon Theme активований.', + neverShowAgain: 'Ніколи не показувати знову', + themeUpdated: 'Material Icon Theme був оновлений.', + readChangelog: 'Прочитати зміни', + folders: { + toggleIcons: 'Переключити теку icons', + }, + toggleSwitch: { + on: 'Включити', + off: 'Відключити', + }, + confirmReload: + 'Необхідно перезавантажити VS Code, щоб активувати зміни значків.', + reload: 'Перезавантажити', + outdatedVersion: + 'Ви повинні оновити VS Code, щоб використовувати цю команду.', + updateVSCode: 'Оновити VS Code', }; diff --git a/src/i18n/lang-zh-cn.ts b/src/i18n/lang-zh-cn.ts index e5bf468898..e332c5522d 100644 --- a/src/i18n/lang-zh-cn.ts +++ b/src/i18n/lang-zh-cn.ts @@ -1,43 +1,43 @@ import { Translation } from '../models'; export const translation: Translation = { - 'themeInstalled': 'Material主题图标已安装', - 'howToActivate': '如何激活图标', - 'activate': '激活', - 'activated': 'Material主题图标已激活', - 'neverShowAgain': '不再显示', - 'themeUpdated': 'Material主题图标已更新', - 'readChangelog': '阅读更新日志', - 'iconPacks': { - 'selectPack': '选择图标包', - 'description': '选择%0符号', - 'disabled': '禁用图标包', + themeInstalled: 'Material主题图标已安装', + howToActivate: '如何激活图标', + activate: '激活', + activated: 'Material主题图标已激活', + neverShowAgain: '不再显示', + themeUpdated: 'Material主题图标已更新', + readChangelog: '阅读更新日志', + iconPacks: { + selectPack: '选择图标包', + description: '选择%0符号', + disabled: '禁用图标包', + }, + folders: { + toggleIcons: '切换文件夹图标的显示', + color: '选择一个文件夹颜色', + hexCode: '插入HEX颜色代码', + wrongHexCode: '无效的HEX颜色代码!', + disabled: '不显示文件夹图标', + theme: { + description: "'%0'主题的文件夹图标", }, - 'folders': { - 'toggleIcons': '切换文件夹图标的显示', - 'color': '选择一个文件夹颜色', - 'hexCode': '插入HEX颜色代码', - 'wrongHexCode': '无效的HEX颜色代码!', - 'disabled': '不显示文件夹图标', - 'theme': { - 'description': '\'%0\'主题的文件夹图标' - } - }, - 'opacity': { - 'inputPlaceholder': '不透明度值(0和1之间)', - 'wrongValue': '该值必须介于0和1之间!', - }, - 'toggleSwitch': { - 'on': 'ON', - 'off': 'OFF' - }, - 'explorerArrows': { - 'toggle': '切换文件夹箭头', - 'enable': '显示文件夹箭头', - 'disable': '隐藏文件夹箭头' - }, - 'confirmReload': '你必须重启VS Code来应用对图标的更改', - 'reload': '重启', - 'outdatedVersion': '你必须更新VS Code才能使用该命令', - 'updateVSCode': '更新VS Code' + }, + opacity: { + inputPlaceholder: '不透明度值(0和1之间)', + wrongValue: '该值必须介于0和1之间!', + }, + toggleSwitch: { + on: 'ON', + off: 'OFF', + }, + explorerArrows: { + toggle: '切换文件夹箭头', + enable: '显示文件夹箭头', + disable: '隐藏文件夹箭头', + }, + confirmReload: '你必须重启VS Code来应用对图标的更改', + reload: '重启', + outdatedVersion: '你必须更新VS Code才能使用该命令', + updateVSCode: '更新VS Code', }; diff --git a/src/icons/fileIcons.ts b/src/icons/fileIcons.ts index aba125fc14..f274154d11 100644 --- a/src/icons/fileIcons.ts +++ b/src/icons/fileIcons.ts @@ -4,966 +4,1277 @@ import { FileIcons, IconPack } from '../models/index'; * Defines file icons */ export const fileIcons: FileIcons = { - defaultIcon: { name: 'file' }, - icons: [ - { name: 'html', fileExtensions: ['htm', 'xhtml', 'html_vm', 'asp'] }, - { - name: 'pug', - fileExtensions: ['jade', 'pug'], - fileNames: [ - '.pug-lintrc', - '.pug-lintrc.js', - '.pug-lintrc.json' - ] - }, - { - name: 'markdown', - fileExtensions: [ - 'md', - 'markdown', - 'rst' - ] - }, - { name: 'blink', fileExtensions: ['blink'], light: true }, - { name: 'css', fileExtensions: ['css'] }, - { name: 'sass', fileExtensions: ['scss', 'sass'] }, - { name: 'less', fileExtensions: ['less'] }, - { - name: 'json', - fileExtensions: ['json', 'tsbuildinfo', 'json5', 'jsonl', 'ndjson'], - fileNames: [ - '.jscsrc', - '.jshintrc', - 'composer.lock', - '.jsbeautifyrc', - '.esformatter', - 'cdp.pid', - '.mjmlconfig', - ] - }, - { - name: 'jinja', - fileExtensions: ['jinja', 'jinja2', 'j2', 'jinja-html'], - light: true - }, - { - name: 'sublime', - fileExtensions: ['sublime-project', 'sublime-workspace'] - }, - { name: 'yaml', fileExtensions: ['yaml', 'YAML-tmLanguage', 'yml'] }, - { - name: 'xml', - fileExtensions: [ - 'xml', - 'plist', - 'xsd', - 'dtd', - 'xsl', - 'xslt', - 'resx', - 'iml', - 'xquery', - 'tmLanguage', - 'manifest', - 'project' - ], - fileNames: ['.htaccess'] - }, - { - name: 'image', - fileExtensions: [ - 'png', - 'jpeg', - 'jpg', - 'gif', - 'ico', - 'tif', - 'tiff', - 'psd', - 'psb', - 'ami', - 'apx', - 'bmp', - 'bpg', - 'brk', - 'cur', - 'dds', - 'dng', - 'exr', - 'fpx', - 'gbr', - 'img', - 'jbig2', - 'jb2', - 'jng', - 'jxr', - 'pbm', - 'pgf', - 'pic', - 'raw', - 'webp', - 'eps', - 'afphoto', - 'ase', - 'aseprite', - 'clip', - 'cpt', - 'heif', - 'heic', - 'kra', - 'mdp', - 'ora', - 'pdn', - 'reb', - 'sai', - 'tga', - 'xcf' - ] - }, - { name: 'javascript', fileExtensions: ['js', 'esx', 'mjs'] }, - { name: 'react', fileExtensions: ['jsx'] }, - { name: 'react_ts', fileExtensions: ['tsx'] }, - { - name: 'routing', - fileExtensions: ['routing.ts', 'routing.tsx', 'routing.js', 'routing.jsx', 'routes.ts', 'routes.tsx', 'routes.js', 'routes.jsx'], - fileNames: ['router.js', 'router.jsx', 'router.ts', 'router.tsx', 'routes.js', 'routes.jsx', 'routes.ts', 'routes.tsx'], - enabledFor: [IconPack.Angular, IconPack.Ngrx, IconPack.React, IconPack.Redux, IconPack.Vue, IconPack.Vuex] - }, - { - name: 'redux-action', - fileExtensions: ['action.js', 'actions.js', 'action.ts', 'actions.ts'], - fileNames: ['action.js', 'actions.js', 'action.ts', 'actions.ts'], - enabledFor: [IconPack.Redux] - }, - { - name: 'redux-reducer', - fileExtensions: ['reducer.js', 'reducers.js', 'reducer.ts', 'reducers.ts'], - fileNames: ['reducer.js', 'reducers.js', 'reducer.ts', 'reducers.ts'], - enabledFor: [IconPack.Redux] - }, - { - name: 'redux-store', - fileExtensions: ['store.js', 'store.ts'], - fileNames: ['store.js', 'store.ts'], - enabledFor: [IconPack.Redux] - }, - { - name: 'settings', - fileExtensions: [ - 'ini', - 'dlc', - 'dll', - 'config', - 'conf', - 'properties', - 'prop', - 'settings', - 'option', - 'props', - 'toml', - 'prefs', - 'sln.dotsettings', - 'sln.dotsettings.user', - 'cfg' - ], - fileNames: [ - '.jshintignore', - '.buildignore', - '.mrconfig', - '.yardopts', - 'manifest.mf', - '.clang-format', - '.clang-tidy' - ] - }, - { name: 'typescript', fileExtensions: ['ts'] }, - { name: 'typescript-def', fileExtensions: ['d.ts'] }, - { name: 'markojs', fileExtensions: ['marko'] }, - { name: 'pdf', fileExtensions: ['pdf'] }, - { name: 'table', fileExtensions: ['xlsx', 'xls', 'csv', 'tsv'] }, - { - name: 'vscode', - fileExtensions: ['vscodeignore', 'vsixmanifest', 'vsix', 'code-workplace'] - }, - { - name: 'visualstudio', - fileExtensions: [ - 'csproj', - 'ruleset', - 'sln', - 'suo', - 'vb', - 'vbs', - 'vcxitems', - 'vcxitems.filters', - 'vcxproj', - 'vcxproj.filters' - ] - }, - { - name: 'database', - fileExtensions: ['pdb', 'sql', 'pks', 'pkb', 'accdb', 'mdb', 'sqlite', 'pgsql', 'postgres', 'psql'] - }, - { name: 'csharp', fileExtensions: ['cs', 'csx'] }, - { name: 'qsharp', fileExtensions: ['qs'] }, - { - name: 'zip', - fileExtensions: [ - 'zip', - 'tar', - 'gz', - 'xz', - 'br', - 'bzip2', - 'gzip', - 'brotli', - '7z', - 'rar', - 'tgz' - ] - }, - { name: 'vala', fileExtensions: ['vala'] }, - { name: 'zig', fileExtensions: ['zig'] }, - { name: 'exe', fileExtensions: ['exe', 'msi'] }, - { name: 'java', fileExtensions: ['java', 'jar', 'jsp'] }, - { name: 'c', fileExtensions: ['c', 'm', 'i', 'mi'] }, - { name: 'h', fileExtensions: ['h'] }, - { name: 'cpp', fileExtensions: ['cc', 'cpp', 'cxx', 'c++', 'cp', 'mm', 'mii', 'ii'] }, - { name: 'hpp', fileExtensions: ['hh', 'hpp', 'hxx', 'h++', 'hp', 'tcc', 'inl'] }, - { name: 'go', fileExtensions: ['go'] }, - { name: 'go-mod', fileNames: ['go.mod', 'go.sum'] }, - { name: 'python', fileExtensions: ['py'] }, - { - name: 'python-misc', - fileExtensions: ['pyc', 'whl'], - fileNames: ['requirements.txt', 'pipfile', '.python-version', 'manifest.in'] - }, - { name: 'url', fileExtensions: ['url'] }, - { - name: 'console', - fileExtensions: [ - 'sh', - 'ksh', - 'csh', - 'tcsh', - 'zsh', - 'bash', - 'bat', - 'cmd', - 'awk', - 'fish' - ] - }, - { - name: 'powershell', - fileExtensions: ['ps1', 'psm1', 'psd1', 'ps1xml', 'psc1', 'pssc'] - }, - { - name: 'gradle', - fileExtensions: ['gradle'], - fileNames: ['gradle.properties', 'gradlew', 'gradle-wrapper.properties'] - }, - { name: 'word', fileExtensions: ['doc', 'docx', 'rtf'] }, - { - name: 'certificate', - fileExtensions: ['cer', 'cert', 'crt'], - fileNames: [ - 'license', - 'license.md', - 'license.txt', - 'licence', - 'licence.md', - 'licence.txt', - 'unlicense', - 'unlicense.md', - 'unlicense.txt' - ] - }, - { - name: 'key', - fileExtensions: ['pub', 'key', 'pem', 'asc', 'gpg'], - fileNames: ['.htpasswd'] - }, - { - name: 'font', - fileExtensions: [ - 'woff', - 'woff2', - 'ttf', - 'eot', - 'suit', - 'otf', - 'bmap', - 'fnt', - 'odttf', - 'ttc', - 'font', - 'fonts', - 'sui', - 'ntf', - 'mrf' - ] - }, - { name: 'lib', fileExtensions: ['lib', 'bib'] }, - { name: 'ruby', fileExtensions: ['rb', 'erb'] }, - { name: 'gemfile', fileNames: ['gemfile'] }, - { name: 'fsharp', fileExtensions: ['fs', 'fsx', 'fsi', 'fsproj'] }, - { name: 'swift', fileExtensions: ['swift'] }, - { name: 'arduino', fileExtensions: ['ino'] }, - { - name: 'docker', - fileExtensions: ['dockerignore', 'dockerfile'], - fileNames: [ - 'dockerfile', - 'dockerfile.prod', - 'dockerfile.production', - 'docker-compose.yml', - 'docker-compose.yaml', - 'docker-compose.dev.yml', - 'docker-compose.local.yml', - 'docker-compose.ci.yml', - 'docker-compose.override.yml', - 'docker-compose.staging.yml', - 'docker-compose.prod.yml', - 'docker-compose.production.yml', - 'docker-compose.test.yml' - ] - }, - { name: 'tex', fileExtensions: ['tex', 'sty', 'dtx', 'ltx'] }, - { - name: 'powerpoint', - fileExtensions: [ - 'pptx', - 'ppt', - 'pptm', - 'potx', - 'potm', - 'ppsx', - 'ppsm', - 'pps', - 'ppam', - 'ppa' - ] - }, - { - name: 'video', - fileExtensions: [ - 'webm', - 'mkv', - 'flv', - 'vob', - 'ogv', - 'ogg', - 'gifv', - 'avi', - 'mov', - 'qt', - 'wmv', - 'yuv', - 'rm', - 'rmvb', - 'mp4', - 'm4v', - 'mpg', - 'mp2', - 'mpeg', - 'mpe', - 'mpv', - 'm2v' - ] - }, - { name: 'virtual', fileExtensions: ['vdi', 'vbox', 'vbox-prev'] }, - { name: 'email', fileExtensions: ['ics'], fileNames: ['.mailmap'] }, - { name: 'audio', fileExtensions: ['mp3', 'flac', 'm4a', 'wma', 'aiff'] }, - { name: 'coffee', fileExtensions: ['coffee', 'cson', 'iced'] }, - { name: 'document', fileExtensions: ['txt'] }, - { name: 'graphql', fileExtensions: ['graphql', 'gql'], fileNames: ['.graphqlconfig'] }, - { name: 'rust', fileExtensions: ['rs'] }, - { name: 'raml', fileExtensions: ['raml'] }, - { name: 'xaml', fileExtensions: ['xaml'] }, - { name: 'haskell', fileExtensions: ['hs'] }, - { name: 'kotlin', fileExtensions: ['kt', 'kts'] }, - { - name: 'git', - fileExtensions: ['patch'], - fileNames: [ - '.gitignore', - '.gitconfig', - '.gitattributes', - '.gitmodules', - '.gitkeep', - 'git-history' - ] - }, - { name: 'lua', fileExtensions: ['lua'], fileNames: ['.luacheckrc'] }, - { name: 'clojure', fileExtensions: ['clj', 'cljs', 'cljc'] }, - { name: 'groovy', fileExtensions: ['groovy'] }, - { name: 'r', fileExtensions: ['r', 'rmd'], fileNames: ['.Rhistory'] }, - { name: 'dart', fileExtensions: ['dart'] }, - { name: 'actionscript', fileExtensions: ['as'] }, - { name: 'mxml', fileExtensions: ['mxml'] }, - { name: 'autohotkey', fileExtensions: ['ahk'] }, - { name: 'flash', fileExtensions: ['swf'] }, - { name: 'swc', fileExtensions: ['swc'] }, - { - name: 'cmake', - fileExtensions: ['cmake'], - fileNames: ['cmakelists.txt', 'cmakecache.txt'] - }, - { - name: 'assembly', - fileExtensions: [ - 'asm', - 'a51', - 'inc', - 'nasm', - 's', - 'ms', - 'agc', - 'ags', - 'aea', - 'argus', - 'mitigus', - 'binsource' - ] - }, - { name: 'vue', fileExtensions: ['vue'] }, - { name: 'vue-config', fileNames: ['vue.config.js', 'vue.config.ts'] }, - { name: 'vuex-store', fileExtensions: ['store.js', 'store.ts'], fileNames: ['store.js', 'store.ts'], enabledFor: [IconPack.Vuex] }, - { name: 'nuxt', fileNames: ['nuxt.config.js', 'nuxt.config.ts'] }, - { name: 'ocaml', fileExtensions: ['ml', 'mli', 'cmx'] }, - { name: 'javascript-map', fileExtensions: ['js.map', 'mjs.map'] }, - { name: 'css-map', fileExtensions: ['css.map'] }, - { name: 'lock', fileExtensions: ['lock'], fileNames: ['security.md', 'security.txt', 'security'] }, - { name: 'handlebars', fileExtensions: ['hbs', 'mustache'] }, - { name: 'perl', fileExtensions: ['pm', 'raku'] }, - { name: 'haxe', fileExtensions: ['hx'] }, - { name: 'test-ts', fileExtensions: ['spec.ts', 'e2e-spec.ts', 'test.ts', 'ts.snap'] }, - { - name: 'test-jsx', - fileExtensions: [ - 'spec.tsx', - 'test.tsx', - 'tsx.snap', - 'spec.jsx', - 'test.jsx', - 'jsx.snap' - ] - }, - { name: 'test-js', fileExtensions: ['spec.js', 'e2e-spec.js', 'test.js', 'js.snap'] }, - { - name: 'angular', - fileExtensions: ['module.ts', 'module.js', 'ng-template'], - fileNames: ['angular-cli.json', '.angular-cli.json', 'angular.json'], - enabledFor: [IconPack.Angular, IconPack.Ngrx] - }, - { - name: 'angular-component', - fileExtensions: ['component.ts', 'component.js'], - enabledFor: [IconPack.Angular, IconPack.Ngrx] - }, - { name: 'angular-guard', fileExtensions: ['guard.ts', 'guard.js'], enabledFor: [IconPack.Angular, IconPack.Ngrx] }, - { name: 'angular-service', fileExtensions: ['service.ts', 'service.js'], enabledFor: [IconPack.Angular, IconPack.Ngrx] }, - { - name: 'angular-pipe', - fileExtensions: ['pipe.ts', 'pipe.js', 'filter.js'], - enabledFor: [IconPack.Angular, IconPack.Ngrx] - }, - { - name: 'angular-directive', - fileExtensions: ['directive.ts', 'directive.js'], - enabledFor: [IconPack.Angular, IconPack.Ngrx] - }, - { - name: 'angular-resolver', - fileExtensions: ['resolver.ts', 'resolver.js'], - enabledFor: [IconPack.Angular, IconPack.Ngrx] - }, - { name: 'puppet', fileExtensions: ['pp'] }, - { name: 'elixir', fileExtensions: ['ex', 'exs', 'eex', 'leex'] }, - { name: 'livescript', fileExtensions: ['ls'] }, - { name: 'erlang', fileExtensions: ['erl'] }, - { name: 'twig', fileExtensions: ['twig'] }, - { name: 'julia', fileExtensions: ['jl'] }, - { name: 'elm', fileExtensions: ['elm'] }, - { name: 'purescript', fileExtensions: ['pure', 'purs'] }, - { name: 'smarty', fileExtensions: ['tpl'] }, - { name: 'stylus', fileExtensions: ['styl'] }, - { name: 'reason', fileExtensions: ['re', 'rei'] }, - { name: 'bucklescript', fileExtensions: ['cmj'] }, - { name: 'merlin', fileExtensions: ['merlin'] }, - { name: 'verilog', fileExtensions: ['v', 'vhd', 'sv', 'svh'] }, - { name: 'mathematica', fileExtensions: ['nb'] }, - { name: 'wolframlanguage', fileExtensions: ['wl', 'wls'] }, - { name: 'nunjucks', fileExtensions: ['njk', 'nunjucks'] }, - { name: 'robot', fileExtensions: ['robot'] }, - { name: 'solidity', fileExtensions: ['sol'] }, - { name: 'autoit', fileExtensions: ['au3'] }, - { name: 'haml', fileExtensions: ['haml'] }, - { name: 'yang', fileExtensions: ['yang'] }, - { name: 'mjml', fileExtensions: ['mjml'] }, - { - name: 'vercel', - fileNames: ['vercel.json', '.vercelignore', 'now.json', '.nowignore'], - light: true - }, - { - name: 'terraform', - fileExtensions: ['tf', 'tf.json', 'tfvars', 'tfstate'] - }, - { name: 'laravel', fileExtensions: ['blade.php', 'inky.php'] }, - { name: 'applescript', fileExtensions: ['applescript', 'ipa'] }, - { name: 'cake', fileExtensions: ['cake'] }, - { name: 'cucumber', fileExtensions: ['feature'] }, - { name: 'nim', fileExtensions: ['nim', 'nimble'] }, - { name: 'apiblueprint', fileExtensions: ['apib', 'apiblueprint'] }, - { name: 'riot', fileExtensions: ['riot', 'tag'] }, - { name: 'vfl', fileExtensions: ['vfl'], fileNames: ['.vfl'] }, - { name: 'kl', fileExtensions: ['kl'], fileNames: ['.kl'] }, - { - name: 'postcss', - fileExtensions: ['pcss', 'sss'], - fileNames: ['postcss.config.js', '.postcssrc.js', '.postcssrc', '.postcssrc.json', '.postcssrc.yml'] - }, - { name: 'todo', fileExtensions: ['todo'] }, - { name: 'coldfusion', fileExtensions: ['cfml', 'cfc', 'lucee', 'cfm'] }, - { name: 'cabal', fileExtensions: ['cabal'] }, - { name: 'nix', fileExtensions: ['nix'] }, - { name: 'slim', fileExtensions: ['slim'] }, - { name: 'http', fileExtensions: ['http', 'rest'], fileNames: ['CNAME'] }, - { name: 'restql', fileExtensions: ['rql', 'restql'] }, - { name: 'kivy', fileExtensions: ['kv'] }, - { - name: 'graphcool', - fileExtensions: ['graphcool'], - fileNames: ['project.graphcool'] - }, - { name: 'sbt', fileExtensions: ['sbt'] }, - { - name: 'webpack', - fileNames: [ - 'webpack.js', - 'webpack.ts', - 'webpack.base.js', - 'webpack.base.ts', - 'webpack.config.js', - 'webpack.config.ts', - 'webpack.common.js', - 'webpack.common.ts', - 'webpack.config.common.js', - 'webpack.config.common.ts', - 'webpack.config.common.babel.js', - 'webpack.config.common.babel.ts', - 'webpack.dev.js', - 'webpack.dev.ts', - 'webpack.development.js', - 'webpack.development.ts', - 'webpack.config.dev.js', - 'webpack.config.dev.ts', - 'webpack.config.dev.babel.js', - 'webpack.config.dev.babel.ts', - 'webpack.prod.js', - 'webpack.prod.ts', - 'webpack.production.js', - 'webpack.production.ts', - 'webpack.server.js', - 'webpack.server.ts', - 'webpack.client.js', - 'webpack.client.ts', - 'webpack.config.server.js', - 'webpack.config.server.ts', - 'webpack.config.client.js', - 'webpack.config.client.ts', - 'webpack.config.production.babel.js', - 'webpack.config.production.babel.ts', - 'webpack.config.prod.babel.js', - 'webpack.config.prod.babel.ts', - 'webpack.config.prod.js', - 'webpack.config.prod.ts', - 'webpack.config.production.js', - 'webpack.config.production.ts', - 'webpack.config.staging.js', - 'webpack.config.staging.ts', - 'webpack.config.babel.js', - 'webpack.config.babel.ts', - 'webpack.config.base.babel.js', - 'webpack.config.base.babel.ts', - 'webpack.config.base.js', - 'webpack.config.base.ts', - 'webpack.config.staging.babel.js', - 'webpack.config.staging.babel.ts', - 'webpack.config.coffee', - 'webpack.config.test.js', - 'webpack.config.test.ts', - 'webpack.config.vendor.js', - 'webpack.config.vendor.ts', - 'webpack.config.vendor.production.js', - 'webpack.config.vendor.production.ts', - 'webpack.test.js', - 'webpack.test.ts', - 'webpack.dist.js', - 'webpack.dist.ts', - 'webpackfile.js', - 'webpackfile.ts' - ] - }, - { name: 'ionic', fileNames: ['ionic.config.json', '.io-config.json'] }, - { - name: 'gulp', - fileNames: ['gulpfile.js', 'gulpfile.mjs', 'gulpfile.ts', 'gulpfile.babel.js'] - }, - { - name: 'nodejs', - fileNames: ['package.json', 'package-lock.json', '.nvmrc', '.esmrc', '.node-version'] - }, - { name: 'npm', fileNames: ['.npmignore', '.npmrc'] }, - { - name: 'yarn', - fileNames: [ - '.yarnrc', - 'yarn.lock', - '.yarnclean', - '.yarn-integrity', - 'yarn-error.log', - '.yarnrc.yml', - '.yarnrc.yaml', - ] - }, - { name: 'android', fileNames: ['androidmanifest.xml'], fileExtensions: ['apk'] }, - { - name: 'tune', - fileExtensions: ['env'], - fileNames: [ - '.env.defaults', - '.env.example', - '.env.sample', - '.env.schema', - '.env.local', - '.env.dev', - '.env.development', - '.env.qa', - '.env.prod', - '.env.production', - '.env.staging', - '.env.preview', - '.env.test', - '.env.testing', - '.env.development.local', - '.env.qa.local', - '.env.production.local', - '.env.staging.local', - '.env.test.local', - ] - }, - { name: 'babel', fileNames: ['.babelrc', '.babelrc.js', '.babelrc.json', 'babel.config.json', 'babel.config.js'] }, - { - name: 'contributing', - fileNames: ['contributing.md'] - }, - { name: 'readme', fileNames: ['readme.md', 'readme.txt', 'readme'] }, - { - name: 'changelog', - fileNames: ['changelog', 'changelog.md', 'changelog.txt', 'changes', 'changes.md', 'changes.txt'] - }, - { - name: 'credits', - fileNames: ['credits', 'credits.txt', 'credits.md'] - }, - { - name: 'authors', - fileNames: ['authors', 'authors.md', 'authors.txt'] - }, - { name: 'flow', fileNames: ['.flowconfig'] }, - { name: 'favicon', fileNames: ['favicon.ico'] }, - { - name: 'karma', - fileNames: [ - 'karma.conf.js', - 'karma.conf.ts', - 'karma.conf.coffee', - 'karma.config.js', - 'karma.config.ts', - 'karma-main.js', - 'karma-main.ts' - ] - }, - { name: 'bithound', fileNames: ['.bithoundrc'] }, - { name: 'appveyor', fileNames: ['.appveyor.yml', 'appveyor.yml'] }, - { name: 'travis', fileNames: ['.travis.yml'] }, - { name: 'codecov', fileNames: ['.codecov.yml', 'codecov.yml'] }, - { - name: 'protractor', - fileNames: [ - 'protractor.conf.js', - 'protractor.conf.ts', - 'protractor.conf.coffee', - 'protractor.config.js', - 'protractor.config.ts' - ] - }, - { name: 'fusebox', fileNames: ['fuse.js'] }, - { name: 'heroku', fileNames: ['procfile', 'procfile.windows'] }, - { name: 'editorconfig', fileNames: ['.editorconfig'] }, - { name: 'gitlab', fileExtensions: ['gitlab-ci.yml'] }, - { name: 'bower', fileNames: ['.bowerrc', 'bower.json'] }, - { - name: 'eslint', - fileNames: [ - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - '.eslintrc', - '.eslintignore', - '.eslintcache' - ] - }, - { - name: 'conduct', - fileNames: ['code_of_conduct.md', 'code_of_conduct.txt'] - }, - { name: 'watchman', fileNames: ['.watchmanconfig'] }, - { name: 'aurelia', fileNames: ['aurelia.json'] }, - { - name: 'mocha', - fileNames: [ - 'mocha.opts', - '.mocharc.yml', - '.mocharc.yaml', - '.mocharc.js', - '.mocharc.json', - '.mocharc.jsonc' - ] - }, - { name: 'jenkins', fileNames: ['jenkinsfile'], fileExtensions: ['jenkinsfile', 'jenkins'] }, - { - name: 'firebase', - fileNames: [ - 'firebase.json', - '.firebaserc', - 'firestore.rules', - 'firestore.indexes.json' - ] - }, - { - name: 'rollup', - fileNames: [ - 'rollup.config.js', - 'rollup.config.ts', - 'rollup-config.js', - 'rollup-config.ts', - 'rollup.config.common.js', - 'rollup.config.common.ts', - 'rollup.config.base.js', - 'rollup.config.base.ts', - 'rollup.config.prod.js', - 'rollup.config.prod.ts', - 'rollup.config.dev.js', - 'rollup.config.dev.ts', - 'rollup.config.prod.vendor.js', - 'rollup.config.prod.vendor.ts' - ] - }, - { name: 'hack', fileNames: ['.hhconfig'] }, - { - name: 'stylelint', - fileNames: [ - '.stylelintrc', - 'stylelint.config.js', - '.stylelintrc.json', - '.stylelintrc.yaml', - '.stylelintrc.yml', - '.stylelintrc.js', - '.stylelintignore' - ], - light: true - }, - { name: 'code-climate', fileNames: ['.codeclimate.yml'], light: true }, - { name: 'prettier', fileNames: ['.prettierrc', 'prettier.config.js', '.prettierrc.js', '.prettierrc.json', '.prettierrc.yaml', '.prettierrc.yml', '.prettierignore'] }, - { name: 'apollo', fileNames: ['apollo.config.js'] }, - { name: 'nodemon', fileNames: ['nodemon.json', 'nodemon-debug.json'] }, - { name: 'ngrx-reducer', fileExtensions: ['reducer.ts', 'rootReducer.ts'], enabledFor: [IconPack.Ngrx] }, - { name: 'ngrx-state', fileExtensions: ['state.ts'], enabledFor: [IconPack.Ngrx] }, - { name: 'ngrx-actions', fileExtensions: ['actions.ts'], enabledFor: [IconPack.Ngrx] }, - { name: 'ngrx-effects', fileExtensions: ['effects.ts'], enabledFor: [IconPack.Ngrx] }, - { name: 'ngrx-entity', fileNames: ['.entity'], enabledFor: [IconPack.Ngrx] }, - { name: 'webhint', fileNames: ['.hintrc'] }, - { name: 'browserlist', fileNames: ['browserslist', '.browserslistrc'], light: true }, - { name: 'crystal', fileExtensions: ['cr', 'ecr'], light: true }, - { name: 'snyk', fileNames: ['.snyk'] }, - { name: 'drone', fileExtensions: ['drone.yml'], fileNames: ['.drone.yml'], light: true }, - { name: 'cuda', fileExtensions: ['cu', 'cuh'] }, - { name: 'log', fileExtensions: ['log'] }, - { name: 'dotjs', fileExtensions: ['def', 'dot', 'jst'] }, - { name: 'ejs', fileExtensions: ['ejs'] }, - { name: 'sequelize', fileNames: ['.sequelizerc'] }, - { name: 'gatsby', fileNames: ['gatsby.config.js', 'gatsby-config.js', 'gatsby-node.js', 'gatsby-browser.js', 'gatsby-ssr.js'] }, - { name: 'wakatime', fileNames: ['.wakatime-project'], fileExtensions: ['.wakatime-project'], light: true }, - { name: 'circleci', fileNames: ['circle.yml'], light: true }, - { name: 'cloudfoundry', fileNames: ['.cfignore'] }, - { - name: 'grunt', - fileNames: [ - 'gruntfile.js', - 'gruntfile.ts', - 'gruntfile.coffee', - 'gruntfile.babel.js', - 'gruntfile.babel.ts', - 'gruntfile.babel.coffee' - ], - }, - { - name: 'jest', fileNames: [ - 'jest.config.js', - 'jest.config.ts', - 'jest.config.cjs', - 'jest.config.mjs', - 'jest.config.json', - 'jest.e2e.config.js', - 'jest.e2e.config.ts', - 'jest.e2e.config.cjs', - 'jest.e2e.config.mjs', - 'jest.e2e.config.json', - 'jest.setup.js', - 'jest.setup.ts', - 'jest.json', - '.jestrc', - '.jestrc.js', - '.jestrc.json', - 'jest.teardown.js' - ] - }, - { name: 'processing', fileExtensions: ['pde'], light: true }, - { name: 'storybook', fileExtensions: ['stories.js', 'stories.jsx', 'story.js', 'story.jsx', 'stories.ts', 'stories.tsx', 'story.ts', 'story.tsx'] }, - { name: 'wepy', fileExtensions: ['wpy'] }, - { name: 'fastlane', fileNames: ['fastfile', 'appfile'] }, - { name: 'hcl', fileExtensions: ['hcl'], light: true }, - { name: 'helm', fileNames: ['.helmignore'] }, - { name: 'san', fileExtensions: ['san'] }, - { name: 'wallaby', fileNames: ['wallaby.js', 'wallaby.conf.js'] }, - { name: 'django', fileExtensions: ['djt'] }, - { name: 'stencil', fileNames: ['stencil.config.js', 'stencil.config.ts'] }, - { name: 'red', fileExtensions: ['red'] }, - { name: 'makefile', fileNames: ['makefile'] }, - { name: 'foxpro', fileExtensions: ['fxp', 'prg'] }, - { name: 'i18n', fileExtensions: ['pot', 'po', 'mo'] }, - { name: 'webassembly', fileExtensions: ['wat', 'wasm'] }, - { name: 'semantic-release', light: true, fileNames: ['.releaserc', '.releaserc.yaml', '.releaserc.yml', '.releaserc.json', '.releaserc.js', 'release.config.js'] }, - { name: 'bitbucket', fileNames: ['bitbucket-pipelines.yaml', 'bitbucket-pipelines.yml'] }, - { name: 'jupyter', fileExtensions: ['ipynb'] }, - { name: 'd', fileExtensions: ['d'] }, - { name: 'mdx', fileExtensions: ['mdx'] }, - { name: 'ballerina', fileExtensions: ['bal', 'balx'] }, - { name: 'racket', fileExtensions: ['rkt'] }, - { name: 'bazel', fileExtensions: ['bzl', 'bazel'], fileNames: ['.bazelignore', '.bazelrc'] }, - { name: 'mint', fileExtensions: ['mint'] }, - { name: 'velocity', fileExtensions: ['vm', 'fhtml', 'vtl'] }, - { name: 'godot', fileExtensions: ['gd'] }, - { name: 'godot-assets', fileExtensions: ['godot', 'tres', 'tscn'] }, - { name: 'azure-pipelines', fileNames: ['azure-pipelines.yml', 'azure-pipelines.yaml'], fileExtensions: ['azure-pipelines.yml', 'azure-pipelines.yaml'] }, - { name: 'azure', fileExtensions: ['azcli'] }, - { name: 'vagrant', fileNames: ['vagrantfile'], fileExtensions: ['vagrantfile'] }, - { name: 'prisma', fileNames: ['prisma.yml'], fileExtensions: ['prisma'] }, - { name: 'razor', fileExtensions: ['cshtml', 'vbhtml'] }, - { name: 'abc', fileExtensions: ['abc'] }, - { name: 'asciidoc', fileExtensions: ['ad', 'adoc', 'asciidoc'] }, - { name: 'istanbul', fileNames: ['.nycrc', '.nycrc.json'] }, - { name: 'edge', fileExtensions: ['edge'] }, - { name: 'scheme', fileExtensions: ['ss', 'scm'] }, - { name: 'lisp', fileExtensions: ['lisp', 'lsp', 'cl', 'fast'] }, - { name: 'tailwindcss', fileNames: ['tailwind.js', 'tailwind.config.js'] }, - { - name: '3d', - fileExtensions: [ - 'stl', - 'obj', - 'ac', - 'blend', - 'mesh', - 'mqo', - 'pmd', - 'pmx', - 'skp', - 'vac', - 'vdp', - 'vox' - ] - }, - { name: 'buildkite', fileNames: ['buildkite.yml', 'buildkite.yaml'] }, - { name: 'netlify', fileNames: ['netlify.json', 'netlify.yml', 'netlify.yaml', 'netlify.toml'] }, - { name: 'svg', fileExtensions: ['svg'] }, - { name: 'svelte', fileExtensions: ['svelte'] }, - { name: 'vim', fileExtensions: ['vimrc', 'gvimrc', 'exrc'] }, - { name: 'nest', fileNames: ['nest-cli.json', '.nest-cli.json', 'nestconfig.json', '.nestconfig.json'] }, - { name: 'nest-controller', fileExtensions: ['controller.ts', 'controller.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-middleware', fileExtensions: ['middleware.ts', 'middleware.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-module', fileExtensions: ['module.ts', 'module.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-service', fileExtensions: ['service.ts', 'service.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-decorator', fileExtensions: ['decorator.ts', 'decorator.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-pipe', fileExtensions: ['pipe.ts', 'pipe.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-filter', fileExtensions: ['filter.ts', 'filter.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-gateway', fileExtensions: ['gateway.ts', 'gateway.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-guard', fileExtensions: ['guard.ts', 'guard.js'], enabledFor: [IconPack.Nest] }, - { name: 'nest-resolver', fileExtensions: ['resolver.ts', 'resolver.js'], enabledFor: [IconPack.Nest] }, - { name: 'moonscript', fileExtensions: ['moon'] }, - { name: 'percy', fileNames: ['.percy.yml'] }, - { name: 'gitpod', fileNames: ['.gitpod.yml'] }, - { name: 'advpl_prw', fileExtensions: ['prw', 'prx'] }, - { name: 'advpl_ptm', fileExtensions: ['ptm'] }, - { name: 'advpl_tlpp', fileExtensions: ['tlpp'] }, - { name: 'advpl_include', fileExtensions: ['ch'] }, - { name: 'codeowners', fileNames: ['codeowners'] }, - { name: 'gcp', fileNames: ['.gcloudignore'] }, - { name: 'disc', fileExtensions: ['iso'] }, - { name: 'fortran', fileExtensions: ['f', 'f77', 'f90', 'f95', 'f03', 'f08'] }, - { name: 'tcl', fileExtensions: ['tcl'] }, - { name: 'liquid', fileExtensions: ['liquid'] }, - { name: 'prolog', fileExtensions: ['p', 'pro'] }, - { name: 'husky', fileNames: ['.huskyrc', 'husky.config.js', '.huskyrc.json', '.huskyrc.js', '.huskyrc.yaml', '.huskyrc.yml'] }, - { name: 'coconut', fileExtensions: ['coco'] }, - { name: 'tilt', fileNames: ['tiltfile'] }, - { name: 'capacitor', fileNames: ['capacitor.config.json'] }, - { name: 'sketch', fileExtensions: ['sketch'] }, - { name: 'pawn', fileExtensions: ['pwn', 'amx'] }, - { name: 'adonis', fileNames: ['.adonisrc.json', 'ace'] }, - { name: 'forth', fileExtensions: ['4th', 'fth', 'frt'] }, - { - name: 'uml', - fileExtensions: ['iuml', 'pu', 'puml', 'plantuml', 'wsd'], - light: true, - }, - { name: 'meson', fileNames: ['meson.build'] }, - { name: 'commitlint', fileNames: ['.commitlintrc', '.commitlintrc.js', 'commitlint.config.js', '.commitlintrc.json', '.commitlint.yaml', '.commitlint.yml'] }, - { name: 'buck', fileNames: ['.buckconfig'] }, - { name: 'dhall', fileExtensions: ['dhall', 'dhallb'] }, - { name: 'sml', fileExtensions: ['sml', 'mlton', 'mlb', 'sig', 'fun', 'cm', 'lex', 'use', 'grm'] }, - { name: 'nrwl', fileNames: ['nx.json'] }, - { name: 'opam', fileExtensions: ['opam'] }, - { name: 'dune', fileNames: ['dune', 'dune-project'] }, - { name: 'imba', fileExtensions: ['imba'] }, - { name: 'drawio', fileExtensions: ['drawio', 'dio'] }, - { name: 'pascal', fileExtensions: ['pas'] }, - { name: 'shaderlab', fileExtensions: ['unity'] }, - { name: 'roadmap', fileNames: ['roadmap.md', 'roadmap.txt', 'timeline.md', 'timeline.txt', 'milestones.md', 'milestones.txt'] }, - { name: 'sas', fileExtensions: ['sas', 'sas7bdat', 'sashdat', 'astore', 'ast', 'sast'] }, - { - name: 'nuget', - fileNames: ['nuget.config', '.nuspec', 'nuget.exe'], - fileExtensions: ['nupkg'] - }, - { name: 'command', fileExtensions: ['command'] }, - { name: 'stryker', fileNames: ['stryker.conf.js', 'stryker.conf.json'] }, - { name: 'denizenscript', fileExtensions: ['dsc'] }, - { - name: 'modernizr', - fileNames: [ - '.modernizrrc', - '.modernizrrc.js', - '.modernizrrc.json' - ] - }, - { name: 'slug', fileNames: ['.slugignore'] }, - { name: 'search', fileExtensions: ['code-search'] }, - ] + defaultIcon: { name: 'file' }, + icons: [ + { name: 'html', fileExtensions: ['htm', 'xhtml', 'html_vm', 'asp'] }, + { + name: 'pug', + fileExtensions: ['jade', 'pug'], + fileNames: ['.pug-lintrc', '.pug-lintrc.js', '.pug-lintrc.json'], + }, + { + name: 'markdown', + fileExtensions: ['md', 'markdown', 'rst'], + }, + { name: 'blink', fileExtensions: ['blink'], light: true }, + { name: 'css', fileExtensions: ['css'] }, + { name: 'sass', fileExtensions: ['scss', 'sass'] }, + { name: 'less', fileExtensions: ['less'] }, + { + name: 'json', + fileExtensions: ['json', 'tsbuildinfo', 'json5', 'jsonl', 'ndjson'], + fileNames: [ + '.jscsrc', + '.jshintrc', + 'composer.lock', + '.jsbeautifyrc', + '.esformatter', + 'cdp.pid', + '.mjmlconfig', + ], + }, + { + name: 'jinja', + fileExtensions: ['jinja', 'jinja2', 'j2', 'jinja-html'], + light: true, + }, + { + name: 'sublime', + fileExtensions: ['sublime-project', 'sublime-workspace'], + }, + { name: 'yaml', fileExtensions: ['yaml', 'YAML-tmLanguage', 'yml'] }, + { + name: 'xml', + fileExtensions: [ + 'xml', + 'plist', + 'xsd', + 'dtd', + 'xsl', + 'xslt', + 'resx', + 'iml', + 'xquery', + 'tmLanguage', + 'manifest', + 'project', + ], + fileNames: ['.htaccess'], + }, + { + name: 'image', + fileExtensions: [ + 'png', + 'jpeg', + 'jpg', + 'gif', + 'ico', + 'tif', + 'tiff', + 'psd', + 'psb', + 'ami', + 'apx', + 'bmp', + 'bpg', + 'brk', + 'cur', + 'dds', + 'dng', + 'exr', + 'fpx', + 'gbr', + 'img', + 'jbig2', + 'jb2', + 'jng', + 'jxr', + 'pbm', + 'pgf', + 'pic', + 'raw', + 'webp', + 'eps', + 'afphoto', + 'ase', + 'aseprite', + 'clip', + 'cpt', + 'heif', + 'heic', + 'kra', + 'mdp', + 'ora', + 'pdn', + 'reb', + 'sai', + 'tga', + 'xcf', + ], + }, + { name: 'javascript', fileExtensions: ['js', 'esx', 'mjs'] }, + { name: 'react', fileExtensions: ['jsx'] }, + { name: 'react_ts', fileExtensions: ['tsx'] }, + { + name: 'routing', + fileExtensions: [ + 'routing.ts', + 'routing.tsx', + 'routing.js', + 'routing.jsx', + 'routes.ts', + 'routes.tsx', + 'routes.js', + 'routes.jsx', + ], + fileNames: [ + 'router.js', + 'router.jsx', + 'router.ts', + 'router.tsx', + 'routes.js', + 'routes.jsx', + 'routes.ts', + 'routes.tsx', + ], + enabledFor: [ + IconPack.Angular, + IconPack.Ngrx, + IconPack.React, + IconPack.Redux, + IconPack.Vue, + IconPack.Vuex, + ], + }, + { + name: 'redux-action', + fileExtensions: ['action.js', 'actions.js', 'action.ts', 'actions.ts'], + fileNames: ['action.js', 'actions.js', 'action.ts', 'actions.ts'], + enabledFor: [IconPack.Redux], + }, + { + name: 'redux-reducer', + fileExtensions: [ + 'reducer.js', + 'reducers.js', + 'reducer.ts', + 'reducers.ts', + ], + fileNames: ['reducer.js', 'reducers.js', 'reducer.ts', 'reducers.ts'], + enabledFor: [IconPack.Redux], + }, + { + name: 'redux-store', + fileExtensions: ['store.js', 'store.ts'], + fileNames: ['store.js', 'store.ts'], + enabledFor: [IconPack.Redux], + }, + { + name: 'settings', + fileExtensions: [ + 'ini', + 'dlc', + 'dll', + 'config', + 'conf', + 'properties', + 'prop', + 'settings', + 'option', + 'props', + 'toml', + 'prefs', + 'sln.dotsettings', + 'sln.dotsettings.user', + 'cfg', + ], + fileNames: [ + '.jshintignore', + '.buildignore', + '.mrconfig', + '.yardopts', + 'manifest.mf', + '.clang-format', + '.clang-tidy', + ], + }, + { name: 'typescript', fileExtensions: ['ts'] }, + { name: 'typescript-def', fileExtensions: ['d.ts'] }, + { name: 'markojs', fileExtensions: ['marko'] }, + { name: 'pdf', fileExtensions: ['pdf'] }, + { name: 'table', fileExtensions: ['xlsx', 'xls', 'csv', 'tsv'] }, + { + name: 'vscode', + fileExtensions: [ + 'vscodeignore', + 'vsixmanifest', + 'vsix', + 'code-workplace', + ], + }, + { + name: 'visualstudio', + fileExtensions: [ + 'csproj', + 'ruleset', + 'sln', + 'suo', + 'vb', + 'vbs', + 'vcxitems', + 'vcxitems.filters', + 'vcxproj', + 'vcxproj.filters', + ], + }, + { + name: 'database', + fileExtensions: [ + 'pdb', + 'sql', + 'pks', + 'pkb', + 'accdb', + 'mdb', + 'sqlite', + 'pgsql', + 'postgres', + 'psql', + ], + }, + { name: 'csharp', fileExtensions: ['cs', 'csx'] }, + { name: 'qsharp', fileExtensions: ['qs'] }, + { + name: 'zip', + fileExtensions: [ + 'zip', + 'tar', + 'gz', + 'xz', + 'br', + 'bzip2', + 'gzip', + 'brotli', + '7z', + 'rar', + 'tgz', + ], + }, + { name: 'vala', fileExtensions: ['vala'] }, + { name: 'zig', fileExtensions: ['zig'] }, + { name: 'exe', fileExtensions: ['exe', 'msi'] }, + { name: 'java', fileExtensions: ['java', 'jar', 'jsp'] }, + { name: 'c', fileExtensions: ['c', 'm', 'i', 'mi'] }, + { name: 'h', fileExtensions: ['h'] }, + { + name: 'cpp', + fileExtensions: ['cc', 'cpp', 'cxx', 'c++', 'cp', 'mm', 'mii', 'ii'], + }, + { + name: 'hpp', + fileExtensions: ['hh', 'hpp', 'hxx', 'h++', 'hp', 'tcc', 'inl'], + }, + { name: 'go', fileExtensions: ['go'] }, + { name: 'go-mod', fileNames: ['go.mod', 'go.sum'] }, + { name: 'python', fileExtensions: ['py'] }, + { + name: 'python-misc', + fileExtensions: ['pyc', 'whl'], + fileNames: [ + 'requirements.txt', + 'pipfile', + '.python-version', + 'manifest.in', + ], + }, + { name: 'url', fileExtensions: ['url'] }, + { + name: 'console', + fileExtensions: [ + 'sh', + 'ksh', + 'csh', + 'tcsh', + 'zsh', + 'bash', + 'bat', + 'cmd', + 'awk', + 'fish', + ], + }, + { + name: 'powershell', + fileExtensions: ['ps1', 'psm1', 'psd1', 'ps1xml', 'psc1', 'pssc'], + }, + { + name: 'gradle', + fileExtensions: ['gradle'], + fileNames: ['gradle.properties', 'gradlew', 'gradle-wrapper.properties'], + }, + { name: 'word', fileExtensions: ['doc', 'docx', 'rtf'] }, + { + name: 'certificate', + fileExtensions: ['cer', 'cert', 'crt'], + fileNames: [ + 'license', + 'license.md', + 'license.txt', + 'licence', + 'licence.md', + 'licence.txt', + 'unlicense', + 'unlicense.md', + 'unlicense.txt', + ], + }, + { + name: 'key', + fileExtensions: ['pub', 'key', 'pem', 'asc', 'gpg'], + fileNames: ['.htpasswd'], + }, + { + name: 'font', + fileExtensions: [ + 'woff', + 'woff2', + 'ttf', + 'eot', + 'suit', + 'otf', + 'bmap', + 'fnt', + 'odttf', + 'ttc', + 'font', + 'fonts', + 'sui', + 'ntf', + 'mrf', + ], + }, + { name: 'lib', fileExtensions: ['lib', 'bib'] }, + { name: 'ruby', fileExtensions: ['rb', 'erb'] }, + { name: 'gemfile', fileNames: ['gemfile'] }, + { name: 'fsharp', fileExtensions: ['fs', 'fsx', 'fsi', 'fsproj'] }, + { name: 'swift', fileExtensions: ['swift'] }, + { name: 'arduino', fileExtensions: ['ino'] }, + { + name: 'docker', + fileExtensions: ['dockerignore', 'dockerfile'], + fileNames: [ + 'dockerfile', + 'dockerfile.prod', + 'dockerfile.production', + 'docker-compose.yml', + 'docker-compose.yaml', + 'docker-compose.dev.yml', + 'docker-compose.local.yml', + 'docker-compose.ci.yml', + 'docker-compose.override.yml', + 'docker-compose.staging.yml', + 'docker-compose.prod.yml', + 'docker-compose.production.yml', + 'docker-compose.test.yml', + ], + }, + { name: 'tex', fileExtensions: ['tex', 'sty', 'dtx', 'ltx'] }, + { + name: 'powerpoint', + fileExtensions: [ + 'pptx', + 'ppt', + 'pptm', + 'potx', + 'potm', + 'ppsx', + 'ppsm', + 'pps', + 'ppam', + 'ppa', + ], + }, + { + name: 'video', + fileExtensions: [ + 'webm', + 'mkv', + 'flv', + 'vob', + 'ogv', + 'ogg', + 'gifv', + 'avi', + 'mov', + 'qt', + 'wmv', + 'yuv', + 'rm', + 'rmvb', + 'mp4', + 'm4v', + 'mpg', + 'mp2', + 'mpeg', + 'mpe', + 'mpv', + 'm2v', + ], + }, + { name: 'virtual', fileExtensions: ['vdi', 'vbox', 'vbox-prev'] }, + { name: 'email', fileExtensions: ['ics'], fileNames: ['.mailmap'] }, + { name: 'audio', fileExtensions: ['mp3', 'flac', 'm4a', 'wma', 'aiff'] }, + { name: 'coffee', fileExtensions: ['coffee', 'cson', 'iced'] }, + { name: 'document', fileExtensions: ['txt'] }, + { + name: 'graphql', + fileExtensions: ['graphql', 'gql'], + fileNames: ['.graphqlconfig'], + }, + { name: 'rust', fileExtensions: ['rs'] }, + { name: 'raml', fileExtensions: ['raml'] }, + { name: 'xaml', fileExtensions: ['xaml'] }, + { name: 'haskell', fileExtensions: ['hs'] }, + { name: 'kotlin', fileExtensions: ['kt', 'kts'] }, + { + name: 'git', + fileExtensions: ['patch'], + fileNames: [ + '.gitignore', + '.gitconfig', + '.gitattributes', + '.gitmodules', + '.gitkeep', + 'git-history', + ], + }, + { name: 'lua', fileExtensions: ['lua'], fileNames: ['.luacheckrc'] }, + { name: 'clojure', fileExtensions: ['clj', 'cljs', 'cljc'] }, + { name: 'groovy', fileExtensions: ['groovy'] }, + { name: 'r', fileExtensions: ['r', 'rmd'], fileNames: ['.Rhistory'] }, + { name: 'dart', fileExtensions: ['dart'] }, + { name: 'actionscript', fileExtensions: ['as'] }, + { name: 'mxml', fileExtensions: ['mxml'] }, + { name: 'autohotkey', fileExtensions: ['ahk'] }, + { name: 'flash', fileExtensions: ['swf'] }, + { name: 'swc', fileExtensions: ['swc'] }, + { + name: 'cmake', + fileExtensions: ['cmake'], + fileNames: ['cmakelists.txt', 'cmakecache.txt'], + }, + { + name: 'assembly', + fileExtensions: [ + 'asm', + 'a51', + 'inc', + 'nasm', + 's', + 'ms', + 'agc', + 'ags', + 'aea', + 'argus', + 'mitigus', + 'binsource', + ], + }, + { name: 'vue', fileExtensions: ['vue'] }, + { name: 'vue-config', fileNames: ['vue.config.js', 'vue.config.ts'] }, + { + name: 'vuex-store', + fileExtensions: ['store.js', 'store.ts'], + fileNames: ['store.js', 'store.ts'], + enabledFor: [IconPack.Vuex], + }, + { name: 'nuxt', fileNames: ['nuxt.config.js', 'nuxt.config.ts'] }, + { name: 'ocaml', fileExtensions: ['ml', 'mli', 'cmx'] }, + { name: 'javascript-map', fileExtensions: ['js.map', 'mjs.map'] }, + { name: 'css-map', fileExtensions: ['css.map'] }, + { + name: 'lock', + fileExtensions: ['lock'], + fileNames: ['security.md', 'security.txt', 'security'], + }, + { name: 'handlebars', fileExtensions: ['hbs', 'mustache'] }, + { name: 'perl', fileExtensions: ['pm', 'raku'] }, + { name: 'haxe', fileExtensions: ['hx'] }, + { + name: 'test-ts', + fileExtensions: ['spec.ts', 'e2e-spec.ts', 'test.ts', 'ts.snap'], + }, + { + name: 'test-jsx', + fileExtensions: [ + 'spec.tsx', + 'test.tsx', + 'tsx.snap', + 'spec.jsx', + 'test.jsx', + 'jsx.snap', + ], + }, + { + name: 'test-js', + fileExtensions: ['spec.js', 'e2e-spec.js', 'test.js', 'js.snap'], + }, + { + name: 'angular', + fileExtensions: ['module.ts', 'module.js', 'ng-template'], + fileNames: ['angular-cli.json', '.angular-cli.json', 'angular.json'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-component', + fileExtensions: ['component.ts', 'component.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-guard', + fileExtensions: ['guard.ts', 'guard.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-service', + fileExtensions: ['service.ts', 'service.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-pipe', + fileExtensions: ['pipe.ts', 'pipe.js', 'filter.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-directive', + fileExtensions: ['directive.ts', 'directive.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'angular-resolver', + fileExtensions: ['resolver.ts', 'resolver.js'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { name: 'puppet', fileExtensions: ['pp'] }, + { name: 'elixir', fileExtensions: ['ex', 'exs', 'eex', 'leex'] }, + { name: 'livescript', fileExtensions: ['ls'] }, + { name: 'erlang', fileExtensions: ['erl'] }, + { name: 'twig', fileExtensions: ['twig'] }, + { name: 'julia', fileExtensions: ['jl'] }, + { name: 'elm', fileExtensions: ['elm'] }, + { name: 'purescript', fileExtensions: ['pure', 'purs'] }, + { name: 'smarty', fileExtensions: ['tpl'] }, + { name: 'stylus', fileExtensions: ['styl'] }, + { name: 'reason', fileExtensions: ['re', 'rei'] }, + { name: 'bucklescript', fileExtensions: ['cmj'] }, + { name: 'merlin', fileExtensions: ['merlin'] }, + { name: 'verilog', fileExtensions: ['v', 'vhd', 'sv', 'svh'] }, + { name: 'mathematica', fileExtensions: ['nb'] }, + { name: 'wolframlanguage', fileExtensions: ['wl', 'wls'] }, + { name: 'nunjucks', fileExtensions: ['njk', 'nunjucks'] }, + { name: 'robot', fileExtensions: ['robot'] }, + { name: 'solidity', fileExtensions: ['sol'] }, + { name: 'autoit', fileExtensions: ['au3'] }, + { name: 'haml', fileExtensions: ['haml'] }, + { name: 'yang', fileExtensions: ['yang'] }, + { name: 'mjml', fileExtensions: ['mjml'] }, + { + name: 'vercel', + fileNames: ['vercel.json', '.vercelignore', 'now.json', '.nowignore'], + light: true, + }, + { + name: 'terraform', + fileExtensions: ['tf', 'tf.json', 'tfvars', 'tfstate'], + }, + { name: 'laravel', fileExtensions: ['blade.php', 'inky.php'] }, + { name: 'applescript', fileExtensions: ['applescript', 'ipa'] }, + { name: 'cake', fileExtensions: ['cake'] }, + { name: 'cucumber', fileExtensions: ['feature'] }, + { name: 'nim', fileExtensions: ['nim', 'nimble'] }, + { name: 'apiblueprint', fileExtensions: ['apib', 'apiblueprint'] }, + { name: 'riot', fileExtensions: ['riot', 'tag'] }, + { name: 'vfl', fileExtensions: ['vfl'], fileNames: ['.vfl'] }, + { name: 'kl', fileExtensions: ['kl'], fileNames: ['.kl'] }, + { + name: 'postcss', + fileExtensions: ['pcss', 'sss'], + fileNames: [ + 'postcss.config.js', + '.postcssrc.js', + '.postcssrc', + '.postcssrc.json', + '.postcssrc.yml', + ], + }, + { name: 'todo', fileExtensions: ['todo'] }, + { name: 'coldfusion', fileExtensions: ['cfml', 'cfc', 'lucee', 'cfm'] }, + { name: 'cabal', fileExtensions: ['cabal'] }, + { name: 'nix', fileExtensions: ['nix'] }, + { name: 'slim', fileExtensions: ['slim'] }, + { name: 'http', fileExtensions: ['http', 'rest'], fileNames: ['CNAME'] }, + { name: 'restql', fileExtensions: ['rql', 'restql'] }, + { name: 'kivy', fileExtensions: ['kv'] }, + { + name: 'graphcool', + fileExtensions: ['graphcool'], + fileNames: ['project.graphcool'], + }, + { name: 'sbt', fileExtensions: ['sbt'] }, + { + name: 'webpack', + fileNames: [ + 'webpack.js', + 'webpack.ts', + 'webpack.base.js', + 'webpack.base.ts', + 'webpack.config.js', + 'webpack.config.ts', + 'webpack.common.js', + 'webpack.common.ts', + 'webpack.config.common.js', + 'webpack.config.common.ts', + 'webpack.config.common.babel.js', + 'webpack.config.common.babel.ts', + 'webpack.dev.js', + 'webpack.dev.ts', + 'webpack.development.js', + 'webpack.development.ts', + 'webpack.config.dev.js', + 'webpack.config.dev.ts', + 'webpack.config.dev.babel.js', + 'webpack.config.dev.babel.ts', + 'webpack.prod.js', + 'webpack.prod.ts', + 'webpack.production.js', + 'webpack.production.ts', + 'webpack.server.js', + 'webpack.server.ts', + 'webpack.client.js', + 'webpack.client.ts', + 'webpack.config.server.js', + 'webpack.config.server.ts', + 'webpack.config.client.js', + 'webpack.config.client.ts', + 'webpack.config.production.babel.js', + 'webpack.config.production.babel.ts', + 'webpack.config.prod.babel.js', + 'webpack.config.prod.babel.ts', + 'webpack.config.prod.js', + 'webpack.config.prod.ts', + 'webpack.config.production.js', + 'webpack.config.production.ts', + 'webpack.config.staging.js', + 'webpack.config.staging.ts', + 'webpack.config.babel.js', + 'webpack.config.babel.ts', + 'webpack.config.base.babel.js', + 'webpack.config.base.babel.ts', + 'webpack.config.base.js', + 'webpack.config.base.ts', + 'webpack.config.staging.babel.js', + 'webpack.config.staging.babel.ts', + 'webpack.config.coffee', + 'webpack.config.test.js', + 'webpack.config.test.ts', + 'webpack.config.vendor.js', + 'webpack.config.vendor.ts', + 'webpack.config.vendor.production.js', + 'webpack.config.vendor.production.ts', + 'webpack.test.js', + 'webpack.test.ts', + 'webpack.dist.js', + 'webpack.dist.ts', + 'webpackfile.js', + 'webpackfile.ts', + ], + }, + { name: 'ionic', fileNames: ['ionic.config.json', '.io-config.json'] }, + { + name: 'gulp', + fileNames: [ + 'gulpfile.js', + 'gulpfile.mjs', + 'gulpfile.ts', + 'gulpfile.babel.js', + ], + }, + { + name: 'nodejs', + fileNames: [ + 'package.json', + 'package-lock.json', + '.nvmrc', + '.esmrc', + '.node-version', + ], + }, + { name: 'npm', fileNames: ['.npmignore', '.npmrc'] }, + { + name: 'yarn', + fileNames: [ + '.yarnrc', + 'yarn.lock', + '.yarnclean', + '.yarn-integrity', + 'yarn-error.log', + '.yarnrc.yml', + '.yarnrc.yaml', + ], + }, + { + name: 'android', + fileNames: ['androidmanifest.xml'], + fileExtensions: ['apk'], + }, + { + name: 'tune', + fileExtensions: ['env'], + fileNames: [ + '.env.defaults', + '.env.example', + '.env.sample', + '.env.schema', + '.env.local', + '.env.dev', + '.env.development', + '.env.qa', + '.env.prod', + '.env.production', + '.env.staging', + '.env.preview', + '.env.test', + '.env.testing', + '.env.development.local', + '.env.qa.local', + '.env.production.local', + '.env.staging.local', + '.env.test.local', + ], + }, + { + name: 'babel', + fileNames: [ + '.babelrc', + '.babelrc.js', + '.babelrc.json', + 'babel.config.json', + 'babel.config.js', + ], + }, + { + name: 'contributing', + fileNames: ['contributing.md'], + }, + { name: 'readme', fileNames: ['readme.md', 'readme.txt', 'readme'] }, + { + name: 'changelog', + fileNames: [ + 'changelog', + 'changelog.md', + 'changelog.txt', + 'changes', + 'changes.md', + 'changes.txt', + ], + }, + { + name: 'credits', + fileNames: ['credits', 'credits.txt', 'credits.md'], + }, + { + name: 'authors', + fileNames: ['authors', 'authors.md', 'authors.txt'], + }, + { name: 'flow', fileNames: ['.flowconfig'] }, + { name: 'favicon', fileNames: ['favicon.ico'] }, + { + name: 'karma', + fileNames: [ + 'karma.conf.js', + 'karma.conf.ts', + 'karma.conf.coffee', + 'karma.config.js', + 'karma.config.ts', + 'karma-main.js', + 'karma-main.ts', + ], + }, + { name: 'bithound', fileNames: ['.bithoundrc'] }, + { name: 'appveyor', fileNames: ['.appveyor.yml', 'appveyor.yml'] }, + { name: 'travis', fileNames: ['.travis.yml'] }, + { name: 'codecov', fileNames: ['.codecov.yml', 'codecov.yml'] }, + { + name: 'protractor', + fileNames: [ + 'protractor.conf.js', + 'protractor.conf.ts', + 'protractor.conf.coffee', + 'protractor.config.js', + 'protractor.config.ts', + ], + }, + { name: 'fusebox', fileNames: ['fuse.js'] }, + { name: 'heroku', fileNames: ['procfile', 'procfile.windows'] }, + { name: 'editorconfig', fileNames: ['.editorconfig'] }, + { name: 'gitlab', fileExtensions: ['gitlab-ci.yml'] }, + { name: 'bower', fileNames: ['.bowerrc', 'bower.json'] }, + { + name: 'eslint', + fileNames: [ + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + '.eslintrc', + '.eslintignore', + '.eslintcache', + ], + }, + { + name: 'conduct', + fileNames: ['code_of_conduct.md', 'code_of_conduct.txt'], + }, + { name: 'watchman', fileNames: ['.watchmanconfig'] }, + { name: 'aurelia', fileNames: ['aurelia.json'] }, + { + name: 'mocha', + fileNames: [ + 'mocha.opts', + '.mocharc.yml', + '.mocharc.yaml', + '.mocharc.js', + '.mocharc.json', + '.mocharc.jsonc', + ], + }, + { + name: 'jenkins', + fileNames: ['jenkinsfile'], + fileExtensions: ['jenkinsfile', 'jenkins'], + }, + { + name: 'firebase', + fileNames: [ + 'firebase.json', + '.firebaserc', + 'firestore.rules', + 'firestore.indexes.json', + ], + }, + { + name: 'rollup', + fileNames: [ + 'rollup.config.js', + 'rollup.config.ts', + 'rollup-config.js', + 'rollup-config.ts', + 'rollup.config.common.js', + 'rollup.config.common.ts', + 'rollup.config.base.js', + 'rollup.config.base.ts', + 'rollup.config.prod.js', + 'rollup.config.prod.ts', + 'rollup.config.dev.js', + 'rollup.config.dev.ts', + 'rollup.config.prod.vendor.js', + 'rollup.config.prod.vendor.ts', + ], + }, + { name: 'hack', fileNames: ['.hhconfig'] }, + { + name: 'stylelint', + fileNames: [ + '.stylelintrc', + 'stylelint.config.js', + '.stylelintrc.json', + '.stylelintrc.yaml', + '.stylelintrc.yml', + '.stylelintrc.js', + '.stylelintignore', + ], + light: true, + }, + { name: 'code-climate', fileNames: ['.codeclimate.yml'], light: true }, + { + name: 'prettier', + fileNames: [ + '.prettierrc', + 'prettier.config.js', + '.prettierrc.js', + '.prettierrc.json', + '.prettierrc.yaml', + '.prettierrc.yml', + '.prettierignore', + ], + }, + { name: 'apollo', fileNames: ['apollo.config.js'] }, + { name: 'nodemon', fileNames: ['nodemon.json', 'nodemon-debug.json'] }, + { + name: 'ngrx-reducer', + fileExtensions: ['reducer.ts', 'rootReducer.ts'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'ngrx-state', + fileExtensions: ['state.ts'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'ngrx-actions', + fileExtensions: ['actions.ts'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'ngrx-effects', + fileExtensions: ['effects.ts'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'ngrx-entity', + fileNames: ['.entity'], + enabledFor: [IconPack.Ngrx], + }, + { name: 'webhint', fileNames: ['.hintrc'] }, + { + name: 'browserlist', + fileNames: ['browserslist', '.browserslistrc'], + light: true, + }, + { name: 'crystal', fileExtensions: ['cr', 'ecr'], light: true }, + { name: 'snyk', fileNames: ['.snyk'] }, + { + name: 'drone', + fileExtensions: ['drone.yml'], + fileNames: ['.drone.yml'], + light: true, + }, + { name: 'cuda', fileExtensions: ['cu', 'cuh'] }, + { name: 'log', fileExtensions: ['log'] }, + { name: 'dotjs', fileExtensions: ['def', 'dot', 'jst'] }, + { name: 'ejs', fileExtensions: ['ejs'] }, + { name: 'sequelize', fileNames: ['.sequelizerc'] }, + { + name: 'gatsby', + fileNames: [ + 'gatsby.config.js', + 'gatsby-config.js', + 'gatsby-node.js', + 'gatsby-browser.js', + 'gatsby-ssr.js', + ], + }, + { + name: 'wakatime', + fileNames: ['.wakatime-project'], + fileExtensions: ['.wakatime-project'], + light: true, + }, + { name: 'circleci', fileNames: ['circle.yml'], light: true }, + { name: 'cloudfoundry', fileNames: ['.cfignore'] }, + { + name: 'grunt', + fileNames: [ + 'gruntfile.js', + 'gruntfile.ts', + 'gruntfile.coffee', + 'gruntfile.babel.js', + 'gruntfile.babel.ts', + 'gruntfile.babel.coffee', + ], + }, + { + name: 'jest', + fileNames: [ + 'jest.config.js', + 'jest.config.ts', + 'jest.config.cjs', + 'jest.config.mjs', + 'jest.config.json', + 'jest.e2e.config.js', + 'jest.e2e.config.ts', + 'jest.e2e.config.cjs', + 'jest.e2e.config.mjs', + 'jest.e2e.config.json', + 'jest.setup.js', + 'jest.setup.ts', + 'jest.json', + '.jestrc', + '.jestrc.js', + '.jestrc.json', + 'jest.teardown.js', + ], + }, + { name: 'processing', fileExtensions: ['pde'], light: true }, + { + name: 'storybook', + fileExtensions: [ + 'stories.js', + 'stories.jsx', + 'story.js', + 'story.jsx', + 'stories.ts', + 'stories.tsx', + 'story.ts', + 'story.tsx', + ], + }, + { name: 'wepy', fileExtensions: ['wpy'] }, + { name: 'fastlane', fileNames: ['fastfile', 'appfile'] }, + { name: 'hcl', fileExtensions: ['hcl'], light: true }, + { name: 'helm', fileNames: ['.helmignore'] }, + { name: 'san', fileExtensions: ['san'] }, + { name: 'wallaby', fileNames: ['wallaby.js', 'wallaby.conf.js'] }, + { name: 'django', fileExtensions: ['djt'] }, + { name: 'stencil', fileNames: ['stencil.config.js', 'stencil.config.ts'] }, + { name: 'red', fileExtensions: ['red'] }, + { name: 'makefile', fileNames: ['makefile'] }, + { name: 'foxpro', fileExtensions: ['fxp', 'prg'] }, + { name: 'i18n', fileExtensions: ['pot', 'po', 'mo'] }, + { name: 'webassembly', fileExtensions: ['wat', 'wasm'] }, + { + name: 'semantic-release', + light: true, + fileNames: [ + '.releaserc', + '.releaserc.yaml', + '.releaserc.yml', + '.releaserc.json', + '.releaserc.js', + 'release.config.js', + ], + }, + { + name: 'bitbucket', + fileNames: ['bitbucket-pipelines.yaml', 'bitbucket-pipelines.yml'], + }, + { name: 'jupyter', fileExtensions: ['ipynb'] }, + { name: 'd', fileExtensions: ['d'] }, + { name: 'mdx', fileExtensions: ['mdx'] }, + { name: 'ballerina', fileExtensions: ['bal', 'balx'] }, + { name: 'racket', fileExtensions: ['rkt'] }, + { + name: 'bazel', + fileExtensions: ['bzl', 'bazel'], + fileNames: ['.bazelignore', '.bazelrc'], + }, + { name: 'mint', fileExtensions: ['mint'] }, + { name: 'velocity', fileExtensions: ['vm', 'fhtml', 'vtl'] }, + { name: 'godot', fileExtensions: ['gd'] }, + { name: 'godot-assets', fileExtensions: ['godot', 'tres', 'tscn'] }, + { + name: 'azure-pipelines', + fileNames: ['azure-pipelines.yml', 'azure-pipelines.yaml'], + fileExtensions: ['azure-pipelines.yml', 'azure-pipelines.yaml'], + }, + { name: 'azure', fileExtensions: ['azcli'] }, + { + name: 'vagrant', + fileNames: ['vagrantfile'], + fileExtensions: ['vagrantfile'], + }, + { name: 'prisma', fileNames: ['prisma.yml'], fileExtensions: ['prisma'] }, + { name: 'razor', fileExtensions: ['cshtml', 'vbhtml'] }, + { name: 'abc', fileExtensions: ['abc'] }, + { name: 'asciidoc', fileExtensions: ['ad', 'adoc', 'asciidoc'] }, + { name: 'istanbul', fileNames: ['.nycrc', '.nycrc.json'] }, + { name: 'edge', fileExtensions: ['edge'] }, + { name: 'scheme', fileExtensions: ['ss', 'scm'] }, + { name: 'lisp', fileExtensions: ['lisp', 'lsp', 'cl', 'fast'] }, + { name: 'tailwindcss', fileNames: ['tailwind.js', 'tailwind.config.js'] }, + { + name: '3d', + fileExtensions: [ + 'stl', + 'obj', + 'ac', + 'blend', + 'mesh', + 'mqo', + 'pmd', + 'pmx', + 'skp', + 'vac', + 'vdp', + 'vox', + ], + }, + { name: 'buildkite', fileNames: ['buildkite.yml', 'buildkite.yaml'] }, + { + name: 'netlify', + fileNames: [ + 'netlify.json', + 'netlify.yml', + 'netlify.yaml', + 'netlify.toml', + ], + }, + { name: 'svg', fileExtensions: ['svg'] }, + { name: 'svelte', fileExtensions: ['svelte'] }, + { name: 'vim', fileExtensions: ['vimrc', 'gvimrc', 'exrc'] }, + { + name: 'nest', + fileNames: [ + 'nest-cli.json', + '.nest-cli.json', + 'nestconfig.json', + '.nestconfig.json', + ], + }, + { + name: 'nest-controller', + fileExtensions: ['controller.ts', 'controller.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-middleware', + fileExtensions: ['middleware.ts', 'middleware.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-module', + fileExtensions: ['module.ts', 'module.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-service', + fileExtensions: ['service.ts', 'service.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-decorator', + fileExtensions: ['decorator.ts', 'decorator.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-pipe', + fileExtensions: ['pipe.ts', 'pipe.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-filter', + fileExtensions: ['filter.ts', 'filter.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-gateway', + fileExtensions: ['gateway.ts', 'gateway.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-guard', + fileExtensions: ['guard.ts', 'guard.js'], + enabledFor: [IconPack.Nest], + }, + { + name: 'nest-resolver', + fileExtensions: ['resolver.ts', 'resolver.js'], + enabledFor: [IconPack.Nest], + }, + { name: 'moonscript', fileExtensions: ['moon'] }, + { name: 'percy', fileNames: ['.percy.yml'] }, + { name: 'gitpod', fileNames: ['.gitpod.yml'] }, + { name: 'advpl_prw', fileExtensions: ['prw', 'prx'] }, + { name: 'advpl_ptm', fileExtensions: ['ptm'] }, + { name: 'advpl_tlpp', fileExtensions: ['tlpp'] }, + { name: 'advpl_include', fileExtensions: ['ch'] }, + { name: 'codeowners', fileNames: ['codeowners'] }, + { name: 'gcp', fileNames: ['.gcloudignore'] }, + { name: 'disc', fileExtensions: ['iso'] }, + { + name: 'fortran', + fileExtensions: ['f', 'f77', 'f90', 'f95', 'f03', 'f08'], + }, + { name: 'tcl', fileExtensions: ['tcl'] }, + { name: 'liquid', fileExtensions: ['liquid'] }, + { name: 'prolog', fileExtensions: ['p', 'pro'] }, + { + name: 'husky', + fileNames: [ + '.huskyrc', + 'husky.config.js', + '.huskyrc.json', + '.huskyrc.js', + '.huskyrc.yaml', + '.huskyrc.yml', + ], + }, + { name: 'coconut', fileExtensions: ['coco'] }, + { name: 'tilt', fileNames: ['tiltfile'] }, + { name: 'capacitor', fileNames: ['capacitor.config.json'] }, + { name: 'sketch', fileExtensions: ['sketch'] }, + { name: 'pawn', fileExtensions: ['pwn', 'amx'] }, + { name: 'adonis', fileNames: ['.adonisrc.json', 'ace'] }, + { name: 'forth', fileExtensions: ['4th', 'fth', 'frt'] }, + { + name: 'uml', + fileExtensions: ['iuml', 'pu', 'puml', 'plantuml', 'wsd'], + light: true, + }, + { name: 'meson', fileNames: ['meson.build'] }, + { + name: 'commitlint', + fileNames: [ + '.commitlintrc', + '.commitlintrc.js', + 'commitlint.config.js', + '.commitlintrc.json', + '.commitlint.yaml', + '.commitlint.yml', + ], + }, + { name: 'buck', fileNames: ['.buckconfig'] }, + { name: 'dhall', fileExtensions: ['dhall', 'dhallb'] }, + { + name: 'sml', + fileExtensions: [ + 'sml', + 'mlton', + 'mlb', + 'sig', + 'fun', + 'cm', + 'lex', + 'use', + 'grm', + ], + }, + { name: 'nrwl', fileNames: ['nx.json'] }, + { name: 'opam', fileExtensions: ['opam'] }, + { name: 'dune', fileNames: ['dune', 'dune-project'] }, + { name: 'imba', fileExtensions: ['imba'] }, + { name: 'drawio', fileExtensions: ['drawio', 'dio'] }, + { name: 'pascal', fileExtensions: ['pas'] }, + { name: 'shaderlab', fileExtensions: ['unity'] }, + { + name: 'roadmap', + fileNames: [ + 'roadmap.md', + 'roadmap.txt', + 'timeline.md', + 'timeline.txt', + 'milestones.md', + 'milestones.txt', + ], + }, + { + name: 'sas', + fileExtensions: ['sas', 'sas7bdat', 'sashdat', 'astore', 'ast', 'sast'], + }, + { + name: 'nuget', + fileNames: ['nuget.config', '.nuspec', 'nuget.exe'], + fileExtensions: ['nupkg'], + }, + { name: 'command', fileExtensions: ['command'] }, + { name: 'stryker', fileNames: ['stryker.conf.js', 'stryker.conf.json'] }, + { name: 'denizenscript', fileExtensions: ['dsc'] }, + { + name: 'modernizr', + fileNames: ['.modernizrrc', '.modernizrrc.js', '.modernizrrc.json'], + }, + { name: 'slug', fileNames: ['.slugignore'] }, + { name: 'search', fileExtensions: ['code-search'] }, + ], }; diff --git a/src/icons/folderIcons.ts b/src/icons/folderIcons.ts index 6ab5d1ff57..9a729b99dd 100644 --- a/src/icons/folderIcons.ts +++ b/src/icons/folderIcons.ts @@ -4,195 +4,581 @@ import { FolderTheme, IconPack } from '../models/index'; * Defines folder icons */ export const folderIcons: FolderTheme[] = [ - { - name: 'specific', - defaultIcon: { name: 'folder' }, - rootFolder: { name: 'folder-root' }, - icons: [ - { name: 'folder-src', folderNames: ['src', 'source', 'sources', 'code'] }, - { name: 'folder-dist', folderNames: ['dist', 'out', 'build', 'release', 'bin'] }, - { - name: 'folder-css', - folderNames: ['css', 'stylesheet', 'stylesheets', 'style', 'styles'] - }, - { name: 'folder-sass', folderNames: ['sass', '_sass', 'scss', '_scss'] }, - { name: 'folder-images', folderNames: ['images', 'image', 'img', 'icons', 'icon', 'ico', 'screenshot', 'screenshots'] }, - { name: 'folder-scripts', folderNames: ['script', 'scripts'] }, - { name: 'folder-node', folderNames: ['node_modules'] }, - { name: 'folder-javascript', folderNames: ['js', 'javascript', 'javascripts'] }, - { name: 'folder-json', folderNames: ['json'] }, - { name: 'folder-font', folderNames: ['font', 'fonts'] }, - { name: 'folder-bower', folderNames: ['bower_components'] }, - { - name: 'folder-test', - folderNames: [ - 'test', - 'tests', - 'testing', - '__tests__', - '__snapshots__', - '__mocks__', - '__test__', - 'spec', - 'specs' - ] - }, - { - name: 'folder-jinja', - folderNames: [ - 'jinja', - 'jinja2', - 'j2' - ], - light: true - }, - { name: 'folder-markdown', folderNames: ['markdown', 'md'] }, - { name: 'folder-php', folderNames: ['php'] }, - { name: 'folder-phpmailer', folderNames: ['phpmailer'] }, - { name: 'folder-sublime', folderNames: ['sublime'] }, - { name: 'folder-docs', folderNames: ['doc', 'docs', 'documents', 'documentation', 'post', 'posts'] }, - { - name: 'folder-git', - folderNames: ['.git', 'githooks', '.githooks', 'submodules', '.submodules'] - }, - { name: 'folder-github', folderNames: ['.github'] }, - { name: 'folder-gitlab', folderNames: ['.gitlab'] }, - { name: 'folder-vscode', folderNames: ['.vscode', '.vscode-test'] }, - { - name: 'folder-views', - folderNames: ['view', 'views', 'screen', 'screens', 'page', 'pages', 'html'] - }, - { name: 'folder-vue', folderNames: ['vue'] }, - { name: 'folder-expo', folderNames: ['.expo', '.expo-shared'] }, - { name: 'folder-config', folderNames: ['config', 'configs', 'configuration', 'configurations', 'setting', '.setting', 'settings', '.settings', 'META-INF'] }, - { - name: 'folder-i18n', - folderNames: ['i18n', 'internationalization', 'lang', 'language', 'languages', 'locale', 'locales', 'l10n', 'localization', 'translation', 'translate', 'translations', '.tx'] - }, - { name: 'folder-components', folderNames: ['components', 'widget', 'widgets'] }, - { name: 'folder-aurelia', folderNames: ['aurelia_project'] }, - { - name: 'folder-resource', - folderNames: ['resource', 'resources', 'res', 'asset', 'assets', 'static'] - }, - { name: 'folder-lib', folderNames: ['lib', 'libs', 'library', 'libraries', 'vendor', 'vendors', 'third-party'] }, - { name: 'folder-theme', folderNames: ['themes', 'theme', 'color', 'colors', 'design', 'designs'] }, - { name: 'folder-webpack', folderNames: ['webpack', '.webpack'] }, - { name: 'folder-global', folderNames: ['global'] }, - { name: 'folder-public', folderNames: ['public', 'www', 'wwwroot', 'web', 'website'] }, - { name: 'folder-include', folderNames: ['include', 'includes', '_includes'] }, - { name: 'folder-docker', folderNames: ['docker', 'dockerfiles', '.docker'] }, - { name: 'folder-ngrx-effects', folderNames: ['effects'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-ngrx-store', folderNames: ['store'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-ngrx-state', folderNames: ['states', 'state'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-ngrx-reducer', folderNames: ['reducers', 'reducer'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-ngrx-actions', folderNames: ['actions'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-ngrx-entities', folderNames: ['entities'], enabledFor: [IconPack.Ngrx] }, - { name: 'folder-redux-reducer', folderNames: ['reducers', 'reducer'], enabledFor: [IconPack.Redux] }, - { name: 'folder-redux-actions', folderNames: ['actions'], enabledFor: [IconPack.Redux] }, - { name: 'folder-redux-store', folderNames: ['store'], enabledFor: [IconPack.Redux] }, - { name: 'folder-react-components', folderNames: ['components'], enabledFor: [IconPack.React, IconPack.Redux] }, - { name: 'folder-database', folderNames: ['db', 'database', 'databases', 'sql', 'data', '_data'] }, - { name: 'folder-log', folderNames: ['log', 'logs'] }, - { name: 'folder-temp', folderNames: ['temp', '.temp', 'tmp', '.tmp', 'cached', 'cache', '.cache'] }, - { name: 'folder-aws', folderNames: ['aws', '.aws'] }, - { name: 'folder-audio', folderNames: ['audio', 'audios', 'music', 'sound', 'sounds'] }, - { name: 'folder-video', folderNames: ['video', 'videos', 'movie', 'movies'] }, - { name: 'folder-kubernetes', folderNames: ['kubernetes', 'k8s'] }, - { name: 'folder-import', folderNames: ['import', 'imports', 'imported'] }, - { name: 'folder-export', folderNames: ['export', 'exports', 'exported'] }, - { name: 'folder-wakatime', folderNames: ['wakatime'] }, - { name: 'folder-circleci', folderNames: ['.circleci'] }, - { name: 'folder-wordpress', folderNames: ['wp-content'] }, - { name: 'folder-gradle', folderNames: ['gradle', '.gradle'] }, - { name: 'folder-coverage', folderNames: ['coverage', '.nyc-output', '.nyc_output', 'e2e', 'it', 'integration-test', 'integration-tests'] }, - { name: 'folder-class', folderNames: ['class', 'classes', 'model', 'models'] }, - { name: 'folder-other', folderNames: ['other', 'others', 'misc', 'miscellaneous', 'extra', 'extras'] }, - { name: 'folder-typescript', folderNames: ['typescript', 'ts', 'typings', '@types'] }, - { name: 'folder-graphql', folderNames: ['graphql', 'gql'] }, - { name: 'folder-routes', folderNames: ['routes', 'router', 'routers'] }, - { name: 'folder-ci', folderNames: ['.ci', 'ci'] }, - { name: 'folder-benchmark', folderNames: ['benchmark', 'benchmarks', 'performance', 'measure', 'measures', 'measurement'] }, - { name: 'folder-messages', folderNames: ['messages', 'forum', 'chat', 'chats', 'conversation', 'conversations'] }, - { name: 'folder-less', folderNames: ['less'] }, - { name: 'folder-python', folderNames: ['python', '__pycache__', '.pytest_cache'] }, - { name: 'folder-debug', folderNames: ['debug', 'debugging'] }, - { name: 'folder-fastlane', folderNames: ['fastlane'] }, - { name: 'folder-plugin', folderNames: ['plugin', 'plugins', '_plugins', 'extension', 'extensions', 'addon', 'addons'] }, - { name: 'folder-middleware', folderNames: ['middleware', 'middlewares'] }, - { name: 'folder-controller', folderNames: ['controller', 'controllers', 'service', 'services', 'provider', 'providers'] }, - { name: 'folder-ansible', folderNames: ['ansible'] }, - { name: 'folder-server', folderNames: ['server', 'servers', 'backend'] }, - { name: 'folder-client', folderNames: ['client', 'clients', 'frontend'] }, - { name: 'folder-tasks', folderNames: ['tasks', 'tickets'] }, - { name: 'folder-android', folderNames: ['android'] }, - { name: 'folder-ios', folderNames: ['ios'] }, - { name: 'folder-upload', folderNames: ['uploads', 'upload'] }, - { name: 'folder-download', folderNames: ['downloads', 'download'] }, - { name: 'folder-tools', folderNames: ['tools'] }, - { name: 'folder-helper', folderNames: ['helpers', 'helper'] }, - { name: 'folder-serverless', folderNames: ['.serverless', 'serverless'] }, - { name: 'folder-api', folderNames: ['api', 'apis'] }, - { name: 'folder-app', folderNames: ['app', 'apps'] }, - { name: 'folder-apollo', folderNames: ['apollo', 'apollo-client', 'apollo-cache', 'apollo-config'] }, - { name: 'folder-archive', folderNames: ['archive', 'archives', 'archival', 'backup', 'backups', 'back-up', 'back-ups'] }, - { name: 'folder-batch', folderNames: ['batch', 'batchs', 'batches'] }, - { name: 'folder-cluster', folderNames: ['cluster', 'clusters'] }, - { name: 'folder-command', folderNames: ['command', 'commands', 'cli', 'clis'] }, - { name: 'folder-constant', folderNames: ['constant', 'constants'] }, - { name: 'folder-container', folderNames: ['container', 'containers', '.devcontainer'] }, - { name: 'folder-content', folderNames: ['content', 'contents'] }, - { name: 'folder-core', folderNames: ['core'] }, - { name: 'folder-delta', folderNames: ['delta', 'deltas', 'changes'] }, - { name: 'folder-dump', folderNames: ['dump', 'dumps'] }, - { name: 'folder-examples', folderNames: ['example', 'examples', 'sample', 'samples', 'demo', 'demos'] }, - { name: 'folder-environment', folderNames: ['.env', '.environment', 'env', 'environment', 'environments'] }, - { name: 'folder-functions', folderNames: ['function', 'functions', 'lambda', 'lambdas', 'logic', 'math', 'calc', 'calculation', 'calculations'] }, - { name: 'folder-generator', folderNames: ['generator', 'generators', 'generated', 'cfn-gen', 'gen', 'gens', 'auto'] }, - { name: 'folder-hook', folderNames: ['hook', 'hooks', 'trigger', 'triggers'] }, - { name: 'folder-job', folderNames: ['job', 'jobs'] }, - { name: 'folder-keys', folderNames: ['keys', 'key', 'token', 'tokens'] }, - { name: 'folder-layout', folderNames: ['layout', 'layouts'] }, - { name: 'folder-mail', folderNames: ['mail', 'mails', 'email', 'emails', 'smtp'] }, - { name: 'folder-mappings', folderNames: ['mappings', 'mapping'] }, - { name: 'folder-meta', folderNames: ['meta'] }, - { name: 'folder-packages', folderNames: ['package', 'packages'] }, - { name: 'folder-shared', folderNames: ['shared', 'common'] }, - { name: 'folder-stack', folderNames: ['stack', 'stacks'] }, - { name: 'folder-template', folderNames: ['template', 'templates'] }, - { name: 'folder-utils', folderNames: ['util', 'utils', 'utility', 'utilities'] }, - { name: 'folder-private', folderNames: ['private', '.private'] }, - { name: 'folder-error', folderNames: ['error', 'errors', 'err'] }, - { name: 'folder-event', folderNames: ['event', 'events'] }, - { name: 'folder-secure', folderNames: ['auth', 'authentication', 'secure', 'security', 'cert', 'certs', 'certificate', 'certificates', 'ssl'] }, - { name: 'folder-custom', folderNames: ['custom', 'customs'] }, - { name: 'folder-mock', folderNames: ['mock', 'mocks', 'draft', 'drafts', 'concept', 'concepts', 'sketch', 'sketches'] }, - { name: 'folder-syntax', folderNames: ['syntax', 'syntaxes', 'spellcheck'] }, - { name: 'folder-vm', folderNames: ['vm', 'vms'] }, - { name: 'folder-stylus', folderNames: ['stylus'] }, - { name: 'folder-flow', folderNames: ['flow-typed'] }, - { name: 'folder-rules', folderNames: ['rule', 'rules', 'validation', 'validations', 'validator', 'validators'] }, - { name: 'folder-review', folderNames: ['review', 'reviews', 'revisal', 'revisals', 'reviewed'] }, - { name: 'folder-animation', folderNames: ['animation', 'animations', 'animated'] }, - { name: 'folder-guard', folderNames: ['guard', 'guards'] }, - { name: 'folder-prisma', folderNames: ['prisma'] }, - { name: 'folder-pipe', folderNames: ['pipe', 'pipes'] }, - { name: 'folder-svg', folderNames: ['svg', 'svgs'] }, - { name: 'folder-vuex-store', folderNames: ['store'], enabledFor: [IconPack.Vuex] }, - { name: 'folder-nuxt', folderNames: ['nuxt', '.nuxt'], enabledFor: [IconPack.Vuex, IconPack.Vue] }, - { name: 'folder-vue-directives', folderNames: ['directives'], enabledFor: [IconPack.Vuex, IconPack.Vue] }, - { name: 'folder-vue', folderNames: ['components'], enabledFor: [IconPack.Vuex, IconPack.Vue] }, - { name: 'folder-terraform', folderNames: ['terraform'] }, - { name: 'folder-mobile', folderNames: ['mobile', 'mobiles', 'portable', 'portability'] }, - { name: 'folder-stencil', folderNames: ['.stencil'] }, - { name: 'folder-firebase', folderNames: ['.firebase'] }, - { name: 'folder-svelte', folderNames: ['svelte'] }, - { name: 'folder-update', folderNames: ['update', 'updates', 'upgrade', 'upgrades'] }, - { name: 'folder-intellij', folderNames: ['.idea'], light: true }, - { name: 'folder-azure-pipelines', folderNames: ['.azure-pipelines', '.azure-pipelines-ci'] }, - { name: 'folder-mjml', folderNames: ['mjml'] }, - ] - }, - { name: 'classic', defaultIcon: { name: 'folder' }, rootFolder: { name: 'folder-root' } }, - { name: 'none', defaultIcon: { name: '' } }, + { + name: 'specific', + defaultIcon: { name: 'folder' }, + rootFolder: { name: 'folder-root' }, + icons: [ + { name: 'folder-src', folderNames: ['src', 'source', 'sources', 'code'] }, + { + name: 'folder-dist', + folderNames: ['dist', 'out', 'build', 'release', 'bin'], + }, + { + name: 'folder-css', + folderNames: ['css', 'stylesheet', 'stylesheets', 'style', 'styles'], + }, + { name: 'folder-sass', folderNames: ['sass', '_sass', 'scss', '_scss'] }, + { + name: 'folder-images', + folderNames: [ + 'images', + 'image', + 'img', + 'icons', + 'icon', + 'ico', + 'screenshot', + 'screenshots', + ], + }, + { name: 'folder-scripts', folderNames: ['script', 'scripts'] }, + { name: 'folder-node', folderNames: ['node_modules'] }, + { + name: 'folder-javascript', + folderNames: ['js', 'javascript', 'javascripts'], + }, + { name: 'folder-json', folderNames: ['json'] }, + { name: 'folder-font', folderNames: ['font', 'fonts'] }, + { name: 'folder-bower', folderNames: ['bower_components'] }, + { + name: 'folder-test', + folderNames: [ + 'test', + 'tests', + 'testing', + '__tests__', + '__snapshots__', + '__mocks__', + '__test__', + 'spec', + 'specs', + ], + }, + { + name: 'folder-jinja', + folderNames: ['jinja', 'jinja2', 'j2'], + light: true, + }, + { name: 'folder-markdown', folderNames: ['markdown', 'md'] }, + { name: 'folder-php', folderNames: ['php'] }, + { name: 'folder-phpmailer', folderNames: ['phpmailer'] }, + { name: 'folder-sublime', folderNames: ['sublime'] }, + { + name: 'folder-docs', + folderNames: [ + 'doc', + 'docs', + 'documents', + 'documentation', + 'post', + 'posts', + ], + }, + { + name: 'folder-git', + folderNames: [ + '.git', + 'githooks', + '.githooks', + 'submodules', + '.submodules', + ], + }, + { name: 'folder-github', folderNames: ['.github'] }, + { name: 'folder-gitlab', folderNames: ['.gitlab'] }, + { name: 'folder-vscode', folderNames: ['.vscode', '.vscode-test'] }, + { + name: 'folder-views', + folderNames: [ + 'view', + 'views', + 'screen', + 'screens', + 'page', + 'pages', + 'html', + ], + }, + { name: 'folder-vue', folderNames: ['vue'] }, + { name: 'folder-expo', folderNames: ['.expo', '.expo-shared'] }, + { + name: 'folder-config', + folderNames: [ + 'config', + 'configs', + 'configuration', + 'configurations', + 'setting', + '.setting', + 'settings', + '.settings', + 'META-INF', + ], + }, + { + name: 'folder-i18n', + folderNames: [ + 'i18n', + 'internationalization', + 'lang', + 'language', + 'languages', + 'locale', + 'locales', + 'l10n', + 'localization', + 'translation', + 'translate', + 'translations', + '.tx', + ], + }, + { + name: 'folder-components', + folderNames: ['components', 'widget', 'widgets'], + }, + { name: 'folder-aurelia', folderNames: ['aurelia_project'] }, + { + name: 'folder-resource', + folderNames: [ + 'resource', + 'resources', + 'res', + 'asset', + 'assets', + 'static', + ], + }, + { + name: 'folder-lib', + folderNames: [ + 'lib', + 'libs', + 'library', + 'libraries', + 'vendor', + 'vendors', + 'third-party', + ], + }, + { + name: 'folder-theme', + folderNames: [ + 'themes', + 'theme', + 'color', + 'colors', + 'design', + 'designs', + ], + }, + { name: 'folder-webpack', folderNames: ['webpack', '.webpack'] }, + { name: 'folder-global', folderNames: ['global'] }, + { + name: 'folder-public', + folderNames: ['public', 'www', 'wwwroot', 'web', 'website'], + }, + { + name: 'folder-include', + folderNames: ['include', 'includes', '_includes'], + }, + { + name: 'folder-docker', + folderNames: ['docker', 'dockerfiles', '.docker'], + }, + { + name: 'folder-ngrx-effects', + folderNames: ['effects'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-ngrx-store', + folderNames: ['store'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-ngrx-state', + folderNames: ['states', 'state'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-ngrx-reducer', + folderNames: ['reducers', 'reducer'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-ngrx-actions', + folderNames: ['actions'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-ngrx-entities', + folderNames: ['entities'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'folder-redux-reducer', + folderNames: ['reducers', 'reducer'], + enabledFor: [IconPack.Redux], + }, + { + name: 'folder-redux-actions', + folderNames: ['actions'], + enabledFor: [IconPack.Redux], + }, + { + name: 'folder-redux-store', + folderNames: ['store'], + enabledFor: [IconPack.Redux], + }, + { + name: 'folder-react-components', + folderNames: ['components'], + enabledFor: [IconPack.React, IconPack.Redux], + }, + { + name: 'folder-database', + folderNames: ['db', 'database', 'databases', 'sql', 'data', '_data'], + }, + { name: 'folder-log', folderNames: ['log', 'logs'] }, + { + name: 'folder-temp', + folderNames: [ + 'temp', + '.temp', + 'tmp', + '.tmp', + 'cached', + 'cache', + '.cache', + ], + }, + { name: 'folder-aws', folderNames: ['aws', '.aws'] }, + { + name: 'folder-audio', + folderNames: ['audio', 'audios', 'music', 'sound', 'sounds'], + }, + { + name: 'folder-video', + folderNames: ['video', 'videos', 'movie', 'movies'], + }, + { name: 'folder-kubernetes', folderNames: ['kubernetes', 'k8s'] }, + { name: 'folder-import', folderNames: ['import', 'imports', 'imported'] }, + { name: 'folder-export', folderNames: ['export', 'exports', 'exported'] }, + { name: 'folder-wakatime', folderNames: ['wakatime'] }, + { name: 'folder-circleci', folderNames: ['.circleci'] }, + { name: 'folder-wordpress', folderNames: ['wp-content'] }, + { name: 'folder-gradle', folderNames: ['gradle', '.gradle'] }, + { + name: 'folder-coverage', + folderNames: [ + 'coverage', + '.nyc-output', + '.nyc_output', + 'e2e', + 'it', + 'integration-test', + 'integration-tests', + ], + }, + { + name: 'folder-class', + folderNames: ['class', 'classes', 'model', 'models'], + }, + { + name: 'folder-other', + folderNames: [ + 'other', + 'others', + 'misc', + 'miscellaneous', + 'extra', + 'extras', + ], + }, + { + name: 'folder-typescript', + folderNames: ['typescript', 'ts', 'typings', '@types'], + }, + { name: 'folder-graphql', folderNames: ['graphql', 'gql'] }, + { name: 'folder-routes', folderNames: ['routes', 'router', 'routers'] }, + { name: 'folder-ci', folderNames: ['.ci', 'ci'] }, + { + name: 'folder-benchmark', + folderNames: [ + 'benchmark', + 'benchmarks', + 'performance', + 'measure', + 'measures', + 'measurement', + ], + }, + { + name: 'folder-messages', + folderNames: [ + 'messages', + 'forum', + 'chat', + 'chats', + 'conversation', + 'conversations', + ], + }, + { name: 'folder-less', folderNames: ['less'] }, + { + name: 'folder-python', + folderNames: ['python', '__pycache__', '.pytest_cache'], + }, + { name: 'folder-debug', folderNames: ['debug', 'debugging'] }, + { name: 'folder-fastlane', folderNames: ['fastlane'] }, + { + name: 'folder-plugin', + folderNames: [ + 'plugin', + 'plugins', + '_plugins', + 'extension', + 'extensions', + 'addon', + 'addons', + ], + }, + { name: 'folder-middleware', folderNames: ['middleware', 'middlewares'] }, + { + name: 'folder-controller', + folderNames: [ + 'controller', + 'controllers', + 'service', + 'services', + 'provider', + 'providers', + ], + }, + { name: 'folder-ansible', folderNames: ['ansible'] }, + { name: 'folder-server', folderNames: ['server', 'servers', 'backend'] }, + { name: 'folder-client', folderNames: ['client', 'clients', 'frontend'] }, + { name: 'folder-tasks', folderNames: ['tasks', 'tickets'] }, + { name: 'folder-android', folderNames: ['android'] }, + { name: 'folder-ios', folderNames: ['ios'] }, + { name: 'folder-upload', folderNames: ['uploads', 'upload'] }, + { name: 'folder-download', folderNames: ['downloads', 'download'] }, + { name: 'folder-tools', folderNames: ['tools'] }, + { name: 'folder-helper', folderNames: ['helpers', 'helper'] }, + { name: 'folder-serverless', folderNames: ['.serverless', 'serverless'] }, + { name: 'folder-api', folderNames: ['api', 'apis'] }, + { name: 'folder-app', folderNames: ['app', 'apps'] }, + { + name: 'folder-apollo', + folderNames: [ + 'apollo', + 'apollo-client', + 'apollo-cache', + 'apollo-config', + ], + }, + { + name: 'folder-archive', + folderNames: [ + 'archive', + 'archives', + 'archival', + 'backup', + 'backups', + 'back-up', + 'back-ups', + ], + }, + { name: 'folder-batch', folderNames: ['batch', 'batchs', 'batches'] }, + { name: 'folder-cluster', folderNames: ['cluster', 'clusters'] }, + { + name: 'folder-command', + folderNames: ['command', 'commands', 'cli', 'clis'], + }, + { name: 'folder-constant', folderNames: ['constant', 'constants'] }, + { + name: 'folder-container', + folderNames: ['container', 'containers', '.devcontainer'], + }, + { name: 'folder-content', folderNames: ['content', 'contents'] }, + { name: 'folder-core', folderNames: ['core'] }, + { name: 'folder-delta', folderNames: ['delta', 'deltas', 'changes'] }, + { name: 'folder-dump', folderNames: ['dump', 'dumps'] }, + { + name: 'folder-examples', + folderNames: [ + 'example', + 'examples', + 'sample', + 'samples', + 'demo', + 'demos', + ], + }, + { + name: 'folder-environment', + folderNames: [ + '.env', + '.environment', + 'env', + 'environment', + 'environments', + ], + }, + { + name: 'folder-functions', + folderNames: [ + 'function', + 'functions', + 'lambda', + 'lambdas', + 'logic', + 'math', + 'calc', + 'calculation', + 'calculations', + ], + }, + { + name: 'folder-generator', + folderNames: [ + 'generator', + 'generators', + 'generated', + 'cfn-gen', + 'gen', + 'gens', + 'auto', + ], + }, + { + name: 'folder-hook', + folderNames: ['hook', 'hooks', 'trigger', 'triggers'], + }, + { name: 'folder-job', folderNames: ['job', 'jobs'] }, + { name: 'folder-keys', folderNames: ['keys', 'key', 'token', 'tokens'] }, + { name: 'folder-layout', folderNames: ['layout', 'layouts'] }, + { + name: 'folder-mail', + folderNames: ['mail', 'mails', 'email', 'emails', 'smtp'], + }, + { name: 'folder-mappings', folderNames: ['mappings', 'mapping'] }, + { name: 'folder-meta', folderNames: ['meta'] }, + { name: 'folder-packages', folderNames: ['package', 'packages'] }, + { name: 'folder-shared', folderNames: ['shared', 'common'] }, + { name: 'folder-stack', folderNames: ['stack', 'stacks'] }, + { name: 'folder-template', folderNames: ['template', 'templates'] }, + { + name: 'folder-utils', + folderNames: ['util', 'utils', 'utility', 'utilities'], + }, + { name: 'folder-private', folderNames: ['private', '.private'] }, + { name: 'folder-error', folderNames: ['error', 'errors', 'err'] }, + { name: 'folder-event', folderNames: ['event', 'events'] }, + { + name: 'folder-secure', + folderNames: [ + 'auth', + 'authentication', + 'secure', + 'security', + 'cert', + 'certs', + 'certificate', + 'certificates', + 'ssl', + ], + }, + { name: 'folder-custom', folderNames: ['custom', 'customs'] }, + { + name: 'folder-mock', + folderNames: [ + 'mock', + 'mocks', + 'draft', + 'drafts', + 'concept', + 'concepts', + 'sketch', + 'sketches', + ], + }, + { + name: 'folder-syntax', + folderNames: ['syntax', 'syntaxes', 'spellcheck'], + }, + { name: 'folder-vm', folderNames: ['vm', 'vms'] }, + { name: 'folder-stylus', folderNames: ['stylus'] }, + { name: 'folder-flow', folderNames: ['flow-typed'] }, + { + name: 'folder-rules', + folderNames: [ + 'rule', + 'rules', + 'validation', + 'validations', + 'validator', + 'validators', + ], + }, + { + name: 'folder-review', + folderNames: ['review', 'reviews', 'revisal', 'revisals', 'reviewed'], + }, + { + name: 'folder-animation', + folderNames: ['animation', 'animations', 'animated'], + }, + { name: 'folder-guard', folderNames: ['guard', 'guards'] }, + { name: 'folder-prisma', folderNames: ['prisma'] }, + { name: 'folder-pipe', folderNames: ['pipe', 'pipes'] }, + { name: 'folder-svg', folderNames: ['svg', 'svgs'] }, + { + name: 'folder-vuex-store', + folderNames: ['store'], + enabledFor: [IconPack.Vuex], + }, + { + name: 'folder-nuxt', + folderNames: ['nuxt', '.nuxt'], + enabledFor: [IconPack.Vuex, IconPack.Vue], + }, + { + name: 'folder-vue-directives', + folderNames: ['directives'], + enabledFor: [IconPack.Vuex, IconPack.Vue], + }, + { + name: 'folder-vue', + folderNames: ['components'], + enabledFor: [IconPack.Vuex, IconPack.Vue], + }, + { name: 'folder-terraform', folderNames: ['terraform'] }, + { + name: 'folder-mobile', + folderNames: ['mobile', 'mobiles', 'portable', 'portability'], + }, + { name: 'folder-stencil', folderNames: ['.stencil'] }, + { name: 'folder-firebase', folderNames: ['.firebase'] }, + { name: 'folder-svelte', folderNames: ['svelte'] }, + { + name: 'folder-update', + folderNames: ['update', 'updates', 'upgrade', 'upgrades'], + }, + { name: 'folder-intellij', folderNames: ['.idea'], light: true }, + { + name: 'folder-azure-pipelines', + folderNames: ['.azure-pipelines', '.azure-pipelines-ci'], + }, + { name: 'folder-mjml', folderNames: ['mjml'] }, + ], + }, + { + name: 'classic', + defaultIcon: { name: 'folder' }, + rootFolder: { name: 'folder-root' }, + }, + { name: 'none', defaultIcon: { name: '' } }, ]; diff --git a/src/icons/generator/fileGenerator.ts b/src/icons/generator/fileGenerator.ts index 120c425e3b..5f709523a6 100644 --- a/src/icons/generator/fileGenerator.ts +++ b/src/icons/generator/fileGenerator.ts @@ -1,118 +1,182 @@ import * as merge from 'lodash.merge'; import { getFileConfigHash } from '../../helpers/fileConfig'; -import { FileIcon, FileIcons, IconAssociations, IconConfiguration, IconJsonOptions } from '../../models/index'; -import { highContrastVersion, iconFolderPath, lightVersion, wildcardPattern } from './constants'; +import { + FileIcon, + FileIcons, + IconAssociations, + IconConfiguration, + IconJsonOptions, +} from '../../models/index'; +import { + highContrastVersion, + iconFolderPath, + lightVersion, + wildcardPattern, +} from './constants'; /** * Get all file icons that can be used in this theme. */ -export const loadFileIconDefinitions = (fileIcons: FileIcons, config: IconConfiguration, options: IconJsonOptions): IconConfiguration => { - config = merge({}, config); - const enabledIcons = disableIconsByPack(fileIcons, options.activeIconPack); - const customIcons = getCustomIcons(options.files.associations); - const allFileIcons = [...enabledIcons, ...customIcons]; - - allFileIcons.forEach(icon => { - if (icon.disabled) return; - config = merge({}, config, setIconDefinition(config, icon.name)); - - if (icon.light) { - config = merge({}, config, setIconDefinition(config, icon.name, lightVersion)); - } - if (icon.highContrast) { - config = merge({}, config, setIconDefinition(config, icon.name, highContrastVersion)); - } - - if (icon.fileExtensions) { - config = merge({}, config, mapSpecificFileIcons(icon, FileMappingType.FileExtensions)); - } - if (icon.fileNames) { - config = merge({}, config, mapSpecificFileIcons(icon, FileMappingType.FileNames, options.files.associations)); - } - }); - - // set default file icon - config = merge({}, config, setIconDefinition(config, fileIcons.defaultIcon.name)); - config.file = fileIcons.defaultIcon.name; - - if (fileIcons.defaultIcon.light) { - config = merge({}, config, setIconDefinition(config, fileIcons.defaultIcon.name, lightVersion)); - config.light.file = fileIcons.defaultIcon.name + lightVersion; +export const loadFileIconDefinitions = ( + fileIcons: FileIcons, + config: IconConfiguration, + options: IconJsonOptions +): IconConfiguration => { + config = merge({}, config); + const enabledIcons = disableIconsByPack(fileIcons, options.activeIconPack); + const customIcons = getCustomIcons(options.files.associations); + const allFileIcons = [...enabledIcons, ...customIcons]; + + allFileIcons.forEach((icon) => { + if (icon.disabled) return; + config = merge({}, config, setIconDefinition(config, icon.name)); + + if (icon.light) { + config = merge( + {}, + config, + setIconDefinition(config, icon.name, lightVersion) + ); } - - if (fileIcons.defaultIcon.highContrast) { - config = merge({}, config, setIconDefinition(config, fileIcons.defaultIcon.name, highContrastVersion)); - config.highContrast.file = fileIcons.defaultIcon.name + highContrastVersion; + if (icon.highContrast) { + config = merge( + {}, + config, + setIconDefinition(config, icon.name, highContrastVersion) + ); } - return config; + if (icon.fileExtensions) { + config = merge( + {}, + config, + mapSpecificFileIcons(icon, FileMappingType.FileExtensions) + ); + } + if (icon.fileNames) { + config = merge( + {}, + config, + mapSpecificFileIcons( + icon, + FileMappingType.FileNames, + options.files.associations + ) + ); + } + }); + + // set default file icon + config = merge( + {}, + config, + setIconDefinition(config, fileIcons.defaultIcon.name) + ); + config.file = fileIcons.defaultIcon.name; + + if (fileIcons.defaultIcon.light) { + config = merge( + {}, + config, + setIconDefinition(config, fileIcons.defaultIcon.name, lightVersion) + ); + config.light.file = fileIcons.defaultIcon.name + lightVersion; + } + + if (fileIcons.defaultIcon.highContrast) { + config = merge( + {}, + config, + setIconDefinition(config, fileIcons.defaultIcon.name, highContrastVersion) + ); + config.highContrast.file = fileIcons.defaultIcon.name + highContrastVersion; + } + + return config; }; /** * Map the file extensions and the filenames to the related icons. */ -const mapSpecificFileIcons = (icon: FileIcon, mappingType: FileMappingType, customFileAssociation: IconAssociations = {}) => { - const config = new IconConfiguration(); - icon[mappingType].forEach(name => { - // if the custom file extension should also overwrite the file names - const shouldOverwriteFileNames = Object.keys(customFileAssociation).some(key => { - // overwrite is enabled if there are two asterisks in the wildcard - if (!/^\*{2}\./.test(key)) return false; - const fileExtension = key.replace(wildcardPattern, '.'); - - // check if the file name contains the particular file extension - // (e.g. extension ".md" in "Readme.md" -> then overwrite it with the *.md icon) - return name.toLowerCase().indexOf(fileExtension.toLowerCase()) !== -1; - }); - - // if overwrite is enabled then do not continue to set the icons for file names containing the file extension - if (shouldOverwriteFileNames) return; - - config[mappingType][name] = icon.name; - if (icon.light) { - config.light[mappingType][name] = `${icon.name}${lightVersion}`; - } - if (icon.highContrast) { - config.highContrast[mappingType][name] = `${icon.name}${highContrastVersion}`; - } - }); - return config; +const mapSpecificFileIcons = ( + icon: FileIcon, + mappingType: FileMappingType, + customFileAssociation: IconAssociations = {} +) => { + const config = new IconConfiguration(); + icon[mappingType].forEach((name) => { + // if the custom file extension should also overwrite the file names + const shouldOverwriteFileNames = Object.keys(customFileAssociation).some( + (key) => { + // overwrite is enabled if there are two asterisks in the wildcard + if (!/^\*{2}\./.test(key)) return false; + const fileExtension = key.replace(wildcardPattern, '.'); + + // check if the file name contains the particular file extension + // (e.g. extension ".md" in "Readme.md" -> then overwrite it with the *.md icon) + return name.toLowerCase().indexOf(fileExtension.toLowerCase()) !== -1; + } + ); + + // if overwrite is enabled then do not continue to set the icons for file names containing the file extension + if (shouldOverwriteFileNames) return; + + config[mappingType][name] = icon.name; + if (icon.light) { + config.light[mappingType][name] = `${icon.name}${lightVersion}`; + } + if (icon.highContrast) { + config.highContrast[mappingType][ + name + ] = `${icon.name}${highContrastVersion}`; + } + }); + return config; }; /** * Disable all file icons that are in a pack which is disabled. */ -const disableIconsByPack = (fileIcons: FileIcons, activatedIconPack: string): FileIcon[] => { - return fileIcons.icons.filter(icon => { - return !icon.enabledFor ? true : icon.enabledFor.some(p => p === activatedIconPack); - }); +const disableIconsByPack = ( + fileIcons: FileIcons, + activatedIconPack: string +): FileIcon[] => { + return fileIcons.icons.filter((icon) => { + return !icon.enabledFor + ? true + : icon.enabledFor.some((p) => p === activatedIconPack); + }); }; -const setIconDefinition = (config: IconConfiguration, iconName: string, appendix: string = '') => { - const obj = { iconDefinitions: {} }; - const fileConfigHash = getFileConfigHash(config.options); - obj.iconDefinitions[`${iconName}${appendix}`] = { - iconPath: `${iconFolderPath}${iconName}${appendix}${fileConfigHash}.svg` - }; - return obj; +const setIconDefinition = ( + config: IconConfiguration, + iconName: string, + appendix: string = '' +) => { + const obj = { iconDefinitions: {} }; + const fileConfigHash = getFileConfigHash(config.options); + obj.iconDefinitions[`${iconName}${appendix}`] = { + iconPath: `${iconFolderPath}${iconName}${appendix}${fileConfigHash}.svg`, + }; + return obj; }; const getCustomIcons = (fileAssociations: IconAssociations) => { - if (!fileAssociations) return []; - - const icons: FileIcon[] = Object.keys(fileAssociations).map(fa => { - const icon: FileIcon = { name: fileAssociations[fa].toLowerCase() }; - if (wildcardPattern.test(fa)) { - icon.fileExtensions = [fa.toLowerCase().replace(wildcardPattern, '')]; - } else { - icon.fileNames = [fa.toLowerCase()]; - } - return icon; - }); - return icons; + if (!fileAssociations) return []; + + const icons: FileIcon[] = Object.keys(fileAssociations).map((fa) => { + const icon: FileIcon = { name: fileAssociations[fa].toLowerCase() }; + if (wildcardPattern.test(fa)) { + icon.fileExtensions = [fa.toLowerCase().replace(wildcardPattern, '')]; + } else { + icon.fileNames = [fa.toLowerCase()]; + } + return icon; + }); + return icons; }; const enum FileMappingType { - FileExtensions = 'fileExtensions', - FileNames = 'fileNames' + FileExtensions = 'fileExtensions', + FileNames = 'fileNames', } diff --git a/src/icons/generator/folderGenerator.ts b/src/icons/generator/folderGenerator.ts index b3bfb95898..b2d857e7dd 100644 --- a/src/icons/generator/folderGenerator.ts +++ b/src/icons/generator/folderGenerator.ts @@ -2,176 +2,301 @@ import * as fs from 'fs'; import * as merge from 'lodash.merge'; import * as path from 'path'; import { getFileConfigHash } from '../../helpers/fileConfig'; -import { DefaultIcon, FolderIcon, FolderTheme, IconAssociations, IconConfiguration, IconJsonOptions } from '../../models/index'; -import { highContrastVersion, iconFolderPath, lightVersion, openedFolder } from './constants'; +import { + DefaultIcon, + FolderIcon, + FolderTheme, + IconAssociations, + IconConfiguration, + IconJsonOptions, +} from '../../models/index'; +import { + highContrastVersion, + iconFolderPath, + lightVersion, + openedFolder, +} from './constants'; /** * Get the folder icon definitions as object. */ -export const loadFolderIconDefinitions = (folderThemes: FolderTheme[], config: IconConfiguration, options: IconJsonOptions): IconConfiguration => { - config = merge({}, config); - config.hidesExplorerArrows = options.hidesExplorerArrows; - const activeTheme = getEnabledFolderTheme(folderThemes, options.folders.theme); - const enabledIcons = disableIconsByPack(activeTheme, options.activeIconPack); - const customIcons = getCustomIcons(options.folders.associations); - const allIcons = [...enabledIcons, ...customIcons]; - - if (options.folders.theme === 'none') { - return config; - } - - allIcons.forEach(icon => { - if (icon.disabled) return; - config = setIconDefinitions(config, icon); - config = merge({}, config, setFolderNames(icon.name, icon.folderNames)); - config.light = icon.light ? merge({}, config.light, setFolderNames(icon.name, icon.folderNames, lightVersion)) : config.light; - config.highContrast = icon.highContrast ? merge({}, config.highContrast, setFolderNames(icon.name, icon.folderNames, highContrastVersion)) : config.highContrast; - }); - - config = setDefaultFolderIcons(activeTheme, config); +export const loadFolderIconDefinitions = ( + folderThemes: FolderTheme[], + config: IconConfiguration, + options: IconJsonOptions +): IconConfiguration => { + config = merge({}, config); + config.hidesExplorerArrows = options.hidesExplorerArrows; + const activeTheme = getEnabledFolderTheme( + folderThemes, + options.folders.theme + ); + const enabledIcons = disableIconsByPack(activeTheme, options.activeIconPack); + const customIcons = getCustomIcons(options.folders.associations); + const allIcons = [...enabledIcons, ...customIcons]; + + if (options.folders.theme === 'none') { return config; + } + + allIcons.forEach((icon) => { + if (icon.disabled) return; + config = setIconDefinitions(config, icon); + config = merge({}, config, setFolderNames(icon.name, icon.folderNames)); + config.light = icon.light + ? merge( + {}, + config.light, + setFolderNames(icon.name, icon.folderNames, lightVersion) + ) + : config.light; + config.highContrast = icon.highContrast + ? merge( + {}, + config.highContrast, + setFolderNames(icon.name, icon.folderNames, highContrastVersion) + ) + : config.highContrast; + }); + + config = setDefaultFolderIcons(activeTheme, config); + return config; }; /** * Set the default folder icons for the theme. */ -const setDefaultFolderIcons = (theme: FolderTheme, config: IconConfiguration): IconConfiguration => { - config = merge({}, config); - const hasFolderIcons = theme.defaultIcon.name && theme.defaultIcon.name.length > 0; - if (hasFolderIcons) { - config = setIconDefinitions(config, theme.defaultIcon); - } - config = merge({}, config, createDefaultIconConfigObject(hasFolderIcons, theme, '')); - config.light = theme.defaultIcon.light ? merge({}, config.light, createDefaultIconConfigObject(hasFolderIcons, theme, lightVersion)) : config.light; - config.highContrast = theme.defaultIcon.highContrast ? merge({}, config.highContrast, createDefaultIconConfigObject(hasFolderIcons, theme, highContrastVersion)) : config.highContrast; - - config = merge({}, config, createRootIconConfigObject(hasFolderIcons, theme, '')); - if (theme.rootFolder) { - config = setIconDefinitions(config, theme.rootFolder); - config.light = theme.rootFolder.light ? merge({}, config.light, createRootIconConfigObject(hasFolderIcons, theme, lightVersion)) : config.light; - config.highContrast = theme.rootFolder.highContrast ? merge({}, config.highContrast, createRootIconConfigObject(hasFolderIcons, theme, highContrastVersion)) : config.highContrast; - } +const setDefaultFolderIcons = ( + theme: FolderTheme, + config: IconConfiguration +): IconConfiguration => { + config = merge({}, config); + const hasFolderIcons = + theme.defaultIcon.name && theme.defaultIcon.name.length > 0; + if (hasFolderIcons) { + config = setIconDefinitions(config, theme.defaultIcon); + } + config = merge( + {}, + config, + createDefaultIconConfigObject(hasFolderIcons, theme, '') + ); + config.light = theme.defaultIcon.light + ? merge( + {}, + config.light, + createDefaultIconConfigObject(hasFolderIcons, theme, lightVersion) + ) + : config.light; + config.highContrast = theme.defaultIcon.highContrast + ? merge( + {}, + config.highContrast, + createDefaultIconConfigObject( + hasFolderIcons, + theme, + highContrastVersion + ) + ) + : config.highContrast; - return config; + config = merge( + {}, + config, + createRootIconConfigObject(hasFolderIcons, theme, '') + ); + if (theme.rootFolder) { + config = setIconDefinitions(config, theme.rootFolder); + config.light = theme.rootFolder.light + ? merge( + {}, + config.light, + createRootIconConfigObject(hasFolderIcons, theme, lightVersion) + ) + : config.light; + config.highContrast = theme.rootFolder.highContrast + ? merge( + {}, + config.highContrast, + createRootIconConfigObject(hasFolderIcons, theme, highContrastVersion) + ) + : config.highContrast; + } + + return config; }; /** * Get the object of the current enabled theme. */ -const getEnabledFolderTheme = (themes: FolderTheme[], enabledTheme: string): FolderTheme => { - return themes.find(theme => theme.name === enabledTheme); +const getEnabledFolderTheme = ( + themes: FolderTheme[], + enabledTheme: string +): FolderTheme => { + return themes.find((theme) => theme.name === enabledTheme); }; /** * Disable all file icons that are in a pack which is disabled. */ -const disableIconsByPack = (folderIcons: FolderTheme, activatedIconPack: string): FolderIcon[] => { - if (!folderIcons.icons || folderIcons.icons.length === 0) { - return []; - } - return folderIcons.icons.filter(icon => { - return !icon.enabledFor ? true : icon.enabledFor.some(p => p === activatedIconPack); - }); +const disableIconsByPack = ( + folderIcons: FolderTheme, + activatedIconPack: string +): FolderIcon[] => { + if (!folderIcons.icons || folderIcons.icons.length === 0) { + return []; + } + return folderIcons.icons.filter((icon) => { + return !icon.enabledFor + ? true + : icon.enabledFor.some((p) => p === activatedIconPack); + }); }; -const setIconDefinitions = (config: IconConfiguration, icon: FolderIcon | DefaultIcon) => { - config = merge({}, config); - config = createIconDefinitions(config, icon.name); - if (icon.light) { - config = merge({}, config, createIconDefinitions(config, icon.name, lightVersion)); - } - if (icon.highContrast) { - config = merge({}, config, createIconDefinitions(config, icon.name, highContrastVersion)); - } - return config; +const setIconDefinitions = ( + config: IconConfiguration, + icon: FolderIcon | DefaultIcon +) => { + config = merge({}, config); + config = createIconDefinitions(config, icon.name); + if (icon.light) { + config = merge( + {}, + config, + createIconDefinitions(config, icon.name, lightVersion) + ); + } + if (icon.highContrast) { + config = merge( + {}, + config, + createIconDefinitions(config, icon.name, highContrastVersion) + ); + } + return config; }; -const createIconDefinitions = (config: IconConfiguration, iconName: string, appendix: string = '') => { - config = merge({}, config); - const fileConfigHash = getFileConfigHash(config.options); - config.iconDefinitions[iconName + appendix] = { - iconPath: `${iconFolderPath}${iconName}${appendix}${fileConfigHash}.svg` - }; - config.iconDefinitions[`${iconName}${openedFolder}${appendix}`] = { - iconPath: `${iconFolderPath}${iconName}${openedFolder}${appendix}${fileConfigHash}.svg` - }; - return config; +const createIconDefinitions = ( + config: IconConfiguration, + iconName: string, + appendix: string = '' +) => { + config = merge({}, config); + const fileConfigHash = getFileConfigHash(config.options); + config.iconDefinitions[iconName + appendix] = { + iconPath: `${iconFolderPath}${iconName}${appendix}${fileConfigHash}.svg`, + }; + config.iconDefinitions[`${iconName}${openedFolder}${appendix}`] = { + iconPath: `${iconFolderPath}${iconName}${openedFolder}${appendix}${fileConfigHash}.svg`, + }; + return config; }; -const setFolderNames = (iconName: string, folderNames: string[], appendix: string = '') => { - const obj = { folderNames: {}, folderNamesExpanded: {} }; - folderNames.forEach(fn => { - obj.folderNames[fn] = iconName + appendix; - obj.folderNamesExpanded[fn] = `${iconName}${openedFolder}${appendix}`; - }); - return obj; +const setFolderNames = ( + iconName: string, + folderNames: string[], + appendix: string = '' +) => { + const obj = { folderNames: {}, folderNamesExpanded: {} }; + folderNames.forEach((fn) => { + obj.folderNames[fn] = iconName + appendix; + obj.folderNamesExpanded[fn] = `${iconName}${openedFolder}${appendix}`; + }); + return obj; }; -const createDefaultIconConfigObject = (hasFolderIcons: boolean, theme: FolderTheme, appendix: string = '') => { - const obj = { - folder: '', - folderExpanded: '' - }; - obj.folder = hasFolderIcons ? theme.defaultIcon.name + appendix : ''; - obj.folderExpanded = hasFolderIcons ? `${theme.defaultIcon.name}${openedFolder}${appendix}` : ''; - return obj; +const createDefaultIconConfigObject = ( + hasFolderIcons: boolean, + theme: FolderTheme, + appendix: string = '' +) => { + const obj = { + folder: '', + folderExpanded: '', + }; + obj.folder = hasFolderIcons ? theme.defaultIcon.name + appendix : ''; + obj.folderExpanded = hasFolderIcons + ? `${theme.defaultIcon.name}${openedFolder}${appendix}` + : ''; + return obj; }; -const createRootIconConfigObject = (hasFolderIcons: boolean, theme: FolderTheme, appendix: string = '') => { - const obj = { - rootFolder: '', - rootFolderExpanded: '' - }; - obj.rootFolder = hasFolderIcons ? theme.rootFolder ? theme.rootFolder.name + appendix : theme.defaultIcon.name + appendix : ''; - obj.rootFolderExpanded = hasFolderIcons ? theme.rootFolder ? `${theme.rootFolder.name}${openedFolder}${appendix}` : `${theme.defaultIcon.name}${openedFolder}${appendix}` : ''; - return obj; +const createRootIconConfigObject = ( + hasFolderIcons: boolean, + theme: FolderTheme, + appendix: string = '' +) => { + const obj = { + rootFolder: '', + rootFolderExpanded: '', + }; + obj.rootFolder = hasFolderIcons + ? theme.rootFolder + ? theme.rootFolder.name + appendix + : theme.defaultIcon.name + appendix + : ''; + obj.rootFolderExpanded = hasFolderIcons + ? theme.rootFolder + ? `${theme.rootFolder.name}${openedFolder}${appendix}` + : `${theme.defaultIcon.name}${openedFolder}${appendix}` + : ''; + return obj; }; const getCustomIcons = (folderAssociations: IconAssociations) => { - if (!folderAssociations) return []; + if (!folderAssociations) return []; - const icons: FolderIcon[] = Object.keys(folderAssociations).map(fa => ({ - // use default folder if icon name is empty - name: folderAssociations[fa].length > 0 ? 'folder-' + folderAssociations[fa].toLowerCase() : 'folder', - folderNames: [fa.toLowerCase()] - })); + const icons: FolderIcon[] = Object.keys(folderAssociations).map((fa) => ({ + // use default folder if icon name is empty + name: + folderAssociations[fa].length > 0 + ? 'folder-' + folderAssociations[fa].toLowerCase() + : 'folder', + folderNames: [fa.toLowerCase()], + })); - return icons; + return icons; }; export const generateFolderIcons = (color: string) => { - if (!validateHEXColorCode(color)) { - return console.error('Invalid color code for folder icons'); - } - - const folderIcon = 'M10 4H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8c0-1.11-.9-2-2-2h-8l-2-2z'; - const folderIconOpen = 'M19 20H4c-1.11 0-2-.9-2-2V6c0-1.11.89-2 2-2h6l2 2h7a2 2 0 0 1 2 2H4v10l2.14-8h17.07l-2.28 8.5c-.23.87-1.01 1.5-1.93 1.5z'; - const rootFolderIcon = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5z'; - const rootFolderIconOpen = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2z'; - - writeSVGFiles('folder', getSVG(getPath(folderIcon, color))); - writeSVGFiles('folder-open', getSVG(getPath(folderIconOpen, color))); - writeSVGFiles('folder-root', getSVG(getPath(rootFolderIcon, color))); - writeSVGFiles('folder-root-open', getSVG(getPath(rootFolderIconOpen, color))); + if (!validateHEXColorCode(color)) { + return console.error('Invalid color code for folder icons'); + } + + const folderIcon = + 'M10 4H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8c0-1.11-.9-2-2-2h-8l-2-2z'; + const folderIconOpen = + 'M19 20H4c-1.11 0-2-.9-2-2V6c0-1.11.89-2 2-2h6l2 2h7a2 2 0 0 1 2 2H4v10l2.14-8h17.07l-2.28 8.5c-.23.87-1.01 1.5-1.93 1.5z'; + const rootFolderIcon = + 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5z'; + const rootFolderIconOpen = + 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2z'; + + writeSVGFiles('folder', getSVG(getPath(folderIcon, color))); + writeSVGFiles('folder-open', getSVG(getPath(folderIconOpen, color))); + writeSVGFiles('folder-root', getSVG(getPath(rootFolderIcon, color))); + writeSVGFiles('folder-root-open', getSVG(getPath(rootFolderIconOpen, color))); }; -const getPath = (d: string, color: string) => ``; -const getSVG = (path: string) => `${path}`; +const getPath = (d: string, color: string) => + ``; +const getSVG = (path: string) => + `${path}`; const writeSVGFiles = (iconName: string, svg: string) => { - let iconsPath; - if (path.basename(__dirname) === 'dist') { - iconsPath = path.join(__dirname, '..', 'icons'); - } else { - // executed via script - iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); - } - const iconsFolderPath = path.join(iconsPath, `${iconName}.svg`); - try { - fs.writeFileSync(iconsFolderPath, svg); - } catch (error) { - console.error(error); - } + let iconsPath; + if (path.basename(__dirname) === 'dist') { + iconsPath = path.join(__dirname, '..', 'icons'); + } else { + // executed via script + iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); + } + const iconsFolderPath = path.join(iconsPath, `${iconName}.svg`); + try { + fs.writeFileSync(iconsFolderPath, svg); + } catch (error) { + console.error(error); + } }; /** @@ -179,6 +304,6 @@ const writeSVGFiles = (iconName: string, svg: string) => { * @param color HEX code */ export const validateHEXColorCode = (color: string) => { - const hexPattern = new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); - return color.length > 0 && hexPattern.test(color); + const hexPattern = new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); + return color.length > 0 && hexPattern.test(color); }; diff --git a/src/icons/generator/iconOpacity.ts b/src/icons/generator/iconOpacity.ts index 39795dfdb5..554fe846d3 100644 --- a/src/icons/generator/iconOpacity.ts +++ b/src/icons/generator/iconOpacity.ts @@ -8,33 +8,38 @@ import { IconJsonOptions } from '../../models'; * @param options Icon JSON options which include the opacity value. * @param fileNames Only change the opacity of certain file names. */ -export const setIconOpacity = (options: IconJsonOptions, fileNames?: string[]) => { - if (!validateOpacityValue(options.opacity)) { - return console.error('Invalid opacity value! Opacity must be a decimal number between 0 and 1!'); - } - - let iconsPath; - if (path.basename(__dirname) === 'dist') { - iconsPath = path.join(__dirname, '..', 'icons'); - } else { - // executed via script - iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); - } - - const customIconPaths = getCustomIconPaths(options); - const iconFiles = fs.readdirSync(iconsPath); - - try { - // read all icon files from the icons folder - (fileNames || iconFiles).forEach(adjustOpacity(iconsPath, options)); - - customIconPaths.forEach(iconPath => { - const customIcons = fs.readdirSync(iconPath); - customIcons.forEach(adjustOpacity(iconPath, options)); - }); - } catch (error) { - console.error(error); - } +export const setIconOpacity = ( + options: IconJsonOptions, + fileNames?: string[] +) => { + if (!validateOpacityValue(options.opacity)) { + return console.error( + 'Invalid opacity value! Opacity must be a decimal number between 0 and 1!' + ); + } + + let iconsPath; + if (path.basename(__dirname) === 'dist') { + iconsPath = path.join(__dirname, '..', 'icons'); + } else { + // executed via script + iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); + } + + const customIconPaths = getCustomIconPaths(options); + const iconFiles = fs.readdirSync(iconsPath); + + try { + // read all icon files from the icons folder + (fileNames || iconFiles).forEach(adjustOpacity(iconsPath, options)); + + customIconPaths.forEach((iconPath) => { + const customIcons = fs.readdirSync(iconPath); + customIcons.forEach(adjustOpacity(iconPath, options)); + }); + } catch (error) { + console.error(error); + } }; /** @@ -42,7 +47,7 @@ export const setIconOpacity = (options: IconJsonOptions, fileNames?: string[]) = * @param opacity Opacity value */ export const validateOpacityValue = (opacity: number) => { - return opacity !== undefined && opacity <= 1 && opacity >= 0; + return opacity !== undefined && opacity <= 1 && opacity >= 0; }; /** @@ -50,8 +55,8 @@ export const validateOpacityValue = (opacity: number) => { * @param svg SVG file as string. */ const getSVGRootElement = (svg: string) => { - const result = new RegExp(/]*>/).exec(svg); - return result?.[0]; + const result = new RegExp(/]*>/).exec(svg); + return result?.[0]; }; /** @@ -60,13 +65,13 @@ const getSVGRootElement = (svg: string) => { * @param opacity Opacity value. */ const addOpacityAttribute = (svgRoot: string, opacity: number) => { - const pattern = new RegExp(/\sopacity="[\d.]+"/); - // if the opacity attribute already exists - if (pattern.test(svgRoot)) { - return svgRoot.replace(pattern, ` opacity="${opacity}"`); - } else { - return svgRoot.replace(/^ { * @param svgRoot Root element of the SVG icon. */ const removeOpacityAttribute = (svgRoot: string) => { - const pattern = new RegExp(/\sopacity="[\d.]+"/); - return svgRoot.replace(pattern, ''); + const pattern = new RegExp(/\sopacity="[\d.]+"/); + return svgRoot.replace(pattern, ''); }; -const adjustOpacity = (iconPath: string, options: IconJsonOptions): (value: string, index: number, array: string[]) => void => { - return iconFileName => { - const svgFilePath = path.join(iconPath, iconFileName); +const adjustOpacity = ( + iconPath: string, + options: IconJsonOptions +): ((value: string, index: number, array: string[]) => void) => { + return (iconFileName) => { + const svgFilePath = path.join(iconPath, iconFileName); - // Read SVG file - const svg = fs.readFileSync(svgFilePath, 'utf-8'); + // Read SVG file + const svg = fs.readFileSync(svgFilePath, 'utf-8'); - // Get the root element of the SVG file - const svgRootElement = getSVGRootElement(svg); - if (!svgRootElement) - return; + // Get the root element of the SVG file + const svgRootElement = getSVGRootElement(svg); + if (!svgRootElement) return; - let updatedRootElement: string; + let updatedRootElement: string; - if (options.opacity < 1) { - updatedRootElement = addOpacityAttribute(svgRootElement, options.opacity); - } - else { - updatedRootElement = removeOpacityAttribute(svgRootElement); - } - const updatedSVG = svg.replace(/]*>/, updatedRootElement); + if (options.opacity < 1) { + updatedRootElement = addOpacityAttribute(svgRootElement, options.opacity); + } else { + updatedRootElement = removeOpacityAttribute(svgRootElement); + } + const updatedSVG = svg.replace(/]*>/, updatedRootElement); - fs.writeFileSync(svgFilePath, updatedSVG); - }; + fs.writeFileSync(svgFilePath, updatedSVG); + }; }; - diff --git a/src/icons/generator/iconSaturation.ts b/src/icons/generator/iconSaturation.ts index 93bc60fa68..40791a25ce 100644 --- a/src/icons/generator/iconSaturation.ts +++ b/src/icons/generator/iconSaturation.ts @@ -8,33 +8,38 @@ import { IconJsonOptions } from '../../models'; * @param options Icon JSON options which include the saturation value. * @param fileNames Only change the saturation of certain file names. */ -export const setIconSaturation = (options: IconJsonOptions, fileNames?: string[]) => { - if (!validateSaturationValue(options.saturation)) { - return console.error('Invalid saturation value! Saturation must be a decimal number between 0 and 1!'); - } - - let iconsPath; - if (path.basename(__dirname) === 'dist') { - iconsPath = path.join(__dirname, '..', 'icons'); - } else { - // executed via script - iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); - } - - const customIconPaths = getCustomIconPaths(options); - const iconFiles = fs.readdirSync(iconsPath); - - // read all icon files from the icons folder - try { - (fileNames || iconFiles).forEach(adjustSaturation(iconsPath, options)); - - customIconPaths.forEach(iconPath => { - const customIcons = fs.readdirSync(iconPath); - customIcons.forEach(adjustSaturation(iconPath, options)); - }); - } catch (error) { - console.error(error); - } +export const setIconSaturation = ( + options: IconJsonOptions, + fileNames?: string[] +) => { + if (!validateSaturationValue(options.saturation)) { + return console.error( + 'Invalid saturation value! Saturation must be a decimal number between 0 and 1!' + ); + } + + let iconsPath; + if (path.basename(__dirname) === 'dist') { + iconsPath = path.join(__dirname, '..', 'icons'); + } else { + // executed via script + iconsPath = path.join(__dirname, '..', '..', '..', 'icons'); + } + + const customIconPaths = getCustomIconPaths(options); + const iconFiles = fs.readdirSync(iconsPath); + + // read all icon files from the icons folder + try { + (fileNames || iconFiles).forEach(adjustSaturation(iconsPath, options)); + + customIconPaths.forEach((iconPath) => { + const customIcons = fs.readdirSync(iconPath); + customIcons.forEach(adjustSaturation(iconPath, options)); + }); + } catch (error) { + console.error(error); + } }; /** @@ -42,8 +47,8 @@ export const setIconSaturation = (options: IconJsonOptions, fileNames?: string[] * @param svg SVG file as string. */ const getSVGRootElement = (svg: string) => { - const result = new RegExp(/]*>/).exec(svg); - return result?.[0]; + const result = new RegExp(/]*>/).exec(svg); + return result?.[0]; }; /** @@ -51,13 +56,13 @@ const getSVGRootElement = (svg: string) => { * @param svgRoot Root element of the SVG icon. */ const addFilterAttribute = (svgRoot: string) => { - const pattern = new RegExp(/\sfilter="[^"]+?"/); - // if the filter attribute already exists - if (pattern.test(svgRoot)) { - return svgRoot.replace(pattern, ' filter="url(#saturation)"'); - } else { - return svgRoot.replace(/^ { * @param svgRoot Root element of the SVG icon. */ const removeFilterAttribute = (svgRoot: string) => { - const pattern = new RegExp(/\sfilter="[^"]+?"/); - return svgRoot.replace(pattern, ''); + const pattern = new RegExp(/\sfilter="[^"]+?"/); + return svgRoot.replace(pattern, ''); }; /** @@ -74,13 +79,13 @@ const removeFilterAttribute = (svgRoot: string) => { * @param svg SVG file as string. */ const addFilterElement = (svg: string, value: number) => { - const pattern = new RegExp(/(.*<\/svg>)/); - const filterElement = ``; - if (pattern.test(svg)) { - return svg.replace(pattern, `${filterElement}$1`); - } else { - return svg.replace(/<\/svg>/, `${filterElement}`); - } + const pattern = new RegExp(/(.*<\/svg>)/); + const filterElement = ``; + if (pattern.test(svg)) { + return svg.replace(pattern, `${filterElement}$1`); + } else { + return svg.replace(/<\/svg>/, `${filterElement}`); + } }; /** @@ -88,8 +93,8 @@ const addFilterElement = (svg: string, value: number) => { * @param svg SVG file as string. */ const removeFilterElement = (svg: string) => { - const pattern = new RegExp(/(.*<\/svg>)/); - return svg.replace(pattern, '$1'); + const pattern = new RegExp(/(.*<\/svg>)/); + return svg.replace(pattern, '$1'); }; /** @@ -97,39 +102,39 @@ const removeFilterElement = (svg: string) => { * @param saturation Saturation value */ export const validateSaturationValue = (saturation: number) => { - return saturation !== undefined && saturation <= 1 && saturation >= 0; + return saturation !== undefined && saturation <= 1 && saturation >= 0; }; -const adjustSaturation = (iconsPath: any, options: IconJsonOptions): (value: string, index: number, array: string[]) => void => { - return iconFileName => { - const svgFilePath = path.join(iconsPath, iconFileName); +const adjustSaturation = ( + iconsPath: any, + options: IconJsonOptions +): ((value: string, index: number, array: string[]) => void) => { + return (iconFileName) => { + const svgFilePath = path.join(iconsPath, iconFileName); - // Read SVG file - const svg = fs.readFileSync(svgFilePath, 'utf-8'); + // Read SVG file + const svg = fs.readFileSync(svgFilePath, 'utf-8'); - // Get the root element of the SVG file - const svgRootElement = getSVGRootElement(svg); - if (!svgRootElement) - return; + // Get the root element of the SVG file + const svgRootElement = getSVGRootElement(svg); + if (!svgRootElement) return; - let updatedRootElement: string; + let updatedRootElement: string; - if (options.saturation < 1) { - updatedRootElement = addFilterAttribute(svgRootElement); - } - else { - updatedRootElement = removeFilterAttribute(svgRootElement); - } + if (options.saturation < 1) { + updatedRootElement = addFilterAttribute(svgRootElement); + } else { + updatedRootElement = removeFilterAttribute(svgRootElement); + } - let updatedSVG = svg.replace(/]*>/, updatedRootElement); + let updatedSVG = svg.replace(/]*>/, updatedRootElement); - if (options.saturation < 1) { - updatedSVG = addFilterElement(updatedSVG, options.saturation); - } - else { - updatedSVG = removeFilterElement(updatedSVG); - } + if (options.saturation < 1) { + updatedSVG = addFilterElement(updatedSVG, options.saturation); + } else { + updatedSVG = removeFilterElement(updatedSVG); + } - fs.writeFileSync(svgFilePath, updatedSVG); - }; + fs.writeFileSync(svgFilePath, updatedSVG); + }; }; diff --git a/src/icons/generator/jsonGenerator.ts b/src/icons/generator/jsonGenerator.ts index 67c3d74cd4..270835d3f5 100644 --- a/src/icons/generator/jsonGenerator.ts +++ b/src/icons/generator/jsonGenerator.ts @@ -8,18 +8,47 @@ import { fileIcons } from '../fileIcons'; import { folderIcons } from '../folderIcons'; import { languageIcons } from '../languageIcons'; import { iconJsonName } from './constants'; -import { generateFolderIcons, loadFileIconDefinitions, loadFolderIconDefinitions, loadLanguageIconDefinitions, setIconOpacity, setIconSaturation, validateHEXColorCode, validateOpacityValue, validateSaturationValue } from './index'; +import { + generateFolderIcons, + loadFileIconDefinitions, + loadFolderIconDefinitions, + loadLanguageIconDefinitions, + setIconOpacity, + setIconSaturation, + validateHEXColorCode, + validateOpacityValue, + validateSaturationValue, +} from './index'; /** * Generate the complete icon configuration object that can be written as JSON file. */ -export const generateIconConfigurationObject = (options: IconJsonOptions): IconConfiguration => { - const iconConfig = merge({}, new IconConfiguration(), { options }); - const languageIconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, options); - const fileIconDefinitions = loadFileIconDefinitions(fileIcons, iconConfig, options); - const folderIconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); +export const generateIconConfigurationObject = ( + options: IconJsonOptions +): IconConfiguration => { + const iconConfig = merge({}, new IconConfiguration(), { options }); + const languageIconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + options + ); + const fileIconDefinitions = loadFileIconDefinitions( + fileIcons, + iconConfig, + options + ); + const folderIconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); - return merge({}, languageIconDefinitions, fileIconDefinitions, folderIconDefinitions); + return merge( + {}, + languageIconDefinitions, + fileIconDefinitions, + folderIconDefinitions + ); }; /** @@ -27,74 +56,99 @@ export const generateIconConfigurationObject = (options: IconJsonOptions): IconC * @param updatedConfigs Options that have been changed. * @param updatedJSONConfig New JSON options that already include the updatedConfigs. */ -export const createIconFile = (updatedConfigs?: IconJsonOptions, updatedJSONConfig: IconJsonOptions = {}) => { - // override the default options with the new options - const options: IconJsonOptions = merge({}, getDefaultIconOptions(), updatedJSONConfig); - const json = generateIconConfigurationObject(options); +export const createIconFile = ( + updatedConfigs?: IconJsonOptions, + updatedJSONConfig: IconJsonOptions = {} +) => { + // override the default options with the new options + const options: IconJsonOptions = merge( + {}, + getDefaultIconOptions(), + updatedJSONConfig + ); + const json = generateIconConfigurationObject(options); - // make sure that the folder color, opacity and saturation values are entered correctly - if (updatedConfigs?.opacity && !validateOpacityValue(updatedConfigs?.opacity)) { - throw Error('Material Icons: Invalid opacity value!'); + // make sure that the folder color, opacity and saturation values are entered correctly + if ( + updatedConfigs?.opacity && + !validateOpacityValue(updatedConfigs?.opacity) + ) { + throw Error('Material Icons: Invalid opacity value!'); + } + if ( + updatedConfigs?.saturation && + !validateSaturationValue(updatedConfigs?.saturation) + ) { + throw Error('Material Icons: Invalid saturation value!'); + } + if ( + updatedConfigs?.folders?.color && + !validateHEXColorCode(updatedConfigs?.folders?.color) + ) { + throw Error('Material Icons: Invalid folder color value!'); + } + + try { + let iconJsonPath = __dirname; + // if executed via script + if (path.basename(__dirname) !== 'dist') { + iconJsonPath = path.join(__dirname, '..', '..', '..', 'dist'); } - if (updatedConfigs?.saturation && !validateSaturationValue(updatedConfigs?.saturation)) { - throw Error('Material Icons: Invalid saturation value!'); + if (!updatedConfigs || (updatedConfigs.folders || {}).color) { + // if updatedConfigs do not exist (because of initial setup) + // or new config value was detected by the change detection + generateFolderIcons(options.folders.color); + setIconOpacity(options, [ + 'folder.svg', + 'folder-open.svg', + 'folder-root.svg', + 'folder-root-open.svg', + ]); } - if (updatedConfigs?.folders?.color && !validateHEXColorCode(updatedConfigs?.folders?.color)) { - throw Error('Material Icons: Invalid folder color value!'); + if (!updatedConfigs || updatedConfigs.opacity !== undefined) { + setIconOpacity(options); } - - try { - let iconJsonPath = __dirname; - // if executed via script - if (path.basename(__dirname) !== 'dist') { - iconJsonPath = path.join(__dirname, '..', '..', '..', 'dist'); - } - if (!updatedConfigs || (updatedConfigs.folders || {}).color) { - // if updatedConfigs do not exist (because of initial setup) - // or new config value was detected by the change detection - generateFolderIcons(options.folders.color); - setIconOpacity(options, ['folder.svg', 'folder-open.svg', 'folder-root.svg', 'folder-root-open.svg']); - } - if (!updatedConfigs || updatedConfigs.opacity !== undefined) { - setIconOpacity(options); - } - if (!updatedConfigs || updatedConfigs.saturation !== undefined) { - setIconSaturation(options); - } - renameIconFiles(iconJsonPath, options); - } catch (error) { - throw Error(error); + if (!updatedConfigs || updatedConfigs.saturation !== undefined) { + setIconSaturation(options); } + renameIconFiles(iconJsonPath, options); + } catch (error) { + throw Error(error); + } - try { - let iconJsonPath = __dirname; - // if executed via script - if (path.basename(__dirname) !== 'dist') { - iconJsonPath = path.join(__dirname, '..', '..', '..', 'dist'); - } - fs.writeFileSync(path.join(iconJsonPath, iconJsonName), JSON.stringify(json, undefined, 2), 'utf-8'); - } catch (error) { - throw Error(error); + try { + let iconJsonPath = __dirname; + // if executed via script + if (path.basename(__dirname) !== 'dist') { + iconJsonPath = path.join(__dirname, '..', '..', '..', 'dist'); } + fs.writeFileSync( + path.join(iconJsonPath, iconJsonName), + JSON.stringify(json, undefined, 2), + 'utf-8' + ); + } catch (error) { + throw Error(error); + } - return iconJsonName; + return iconJsonName; }; /** * The options control the generator and decide which icons are disabled or not. */ export const getDefaultIconOptions = (): IconJsonOptions => ({ - folders: { - theme: 'specific', - color: '#90a4ae', - associations: {}, - }, - activeIconPack: 'angular', - hidesExplorerArrows: false, - opacity: 1, - saturation: 1, - files: { associations: {} }, - languages: { associations: {} }, + folders: { + theme: 'specific', + color: '#90a4ae', + associations: {}, + }, + activeIconPack: 'angular', + hidesExplorerArrows: false, + opacity: 1, + saturation: 1, + files: { associations: {} }, + languages: { associations: {} }, }); /** @@ -103,26 +157,29 @@ export const getDefaultIconOptions = (): IconJsonOptions => ({ * @param options Icon Json Options */ const renameIconFiles = (iconJsonPath: string, options: IconJsonOptions) => { - const customPaths = getCustomIconPaths(options); - const defaultIconPath = path.join(iconJsonPath, '..', 'icons'); - const iconPaths = [defaultIconPath, ...customPaths]; + const customPaths = getCustomIconPaths(options); + const defaultIconPath = path.join(iconJsonPath, '..', 'icons'); + const iconPaths = [defaultIconPath, ...customPaths]; - iconPaths.forEach(iconPath => { - fs.readdirSync(iconPath) - .filter(f => f.match(/\.svg/gi)) - .forEach(f => { - const filePath = path.join(iconPath, f); - const fileConfigHash = getFileConfigHash(options); + iconPaths.forEach((iconPath) => { + fs.readdirSync(iconPath) + .filter((f) => f.match(/\.svg/gi)) + .forEach((f) => { + const filePath = path.join(iconPath, f); + const fileConfigHash = getFileConfigHash(options); - // append file config to file name - const newFilePath = path.join(iconPath, f.replace(/(^[^\.~]+)(.*)\.svg/, `$1${fileConfigHash}.svg`)); + // append file config to file name + const newFilePath = path.join( + iconPath, + f.replace(/(^[^\.~]+)(.*)\.svg/, `$1${fileConfigHash}.svg`) + ); - // if generated files are already in place, do not overwrite them - if (filePath !== newFilePath && fs.existsSync(newFilePath)) { - fs.unlinkSync(filePath); - } else { - fs.renameSync(filePath, newFilePath); - } - }); - }); + // if generated files are already in place, do not overwrite them + if (filePath !== newFilePath && fs.existsSync(newFilePath)) { + fs.unlinkSync(filePath); + } else { + fs.renameSync(filePath, newFilePath); + } + }); + }); }; diff --git a/src/icons/generator/languageGenerator.ts b/src/icons/generator/languageGenerator.ts index ae60bdeb33..b70afec900 100644 --- a/src/icons/generator/languageGenerator.ts +++ b/src/icons/generator/languageGenerator.ts @@ -1,69 +1,115 @@ import * as merge from 'lodash.merge'; import { getFileConfigHash } from '../../helpers/fileConfig'; -import { DefaultIcon, IconAssociations, IconConfiguration, IconJsonOptions, LanguageIcon } from '../../models/index'; +import { + DefaultIcon, + IconAssociations, + IconConfiguration, + IconJsonOptions, + LanguageIcon, +} from '../../models/index'; import { highContrastVersion, iconFolderPath, lightVersion } from './constants'; /** * Get all file icons that can be used in this theme. */ -export const loadLanguageIconDefinitions = (languages: LanguageIcon[], config: IconConfiguration, options: IconJsonOptions): IconConfiguration => { - config = merge({}, config); - const enabledLanguages = disableLanguagesByPack(languages, options.activeIconPack); - const customIcons = getCustomIcons(options.languages.associations); - const allLanguageIcons = [...enabledLanguages, ...customIcons]; +export const loadLanguageIconDefinitions = ( + languages: LanguageIcon[], + config: IconConfiguration, + options: IconJsonOptions +): IconConfiguration => { + config = merge({}, config); + const enabledLanguages = disableLanguagesByPack( + languages, + options.activeIconPack + ); + const customIcons = getCustomIcons(options.languages.associations); + const allLanguageIcons = [...enabledLanguages, ...customIcons]; - allLanguageIcons.forEach(lang => { - if (lang.disabled) return; - config = setIconDefinitions(config, lang.icon); - config = merge({}, config, setLanguageIdentifiers(lang.icon.name, lang.ids)); - config.light = lang.icon.light ? merge({}, config.light, setLanguageIdentifiers(lang.icon.name + lightVersion, lang.ids)) : config.light; - config.highContrast = lang.icon.highContrast ? merge({}, config.highContrast, setLanguageIdentifiers(lang.icon.name + highContrastVersion, lang.ids)) : config.highContrast; - }); + allLanguageIcons.forEach((lang) => { + if (lang.disabled) return; + config = setIconDefinitions(config, lang.icon); + config = merge( + {}, + config, + setLanguageIdentifiers(lang.icon.name, lang.ids) + ); + config.light = lang.icon.light + ? merge( + {}, + config.light, + setLanguageIdentifiers(lang.icon.name + lightVersion, lang.ids) + ) + : config.light; + config.highContrast = lang.icon.highContrast + ? merge( + {}, + config.highContrast, + setLanguageIdentifiers(lang.icon.name + highContrastVersion, lang.ids) + ) + : config.highContrast; + }); - return config; + return config; }; const setIconDefinitions = (config: IconConfiguration, icon: DefaultIcon) => { - config = merge({}, config); - config = createIconDefinitions(config, icon.name); - config = merge({}, config, icon.light ? createIconDefinitions(config, icon.name + lightVersion) : config.light); - config = merge({}, config, icon.highContrast ? createIconDefinitions(config, icon.name + highContrastVersion) : config.highContrast); - return config; + config = merge({}, config); + config = createIconDefinitions(config, icon.name); + config = merge( + {}, + config, + icon.light + ? createIconDefinitions(config, icon.name + lightVersion) + : config.light + ); + config = merge( + {}, + config, + icon.highContrast + ? createIconDefinitions(config, icon.name + highContrastVersion) + : config.highContrast + ); + return config; }; const createIconDefinitions = (config: IconConfiguration, iconName: string) => { - config = merge({}, config); - const fileConfigHash = getFileConfigHash(config.options); - config.iconDefinitions[iconName] = { - iconPath: `${iconFolderPath}${iconName}${fileConfigHash}.svg` - }; - return config; + config = merge({}, config); + const fileConfigHash = getFileConfigHash(config.options); + config.iconDefinitions[iconName] = { + iconPath: `${iconFolderPath}${iconName}${fileConfigHash}.svg`, + }; + return config; }; const setLanguageIdentifiers = (iconName: string, languageIds: string[]) => { - const obj = { languageIds: {} }; - languageIds.forEach(id => { - obj.languageIds[id] = iconName; - }); - return obj; + const obj = { languageIds: {} }; + languageIds.forEach((id) => { + obj.languageIds[id] = iconName; + }); + return obj; }; const getCustomIcons = (languageAssociations: IconAssociations) => { - if (!languageAssociations) return []; + if (!languageAssociations) return []; - const icons: LanguageIcon[] = Object.keys(languageAssociations).map(fa => ({ - icon: { name: languageAssociations[fa].toLowerCase() }, - ids: [fa.toLowerCase()] - })); + const icons: LanguageIcon[] = Object.keys(languageAssociations).map((fa) => ({ + icon: { name: languageAssociations[fa].toLowerCase() }, + ids: [fa.toLowerCase()], + })); - return icons; + return icons; }; /** * Disable all file icons that are in a pack which is disabled. */ -const disableLanguagesByPack = (languageIcons: LanguageIcon[], activatedIconPack: string) => { - return languageIcons.filter(language => { - return !language.enabledFor ? true : language.enabledFor.some(p => p === activatedIconPack); - }); +const disableLanguagesByPack = ( + languageIcons: LanguageIcon[], + activatedIconPack: string +) => { + return languageIcons.filter((language) => { + return !language.enabledFor + ? true + : language.enabledFor.some((p) => p === activatedIconPack); + }); }; diff --git a/src/icons/languageIcons.ts b/src/icons/languageIcons.ts index 55c2561e1e..fe543c3ecf 100644 --- a/src/icons/languageIcons.ts +++ b/src/icons/languageIcons.ts @@ -4,112 +4,115 @@ import { LanguageIcon } from '../models'; * Defines icons for language ids */ export const languageIcons: LanguageIcon[] = [ - { icon: { name: 'git' }, ids: ['git', 'git-commit', 'git-rebase', 'ignore'] }, - { icon: { name: 'c' }, ids: ['c', 'objective-c', 'objective-cpp'] }, - { icon: { name: 'yaml' }, ids: ['yaml'] }, - { icon: { name: 'xml' }, ids: ['xml', 'xquery', 'xsl'] }, - { icon: { name: 'matlab' }, ids: ['matlab'] }, - { icon: { name: 'settings' }, ids: ['makefile', 'toml', 'ini', 'properties'] }, - { icon: { name: 'shaderlab' }, ids: ['shaderlab'] }, - { icon: { name: 'diff' }, ids: ['diff'] }, - { icon: { name: 'json' }, ids: ['json', 'jsonc', 'json5'] }, - { icon: { name: 'blink' }, ids: ['blink'] }, - { icon: { name: 'java' }, ids: ['java'] }, - { icon: { name: 'razor' }, ids: ['razor', 'aspnetcorerazor'] }, - { icon: { name: 'python' }, ids: ['python'] }, - { icon: { name: 'javascript' }, ids: ['javascript'] }, - { icon: { name: 'typescript' }, ids: ['typescript'] }, - { icon: { name: 'scala' }, ids: ['scala'] }, - { icon: { name: 'handlebars' }, ids: ['handlebars'] }, - { icon: { name: 'perl' }, ids: ['perl', 'perl6'] }, - { icon: { name: 'haxe' }, ids: ['haxe', 'hxml'] }, - { icon: { name: 'puppet' }, ids: ['puppet'] }, - { icon: { name: 'elixir' }, ids: ['elixir'] }, - { icon: { name: 'livescript' }, ids: ['livescript'] }, - { icon: { name: 'erlang' }, ids: ['erlang'] }, - { icon: { name: 'twig' }, ids: ['twig'] }, - { icon: { name: 'julia' }, ids: ['julia'] }, - { icon: { name: 'elm' }, ids: ['elm'] }, - { icon: { name: 'purescript' }, ids: ['purescript'] }, - { icon: { name: 'stylus' }, ids: ['stylus'] }, - { icon: { name: 'nunjucks' }, ids: ['nunjucks'] }, - { icon: { name: 'pug' }, ids: ['pug'] }, - { icon: { name: 'robot' }, ids: ['robotframework'] }, - { icon: { name: 'sass' }, ids: ['sass', 'scss'] }, - { icon: { name: 'less' }, ids: ['less'] }, - { icon: { name: 'css' }, ids: ['css'] }, - { icon: { name: 'visualstudio' }, ids: ['testOutput', 'vb'] }, - { icon: { name: 'angular' }, ids: ['ng-template'] }, - { icon: { name: 'graphql' }, ids: ['graphql'] }, - { icon: { name: 'solidity' }, ids: ['solidity'] }, - { icon: { name: 'autoit' }, ids: ['autoit'] }, - { icon: { name: 'haml' }, ids: ['haml'] }, - { icon: { name: 'yang' }, ids: ['yang'] }, - { icon: { name: 'terraform' }, ids: ['terraform'] }, - { icon: { name: 'applescript' }, ids: ['applescript'] }, - { icon: { name: 'cake' }, ids: ['cake'] }, - { icon: { name: 'cucumber' }, ids: ['cucumber'] }, - { icon: { name: 'nim' }, ids: ['nim', 'nimble'] }, - { icon: { name: 'apiblueprint' }, ids: ['apiblueprint'] }, - { icon: { name: 'riot' }, ids: ['riot'] }, - { icon: { name: 'postcss' }, ids: ['postcss'] }, - { icon: { name: 'coldfusion' }, ids: ['lang-cfml'] }, - { icon: { name: 'haskell' }, ids: ['haskell'] }, - { icon: { name: 'dhall' }, ids: ['dhall'] }, - { icon: { name: 'cabal' }, ids: ['cabal'] }, - { icon: { name: 'nix' }, ids: ['nix'] }, - { icon: { name: 'ruby' }, ids: ['ruby'] }, - { icon: { name: 'slim' }, ids: ['slim'] }, - { icon: { name: 'php' }, ids: ['php'] }, - { icon: { name: 'php_elephant' }, ids: [] }, - { icon: { name: 'hack' }, ids: ['hack'] }, - { icon: { name: 'react' }, ids: ['javascriptreact'] }, - { icon: { name: 'mjml' }, ids: ['mjml'] }, - { icon: { name: 'processing' }, ids: ['processing'] }, - { icon: { name: 'hcl' }, ids: ['hcl'] }, - { icon: { name: 'go' }, ids: ['go'] }, - { icon: { name: 'go_gopher' }, ids: [] }, - { icon: { name: 'nodejs_alt' }, ids: [] }, - { icon: { name: 'django' }, ids: ['django-html', 'django-txt'] }, - { icon: { name: 'html' }, ids: ['html'] }, - { icon: { name: 'godot' }, ids: ['gdscript'] }, - { icon: { name: 'vim' }, ids: ['viml'] }, - { icon: { name: 'silverstripe' }, ids: [] }, - { icon: { name: 'prolog' }, ids: ['prolog'] }, - { icon: { name: 'pawn' }, ids: ['pawn'] }, - { icon: { name: 'reason' }, ids: ['reason', 'reason_lisp'] }, - { icon: { name: 'sml' }, ids: ['sml'] }, - { icon: { name: 'tex' }, ids: ['tex', 'doctex', 'latex', 'latex-expl3'] }, - { icon: { name: 'salesforce' }, ids: ['apex'] }, - { icon: { name: 'sas' }, ids: ['sas'] }, - { icon: { name: 'docker' }, ids: ['dockerfile'] }, - { icon: { name: 'table' }, ids: ['csv', 'tsv'] }, - { icon: { name: 'csharp' }, ids: ['csharp'] }, - { icon: { name: 'console' }, ids: ['bat', 'awk', 'shellscript'] }, - { icon: { name: 'cpp' }, ids: ['cpp'] }, - { icon: { name: 'coffee' }, ids: ['coffeescript'] }, - { icon: { name: 'fsharp' }, ids: ['fsharp'] }, - { icon: { name: 'editorconfig' }, ids: ['editorconfig'] }, - { icon: { name: 'clojure' }, ids: ['clojure'] }, - { icon: { name: 'groovy' }, ids: ['groovy'] }, - { icon: { name: 'markdown' }, ids: ['markdown'] }, - { icon: { name: 'jinja' }, ids: ['jinja'] }, - { icon: { name: 'python-misc' }, ids: ['pip-requirements'] }, - { icon: { name: 'vue' }, ids: ['vue', 'vue-postcss', 'vue-html'] }, - { icon: { name: 'lua' }, ids: ['lua'] }, - { icon: { name: 'lib' }, ids: ['bibtex', 'bibtex-style'] }, - { icon: { name: 'log' }, ids: ['log'] }, - { icon: { name: 'jupyter' }, ids: ['jupyter'] }, - { icon: { name: 'document' }, ids: ['plaintext'] }, - { icon: { name: 'pdf' }, ids: ['pdf'] }, - { icon: { name: 'powershell' }, ids: ['powershell'] }, - { icon: { name: 'pug' }, ids: ['jade'] }, - { icon: { name: 'r' }, ids: ['r', 'rsweave'] }, - { icon: { name: 'rust' }, ids: ['rust'] }, - { icon: { name: 'database' }, ids: ['sql'] }, - { icon: { name: 'lock' }, ids: ['ssh_config'] }, - { icon: { name: 'svg' }, ids: ['svg'] }, - { icon: { name: 'swift' }, ids: ['swift'] }, - { icon: { name: 'react_ts' }, ids: ['typescriptreact'] }, - { icon: { name: 'search' }, ids: ['search-result'] }, + { icon: { name: 'git' }, ids: ['git', 'git-commit', 'git-rebase', 'ignore'] }, + { icon: { name: 'c' }, ids: ['c', 'objective-c', 'objective-cpp'] }, + { icon: { name: 'yaml' }, ids: ['yaml'] }, + { icon: { name: 'xml' }, ids: ['xml', 'xquery', 'xsl'] }, + { icon: { name: 'matlab' }, ids: ['matlab'] }, + { + icon: { name: 'settings' }, + ids: ['makefile', 'toml', 'ini', 'properties'], + }, + { icon: { name: 'shaderlab' }, ids: ['shaderlab'] }, + { icon: { name: 'diff' }, ids: ['diff'] }, + { icon: { name: 'json' }, ids: ['json', 'jsonc', 'json5'] }, + { icon: { name: 'blink' }, ids: ['blink'] }, + { icon: { name: 'java' }, ids: ['java'] }, + { icon: { name: 'razor' }, ids: ['razor', 'aspnetcorerazor'] }, + { icon: { name: 'python' }, ids: ['python'] }, + { icon: { name: 'javascript' }, ids: ['javascript'] }, + { icon: { name: 'typescript' }, ids: ['typescript'] }, + { icon: { name: 'scala' }, ids: ['scala'] }, + { icon: { name: 'handlebars' }, ids: ['handlebars'] }, + { icon: { name: 'perl' }, ids: ['perl', 'perl6'] }, + { icon: { name: 'haxe' }, ids: ['haxe', 'hxml'] }, + { icon: { name: 'puppet' }, ids: ['puppet'] }, + { icon: { name: 'elixir' }, ids: ['elixir'] }, + { icon: { name: 'livescript' }, ids: ['livescript'] }, + { icon: { name: 'erlang' }, ids: ['erlang'] }, + { icon: { name: 'twig' }, ids: ['twig'] }, + { icon: { name: 'julia' }, ids: ['julia'] }, + { icon: { name: 'elm' }, ids: ['elm'] }, + { icon: { name: 'purescript' }, ids: ['purescript'] }, + { icon: { name: 'stylus' }, ids: ['stylus'] }, + { icon: { name: 'nunjucks' }, ids: ['nunjucks'] }, + { icon: { name: 'pug' }, ids: ['pug'] }, + { icon: { name: 'robot' }, ids: ['robotframework'] }, + { icon: { name: 'sass' }, ids: ['sass', 'scss'] }, + { icon: { name: 'less' }, ids: ['less'] }, + { icon: { name: 'css' }, ids: ['css'] }, + { icon: { name: 'visualstudio' }, ids: ['testOutput', 'vb'] }, + { icon: { name: 'angular' }, ids: ['ng-template'] }, + { icon: { name: 'graphql' }, ids: ['graphql'] }, + { icon: { name: 'solidity' }, ids: ['solidity'] }, + { icon: { name: 'autoit' }, ids: ['autoit'] }, + { icon: { name: 'haml' }, ids: ['haml'] }, + { icon: { name: 'yang' }, ids: ['yang'] }, + { icon: { name: 'terraform' }, ids: ['terraform'] }, + { icon: { name: 'applescript' }, ids: ['applescript'] }, + { icon: { name: 'cake' }, ids: ['cake'] }, + { icon: { name: 'cucumber' }, ids: ['cucumber'] }, + { icon: { name: 'nim' }, ids: ['nim', 'nimble'] }, + { icon: { name: 'apiblueprint' }, ids: ['apiblueprint'] }, + { icon: { name: 'riot' }, ids: ['riot'] }, + { icon: { name: 'postcss' }, ids: ['postcss'] }, + { icon: { name: 'coldfusion' }, ids: ['lang-cfml'] }, + { icon: { name: 'haskell' }, ids: ['haskell'] }, + { icon: { name: 'dhall' }, ids: ['dhall'] }, + { icon: { name: 'cabal' }, ids: ['cabal'] }, + { icon: { name: 'nix' }, ids: ['nix'] }, + { icon: { name: 'ruby' }, ids: ['ruby'] }, + { icon: { name: 'slim' }, ids: ['slim'] }, + { icon: { name: 'php' }, ids: ['php'] }, + { icon: { name: 'php_elephant' }, ids: [] }, + { icon: { name: 'hack' }, ids: ['hack'] }, + { icon: { name: 'react' }, ids: ['javascriptreact'] }, + { icon: { name: 'mjml' }, ids: ['mjml'] }, + { icon: { name: 'processing' }, ids: ['processing'] }, + { icon: { name: 'hcl' }, ids: ['hcl'] }, + { icon: { name: 'go' }, ids: ['go'] }, + { icon: { name: 'go_gopher' }, ids: [] }, + { icon: { name: 'nodejs_alt' }, ids: [] }, + { icon: { name: 'django' }, ids: ['django-html', 'django-txt'] }, + { icon: { name: 'html' }, ids: ['html'] }, + { icon: { name: 'godot' }, ids: ['gdscript'] }, + { icon: { name: 'vim' }, ids: ['viml'] }, + { icon: { name: 'silverstripe' }, ids: [] }, + { icon: { name: 'prolog' }, ids: ['prolog'] }, + { icon: { name: 'pawn' }, ids: ['pawn'] }, + { icon: { name: 'reason' }, ids: ['reason', 'reason_lisp'] }, + { icon: { name: 'sml' }, ids: ['sml'] }, + { icon: { name: 'tex' }, ids: ['tex', 'doctex', 'latex', 'latex-expl3'] }, + { icon: { name: 'salesforce' }, ids: ['apex'] }, + { icon: { name: 'sas' }, ids: ['sas'] }, + { icon: { name: 'docker' }, ids: ['dockerfile'] }, + { icon: { name: 'table' }, ids: ['csv', 'tsv'] }, + { icon: { name: 'csharp' }, ids: ['csharp'] }, + { icon: { name: 'console' }, ids: ['bat', 'awk', 'shellscript'] }, + { icon: { name: 'cpp' }, ids: ['cpp'] }, + { icon: { name: 'coffee' }, ids: ['coffeescript'] }, + { icon: { name: 'fsharp' }, ids: ['fsharp'] }, + { icon: { name: 'editorconfig' }, ids: ['editorconfig'] }, + { icon: { name: 'clojure' }, ids: ['clojure'] }, + { icon: { name: 'groovy' }, ids: ['groovy'] }, + { icon: { name: 'markdown' }, ids: ['markdown'] }, + { icon: { name: 'jinja' }, ids: ['jinja'] }, + { icon: { name: 'python-misc' }, ids: ['pip-requirements'] }, + { icon: { name: 'vue' }, ids: ['vue', 'vue-postcss', 'vue-html'] }, + { icon: { name: 'lua' }, ids: ['lua'] }, + { icon: { name: 'lib' }, ids: ['bibtex', 'bibtex-style'] }, + { icon: { name: 'log' }, ids: ['log'] }, + { icon: { name: 'jupyter' }, ids: ['jupyter'] }, + { icon: { name: 'document' }, ids: ['plaintext'] }, + { icon: { name: 'pdf' }, ids: ['pdf'] }, + { icon: { name: 'powershell' }, ids: ['powershell'] }, + { icon: { name: 'pug' }, ids: ['jade'] }, + { icon: { name: 'r' }, ids: ['r', 'rsweave'] }, + { icon: { name: 'rust' }, ids: ['rust'] }, + { icon: { name: 'database' }, ids: ['sql'] }, + { icon: { name: 'lock' }, ids: ['ssh_config'] }, + { icon: { name: 'svg' }, ids: ['svg'] }, + { icon: { name: 'swift' }, ids: ['swift'] }, + { icon: { name: 'react_ts' }, ids: ['typescriptreact'] }, + { icon: { name: 'search' }, ids: ['search-result'] }, ]; diff --git a/src/messages/outdated.ts b/src/messages/outdated.ts index a185e23a46..966655dabe 100644 --- a/src/messages/outdated.ts +++ b/src/messages/outdated.ts @@ -3,25 +3,31 @@ import * as i18n from './../i18n'; /** Show message that the editor version is outdated. */ export const showOutdatedMessage = () => { - vscode.window.showWarningMessage( - i18n.translate('outdatedVersion'), - i18n.translate('updateVSCode'), - i18n.translate('howToActivate') - ).then(handleActivateActions); + vscode.window + .showWarningMessage( + i18n.translate('outdatedVersion'), + i18n.translate('updateVSCode'), + i18n.translate('howToActivate') + ) + .then(handleActivateActions); }; /** Handle the actions from the outdatedMessage command message */ const handleActivateActions = (value) => { - switch (value) { - case i18n.translate('howToActivate'): - vscode.env.openExternal(vscode.Uri.parse('https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes')); - break; + switch (value) { + case i18n.translate('howToActivate'): + vscode.env.openExternal( + vscode.Uri.parse( + 'https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes' + ) + ); + break; - case i18n.translate('updateVSCode'): - open('https://code.visualstudio.com/download'); - break; + case i18n.translate('updateVSCode'): + open('https://code.visualstudio.com/download'); + break; - default: - break; - } + default: + break; + } }; diff --git a/src/messages/reload.ts b/src/messages/reload.ts index 4f4144fff0..b1f02ff9a2 100644 --- a/src/messages/reload.ts +++ b/src/messages/reload.ts @@ -4,29 +4,29 @@ import * as i18n from './../i18n'; /** User has to confirm if he wants to reload the editor */ export const showConfirmToReloadMessage = async (): Promise => { - // if the user does not want to see the reload message - if (helpers.getThemeConfig('showReloadMessage').globalValue === false) return; + // if the user does not want to see the reload message + if (helpers.getThemeConfig('showReloadMessage').globalValue === false) return; - const response = await vscode.window.showInformationMessage( - i18n.translate('confirmReload'), - i18n.translate('reload'), - i18n.translate('neverShowAgain') - ); + const response = await vscode.window.showInformationMessage( + i18n.translate('confirmReload'), + i18n.translate('reload'), + i18n.translate('neverShowAgain') + ); - switch (response) { - case i18n.translate('reload'): - return true; + switch (response) { + case i18n.translate('reload'): + return true; - case i18n.translate('neverShowAgain'): - disableReloadMessage(); - return false; + case i18n.translate('neverShowAgain'): + disableReloadMessage(); + return false; - default: - return false; - } + default: + return false; + } }; /** Disable the reload message in the global settings */ const disableReloadMessage = () => { - helpers.setThemeConfig('showReloadMessage', false, true); + helpers.setThemeConfig('showReloadMessage', false, true); }; diff --git a/src/messages/start.ts b/src/messages/start.ts index df2b2ebb01..74ba01fe30 100644 --- a/src/messages/start.ts +++ b/src/messages/start.ts @@ -4,10 +4,9 @@ import { showWelcomeMessage } from './welcome'; /** Initialization of the icons every time the theme get activated */ export const showStartMessages = (status: ThemeStatus) => { - if (status === ThemeStatus.updated) { - showUpdateMessage(); - } - else if (status === ThemeStatus.neverUsedBefore) { - showWelcomeMessage(); - } + if (status === ThemeStatus.updated) { + showUpdateMessage(); + } else if (status === ThemeStatus.neverUsedBefore) { + showWelcomeMessage(); + } }; diff --git a/src/messages/update.ts b/src/messages/update.ts index 692fadc757..16c5444f92 100644 --- a/src/messages/update.ts +++ b/src/messages/update.ts @@ -5,38 +5,44 @@ import * as i18n from './../i18n'; /** Show the update message if the icon theme has been updated. */ export const showUpdateMessage = () => { - // if the user does not want to see the update message - if (helpers.getThemeConfig('showUpdateMessage').globalValue !== true) return; + // if the user does not want to see the update message + if (helpers.getThemeConfig('showUpdateMessage').globalValue !== true) return; - vscode.window.showInformationMessage( - i18n.translate('themeUpdated'), - helpers.isThemeNotVisible() ? i18n.translate('activate') : undefined, - i18n.translate('readChangelog'), - i18n.translate('neverShowAgain') - ).then(handleUpdateMessageActions); + vscode.window + .showInformationMessage( + i18n.translate('themeUpdated'), + helpers.isThemeNotVisible() ? i18n.translate('activate') : undefined, + i18n.translate('readChangelog'), + i18n.translate('neverShowAgain') + ) + .then(handleUpdateMessageActions); }; /** Handle the actions of the update message. */ const handleUpdateMessageActions = (value) => { - switch (value) { - case i18n.translate('activate'): - activateIcons(); - break; + switch (value) { + case i18n.translate('activate'): + activateIcons(); + break; - case i18n.translate('readChangelog'): - vscode.env.openExternal(vscode.Uri.parse('https://marketplace.visualstudio.com/items/PKief.material-icon-theme/changelog')); - break; + case i18n.translate('readChangelog'): + vscode.env.openExternal( + vscode.Uri.parse( + 'https://marketplace.visualstudio.com/items/PKief.material-icon-theme/changelog' + ) + ); + break; - case i18n.translate('neverShowAgain'): - disableUpdateMessage(); - break; + case i18n.translate('neverShowAgain'): + disableUpdateMessage(); + break; - default: - break; - } + default: + break; + } }; /** Disable the update messages in the global settings */ const disableUpdateMessage = () => { - helpers.setThemeConfig('showUpdateMessage', false, true); + helpers.setThemeConfig('showUpdateMessage', false, true); }; diff --git a/src/messages/welcome.ts b/src/messages/welcome.ts index 93a3afbf44..b148898feb 100644 --- a/src/messages/welcome.ts +++ b/src/messages/welcome.ts @@ -5,37 +5,44 @@ import * as i18n from './../i18n'; /** Show the welcome message if the icon theme has been installed the first time. */ export const showWelcomeMessage = () => { - // if the user does not want to see the welcome message - if (helpers.getThemeConfig('showWelcomeMessage').globalValue === false) return; + // if the user does not want to see the welcome message + if (helpers.getThemeConfig('showWelcomeMessage').globalValue === false) + return; - vscode.window.showInformationMessage( - i18n.translate('themeInstalled'), - helpers.isThemeNotVisible() ? i18n.translate('activate') : undefined, - i18n.translate('neverShowAgain') - ).then(handleWelcomeMessageActions); + vscode.window + .showInformationMessage( + i18n.translate('themeInstalled'), + helpers.isThemeNotVisible() ? i18n.translate('activate') : undefined, + i18n.translate('neverShowAgain') + ) + .then(handleWelcomeMessageActions); }; /** Handle the actions of the welcome message. */ const handleWelcomeMessageActions = (value) => { - switch (value) { - case i18n.translate('activate'): - activateIcons(); - break; + switch (value) { + case i18n.translate('activate'): + activateIcons(); + break; - case i18n.translate('howToActivate'): - vscode.env.openExternal(vscode.Uri.parse('https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes')); - break; + case i18n.translate('howToActivate'): + vscode.env.openExternal( + vscode.Uri.parse( + 'https://code.visualstudio.com/blogs/2016/09/08/icon-themes#_file-icon-themes' + ) + ); + break; - case i18n.translate('neverShowAgain'): - disableWelcomeMessage(); - break; + case i18n.translate('neverShowAgain'): + disableWelcomeMessage(); + break; - default: - break; - } + default: + break; + } }; /** Disable the welcome messages in the global settings */ const disableWelcomeMessage = () => { - helpers.setThemeConfig('showWelcomeMessage', false, true); + helpers.setThemeConfig('showWelcomeMessage', false, true); }; diff --git a/src/models/i18n/translation.ts b/src/models/i18n/translation.ts index 1d6123fa89..0b55380f3f 100644 --- a/src/models/i18n/translation.ts +++ b/src/models/i18n/translation.ts @@ -1,50 +1,50 @@ export interface Translation { - themeInstalled?: string; - howToActivate?: string; - activate?: string; - activated?: string; - neverShowAgain?: string; - themeUpdated?: string; - readChangelog?: string; - iconPacks?: { - selectPack?: string; - description?: string; - disabled?: string; - }; - folders?: { - toggleIcons?: string; - color?: string; - hexCode?: string; - wrongHexCode?: string; - disabled?: string; - theme?: { - description?: string; - }; - }; - opacity?: { - inputPlaceholder?: string; - wrongValue?: string; - }; - toggleSwitch?: { - on?: string; - off?: string; - }; - explorerArrows?: { - toggle?: string; - enable?: string; - disable?: string; - }; - confirmReload?: string; - reload?: string; - outdatedVersion?: string; - updateVSCode?: string; - grayscale?: { - toggle?: string; - enable?: string; - disable?: string; - }; - saturation?: { - inputPlaceholder?: string; - wrongValue?: string; + themeInstalled?: string; + howToActivate?: string; + activate?: string; + activated?: string; + neverShowAgain?: string; + themeUpdated?: string; + readChangelog?: string; + iconPacks?: { + selectPack?: string; + description?: string; + disabled?: string; + }; + folders?: { + toggleIcons?: string; + color?: string; + hexCode?: string; + wrongHexCode?: string; + disabled?: string; + theme?: { + description?: string; }; + }; + opacity?: { + inputPlaceholder?: string; + wrongValue?: string; + }; + toggleSwitch?: { + on?: string; + off?: string; + }; + explorerArrows?: { + toggle?: string; + enable?: string; + disable?: string; + }; + confirmReload?: string; + reload?: string; + outdatedVersion?: string; + updateVSCode?: string; + grayscale?: { + toggle?: string; + enable?: string; + disable?: string; + }; + saturation?: { + inputPlaceholder?: string; + wrongValue?: string; + }; } diff --git a/src/models/iconConfiguration.ts b/src/models/iconConfiguration.ts index e4b1347234..5ae5f0e2b0 100644 --- a/src/models/iconConfiguration.ts +++ b/src/models/iconConfiguration.ts @@ -1,37 +1,37 @@ import { IconJsonOptions } from './index'; export class IconConfiguration { - file?: string; - folder?: string; - folderExpanded?: string; - folderNames?: { [s: string]: string }; - folderNamesExpanded?: { [s: string]: string }; - rootFolder?: string; - rootFolderExpanded?: string; - fileExtensions?: { [s: string]: string }; - fileNames?: { [s: string]: string }; - languageIds?: { [s: string]: string }; - iconDefinitions?: { [s: string]: any }; - light?: IconConfiguration; - highContrast?: IconConfiguration; - options?: IconJsonOptions; - hidesExplorerArrows?: boolean; + file?: string; + folder?: string; + folderExpanded?: string; + folderNames?: { [s: string]: string }; + folderNamesExpanded?: { [s: string]: string }; + rootFolder?: string; + rootFolderExpanded?: string; + fileExtensions?: { [s: string]: string }; + fileNames?: { [s: string]: string }; + languageIds?: { [s: string]: string }; + iconDefinitions?: { [s: string]: any }; + light?: IconConfiguration; + highContrast?: IconConfiguration; + options?: IconJsonOptions; + hidesExplorerArrows?: boolean; - constructor() { - this.iconDefinitions = {}; - this.folderNames = {}; - this.folderNamesExpanded = {}; - this.fileExtensions = {}; - this.fileNames = {}; - this.languageIds = {}; - this.light = { - fileExtensions: {}, - fileNames: {} - }; - this.highContrast = { - fileExtensions: {}, - fileNames: {} - }; - this.options = {}; - } + constructor() { + this.iconDefinitions = {}; + this.folderNames = {}; + this.folderNamesExpanded = {}; + this.fileExtensions = {}; + this.fileNames = {}; + this.languageIds = {}; + this.light = { + fileExtensions: {}, + fileNames: {}, + }; + this.highContrast = { + fileExtensions: {}, + fileNames: {}, + }; + this.options = {}; + } } diff --git a/src/models/icons/defaultIcon.ts b/src/models/icons/defaultIcon.ts index dce7a4c807..a8de24d1d3 100644 --- a/src/models/icons/defaultIcon.ts +++ b/src/models/icons/defaultIcon.ts @@ -1,16 +1,16 @@ export interface DefaultIcon { - /** - * Name of the icon, e.g. 'src' - */ - name: string; + /** + * Name of the icon, e.g. 'src' + */ + name: string; - /** - * Define if there is a light icon available. - */ - light?: boolean; + /** + * Define if there is a light icon available. + */ + light?: boolean; - /** - * Define if there is a high contrast icon available. - */ - highContrast?: boolean; + /** + * Define if there is a high contrast icon available. + */ + highContrast?: boolean; } diff --git a/src/models/icons/files/fileIcon.ts b/src/models/icons/files/fileIcon.ts index 0b94680c11..8ab040a1fd 100644 --- a/src/models/icons/files/fileIcon.ts +++ b/src/models/icons/files/fileIcon.ts @@ -1,40 +1,40 @@ import { IconPack } from '../index'; export interface FileIcon { - /** - * Name of the icon, e.g. 'javascript' - */ - name: string; + /** + * Name of the icon, e.g. 'javascript' + */ + name: string; - /** - * Define the file extensions that should use this icon. - * E.g. ['js'] - */ - fileExtensions?: string[]; + /** + * Define the file extensions that should use this icon. + * E.g. ['js'] + */ + fileExtensions?: string[]; - /** - * Define if there are some static file names that should apply this icon. - * E.g. ['sample.js'] - */ - fileNames?: string[]; + /** + * Define if there are some static file names that should apply this icon. + * E.g. ['sample.js'] + */ + fileNames?: string[]; - /** - * Define if there is a light icon available. - */ - light?: boolean; + /** + * Define if there is a light icon available. + */ + light?: boolean; - /** - * Define if there is a high contrast icon available. - */ - highContrast?: boolean; + /** + * Define if there is a high contrast icon available. + */ + highContrast?: boolean; - /** - * Define if the icon should be disabled. - */ - disabled?: boolean; + /** + * Define if the icon should be disabled. + */ + disabled?: boolean; - /** - * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. - */ - enabledFor?: IconPack[]; + /** + * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. + */ + enabledFor?: IconPack[]; } diff --git a/src/models/icons/files/fileTypes.ts b/src/models/icons/files/fileTypes.ts index f8e4834b04..317665e8ef 100644 --- a/src/models/icons/files/fileTypes.ts +++ b/src/models/icons/files/fileTypes.ts @@ -2,13 +2,13 @@ import { DefaultIcon } from '../defaultIcon'; import { FileIcon } from './index'; export class FileIcons { - /** - * Define the default icon for folders. - */ - defaultIcon: DefaultIcon; + /** + * Define the default icon for folders. + */ + defaultIcon: DefaultIcon; - /** - * Defines all folder icons. - */ - icons?: FileIcon[]; + /** + * Defines all folder icons. + */ + icons?: FileIcon[]; } diff --git a/src/models/icons/folders/folderIcon.ts b/src/models/icons/folders/folderIcon.ts index a11cdd463e..386d3a7f64 100644 --- a/src/models/icons/folders/folderIcon.ts +++ b/src/models/icons/folders/folderIcon.ts @@ -1,34 +1,34 @@ import { IconPack } from '../index'; export interface FolderIcon { - /** - * Name of the icon, e.g. 'src' - */ - name: string; + /** + * Name of the icon, e.g. 'src' + */ + name: string; - /** - * Define the folder names that should apply the icon. - * E.g. ['src', 'source'] - */ - folderNames: string[]; + /** + * Define the folder names that should apply the icon. + * E.g. ['src', 'source'] + */ + folderNames: string[]; - /** - * Define if there is a light icon available. - */ - light?: boolean; + /** + * Define if there is a light icon available. + */ + light?: boolean; - /** - * Define if there is a high contrast icon available. - */ - highContrast?: boolean; + /** + * Define if there is a high contrast icon available. + */ + highContrast?: boolean; - /** - * Define if the icon should be disabled. - */ - disabled?: boolean; + /** + * Define if the icon should be disabled. + */ + disabled?: boolean; - /** - * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. - */ - enabledFor?: IconPack[]; + /** + * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. + */ + enabledFor?: IconPack[]; } diff --git a/src/models/icons/folders/folderTheme.ts b/src/models/icons/folders/folderTheme.ts index bbcca3837e..215e2578db 100644 --- a/src/models/icons/folders/folderTheme.ts +++ b/src/models/icons/folders/folderTheme.ts @@ -1,23 +1,23 @@ import { DefaultIcon, FolderIcon } from '../index'; export interface FolderTheme { - /** - * Name of the theme - */ - name: string; + /** + * Name of the theme + */ + name: string; - /** - * Define the default icon for folders in a theme. - */ - defaultIcon: DefaultIcon; + /** + * Define the default icon for folders in a theme. + */ + defaultIcon: DefaultIcon; - /** - * Icon for root folders. - */ - rootFolder?: DefaultIcon; + /** + * Icon for root folders. + */ + rootFolder?: DefaultIcon; - /** - * Defines folder icons for specific folder names. - */ - icons?: FolderIcon[]; + /** + * Defines folder icons for specific folder names. + */ + icons?: FolderIcon[]; } diff --git a/src/models/icons/iconJsonOptions.ts b/src/models/icons/iconJsonOptions.ts index dd757bfd43..ed8b4a7336 100644 --- a/src/models/icons/iconJsonOptions.ts +++ b/src/models/icons/iconJsonOptions.ts @@ -1,23 +1,23 @@ export interface IconJsonOptions { - activeIconPack?: string; - hidesExplorerArrows?: boolean; - opacity?: number; - saturation?: number; - folders?: { - theme?: string; - color?: string; - associations?: IconAssociations; - }; - files?: { - associations?: IconAssociations; - }; - languages?: { - associations?: IconAssociations; - }; - showWelcomeMessage?: boolean; - showUpdateMessage?: boolean; + activeIconPack?: string; + hidesExplorerArrows?: boolean; + opacity?: number; + saturation?: number; + folders?: { + theme?: string; + color?: string; + associations?: IconAssociations; + }; + files?: { + associations?: IconAssociations; + }; + languages?: { + associations?: IconAssociations; + }; + showWelcomeMessage?: boolean; + showUpdateMessage?: boolean; } export interface IconAssociations { - [pattern: string]: string; + [pattern: string]: string; } diff --git a/src/models/icons/iconPack.ts b/src/models/icons/iconPack.ts index e9787fb67e..ec0643736d 100644 --- a/src/models/icons/iconPack.ts +++ b/src/models/icons/iconPack.ts @@ -2,11 +2,11 @@ * Defines icon packs that can be toggled. */ export enum IconPack { - Angular = 'angular', - Nest = 'nest', - Ngrx = 'angular_ngrx', - React = 'react', - Redux = 'react_redux', - Vue = 'vue', - Vuex = 'vue_vuex', + Angular = 'angular', + Nest = 'nest', + Ngrx = 'angular_ngrx', + React = 'react', + Redux = 'react_redux', + Vue = 'vue', + Vuex = 'vue_vuex', } diff --git a/src/models/icons/languages/languageIdentifier.ts b/src/models/icons/languages/languageIdentifier.ts index af5b63d252..96a7e1e99b 100644 --- a/src/models/icons/languages/languageIdentifier.ts +++ b/src/models/icons/languages/languageIdentifier.ts @@ -1,26 +1,26 @@ import { DefaultIcon, IconPack } from '../index'; export interface LanguageIcon { - /** - * Icon for the language identifier - */ - icon: DefaultIcon; + /** + * Icon for the language identifier + */ + icon: DefaultIcon; - /** - * Language ID, e.g. 'javascript' - * - * According to official VS Code documentation: - * https://code.visualstudio.com/docs/languages/identifiers - */ - ids: string[]; + /** + * Language ID, e.g. 'javascript' + * + * According to official VS Code documentation: + * https://code.visualstudio.com/docs/languages/identifiers + */ + ids: string[]; - /** - * Define if the icon should be disabled. - */ - disabled?: boolean; + /** + * Define if the icon should be disabled. + */ + disabled?: boolean; - /** - * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. - */ - enabledFor?: IconPack[]; + /** + * Defines a pack to which this icon belongs. A pack can be toggled and all icons inside this pack can be enabled or disabled together. + */ + enabledFor?: IconPack[]; } diff --git a/src/models/scripts/contributors/contributor.ts b/src/models/scripts/contributors/contributor.ts index 71c5644388..c4e70a9cb2 100644 --- a/src/models/scripts/contributors/contributor.ts +++ b/src/models/scripts/contributors/contributor.ts @@ -1,22 +1,22 @@ /* eslint-disable camelcase */ export interface Contributor { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - contributions: number; + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + contributions: number; } diff --git a/src/models/scripts/contributors/contributorsConfig.ts b/src/models/scripts/contributors/contributorsConfig.ts index c0e4369dc9..0c14d201a1 100644 --- a/src/models/scripts/contributors/contributorsConfig.ts +++ b/src/models/scripts/contributors/contributorsConfig.ts @@ -1,10 +1,10 @@ export interface ContributorsConfig { - /** Owner of the repository */ - owner: string; + /** Owner of the repository */ + owner: string; - /** Name of the repository */ - repo: string; + /** Name of the repository */ + repo: string; - /** Size of a contributor's profile image in pixels */ - imageSize: number; + /** Size of a contributor's profile image in pixels */ + imageSize: number; } diff --git a/src/scripts/contributors/contributors.css b/src/scripts/contributors/contributors.css index 741b40acc1..6fb06b9e87 100644 --- a/src/scripts/contributors/contributors.css +++ b/src/scripts/contributors/contributors.css @@ -1,24 +1,24 @@ body { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } ul { - list-style: none; - margin: 0; - padding: 0; - width: 100%; + list-style: none; + margin: 0; + padding: 0; + width: 100%; } li { - width: 40px; - height: 40px; - float: left; - margin: 3px; + width: 40px; + height: 40px; + float: left; + margin: 3px; } img { - width: 100%; - height: 100%; - border-radius: 5px; -} \ No newline at end of file + width: 100%; + height: 100%; + border-radius: 5px; +} diff --git a/src/scripts/contributors/index.ts b/src/scripts/contributors/index.ts index 4e5b082597..d4b6b1ce69 100644 --- a/src/scripts/contributors/index.ts +++ b/src/scripts/contributors/index.ts @@ -11,103 +11,127 @@ import { createScreenshot } from '../helpers/screenshots'; * @returns Object that contains the page numbers of `prev`, `next` and `last`. */ const parseLinkHeader = (linkHeader: string) => { - const nextPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="next"/); - const lastPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="last"/); - const prevPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="prev"/); + const nextPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="next"/); + const lastPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="last"/); + const prevPagePattern = new RegExp(/\bpage=(\d)[^>]*>;\srel="prev"/); - const nextPage = nextPagePattern.exec(linkHeader); - const lastPage = lastPagePattern.exec(linkHeader); - const prevPage = prevPagePattern.exec(linkHeader); + const nextPage = nextPagePattern.exec(linkHeader); + const lastPage = lastPagePattern.exec(linkHeader); + const prevPage = prevPagePattern.exec(linkHeader); - return { nextPage, lastPage, prevPage }; + return { nextPage, lastPage, prevPage }; }; /** * Get all contributors from GitHub API. */ -const fetchContributors = (page: string): Promise<{ contributorsOfPage: Contributor[]; nextPage: string }> => { - return new Promise((resolve, reject) => { - const requestOptions: https.RequestOptions = { - method: 'GET', - hostname: 'api.github.com', - path: `/repos/pkief/vscode-material-icon-theme/contributors?page=${page}`, - port: 443, - headers: { - 'link': 'next', - 'accept': 'application/json', - 'User-Agent': 'Contributors script', - }, - }; - - const req = https.request(requestOptions, (res) => { - const { nextPage, lastPage, prevPage } = parseLinkHeader(res.headers.link.toString()); - console.log('> Material Icon Theme:', painter.yellow(`[${page}/${lastPage ? lastPage[1] : +prevPage[1] + 1}] Loading contributors from GitHub...`)); - const result = []; - res.on('data', (data: Buffer) => { - result.push(data); - }); - - res.on('end', () => { - try { - const buffer = Buffer.concat(result); - const bufferAsString = buffer.toString('utf8'); - const contributorsOfPage = JSON.parse(bufferAsString); - resolve({ contributorsOfPage, nextPage: nextPage?.[1] }); - } catch (error) { - reject(error); - } - }); - }); - - req.on('error', (error) => { - console.error(error); - reject(error); - }); - - req.end(); +const fetchContributors = ( + page: string +): Promise<{ contributorsOfPage: Contributor[]; nextPage: string }> => { + return new Promise((resolve, reject) => { + const requestOptions: https.RequestOptions = { + method: 'GET', + hostname: 'api.github.com', + path: `/repos/pkief/vscode-material-icon-theme/contributors?page=${page}`, + port: 443, + headers: { + link: 'next', + accept: 'application/json', + 'User-Agent': 'Contributors script', + }, + }; + + const req = https.request(requestOptions, (res) => { + const { nextPage, lastPage, prevPage } = parseLinkHeader( + res.headers.link.toString() + ); + console.log( + '> Material Icon Theme:', + painter.yellow( + `[${page}/${ + lastPage ? lastPage[1] : +prevPage[1] + 1 + }] Loading contributors from GitHub...` + ) + ); + const result = []; + res.on('data', (data: Buffer) => { + result.push(data); + }); + + res.on('end', () => { + try { + const buffer = Buffer.concat(result); + const bufferAsString = buffer.toString('utf8'); + const contributorsOfPage = JSON.parse(bufferAsString); + resolve({ contributorsOfPage, nextPage: nextPage?.[1] }); + } catch (error) { + reject(error); + } + }); }); -}; -const createContributorsList = (contributors: Contributor[]) => { - const list = contributors.map(c => { - return `
  • ${c.login}
  • `; - }).join('\n'); + req.on('error', (error) => { + console.error(error); + reject(error); + }); - const htmlDoctype = ''; - const styling = ''; - const generatedHtml = `${htmlDoctype}${styling}
      ${list}
    `; + req.end(); + }); +}; - const outputPath = path.join(__dirname, 'contributors.html'); - fs.writeFileSync(outputPath, generatedHtml); - return outputPath; +const createContributorsList = (contributors: Contributor[]) => { + const list = contributors + .map((c) => { + return `
  • ${c.login}
  • `; + }) + .join('\n'); + + const htmlDoctype = ''; + const styling = ''; + const generatedHtml = `${htmlDoctype}${styling}
      ${list}
    `; + + const outputPath = path.join(__dirname, 'contributors.html'); + fs.writeFileSync(outputPath, generatedHtml); + return outputPath; }; const init = async () => { - const contributorsList: Contributor[] = []; - let page = '1'; - - // iterate over the pages of GitHub API - while (page !== undefined) { - const result = await fetchContributors(page); - contributorsList.push(...result.contributorsOfPage); - page = result.nextPage; - } - - if (contributorsList.length > 0) { - console.log('> Material Icon Theme:', painter.green('Successfully fetched all contributors from GitHub!')); - } else { - console.log('> Material Icon Theme:', painter.red('Error: Could not fetch contributors from GitHub!')); - throw Error(); - } - const outputPath = createContributorsList(contributorsList); - - // create the image - console.log('> Material Icon Theme:', painter.yellow('Creating image...')); - const fileName = 'contributors'; - createScreenshot(outputPath, fileName).then(() => { - console.log('> Material Icon Theme:', painter.green(`Successfully created ${fileName} image!`)); - }).catch(() => { - throw Error(painter.red(`Error while creating ${fileName} image`)); + const contributorsList: Contributor[] = []; + let page = '1'; + + // iterate over the pages of GitHub API + while (page !== undefined) { + const result = await fetchContributors(page); + contributorsList.push(...result.contributorsOfPage); + page = result.nextPage; + } + + if (contributorsList.length > 0) { + console.log( + '> Material Icon Theme:', + painter.green('Successfully fetched all contributors from GitHub!') + ); + } else { + console.log( + '> Material Icon Theme:', + painter.red('Error: Could not fetch contributors from GitHub!') + ); + throw Error(); + } + const outputPath = createContributorsList(contributorsList); + + // create the image + console.log('> Material Icon Theme:', painter.yellow('Creating image...')); + const fileName = 'contributors'; + createScreenshot(outputPath, fileName) + .then(() => { + console.log( + '> Material Icon Theme:', + painter.green(`Successfully created ${fileName} image!`) + ); + }) + .catch(() => { + throw Error(painter.red(`Error while creating ${fileName} image`)); }); }; diff --git a/src/scripts/helpers/screenshots.ts b/src/scripts/helpers/screenshots.ts index 078ccc86a9..185a03ca4d 100644 --- a/src/scripts/helpers/screenshots.ts +++ b/src/scripts/helpers/screenshots.ts @@ -7,26 +7,26 @@ import * as puppeteer from 'puppeteer'; * @param fileName Name of the output image */ export const createScreenshot = async (filePath: string, fileName: string) => { - try { - const htmlFilePath = path.join('file:', filePath); - const browser = await puppeteer.launch(); - const page = await browser.newPage(); - await page.setViewport({ - height: 10, - width: 1000, - }); + try { + const htmlFilePath = path.join('file:', filePath); + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + await page.setViewport({ + height: 10, + width: 1000, + }); - await page.goto(htmlFilePath); + await page.goto(htmlFilePath); - await page.screenshot({ - path: `images/${fileName}.png`, - omitBackground: true, - fullPage: true - }); + await page.screenshot({ + path: `images/${fileName}.png`, + omitBackground: true, + fullPage: true, + }); - await browser.close(); - } catch (error) { - console.error(error); - throw Error(error); - } + await browser.close(); + } catch (error) { + console.error(error); + throw Error(error); + } }; diff --git a/src/scripts/helpers/similarity.ts b/src/scripts/helpers/similarity.ts index 85ceab8eb7..97dc31179e 100644 --- a/src/scripts/helpers/similarity.ts +++ b/src/scripts/helpers/similarity.ts @@ -5,43 +5,43 @@ * @param s2 text string */ export const similarity = (s1: string, s2: string) => { - let longer = s1; - let shorter = s2; - if (s1.length < s2.length) { - longer = s2; - shorter = s1; - } - const longerLength = longer.length; - if (longerLength === 0) { - return 1.0; - } - return (longerLength - editDistance(longer, shorter)) / longerLength; + let longer = s1; + let shorter = s2; + if (s1.length < s2.length) { + longer = s2; + shorter = s1; + } + const longerLength = longer.length; + if (longerLength === 0) { + return 1.0; + } + return (longerLength - editDistance(longer, shorter)) / longerLength; }; const editDistance = (s1: string, s2: string) => { - s1 = s1.toLowerCase(); - s2 = s2.toLowerCase(); + s1 = s1.toLowerCase(); + s2 = s2.toLowerCase(); - const costs = new Array(); - for (let i = 0; i <= s1.length; i++) { - let lastValue = i; - for (let j = 0; j <= s2.length; j++) { - if (i === 0) { - costs[j] = j; - } else { - if (j > 0) { - let newValue = costs[j - 1]; - if (s1.charAt(i - 1) !== s2.charAt(j - 1)) { - newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1; - } - costs[j - 1] = lastValue; - lastValue = newValue; - } - } - } - if (i > 0) { - costs[s2.length] = lastValue; + const costs = new Array(); + for (let i = 0; i <= s1.length; i++) { + let lastValue = i; + for (let j = 0; j <= s2.length; j++) { + if (i === 0) { + costs[j] = j; + } else { + if (j > 0) { + let newValue = costs[j - 1]; + if (s1.charAt(i - 1) !== s2.charAt(j - 1)) { + newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1; + } + costs[j - 1] = lastValue; + lastValue = newValue; } + } + } + if (i > 0) { + costs[s2.length] = lastValue; } - return costs[s2.length]; + } + return costs[s2.length]; }; diff --git a/src/scripts/helpers/titleCase.ts b/src/scripts/helpers/titleCase.ts index 66a763f5d4..3c13d2b560 100644 --- a/src/scripts/helpers/titleCase.ts +++ b/src/scripts/helpers/titleCase.ts @@ -1,4 +1,7 @@ /** TitleCase all words in a string */ export const toTitleCase = (str: string): string => { - return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()); + return str.replace( + /\w\S*/g, + (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() + ); }; diff --git a/src/scripts/icons/checks/checkIconAvailability.ts b/src/scripts/icons/checks/checkIconAvailability.ts index f780a3ca78..a05e287c3b 100644 --- a/src/scripts/icons/checks/checkIconAvailability.ts +++ b/src/scripts/icons/checks/checkIconAvailability.ts @@ -1,9 +1,21 @@ import * as fs from 'fs'; import * as path from 'path'; -import { DefaultIcon, FileIcon, FolderIcon, FolderTheme } from '../../../models/index'; +import { + DefaultIcon, + FileIcon, + FolderIcon, + FolderTheme, +} from '../../../models/index'; import * as painter from '../../helpers/painter'; import { similarity } from '../../helpers/similarity'; -import { fileIcons, folderIcons, highContrastVersion, languageIcons, lightVersion, openedFolder } from './../../../icons'; +import { + fileIcons, + folderIcons, + highContrastVersion, + languageIcons, + lightVersion, + openedFolder, +} from './../../../icons'; /** * Defines the folder where all icon files are located. @@ -18,29 +30,33 @@ const availableIcons: { [s: string]: string } = {}; /** * Save the misconfigured icons. */ -const wrongIconNames: { [s: string]: string[] } = { fileIcons: [], folderIcons: [], languageIcons: [] }; +const wrongIconNames: { [s: string]: string[] } = { + fileIcons: [], + folderIcons: [], + languageIcons: [], +}; /** * Get all icon file names from the file system. */ const fsReadAllIconFiles = (err: Error, files: string[]) => { - if (err) { - throw Error(err.message); - } - - files.forEach(file => { - const fileName = file; - const iconName = path.parse(file).name; - availableIcons[iconName] = fileName; - }); - - // check icon configurations - checkFileIcons(); - checkFolderIcons(); - checkLanguageIcons(); - - // show error messages - handleErrors(); + if (err) { + throw Error(err.message); + } + + files.forEach((file) => { + const fileName = file; + const iconName = path.parse(file).name; + availableIcons[iconName] = fileName; + }); + + // check icon configurations + checkFileIcons(); + checkFolderIcons(); + checkLanguageIcons(); + + // show error messages + handleErrors(); }; // read from the file system @@ -50,102 +66,139 @@ export const check = () => fs.readdir(folderPath, fsReadAllIconFiles); * Check if the file icons from the configuration are available on the file system. */ const checkFileIcons = () => { - fileIcons.icons.concat([fileIcons.defaultIcon]).forEach(icon => { - isIconAvailable(icon, IconType.fileIcons, IconColor.default); - isIconAvailable(icon, IconType.fileIcons, IconColor.light); - isIconAvailable(icon, IconType.fileIcons, IconColor.highContrast); - }); + fileIcons.icons.concat([fileIcons.defaultIcon]).forEach((icon) => { + isIconAvailable(icon, IconType.fileIcons, IconColor.default); + isIconAvailable(icon, IconType.fileIcons, IconColor.light); + isIconAvailable(icon, IconType.fileIcons, IconColor.highContrast); + }); }; -const isIconAvailable = (icon: FileIcon | FolderIcon | DefaultIcon, iconType: IconType, iconColor: IconColor, hasOpenedFolder?: boolean) => { - const iconName = `${icon.name}${hasOpenedFolder ? openedFolder : ''}${icon[iconColor] ? iconColor === IconColor.light ? lightVersion : highContrastVersion ? highContrastVersion : '' : ''}`; - if (!availableIcons[iconName] && wrongIconNames[iconType].indexOf(iconName) === -1) { - wrongIconNames[iconType].push(iconName); - } +const isIconAvailable = ( + icon: FileIcon | FolderIcon | DefaultIcon, + iconType: IconType, + iconColor: IconColor, + hasOpenedFolder?: boolean +) => { + const iconName = `${icon.name}${hasOpenedFolder ? openedFolder : ''}${ + icon[iconColor] + ? iconColor === IconColor.light + ? lightVersion + : highContrastVersion + ? highContrastVersion + : '' + : '' + }`; + if ( + !availableIcons[iconName] && + wrongIconNames[iconType].indexOf(iconName) === -1 + ) { + wrongIconNames[iconType].push(iconName); + } }; /** * Check if the folder icons from the configuration are available on the file system. */ const checkFolderIcons = () => { - folderIcons.map( - theme => theme.name === 'none' ? [] : getAllFolderIcons(theme) - ) - .reduce((a, b) => a.concat(b)) - .forEach(icon => { - isIconAvailable(icon, IconType.folderIcons, IconColor.default); - isIconAvailable(icon, IconType.folderIcons, IconColor.default, true); - isIconAvailable(icon, IconType.folderIcons, IconColor.light); - isIconAvailable(icon, IconType.folderIcons, IconColor.light, true); - isIconAvailable(icon, IconType.folderIcons, IconColor.highContrast); - isIconAvailable(icon, IconType.folderIcons, IconColor.highContrast, true); - }); + folderIcons + .map((theme) => (theme.name === 'none' ? [] : getAllFolderIcons(theme))) + .reduce((a, b) => a.concat(b)) + .forEach((icon) => { + isIconAvailable(icon, IconType.folderIcons, IconColor.default); + isIconAvailable(icon, IconType.folderIcons, IconColor.default, true); + isIconAvailable(icon, IconType.folderIcons, IconColor.light); + isIconAvailable(icon, IconType.folderIcons, IconColor.light, true); + isIconAvailable(icon, IconType.folderIcons, IconColor.highContrast); + isIconAvailable(icon, IconType.folderIcons, IconColor.highContrast, true); + }); }; const getAllFolderIcons = (theme: FolderTheme) => { - const icons = theme.icons ? theme.icons : []; - return [ - theme.defaultIcon, - theme.rootFolder, - ...icons - ].filter(icon => icon !== undefined); // filter undefined root folder icons + const icons = theme.icons ? theme.icons : []; + return [theme.defaultIcon, theme.rootFolder, ...icons].filter( + (icon) => icon !== undefined + ); // filter undefined root folder icons }; /** * Check if the language icons from the configuration are available on the file system. */ const checkLanguageIcons = () => { - languageIcons.forEach(lang => { - const icon = lang.icon; - isIconAvailable(icon, IconType.languageIcons, IconColor.default); - isIconAvailable(icon, IconType.languageIcons, IconColor.light); - isIconAvailable(icon, IconType.languageIcons, IconColor.highContrast); - }); + languageIcons.forEach((lang) => { + const icon = lang.icon; + isIconAvailable(icon, IconType.languageIcons, IconColor.default); + isIconAvailable(icon, IconType.languageIcons, IconColor.light); + isIconAvailable(icon, IconType.languageIcons, IconColor.highContrast); + }); }; /** * Show error messages in the terminal. */ const handleErrors = () => { - const amountOfErrors = wrongIconNames.fileIcons.length + wrongIconNames.folderIcons.length + wrongIconNames.languageIcons.length; - if (amountOfErrors > 0) { - console.log('> Material Icon Theme:', painter.red(`Found ${amountOfErrors} error(s) in the icon configuration!`)); - } else { - console.log('> Material Icon Theme:', painter.green('Passed icon availability checks!')); - } - logIconInformation(wrongIconNames.fileIcons, 'File icons'); - logIconInformation(wrongIconNames.folderIcons, 'Folder icons'); - logIconInformation(wrongIconNames.languageIcons, 'Language icons'); - - if (amountOfErrors > 0) { - throw new Error('Found some wrong file definitions in the icon configuration.'); - } + const amountOfErrors = + wrongIconNames.fileIcons.length + + wrongIconNames.folderIcons.length + + wrongIconNames.languageIcons.length; + if (amountOfErrors > 0) { + console.log( + '> Material Icon Theme:', + painter.red(`Found ${amountOfErrors} error(s) in the icon configuration!`) + ); + } else { + console.log( + '> Material Icon Theme:', + painter.green('Passed icon availability checks!') + ); + } + logIconInformation(wrongIconNames.fileIcons, 'File icons'); + logIconInformation(wrongIconNames.folderIcons, 'Folder icons'); + logIconInformation(wrongIconNames.languageIcons, 'Language icons'); + + if (amountOfErrors > 0) { + throw new Error( + 'Found some wrong file definitions in the icon configuration.' + ); + } }; const logIconInformation = (wrongIcons: string[], title: string) => { - if (wrongIcons.length === 0) return; - console.log(`\n${title}:\n--------------------------------`); - wrongIcons.forEach(icon => { - const suggestion = Object.keys(availableIcons).find((i) => { - return similarity(icon, i) > 0.75; - }); - const suggestionString = suggestion ? ` (Did you mean ${painter.green(suggestion)}?)` : ''; - const isWrongLightVersion = icon.endsWith(lightVersion); - const isWrongLightVersionString = isWrongLightVersion ? ` (There is no light icon for ${painter.green(icon.slice(0, -6))}! Set the light option to false!)` : ''; - const isWrongHighContrastVersion = icon.endsWith(highContrastVersion); - const isWrongHighContrastVersionString = isWrongHighContrastVersion ? ` (There is no high contrast icon for ${painter.green(icon.slice(0, -13))}! Set the highContrast option to false!)` : ''; - console.log(painter.red(`Icon not found: ${icon}.svg`) + `${suggestionString}${isWrongLightVersionString}${isWrongHighContrastVersionString}`); + if (wrongIcons.length === 0) return; + console.log(`\n${title}:\n--------------------------------`); + wrongIcons.forEach((icon) => { + const suggestion = Object.keys(availableIcons).find((i) => { + return similarity(icon, i) > 0.75; }); + const suggestionString = suggestion + ? ` (Did you mean ${painter.green(suggestion)}?)` + : ''; + const isWrongLightVersion = icon.endsWith(lightVersion); + const isWrongLightVersionString = isWrongLightVersion + ? ` (There is no light icon for ${painter.green( + icon.slice(0, -6) + )}! Set the light option to false!)` + : ''; + const isWrongHighContrastVersion = icon.endsWith(highContrastVersion); + const isWrongHighContrastVersionString = isWrongHighContrastVersion + ? ` (There is no high contrast icon for ${painter.green( + icon.slice(0, -13) + )}! Set the highContrast option to false!)` + : ''; + console.log( + painter.red(`Icon not found: ${icon}.svg`) + + `${suggestionString}${isWrongLightVersionString}${isWrongHighContrastVersionString}` + ); + }); }; enum IconType { - fileIcons = 'fileIcons', - folderIcons = 'folderIcons', - languageIcons = 'languageIcons' + fileIcons = 'fileIcons', + folderIcons = 'folderIcons', + languageIcons = 'languageIcons', } enum IconColor { - default = 'default', - light = 'light', - highContrast = 'highContrast' + default = 'default', + light = 'light', + highContrast = 'highContrast', } diff --git a/src/scripts/icons/checks/checkIconConflicts.ts b/src/scripts/icons/checks/checkIconConflicts.ts index 7c14ffa3d9..ef7ecdf91f 100644 --- a/src/scripts/icons/checks/checkIconConflicts.ts +++ b/src/scripts/icons/checks/checkIconConflicts.ts @@ -5,115 +5,141 @@ import { fileIcons, folderIcons, languageIcons } from './../../../icons'; * Store all icons that are wrong configured */ const allConflicts = { - fileIcons: { - fileExtensions: {}, - fileNames: {} - }, - folderIcons: {}, - languageIcons: {} + fileIcons: { + fileExtensions: {}, + fileNames: {}, + }, + folderIcons: {}, + languageIcons: {}, }; export const check = () => { - checkFolderIcons(); - checkFileIcons(); - checkLanguageIcons(); + checkFolderIcons(); + checkFileIcons(); + checkLanguageIcons(); - handleErrors(); + handleErrors(); }; const checkFileIcons = () => { - checkForConflictsInFileIcons('fileExtensions'); - checkForConflictsInFileIcons('fileNames'); + checkForConflictsInFileIcons('fileExtensions'); + checkForConflictsInFileIcons('fileNames'); }; const checkForConflictsInFileIcons = (fileIconDefinitionType: string) => { - const icons = {}; - fileIcons.icons.forEach(icon => { - if (!icon[fileIconDefinitionType]) return; - icon[fileIconDefinitionType] - .map(d => d.toLowerCase()) - .forEach(definition => { - if (!icons[definition] || icon.enabledFor && icon.enabledFor.length > 0) { - icons[definition] = icon.name; - } else { - if (!allConflicts.fileIcons[fileIconDefinitionType][definition]) { - allConflicts.fileIcons[fileIconDefinitionType][definition] = [icons[definition], icon.name]; - } else { - allConflicts.fileIcons[fileIconDefinitionType][definition].push(icon.name); - } - } - }); - }); + const icons = {}; + fileIcons.icons.forEach((icon) => { + if (!icon[fileIconDefinitionType]) return; + icon[fileIconDefinitionType] + .map((d) => d.toLowerCase()) + .forEach((definition) => { + if ( + !icons[definition] || + (icon.enabledFor && icon.enabledFor.length > 0) + ) { + icons[definition] = icon.name; + } else { + if (!allConflicts.fileIcons[fileIconDefinitionType][definition]) { + allConflicts.fileIcons[fileIconDefinitionType][definition] = [ + icons[definition], + icon.name, + ]; + } else { + allConflicts.fileIcons[fileIconDefinitionType][definition].push( + icon.name + ); + } + } + }); + }); }; const checkFolderIcons = () => { - folderIcons.forEach(theme => { - if (!theme.icons) return; - const icons = {}; - theme.icons.forEach(icon => { - icon.folderNames - .map(f => f.toLowerCase()) - .forEach(folderName => { - if (!icons[folderName] || icon.enabledFor && icon.enabledFor.length > 0) { - icons[folderName] = icon.name; - } - else { - if (!allConflicts.folderIcons[folderName]) { - allConflicts.folderIcons[folderName] = [icons[folderName], icon.name]; - } else { - allConflicts.folderIcons[folderName].push(icon.name); - } - } - }); + folderIcons.forEach((theme) => { + if (!theme.icons) return; + const icons = {}; + theme.icons.forEach((icon) => { + icon.folderNames + .map((f) => f.toLowerCase()) + .forEach((folderName) => { + if ( + !icons[folderName] || + (icon.enabledFor && icon.enabledFor.length > 0) + ) { + icons[folderName] = icon.name; + } else { + if (!allConflicts.folderIcons[folderName]) { + allConflicts.folderIcons[folderName] = [ + icons[folderName], + icon.name, + ]; + } else { + allConflicts.folderIcons[folderName].push(icon.name); + } + } }); }); + }); }; const checkLanguageIcons = () => { - const icons = {}; - languageIcons.forEach(langIcon => { - langIcon.ids - .map(id => id.toLowerCase()) - .forEach(id => { - if (!icons[id]) { - icons[id] = langIcon.icon.name; - } else { - if (!allConflicts.languageIcons[id]) { - allConflicts.languageIcons[id] = [icons[id], langIcon.icon.name]; - } else { - allConflicts.languageIcons[id].push(langIcon.icon.name); - } - } - }); - }); + const icons = {}; + languageIcons.forEach((langIcon) => { + langIcon.ids + .map((id) => id.toLowerCase()) + .forEach((id) => { + if (!icons[id]) { + icons[id] = langIcon.icon.name; + } else { + if (!allConflicts.languageIcons[id]) { + allConflicts.languageIcons[id] = [icons[id], langIcon.icon.name]; + } else { + allConflicts.languageIcons[id].push(langIcon.icon.name); + } + } + }); + }); }; const handleErrors = () => { - if ([ - ...Object.keys(allConflicts.fileIcons.fileExtensions), - ...Object.keys(allConflicts.fileIcons.fileNames), - ...Object.keys(allConflicts.folderIcons), - ...Object.keys(allConflicts.languageIcons) - ].length > 0) { - console.log('> Material Icon Theme:', painter.red('Icon conflicts:')); - console.log(painter.red('--------------------------------------')); + if ( + [ + ...Object.keys(allConflicts.fileIcons.fileExtensions), + ...Object.keys(allConflicts.fileIcons.fileNames), + ...Object.keys(allConflicts.folderIcons), + ...Object.keys(allConflicts.languageIcons), + ].length > 0 + ) { + console.log('> Material Icon Theme:', painter.red('Icon conflicts:')); + console.log(painter.red('--------------------------------------')); - printErrorMessage(allConflicts.fileIcons.fileExtensions, 'fileExtension'); - printErrorMessage(allConflicts.fileIcons.fileNames, 'fileName'); - printErrorMessage(allConflicts.folderIcons, 'folderName'); - printErrorMessage(allConflicts.languageIcons, 'languageId'); + printErrorMessage(allConflicts.fileIcons.fileExtensions, 'fileExtension'); + printErrorMessage(allConflicts.fileIcons.fileNames, 'fileName'); + printErrorMessage(allConflicts.folderIcons, 'folderName'); + printErrorMessage(allConflicts.languageIcons, 'languageId'); - console.log('\n' + painter.red('Please check the wrong icon configurations!\n')); - process.exit(1); - } else { - console.log('> Material Icon Theme:', painter.green('Passed icon conflict checks!')); - } + console.log( + '\n' + painter.red('Please check the wrong icon configurations!\n') + ); + process.exit(1); + } else { + console.log( + '> Material Icon Theme:', + painter.green('Passed icon conflict checks!') + ); + } }; const printErrorMessage = (icons: any, definitionType: string) => { - const keys = Object.keys(icons); - keys.forEach(key => { - const conflictIcons = icons[key]; - console.log(painter.red(`For ${definitionType} "${key}" are ${conflictIcons.length} icons defined: [${conflictIcons.join(', ')}]`)); - }); + const keys = Object.keys(icons); + keys.forEach((key) => { + const conflictIcons = icons[key]; + console.log( + painter.red( + `For ${definitionType} "${key}" are ${ + conflictIcons.length + } icons defined: [${conflictIcons.join(', ')}]` + ) + ); + }); }; diff --git a/src/scripts/icons/checks/checkIconUsage.ts b/src/scripts/icons/checks/checkIconUsage.ts index 50210791b8..372a6ae3f2 100644 --- a/src/scripts/icons/checks/checkIconUsage.ts +++ b/src/scripts/icons/checks/checkIconUsage.ts @@ -1,7 +1,14 @@ import * as fs from 'fs'; import * as path from 'path'; import { DefaultIcon, FolderIcon, FolderTheme } from '../../../models/index'; -import { fileIcons, folderIcons, highContrastVersion, languageIcons, lightVersion, openedFolder } from './../../../icons'; +import { + fileIcons, + folderIcons, + highContrastVersion, + languageIcons, + lightVersion, + openedFolder, +} from './../../../icons'; import * as painter from './../../helpers/painter'; /** @@ -18,93 +25,113 @@ const availableIcons: { [s: string]: string } = {}; * Get all icon file names from the file system. */ const fsReadAllIconFiles = (err: Error, files: string[]) => { - if (err) { - throw Error(err.message); - } + if (err) { + throw Error(err.message); + } - files.forEach(file => { - const fileName = file; - const iconName = path.parse(file).name; - availableIcons[iconName] = fileName; - }); + files.forEach((file) => { + const fileName = file; + const iconName = path.parse(file).name; + availableIcons[iconName] = fileName; + }); - checkUsageOfAllIcons(); - handleErrors(); + checkUsageOfAllIcons(); + handleErrors(); }; const checkUsageOfAllIcons = () => { - const usedFileIcons: string[] = getAllUsedFileIcons(); - const usedFolderIcons: string[] = getAllUsedFolderIcons(); - const usedLanguageIcons: string[] = getAllUsedLanguageIcons(); + const usedFileIcons: string[] = getAllUsedFileIcons(); + const usedFolderIcons: string[] = getAllUsedFolderIcons(); + const usedLanguageIcons: string[] = getAllUsedLanguageIcons(); - [].concat( - usedFileIcons, - usedFolderIcons, - usedLanguageIcons - ).forEach(icon => { - delete availableIcons[icon]; + [] + .concat(usedFileIcons, usedFolderIcons, usedLanguageIcons) + .forEach((icon) => { + delete availableIcons[icon]; }); }; const handleErrors = () => { - const amountOfUnusedIcons = Object.keys(availableIcons).length; - if (amountOfUnusedIcons === 0) { - console.log('> Material Icon Theme:', painter.green('Passed icon usage checks!')); - } else { - console.log('> Material Icon Theme: ' + painter.red(`${amountOfUnusedIcons} unused icon(s):`)); - Object.keys(availableIcons).forEach(icon => { - console.log(painter.red(`- ${availableIcons[icon]}`)); - }); - throw new Error('Found unused icon files!'); - } + const amountOfUnusedIcons = Object.keys(availableIcons).length; + if (amountOfUnusedIcons === 0) { + console.log( + '> Material Icon Theme:', + painter.green('Passed icon usage checks!') + ); + } else { + console.log( + '> Material Icon Theme: ' + + painter.red(`${amountOfUnusedIcons} unused icon(s):`) + ); + Object.keys(availableIcons).forEach((icon) => { + console.log(painter.red(`- ${availableIcons[icon]}`)); + }); + throw new Error('Found unused icon files!'); + } }; // read from the file system export const check = () => fs.readdir(folderPath, fsReadAllIconFiles); const getAllUsedFileIcons = (): string[] => { - const icons = [ - fileIcons.defaultIcon.name, - fileIcons.defaultIcon.light ? fileIcons.defaultIcon.name + lightVersion : undefined, - fileIcons.defaultIcon.highContrast ? fileIcons.defaultIcon.name + highContrastVersion : undefined, - ...fileIcons.icons.map(icon => icon.name), - ...fileIcons.icons.filter(icon => icon.light).map(icon => icon.name + lightVersion), - ...fileIcons.icons.filter(icon => icon.highContrast).map(icon => icon.name + highContrastVersion) - ]; - return icons; + const icons = [ + fileIcons.defaultIcon.name, + fileIcons.defaultIcon.light + ? fileIcons.defaultIcon.name + lightVersion + : undefined, + fileIcons.defaultIcon.highContrast + ? fileIcons.defaultIcon.name + highContrastVersion + : undefined, + ...fileIcons.icons.map((icon) => icon.name), + ...fileIcons.icons + .filter((icon) => icon.light) + .map((icon) => icon.name + lightVersion), + ...fileIcons.icons + .filter((icon) => icon.highContrast) + .map((icon) => icon.name + highContrastVersion), + ]; + return icons; }; const getAllUsedFolderIcons = (): string[] => { - const icons = folderIcons.map( - theme => theme.name === 'none' ? [] : getAllFolderIcons(theme) - ).reduce((a, b) => a.concat(b)); - return icons.map(icon => { - return [ - icon.name, - icon.name + openedFolder, - icon.light ? icon.name + lightVersion : undefined, - icon.light ? icon.name + openedFolder + lightVersion : undefined, - icon.highContrast ? icon.name + highContrastVersion : undefined, - icon.highContrast ? icon.name + openedFolder + highContrastVersion : undefined - ]; - }).filter(icon => icon !== undefined) - .reduce((a, b) => a.concat(b)); + const icons = folderIcons + .map((theme) => (theme.name === 'none' ? [] : getAllFolderIcons(theme))) + .reduce((a, b) => a.concat(b)); + return icons + .map((icon) => { + return [ + icon.name, + icon.name + openedFolder, + icon.light ? icon.name + lightVersion : undefined, + icon.light ? icon.name + openedFolder + lightVersion : undefined, + icon.highContrast ? icon.name + highContrastVersion : undefined, + icon.highContrast + ? icon.name + openedFolder + highContrastVersion + : undefined, + ]; + }) + .filter((icon) => icon !== undefined) + .reduce((a, b) => a.concat(b)); }; -const getAllFolderIcons = (theme: FolderTheme): (FolderIcon | DefaultIcon)[] => { - const icons = theme.icons || []; - return [ - theme.defaultIcon, - theme.rootFolder, - ...icons - ].filter(icon => icon !== undefined); // filter undefined root folder icons +const getAllFolderIcons = ( + theme: FolderTheme +): (FolderIcon | DefaultIcon)[] => { + const icons = theme.icons || []; + return [theme.defaultIcon, theme.rootFolder, ...icons].filter( + (icon) => icon !== undefined + ); // filter undefined root folder icons }; const getAllUsedLanguageIcons = (): string[] => { - const icons = [ - ...languageIcons.map(lang => lang.icon.name), - ...languageIcons.filter(lang => lang.icon.light).map(lang => lang.icon.name + lightVersion), - ...languageIcons.filter(lang => lang.icon.highContrast).map(lang => lang.icon.name + highContrastVersion), - ]; - return icons; + const icons = [ + ...languageIcons.map((lang) => lang.icon.name), + ...languageIcons + .filter((lang) => lang.icon.light) + .map((lang) => lang.icon.name + lightVersion), + ...languageIcons + .filter((lang) => lang.icon.highContrast) + .map((lang) => lang.icon.name + highContrastVersion), + ]; + return icons; }; diff --git a/src/scripts/icons/generateJson.ts b/src/scripts/icons/generateJson.ts index f3b5883027..823d3ad7ac 100644 --- a/src/scripts/icons/generateJson.ts +++ b/src/scripts/icons/generateJson.ts @@ -4,7 +4,7 @@ import { createIconFile } from './../../icons/index'; try { - createIconFile(); + createIconFile(); } catch (error) { - throw Error(error); + throw Error(error); } diff --git a/src/scripts/preview/index.ts b/src/scripts/preview/index.ts index ffc7a052b5..0a06295cf4 100644 --- a/src/scripts/preview/index.ts +++ b/src/scripts/preview/index.ts @@ -4,26 +4,30 @@ import { languageIcons } from './../../icons/languageIcons'; import { generatePreview } from './preview'; const filterDuplicates = (icons: string[]) => { - return [...new Set(icons)]; + return [...new Set(icons)]; }; const basicFileIcons = filterDuplicates( - fileIcons.icons - .map(i => i.name) - // merge language icons - .concat(languageIcons.map(i => i.icon.name)) -).map(i => ({ iconName: i, label: i })); + fileIcons.icons + .map((i) => i.name) + // merge language icons + .concat(languageIcons.map((i) => i.icon.name)) +).map((i) => ({ iconName: i, label: i })); -const folderThemes = filterDuplicates(folderIcons.map(theme => { - const folders = []; - if (theme.defaultIcon.name !== '') { +const folderThemes = filterDuplicates( + folderIcons + .map((theme) => { + const folders = []; + if (theme.defaultIcon.name !== '') { folders.push(theme.defaultIcon.name); - } - if (theme.icons && theme.icons.length > 0) { - folders.push(...theme.icons.map(i => i.name)); - } - return [].concat(...folders); -}).reduce((a, b) => a.concat(b))).map(i => ({ iconName: i, label: i.replace('folder-', '') })); + } + if (theme.icons && theme.icons.length > 0) { + folders.push(...theme.icons.map((i) => i.name)); + } + return [].concat(...folders); + }) + .reduce((a, b) => a.concat(b)) +).map((i) => ({ iconName: i, label: i.replace('folder-', '') })); generatePreview('fileIcons', basicFileIcons, 5, ['virtual', 'video']); generatePreview('folderIcons', folderThemes, 5, ['folder-wakatime']); diff --git a/src/scripts/preview/preview.ts b/src/scripts/preview/preview.ts index befed0a971..d9437ee837 100644 --- a/src/scripts/preview/preview.ts +++ b/src/scripts/preview/preview.ts @@ -9,12 +9,12 @@ const cssFilePath = path.join('style.css'); const styling = ``; const createHTMLTableHeadRow = (amount: number) => { - const pair = ` + const pair = ` Icon Name `; - const columns = [...Array(amount)].map(() => pair).join(''); - return ` + const columns = [...Array(amount)].map(() => pair).join(''); + return ` ${columns} @@ -22,22 +22,28 @@ const createHTMLTableHeadRow = (amount: number) => { }; const createHTMLTableBodyRows = (items: IconDefinition[][]) => { - let rows = ''; - items.forEach(row => { - const columns = row.map(icon => ` + let rows = ''; + items.forEach((row) => { + const columns = row + .map( + (icon) => ` - ${icon.label} + ${
+          icon.label
+        } ${toTitleCase(icon.label)} - `).join(''); - const tableRow = ` + ` + ) + .join(''); + const tableRow = ` ${columns} `; - rows = rows + tableRow; - }); - return rows; + rows = rows + tableRow; + }); + return rows; }; const createHTMLTable = (headRow, bodyRows) => ` @@ -48,51 +54,69 @@ const createHTMLTable = (headRow, bodyRows) => ` `; const createPreviewTable = (icons: IconDefinition[][], size: number) => { - const table = htmlDoctype + styling + createHTMLTable( - createHTMLTableHeadRow(size), - createHTMLTableBodyRows(icons) + const table = + htmlDoctype + + styling + + createHTMLTable( + createHTMLTableHeadRow(size), + createHTMLTableBodyRows(icons) ); - return table; + return table; }; -const savePreview = (fileName: string, size: number, icons: IconDefinition[][]) => { - const filePath = path.join(__dirname, fileName + '.html'); +const savePreview = ( + fileName: string, + size: number, + icons: IconDefinition[][] +) => { + const filePath = path.join(__dirname, fileName + '.html'); - // write the html file with the icon table - fs.writeFileSync(filePath, createPreviewTable(icons, size)); + // write the html file with the icon table + fs.writeFileSync(filePath, createPreviewTable(icons, size)); - // create the image - createScreenshot(filePath, fileName).then(() => { - console.log('> Material Icon Theme:', painter.green(`Successfully created ${fileName} preview image!`)); - }).catch(() => { - throw Error(painter.red(`Error while creating ${fileName} preview image`)); + // create the image + createScreenshot(filePath, fileName) + .then(() => { + console.log( + '> Material Icon Theme:', + painter.green(`Successfully created ${fileName} preview image!`) + ); + }) + .catch(() => { + throw Error( + painter.red(`Error while creating ${fileName} preview image`) + ); }); }; -const getIconDefinitionsMatrix = (icons: IconDefinition[], size: number, excluded: string[] = []): IconDefinition[][] => { - const iconList = icons - .sort((a, b) => a.label.localeCompare(b.label)) - .filter(i => excluded.indexOf(i.iconName) === -1); +const getIconDefinitionsMatrix = ( + icons: IconDefinition[], + size: number, + excluded: string[] = [] +): IconDefinition[][] => { + const iconList = icons + .sort((a, b) => a.label.localeCompare(b.label)) + .filter((i) => excluded.indexOf(i.iconName) === -1); - // list for the columns with the icons - const matrix: IconDefinition[][] = []; + // list for the columns with the icons + const matrix: IconDefinition[][] = []; - // calculate the amount of icons per column - const itemsPerColumn = Math.floor(iconList.length / size); + // calculate the amount of icons per column + const itemsPerColumn = Math.floor(iconList.length / size); - // create the columns with the icons - let counter = 0; - for (let c = 0; c < itemsPerColumn; c++) { - matrix[c] = []; - } - for (let s = 0; s < size; s++) { - for (let i = 0; i < itemsPerColumn; i++) { - matrix[i][s] = iconList[counter]; - counter++; - } + // create the columns with the icons + let counter = 0; + for (let c = 0; c < itemsPerColumn; c++) { + matrix[c] = []; + } + for (let s = 0; s < size; s++) { + for (let i = 0; i < itemsPerColumn; i++) { + matrix[i][s] = iconList[counter]; + counter++; } + } - return matrix; + return matrix; }; /** @@ -102,11 +126,16 @@ const getIconDefinitionsMatrix = (icons: IconDefinition[], size: number, exclude * @param size amount of table columns * @param excluded which icons shall be excluded */ -export const generatePreview = (name: string, icons: IconDefinition[], size: number, excluded: string[] = []) => { - savePreview(name, size, getIconDefinitionsMatrix(icons, size, excluded)); +export const generatePreview = ( + name: string, + icons: IconDefinition[], + size: number, + excluded: string[] = [] +) => { + savePreview(name, size, getIconDefinitionsMatrix(icons, size, excluded)); }; interface IconDefinition { - iconName: string; - label: string; + iconName: string; + label: string; } diff --git a/src/scripts/preview/style.css b/src/scripts/preview/style.css index e9f8b163ff..6a7d7e7148 100644 --- a/src/scripts/preview/style.css +++ b/src/scripts/preview/style.css @@ -1,47 +1,48 @@ :root { - --main-bg-color: #1e1e1e; + --main-bg-color: #1e1e1e; } body { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } table { - font-family: arial, sans-serif; - border-collapse: collapse; - width: 100%; - background: var(--main-bg-color); - color: rgb(250, 250, 250); - font-size: 1rem; + font-family: arial, sans-serif; + border-collapse: collapse; + width: 100%; + background: var(--main-bg-color); + color: rgb(250, 250, 250); + font-size: 1rem; } -td, th { - border: 0px solid #dddddd; - text-align: left; - padding: 8px; +td, +th { + border: 0px solid #dddddd; + text-align: left; + padding: 8px; } tr:last-child { - border-bottom: .5rem solid var(--main-bg-color); + border-bottom: 0.5rem solid var(--main-bg-color); } tr:first-child { - border-top: .5rem solid var(--main-bg-color); - border-bottom: .5rem solid var(--main-bg-color); + border-top: 0.5rem solid var(--main-bg-color); + border-bottom: 0.5rem solid var(--main-bg-color); } .icon { - width: 2rem; - text-align: center; - padding: .5rem 1rem .5rem 1rem; + width: 2rem; + text-align: center; + padding: 0.5rem 1rem 0.5rem 1rem; } .iconName { - min-width: 9rem; + min-width: 9rem; } img { - width: 30px; - height: auto; -} \ No newline at end of file + width: 30px; + height: auto; +} diff --git a/src/test/runTest.ts b/src/test/runTest.ts index 19a8133df8..9e04f2adb5 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -2,21 +2,21 @@ import * as path from 'path'; import { runTests } from 'vscode-test'; const main = async () => { - try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); + try { + // The folder containing the Extension Manifest package.json + // Passed to `--extensionDevelopmentPath` + const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - // The path to the extension test script - // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, './spec/index'); + // The path to the extension test script + // Passed to --extensionTestsPath + const extensionTestsPath = path.resolve(__dirname, './spec/index'); - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { - console.error('Failed to run tests'); - process.exit(1); - } + // Download VS Code, unzip it and run the integration test + await runTests({ extensionDevelopmentPath, extensionTestsPath }); + } catch (err) { + console.error('Failed to run tests'); + process.exit(1); + } }; main(); diff --git a/src/test/spec/i18n/i18n.spec.ts b/src/test/spec/i18n/i18n.spec.ts index a3e7eb7fb5..2232535d47 100644 --- a/src/test/spec/i18n/i18n.spec.ts +++ b/src/test/spec/i18n/i18n.spec.ts @@ -3,35 +3,41 @@ import { getObjectPropertyValue } from '../../../helpers/objects'; import * as i18n from '../../../i18n'; describe('i18n', () => { - it('should initialize translations', () => { - return i18n.initTranslations(); - }); + it('should initialize translations', () => { + return i18n.initTranslations(); + }); - it('should translate key', () => { - assert.equal(i18n.getTranslationValue('a', { a: 'b' }), 'b'); - }); + it('should translate key', () => { + assert.equal(i18n.getTranslationValue('a', { a: 'b' }), 'b'); + }); - it('should return undefined if translation is not defined', () => { - assert.equal(i18n.getTranslationValue('c', { a: 'b' }), undefined); - }); + it('should return undefined if translation is not defined', () => { + assert.equal(i18n.getTranslationValue('c', { a: 'b' }), undefined); + }); - it('should use fallback if translation is not defined', () => { - assert.equal(i18n.getTranslationValue('a', { b: 'b' }, { a: 'fb' }), 'fb'); - }); + it('should use fallback if translation is not defined', () => { + assert.equal(i18n.getTranslationValue('a', { b: 'b' }, { a: 'fb' }), 'fb'); + }); - it('should get the correct translation value of the translation object', () => { - const translation = { - a: { - b: { - c: 'c' - } - } - }; - assert.equal(getObjectPropertyValue(translation, 'a.b.c'), 'c'); - }); + it('should get the correct translation value of the translation object', () => { + const translation = { + a: { + b: { + c: 'c', + }, + }, + }; + assert.equal(getObjectPropertyValue(translation, 'a.b.c'), 'c'); + }); - it('should use placeholder in translation', () => { - assert.equal(i18n.replace('%0 with placeholder', 'test'), 'test with placeholder'); - assert.equal(i18n.replace('%0 with %1', ['test', 'placeholder']), 'test with placeholder'); - }); + it('should use placeholder in translation', () => { + assert.equal( + i18n.replace('%0 with placeholder', 'test'), + 'test with placeholder' + ); + assert.equal( + i18n.replace('%0 with %1', ['test', 'placeholder']), + 'test with placeholder' + ); + }); }); diff --git a/src/test/spec/icons/fileIcons.spec.ts b/src/test/spec/icons/fileIcons.spec.ts index 48374ad9c1..bb04aa517b 100644 --- a/src/test/spec/icons/fileIcons.spec.ts +++ b/src/test/spec/icons/fileIcons.spec.ts @@ -1,197 +1,250 @@ import * as assert from 'assert'; import * as merge from 'lodash.merge'; -import { getDefaultIconOptions, loadFileIconDefinitions } from '../../../icons/index'; +import { + getDefaultIconOptions, + loadFileIconDefinitions, +} from '../../../icons/index'; import { FileIcons, IconConfiguration, IconPack } from '../../../models/index'; describe('file icons', () => { + let expectedConfig: IconConfiguration; - let expectedConfig: IconConfiguration; - - beforeEach(() => { - expectedConfig = merge({}, new IconConfiguration(), { options: getDefaultIconOptions() }); - }); - - it('should configure icon definitions', () => { - const fileIcons: FileIcons = { - defaultIcon: { name: 'file' }, - icons: [ - { name: 'angular', fileNames: ['.angular-cli.json', 'angular-cli.json'], enabledFor: [IconPack.Angular, IconPack.Ngrx] }, - { name: 'javascript', fileNames: ['filename.js'], fileExtensions: ['js'] } - ] - }; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFileIconDefinitions(fileIcons, iconConfig, options); - - expectedConfig.iconDefinitions = { - 'angular': { - 'iconPath': './../icons/angular.svg' - }, - 'javascript': { - 'iconPath': './../icons/javascript.svg' - }, - 'file': { - 'iconPath': './../icons/file.svg' - }, - }; - expectedConfig.file = 'file'; - expectedConfig.fileExtensions = { - 'js': 'javascript' - }; - expectedConfig.fileNames = { - '.angular-cli.json': 'angular', - 'angular-cli.json': 'angular', - 'filename.js': 'javascript' - }; - - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); - - it('should disable icon packs', () => { - const fileIcons: FileIcons = { - defaultIcon: { name: 'file' }, - icons: [ - { name: 'angular', fileNames: ['.angular-cli.json', 'angular-cli.json'], enabledFor: [IconPack.Ngrx] }, - { name: 'javascript', fileNames: ['filename.js'], fileExtensions: ['js'] } - ] - }; - - const options = getDefaultIconOptions(); - options.activeIconPack = ''; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFileIconDefinitions(fileIcons, iconConfig, options); - - expectedConfig.iconDefinitions = { - 'file': { - 'iconPath': './../icons/file.svg' - }, - 'javascript': { - 'iconPath': './../icons/javascript.svg' - } - }; - expectedConfig.file = 'file'; - expectedConfig.fileExtensions = { - 'js': 'javascript' - }; - expectedConfig.fileNames = { - 'filename.js': 'javascript' - }; - - // disable default icon pack by using empty string - expectedConfig.options.activeIconPack = ''; - - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); - - it('should configure custom icon associations', () => { - const fileIcons: FileIcons = { - defaultIcon: { name: 'file' }, - icons: [ - { name: 'angular', fileNames: ['.angular-cli.json', 'angular-cli.json'] }, - { name: 'javascript', fileNames: ['filename.js'], fileExtensions: ['js'] } - ] - }; - const options = getDefaultIconOptions(); - options.files.associations = { - '*.sample.ts': 'angular', - 'sample.js': 'javascript' - }; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFileIconDefinitions(fileIcons, iconConfig, options); - - expectedConfig.iconDefinitions = { - 'file': { - 'iconPath': './../icons/file.svg' - }, - 'javascript': { - 'iconPath': './../icons/javascript.svg' - }, - 'angular': { - 'iconPath': './../icons/angular.svg' - } - }; - expectedConfig.file = 'file'; - expectedConfig.fileExtensions = { - 'js': 'javascript', - 'sample.ts': 'angular' - }; - expectedConfig.fileNames = { - '.angular-cli.json': 'angular', - 'angular-cli.json': 'angular', - 'sample.js': 'javascript', - 'filename.js': 'javascript' - }; - expectedConfig.options.files.associations = { - '*.sample.ts': 'angular', - 'sample.js': 'javascript' - }; - - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); - - it('should configure language icons for light and high contrast', () => { - const fileIcons: FileIcons = { - defaultIcon: { name: 'file', light: true, highContrast: true }, - icons: [ - { name: 'angular', fileNames: ['.angular-cli.json', 'angular-cli.json'], enabledFor: [IconPack.Angular, IconPack.Ngrx] }, - { name: 'javascript', fileNames: ['filename.js'], fileExtensions: ['js'], light: true, highContrast: true } - ] - }; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFileIconDefinitions(fileIcons, iconConfig, options); - - expectedConfig.iconDefinitions = { - 'file': { - 'iconPath': './../icons/file.svg' - }, - 'file_light': { - 'iconPath': './../icons/file_light.svg' - }, - 'file_highContrast': { - 'iconPath': './../icons/file_highContrast.svg' - }, - 'javascript': { - 'iconPath': './../icons/javascript.svg' - }, - 'javascript_light': { - 'iconPath': './../icons/javascript_light.svg' - }, - 'javascript_highContrast': { - 'iconPath': './../icons/javascript_highContrast.svg' - }, - 'angular': { - 'iconPath': './../icons/angular.svg' - } - }; - expectedConfig.file = 'file'; - expectedConfig.fileExtensions = { - 'js': 'javascript' - }; - expectedConfig.light = { - 'file': 'file_light', - 'fileExtensions': { - 'js': 'javascript_light' - }, - 'fileNames': { - 'filename.js': 'javascript_light' - } - }; - expectedConfig.highContrast = { - 'file': 'file_highContrast', - 'fileExtensions': { - 'js': 'javascript_highContrast' - }, - 'fileNames': { - 'filename.js': 'javascript_highContrast' - } - }; - expectedConfig.fileNames = { - '.angular-cli.json': 'angular', - 'angular-cli.json': 'angular', - 'filename.js': 'javascript' - }; - - assert.deepStrictEqual(iconDefinitions, expectedConfig); + beforeEach(() => { + expectedConfig = merge({}, new IconConfiguration(), { + options: getDefaultIconOptions(), }); + }); + + it('should configure icon definitions', () => { + const fileIcons: FileIcons = { + defaultIcon: { name: 'file' }, + icons: [ + { + name: 'angular', + fileNames: ['.angular-cli.json', 'angular-cli.json'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'javascript', + fileNames: ['filename.js'], + fileExtensions: ['js'], + }, + ], + }; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFileIconDefinitions( + fileIcons, + iconConfig, + options + ); + + expectedConfig.iconDefinitions = { + angular: { + iconPath: './../icons/angular.svg', + }, + javascript: { + iconPath: './../icons/javascript.svg', + }, + file: { + iconPath: './../icons/file.svg', + }, + }; + expectedConfig.file = 'file'; + expectedConfig.fileExtensions = { + js: 'javascript', + }; + expectedConfig.fileNames = { + '.angular-cli.json': 'angular', + 'angular-cli.json': 'angular', + 'filename.js': 'javascript', + }; + + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); + + it('should disable icon packs', () => { + const fileIcons: FileIcons = { + defaultIcon: { name: 'file' }, + icons: [ + { + name: 'angular', + fileNames: ['.angular-cli.json', 'angular-cli.json'], + enabledFor: [IconPack.Ngrx], + }, + { + name: 'javascript', + fileNames: ['filename.js'], + fileExtensions: ['js'], + }, + ], + }; + + const options = getDefaultIconOptions(); + options.activeIconPack = ''; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFileIconDefinitions( + fileIcons, + iconConfig, + options + ); + + expectedConfig.iconDefinitions = { + file: { + iconPath: './../icons/file.svg', + }, + javascript: { + iconPath: './../icons/javascript.svg', + }, + }; + expectedConfig.file = 'file'; + expectedConfig.fileExtensions = { + js: 'javascript', + }; + expectedConfig.fileNames = { + 'filename.js': 'javascript', + }; + + // disable default icon pack by using empty string + expectedConfig.options.activeIconPack = ''; + + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); + + it('should configure custom icon associations', () => { + const fileIcons: FileIcons = { + defaultIcon: { name: 'file' }, + icons: [ + { + name: 'angular', + fileNames: ['.angular-cli.json', 'angular-cli.json'], + }, + { + name: 'javascript', + fileNames: ['filename.js'], + fileExtensions: ['js'], + }, + ], + }; + const options = getDefaultIconOptions(); + options.files.associations = { + '*.sample.ts': 'angular', + 'sample.js': 'javascript', + }; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFileIconDefinitions( + fileIcons, + iconConfig, + options + ); + + expectedConfig.iconDefinitions = { + file: { + iconPath: './../icons/file.svg', + }, + javascript: { + iconPath: './../icons/javascript.svg', + }, + angular: { + iconPath: './../icons/angular.svg', + }, + }; + expectedConfig.file = 'file'; + expectedConfig.fileExtensions = { + js: 'javascript', + 'sample.ts': 'angular', + }; + expectedConfig.fileNames = { + '.angular-cli.json': 'angular', + 'angular-cli.json': 'angular', + 'sample.js': 'javascript', + 'filename.js': 'javascript', + }; + expectedConfig.options.files.associations = { + '*.sample.ts': 'angular', + 'sample.js': 'javascript', + }; + + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); + + it('should configure language icons for light and high contrast', () => { + const fileIcons: FileIcons = { + defaultIcon: { name: 'file', light: true, highContrast: true }, + icons: [ + { + name: 'angular', + fileNames: ['.angular-cli.json', 'angular-cli.json'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + { + name: 'javascript', + fileNames: ['filename.js'], + fileExtensions: ['js'], + light: true, + highContrast: true, + }, + ], + }; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFileIconDefinitions( + fileIcons, + iconConfig, + options + ); + /* eslint-disable camelcase */ + expectedConfig.iconDefinitions = { + file: { + iconPath: './../icons/file.svg', + }, + file_light: { + iconPath: './../icons/file_light.svg', + }, + file_highContrast: { + iconPath: './../icons/file_highContrast.svg', + }, + javascript: { + iconPath: './../icons/javascript.svg', + }, + javascript_light: { + iconPath: './../icons/javascript_light.svg', + }, + javascript_highContrast: { + iconPath: './../icons/javascript_highContrast.svg', + }, + angular: { + iconPath: './../icons/angular.svg', + }, + }; + expectedConfig.file = 'file'; + expectedConfig.fileExtensions = { + js: 'javascript', + }; + expectedConfig.light = { + file: 'file_light', + fileExtensions: { + js: 'javascript_light', + }, + fileNames: { + 'filename.js': 'javascript_light', + }, + }; + expectedConfig.highContrast = { + file: 'file_highContrast', + fileExtensions: { + js: 'javascript_highContrast', + }, + fileNames: { + 'filename.js': 'javascript_highContrast', + }, + }; + expectedConfig.fileNames = { + '.angular-cli.json': 'angular', + 'angular-cli.json': 'angular', + 'filename.js': 'javascript', + }; + /* eslint-enable camelcase */ + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); }); diff --git a/src/test/spec/icons/folderIcons.spec.ts b/src/test/spec/icons/folderIcons.spec.ts index 0c37da53c5..4a890dc337 100644 --- a/src/test/spec/icons/folderIcons.spec.ts +++ b/src/test/spec/icons/folderIcons.spec.ts @@ -1,374 +1,418 @@ import * as assert from 'assert'; import * as merge from 'lodash.merge'; -import { getDefaultIconOptions, loadFolderIconDefinitions } from '../../../icons/index'; -import { FolderTheme, IconConfiguration, IconPack } from '../../../models/index'; +import { + getDefaultIconOptions, + loadFolderIconDefinitions, +} from '../../../icons/index'; +import { + FolderTheme, + IconConfiguration, + IconPack, +} from '../../../models/index'; describe('folder icons', () => { - let folderIcons: FolderTheme[]; - let expectedConfig: IconConfiguration; + let folderIcons: FolderTheme[]; + let expectedConfig: IconConfiguration; - before(() => { - folderIcons = [ - { - name: 'specific', - defaultIcon: { name: 'folder' }, - rootFolder: { name: 'folder-root' }, - icons: [ - { name: 'folder-src', folderNames: ['src', 'source'] }, - { name: 'folder-angular', folderNames: ['angular', 'ng'], enabledFor: [IconPack.Angular, IconPack.Ngrx] } - ] - }, - { - name: 'blue', - defaultIcon: { name: 'folder-blue' }, - icons: [ - { name: 'folder-blue-src', folderNames: ['src', 'source'] } - ] - }, - { name: 'classic', defaultIcon: { name: 'folder' } }, - { name: 'none', defaultIcon: { name: '' } }, - ]; - }); + before(() => { + folderIcons = [ + { + name: 'specific', + defaultIcon: { name: 'folder' }, + rootFolder: { name: 'folder-root' }, + icons: [ + { name: 'folder-src', folderNames: ['src', 'source'] }, + { + name: 'folder-angular', + folderNames: ['angular', 'ng'], + enabledFor: [IconPack.Angular, IconPack.Ngrx], + }, + ], + }, + { + name: 'blue', + defaultIcon: { name: 'folder-blue' }, + icons: [{ name: 'folder-blue-src', folderNames: ['src', 'source'] }], + }, + { name: 'classic', defaultIcon: { name: 'folder' } }, + { name: 'none', defaultIcon: { name: '' } }, + ]; + }); - beforeEach(() => { - expectedConfig = merge({}, new IconConfiguration(), { options: getDefaultIconOptions() }); + beforeEach(() => { + expectedConfig = merge({}, new IconConfiguration(), { + options: getDefaultIconOptions(), }); + }); - it('should configure icon definitions', () => { - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); - - expectedConfig.iconDefinitions = { - 'folder': { - 'iconPath': './../icons/folder.svg' - }, - 'folder-open': { - 'iconPath': './../icons/folder-open.svg' - }, - 'folder-root': { - 'iconPath': './../icons/folder-root.svg' - }, - 'folder-root-open': { - 'iconPath': './../icons/folder-root-open.svg' - }, - 'folder-src': { - 'iconPath': './../icons/folder-src.svg' - }, - 'folder-src-open': { - 'iconPath': './../icons/folder-src-open.svg' - }, - 'folder-angular': { - 'iconPath': './../icons/folder-angular.svg' - }, - 'folder-angular-open': { - 'iconPath': './../icons/folder-angular-open.svg' - } - }; - expectedConfig.folder = 'folder'; - expectedConfig.folderExpanded = 'folder-open'; - expectedConfig.rootFolder = 'folder-root'; - expectedConfig.rootFolderExpanded = 'folder-root-open'; - expectedConfig.folderNames = { - 'src': 'folder-src', - 'source': 'folder-src', - 'angular': 'folder-angular', - 'ng': 'folder-angular' - }; - expectedConfig.folderNamesExpanded = { - 'src': 'folder-src-open', - 'source': 'folder-src-open', - 'angular': 'folder-angular-open', - 'ng': 'folder-angular-open' - }; - expectedConfig.hidesExplorerArrows = false; + it('should configure icon definitions', () => { + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + expectedConfig.iconDefinitions = { + folder: { + iconPath: './../icons/folder.svg', + }, + 'folder-open': { + iconPath: './../icons/folder-open.svg', + }, + 'folder-root': { + iconPath: './../icons/folder-root.svg', + }, + 'folder-root-open': { + iconPath: './../icons/folder-root-open.svg', + }, + 'folder-src': { + iconPath: './../icons/folder-src.svg', + }, + 'folder-src-open': { + iconPath: './../icons/folder-src-open.svg', + }, + 'folder-angular': { + iconPath: './../icons/folder-angular.svg', + }, + 'folder-angular-open': { + iconPath: './../icons/folder-angular-open.svg', + }, + }; + expectedConfig.folder = 'folder'; + expectedConfig.folderExpanded = 'folder-open'; + expectedConfig.rootFolder = 'folder-root'; + expectedConfig.rootFolderExpanded = 'folder-root-open'; + expectedConfig.folderNames = { + src: 'folder-src', + source: 'folder-src', + angular: 'folder-angular', + ng: 'folder-angular', + }; + expectedConfig.folderNamesExpanded = { + src: 'folder-src-open', + source: 'folder-src-open', + angular: 'folder-angular-open', + ng: 'folder-angular-open', + }; + expectedConfig.hidesExplorerArrows = false; - it('should deactivate folder icons', () => { - const options = getDefaultIconOptions(); - options.folders.theme = 'none'; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - expectedConfig.iconDefinitions = {}; - expectedConfig.folderNames = {}; - expectedConfig.folderNamesExpanded = {}; - expectedConfig.hidesExplorerArrows = false; - expectedConfig.options.folders.theme = 'none'; - - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should deactivate folder icons', () => { + const options = getDefaultIconOptions(); + options.folders.theme = 'none'; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); - it('should enable folder theme', () => { - const options = getDefaultIconOptions(); - options.folders.theme = 'blue'; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); + expectedConfig.iconDefinitions = {}; + expectedConfig.folderNames = {}; + expectedConfig.folderNamesExpanded = {}; + expectedConfig.hidesExplorerArrows = false; + expectedConfig.options.folders.theme = 'none'; - expectedConfig.iconDefinitions = { - 'folder-blue': { - 'iconPath': './../icons/folder-blue.svg' - }, - 'folder-blue-open': { - 'iconPath': './../icons/folder-blue-open.svg' - }, - 'folder-blue-src': { - 'iconPath': './../icons/folder-blue-src.svg' - }, - 'folder-blue-src-open': { - 'iconPath': './../icons/folder-blue-src-open.svg' - } - }; - expectedConfig.folder = 'folder-blue'; - expectedConfig.folderExpanded = 'folder-blue-open'; - expectedConfig.rootFolder = 'folder-blue'; - expectedConfig.rootFolderExpanded = 'folder-blue-open'; - expectedConfig.folderNames = { - 'src': 'folder-blue-src', - 'source': 'folder-blue-src' - }; - expectedConfig.folderNamesExpanded = { - 'src': 'folder-blue-src-open', - 'source': 'folder-blue-src-open' - }; - expectedConfig.hidesExplorerArrows = false; - expectedConfig.options.folders.theme = 'blue'; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should enable folder theme', () => { + const options = getDefaultIconOptions(); + options.folders.theme = 'blue'; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); - it('should configure custom icon associations', () => { - const options = getDefaultIconOptions(); - options.folders.associations = { - 'sample': 'src' - }; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); - expectedConfig.iconDefinitions = { - 'folder': { - 'iconPath': './../icons/folder.svg' - }, - 'folder-open': { - 'iconPath': './../icons/folder-open.svg' - }, - 'folder-root': { - 'iconPath': './../icons/folder-root.svg' - }, - 'folder-root-open': { - 'iconPath': './../icons/folder-root-open.svg' - }, - 'folder-src': { - 'iconPath': './../icons/folder-src.svg' - }, - 'folder-src-open': { - 'iconPath': './../icons/folder-src-open.svg' - }, - 'folder-angular': { - 'iconPath': './../icons/folder-angular.svg' - }, - 'folder-angular-open': { - 'iconPath': './../icons/folder-angular-open.svg' - } - }; - expectedConfig.folder = 'folder'; - expectedConfig.folderExpanded = 'folder-open'; - expectedConfig.rootFolder = 'folder-root'; - expectedConfig.rootFolderExpanded = 'folder-root-open'; - expectedConfig.folderNames = { - 'src': 'folder-src', - 'source': 'folder-src', - 'angular': 'folder-angular', - 'ng': 'folder-angular', - 'sample': 'folder-src' - }; - expectedConfig.folderNamesExpanded = { - 'src': 'folder-src-open', - 'source': 'folder-src-open', - 'angular': 'folder-angular-open', - 'ng': 'folder-angular-open', - 'sample': 'folder-src-open' - }; - expectedConfig.hidesExplorerArrows = false; - expectedConfig.options.folders.associations = { - 'sample': 'src' - }; + expectedConfig.iconDefinitions = { + 'folder-blue': { + iconPath: './../icons/folder-blue.svg', + }, + 'folder-blue-open': { + iconPath: './../icons/folder-blue-open.svg', + }, + 'folder-blue-src': { + iconPath: './../icons/folder-blue-src.svg', + }, + 'folder-blue-src-open': { + iconPath: './../icons/folder-blue-src-open.svg', + }, + }; + expectedConfig.folder = 'folder-blue'; + expectedConfig.folderExpanded = 'folder-blue-open'; + expectedConfig.rootFolder = 'folder-blue'; + expectedConfig.rootFolderExpanded = 'folder-blue-open'; + expectedConfig.folderNames = { + src: 'folder-blue-src', + source: 'folder-blue-src', + }; + expectedConfig.folderNamesExpanded = { + src: 'folder-blue-src-open', + source: 'folder-blue-src-open', + }; + expectedConfig.hidesExplorerArrows = false; + expectedConfig.options.folders.theme = 'blue'; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - it('should disable icon packs', () => { - const options = getDefaultIconOptions(); - options.activeIconPack = ''; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); - expectedConfig.iconDefinitions = { - 'folder': { - 'iconPath': './../icons/folder.svg' - }, - 'folder-open': { - 'iconPath': './../icons/folder-open.svg' - }, - 'folder-root': { - 'iconPath': './../icons/folder-root.svg' - }, - 'folder-root-open': { - 'iconPath': './../icons/folder-root-open.svg' - }, - 'folder-src': { - 'iconPath': './../icons/folder-src.svg' - }, - 'folder-src-open': { - 'iconPath': './../icons/folder-src-open.svg' - } - }; - expectedConfig.folder = 'folder'; - expectedConfig.folderExpanded = 'folder-open'; - expectedConfig.rootFolder = 'folder-root'; - expectedConfig.rootFolderExpanded = 'folder-root-open'; - expectedConfig.folderNames = { - 'src': 'folder-src', - 'source': 'folder-src' - }; - expectedConfig.folderNamesExpanded = { - 'src': 'folder-src-open', - 'source': 'folder-src-open' - }; - expectedConfig.hidesExplorerArrows = false; + it('should configure custom icon associations', () => { + const options = getDefaultIconOptions(); + options.folders.associations = { + sample: 'src', + }; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); + expectedConfig.iconDefinitions = { + folder: { + iconPath: './../icons/folder.svg', + }, + 'folder-open': { + iconPath: './../icons/folder-open.svg', + }, + 'folder-root': { + iconPath: './../icons/folder-root.svg', + }, + 'folder-root-open': { + iconPath: './../icons/folder-root-open.svg', + }, + 'folder-src': { + iconPath: './../icons/folder-src.svg', + }, + 'folder-src-open': { + iconPath: './../icons/folder-src-open.svg', + }, + 'folder-angular': { + iconPath: './../icons/folder-angular.svg', + }, + 'folder-angular-open': { + iconPath: './../icons/folder-angular-open.svg', + }, + }; + expectedConfig.folder = 'folder'; + expectedConfig.folderExpanded = 'folder-open'; + expectedConfig.rootFolder = 'folder-root'; + expectedConfig.rootFolderExpanded = 'folder-root-open'; + expectedConfig.folderNames = { + src: 'folder-src', + source: 'folder-src', + angular: 'folder-angular', + ng: 'folder-angular', + sample: 'folder-src', + }; + expectedConfig.folderNamesExpanded = { + src: 'folder-src-open', + source: 'folder-src-open', + angular: 'folder-angular-open', + ng: 'folder-angular-open', + sample: 'folder-src-open', + }; + expectedConfig.hidesExplorerArrows = false; + expectedConfig.options.folders.associations = { + sample: 'src', + }; - // disable default icon pack by using empty string - expectedConfig.options.activeIconPack = ''; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should disable icon packs', () => { + const options = getDefaultIconOptions(); + options.activeIconPack = ''; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); + expectedConfig.iconDefinitions = { + folder: { + iconPath: './../icons/folder.svg', + }, + 'folder-open': { + iconPath: './../icons/folder-open.svg', + }, + 'folder-root': { + iconPath: './../icons/folder-root.svg', + }, + 'folder-root-open': { + iconPath: './../icons/folder-root-open.svg', + }, + 'folder-src': { + iconPath: './../icons/folder-src.svg', + }, + 'folder-src-open': { + iconPath: './../icons/folder-src-open.svg', + }, + }; + expectedConfig.folder = 'folder'; + expectedConfig.folderExpanded = 'folder-open'; + expectedConfig.rootFolder = 'folder-root'; + expectedConfig.rootFolderExpanded = 'folder-root-open'; + expectedConfig.folderNames = { + src: 'folder-src', + source: 'folder-src', + }; + expectedConfig.folderNamesExpanded = { + src: 'folder-src-open', + source: 'folder-src-open', + }; + expectedConfig.hidesExplorerArrows = false; - it('should configure folder icons for light and high contrast', () => { - const options = getDefaultIconOptions(); - const lightHighContrastFolderIcons: FolderTheme[] = [ - { - name: 'specific', - defaultIcon: { name: 'folder', light: true, highContrast: true }, - rootFolder: { name: 'folder-root', light: true, highContrast: true }, - icons: [ - { name: 'folder-src', folderNames: ['src', 'source'], light: true, highContrast: true }, - ] - } - ]; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(lightHighContrastFolderIcons, iconConfig, options); + // disable default icon pack by using empty string + expectedConfig.options.activeIconPack = ''; - expectedConfig.iconDefinitions = { - 'folder': { - 'iconPath': './../icons/folder.svg' - }, - 'folder-open': { - 'iconPath': './../icons/folder-open.svg' - }, - 'folder_light': { - 'iconPath': './../icons/folder_light.svg' - }, - 'folder-open_light': { - 'iconPath': './../icons/folder-open_light.svg' - }, - 'folder_highContrast': { - 'iconPath': './../icons/folder_highContrast.svg' - }, - 'folder-open_highContrast': { - 'iconPath': './../icons/folder-open_highContrast.svg' - }, - 'folder-root': { - 'iconPath': './../icons/folder-root.svg' - }, - 'folder-root-open': { - 'iconPath': './../icons/folder-root-open.svg' - }, - 'folder-root_light': { - 'iconPath': './../icons/folder-root_light.svg' - }, - 'folder-root-open_light': { - 'iconPath': './../icons/folder-root-open_light.svg' - }, - 'folder-root_highContrast': { - 'iconPath': './../icons/folder-root_highContrast.svg' - }, - 'folder-root-open_highContrast': { - 'iconPath': './../icons/folder-root-open_highContrast.svg' - }, - 'folder-src': { - 'iconPath': './../icons/folder-src.svg' - }, - 'folder-src-open': { - 'iconPath': './../icons/folder-src-open.svg' - }, - 'folder-src_light': { - 'iconPath': './../icons/folder-src_light.svg' - }, - 'folder-src-open_light': { - 'iconPath': './../icons/folder-src-open_light.svg' - }, - 'folder-src_highContrast': { - 'iconPath': './../icons/folder-src_highContrast.svg' - }, - 'folder-src-open_highContrast': { - 'iconPath': './../icons/folder-src-open_highContrast.svg' - } - }; - expectedConfig.folder = 'folder'; - expectedConfig.folderExpanded = 'folder-open'; - expectedConfig.rootFolder = 'folder-root'; - expectedConfig.rootFolderExpanded = 'folder-root-open'; - expectedConfig.folderNames = { - 'src': 'folder-src', - 'source': 'folder-src' - }; - expectedConfig.folderNamesExpanded = { - 'src': 'folder-src-open', - 'source': 'folder-src-open' - }; - expectedConfig.light = { - fileExtensions: {}, - fileNames: {}, - folder: 'folder_light', - folderExpanded: 'folder-open_light', - rootFolder: 'folder-root_light', - rootFolderExpanded: 'folder-root-open_light', - folderNames: { - 'src': 'folder-src_light', - 'source': 'folder-src_light' - }, - folderNamesExpanded: { - 'src': 'folder-src-open_light', - 'source': 'folder-src-open_light' - }, - }; - expectedConfig.highContrast = { - fileExtensions: {}, - fileNames: {}, - folder: 'folder_highContrast', - folderExpanded: 'folder-open_highContrast', - rootFolder: 'folder-root_highContrast', - rootFolderExpanded: 'folder-root-open_highContrast', - folderNames: { - 'src': 'folder-src_highContrast', - 'source': 'folder-src_highContrast' - }, - folderNamesExpanded: { - 'src': 'folder-src-open_highContrast', - 'source': 'folder-src-open_highContrast' - } - }; - expectedConfig.hidesExplorerArrows = false; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should configure folder icons for light and high contrast', () => { + const options = getDefaultIconOptions(); + const lightHighContrastFolderIcons: FolderTheme[] = [ + { + name: 'specific', + defaultIcon: { name: 'folder', light: true, highContrast: true }, + rootFolder: { name: 'folder-root', light: true, highContrast: true }, + icons: [ + { + name: 'folder-src', + folderNames: ['src', 'source'], + light: true, + highContrast: true, + }, + ], + }, + ]; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + lightHighContrastFolderIcons, + iconConfig, + options + ); + /* eslint-disable camelcase */ + expectedConfig.iconDefinitions = { + folder: { + iconPath: './../icons/folder.svg', + }, + 'folder-open': { + iconPath: './../icons/folder-open.svg', + }, + folder_light: { + iconPath: './../icons/folder_light.svg', + }, + 'folder-open_light': { + iconPath: './../icons/folder-open_light.svg', + }, + folder_highContrast: { + iconPath: './../icons/folder_highContrast.svg', + }, + 'folder-open_highContrast': { + iconPath: './../icons/folder-open_highContrast.svg', + }, + 'folder-root': { + iconPath: './../icons/folder-root.svg', + }, + 'folder-root-open': { + iconPath: './../icons/folder-root-open.svg', + }, + 'folder-root_light': { + iconPath: './../icons/folder-root_light.svg', + }, + 'folder-root-open_light': { + iconPath: './../icons/folder-root-open_light.svg', + }, + 'folder-root_highContrast': { + iconPath: './../icons/folder-root_highContrast.svg', + }, + 'folder-root-open_highContrast': { + iconPath: './../icons/folder-root-open_highContrast.svg', + }, + 'folder-src': { + iconPath: './../icons/folder-src.svg', + }, + 'folder-src-open': { + iconPath: './../icons/folder-src-open.svg', + }, + 'folder-src_light': { + iconPath: './../icons/folder-src_light.svg', + }, + 'folder-src-open_light': { + iconPath: './../icons/folder-src-open_light.svg', + }, + 'folder-src_highContrast': { + iconPath: './../icons/folder-src_highContrast.svg', + }, + 'folder-src-open_highContrast': { + iconPath: './../icons/folder-src-open_highContrast.svg', + }, + }; + expectedConfig.folder = 'folder'; + expectedConfig.folderExpanded = 'folder-open'; + expectedConfig.rootFolder = 'folder-root'; + expectedConfig.rootFolderExpanded = 'folder-root-open'; + expectedConfig.folderNames = { + src: 'folder-src', + source: 'folder-src', + }; + expectedConfig.folderNamesExpanded = { + src: 'folder-src-open', + source: 'folder-src-open', + }; + expectedConfig.light = { + fileExtensions: {}, + fileNames: {}, + folder: 'folder_light', + folderExpanded: 'folder-open_light', + rootFolder: 'folder-root_light', + rootFolderExpanded: 'folder-root-open_light', + folderNames: { + src: 'folder-src_light', + source: 'folder-src_light', + }, + folderNamesExpanded: { + src: 'folder-src-open_light', + source: 'folder-src-open_light', + }, + }; + expectedConfig.highContrast = { + fileExtensions: {}, + fileNames: {}, + folder: 'folder_highContrast', + folderExpanded: 'folder-open_highContrast', + rootFolder: 'folder-root_highContrast', + rootFolderExpanded: 'folder-root-open_highContrast', + folderNames: { + src: 'folder-src_highContrast', + source: 'folder-src_highContrast', + }, + folderNamesExpanded: { + src: 'folder-src-open_highContrast', + source: 'folder-src-open_highContrast', + }, + }; + expectedConfig.hidesExplorerArrows = false; + /* eslint-enable camelcase */ + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - it('should hide explorer arrows', () => { - const options = getDefaultIconOptions(); - options.hidesExplorerArrows = true; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadFolderIconDefinitions(folderIcons, iconConfig, options); + it('should hide explorer arrows', () => { + const options = getDefaultIconOptions(); + options.hidesExplorerArrows = true; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadFolderIconDefinitions( + folderIcons, + iconConfig, + options + ); - assert.deepStrictEqual(iconDefinitions.hidesExplorerArrows, true); - }); + assert.deepStrictEqual(iconDefinitions.hidesExplorerArrows, true); + }); }); diff --git a/src/test/spec/icons/languageIcons.spec.ts b/src/test/spec/icons/languageIcons.spec.ts index 07e71a75dd..2a7973034c 100644 --- a/src/test/spec/icons/languageIcons.spec.ts +++ b/src/test/spec/icons/languageIcons.spec.ts @@ -1,154 +1,184 @@ import * as assert from 'assert'; import * as merge from 'lodash.merge'; -import { getDefaultIconOptions, loadLanguageIconDefinitions } from '../../../icons/index'; -import { IconConfiguration, IconPack, LanguageIcon } from '../../../models/index'; +import { + getDefaultIconOptions, + loadLanguageIconDefinitions, +} from '../../../icons/index'; +import { + IconConfiguration, + IconPack, + LanguageIcon, +} from '../../../models/index'; describe('language icons', () => { - let expectedConfig: IconConfiguration; + let expectedConfig: IconConfiguration; - beforeEach(() => { - expectedConfig = merge({}, new IconConfiguration(), { options: getDefaultIconOptions() }); + beforeEach(() => { + expectedConfig = merge({}, new IconConfiguration(), { + options: getDefaultIconOptions(), }); + }); - it('should configure icon definitions', () => { - const languageIcons: LanguageIcon[] = [ - { icon: { name: 'a' }, ids: ['a'] }, - { icon: { name: 'b' }, ids: ['b'] }, - { icon: { name: 'c' }, ids: ['c', 'd'], }, - ]; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, options); + it('should configure icon definitions', () => { + const languageIcons: LanguageIcon[] = [ + { icon: { name: 'a' }, ids: ['a'] }, + { icon: { name: 'b' }, ids: ['b'] }, + { icon: { name: 'c' }, ids: ['c', 'd'] }, + ]; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + options + ); - expectedConfig.iconDefinitions = { - 'a': { - 'iconPath': './../icons/a.svg' - }, - 'b': { - 'iconPath': './../icons/b.svg' - }, - 'c': { - 'iconPath': './../icons/c.svg' - } - }; - expectedConfig.languageIds = { - 'a': 'a', - 'b': 'b', - 'c': 'c', - 'd': 'c' - }; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); - - it('should disable icon definitions', () => { - const languageIcons: LanguageIcon[] = [ - { icon: { name: 'a' }, ids: ['a'] }, - { icon: { name: 'c' }, ids: ['c', 'd'], disabled: true }, - ]; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, options); + expectedConfig.iconDefinitions = { + a: { + iconPath: './../icons/a.svg', + }, + b: { + iconPath: './../icons/b.svg', + }, + c: { + iconPath: './../icons/c.svg', + }, + }; + expectedConfig.languageIds = { + a: 'a', + b: 'b', + c: 'c', + d: 'c', + }; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - expectedConfig.iconDefinitions = { - 'a': { - 'iconPath': './../icons/a.svg' - } - }; - expectedConfig.languageIds = { - 'a': 'a' - }; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should disable icon definitions', () => { + const languageIcons: LanguageIcon[] = [ + { icon: { name: 'a' }, ids: ['a'] }, + { icon: { name: 'c' }, ids: ['c', 'd'], disabled: true }, + ]; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + options + ); - it('should disable icon packs', () => { - const languageIcons: LanguageIcon[] = [ - { icon: { name: 'a' }, ids: ['a'], enabledFor: [IconPack.Angular] }, - { icon: { name: 'c' }, ids: ['c', 'd'], disabled: true }, - ]; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, { ...options, activeIconPack: '' }); + expectedConfig.iconDefinitions = { + a: { + iconPath: './../icons/a.svg', + }, + }; + expectedConfig.languageIds = { + a: 'a', + }; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - expectedConfig.iconDefinitions = {}; - expectedConfig.languageIds = {}; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should disable icon packs', () => { + const languageIcons: LanguageIcon[] = [ + { icon: { name: 'a' }, ids: ['a'], enabledFor: [IconPack.Angular] }, + { icon: { name: 'c' }, ids: ['c', 'd'], disabled: true }, + ]; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + { ...options, activeIconPack: '' } + ); - it('should configure language icons for light and high contrast', () => { - const languageIcons: LanguageIcon[] = [ - { icon: { name: 'a', light: true, highContrast: true }, ids: ['a'] }, - { icon: { name: 'b', light: true, highContrast: true }, ids: ['b'] }, - ]; - const options = getDefaultIconOptions(); - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, options); + expectedConfig.iconDefinitions = {}; + expectedConfig.languageIds = {}; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - expectedConfig.iconDefinitions = { - 'a': { - 'iconPath': './../icons/a.svg' - }, - 'a_light': { - 'iconPath': './../icons/a_light.svg' - }, - 'a_highContrast': { - 'iconPath': './../icons/a_highContrast.svg' - }, - 'b': { - 'iconPath': './../icons/b.svg' - }, - 'b_light': { - 'iconPath': './../icons/b_light.svg' - }, - 'b_highContrast': { - 'iconPath': './../icons/b_highContrast.svg' - } - }; - expectedConfig.languageIds = { - 'a': 'a', - 'b': 'b' - }; - expectedConfig.light = { - fileExtensions: {}, - fileNames: {}, - languageIds: { - 'a': 'a_light', - 'b': 'b_light' - } - }; - expectedConfig.highContrast = { - fileExtensions: {}, - fileNames: {}, - languageIds: { - 'a': 'a_highContrast', - 'b': 'b_highContrast' - } - }; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + it('should configure language icons for light and high contrast', () => { + const languageIcons: LanguageIcon[] = [ + { icon: { name: 'a', light: true, highContrast: true }, ids: ['a'] }, + { icon: { name: 'b', light: true, highContrast: true }, ids: ['b'] }, + ]; + const options = getDefaultIconOptions(); + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + options + ); + /* eslint-disable camelcase */ + expectedConfig.iconDefinitions = { + a: { + iconPath: './../icons/a.svg', + }, + a_light: { + iconPath: './../icons/a_light.svg', + }, + a_highContrast: { + iconPath: './../icons/a_highContrast.svg', + }, + b: { + iconPath: './../icons/b.svg', + }, + b_light: { + iconPath: './../icons/b_light.svg', + }, + b_highContrast: { + iconPath: './../icons/b_highContrast.svg', + }, + }; + expectedConfig.languageIds = { + a: 'a', + b: 'b', + }; + expectedConfig.light = { + fileExtensions: {}, + fileNames: {}, + languageIds: { + a: 'a_light', + b: 'b_light', + }, + }; + expectedConfig.highContrast = { + fileExtensions: {}, + fileNames: {}, + languageIds: { + a: 'a_highContrast', + b: 'b_highContrast', + }, + }; + /* eslint-enable camelcase */ + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); - it('should configure custom icon associations', () => { - const languageIcons: LanguageIcon[] = [ - { icon: { name: 'json' }, ids: ['a'] } - ]; - const options = getDefaultIconOptions(); - options.languages.associations = { - 'xml': 'json' - }; - const iconConfig = merge({}, new IconConfiguration(), { options }); - const iconDefinitions = loadLanguageIconDefinitions(languageIcons, iconConfig, options); + it('should configure custom icon associations', () => { + const languageIcons: LanguageIcon[] = [ + { icon: { name: 'json' }, ids: ['a'] }, + ]; + const options = getDefaultIconOptions(); + options.languages.associations = { + xml: 'json', + }; + const iconConfig = merge({}, new IconConfiguration(), { options }); + const iconDefinitions = loadLanguageIconDefinitions( + languageIcons, + iconConfig, + options + ); - expectedConfig.iconDefinitions = { - 'json': { - 'iconPath': './../icons/json.svg' - } - }; - expectedConfig.languageIds = { - 'a': 'json', - 'xml': 'json' - }; - expectedConfig.options.languages.associations = { - 'xml': 'json' - }; - assert.deepStrictEqual(iconDefinitions, expectedConfig); - }); + expectedConfig.iconDefinitions = { + json: { + iconPath: './../icons/json.svg', + }, + }; + expectedConfig.languageIds = { + a: 'json', + xml: 'json', + }; + expectedConfig.options.languages.associations = { + xml: 'json', + }; + assert.deepStrictEqual(iconDefinitions, expectedConfig); + }); }); diff --git a/src/test/spec/index.ts b/src/test/spec/index.ts index b2db33b442..1042bf8e53 100644 --- a/src/test/spec/index.ts +++ b/src/test/spec/index.ts @@ -3,34 +3,34 @@ import * as Mocha from 'mocha'; import * as path from 'path'; export const run = (): Promise => { - // Create the mocha test - const mocha = new Mocha({ - ui: 'bdd', - }); + // Create the mocha test + const mocha = new Mocha({ + ui: 'bdd', + }); - const testsRoot = path.resolve(__dirname, '..'); + const testsRoot = path.resolve(__dirname, '..'); - return new Promise((c, e) => { - glob('**/*.spec.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } + return new Promise((c, e) => { + glob('**/*.spec.js', { cwd: testsRoot }, (err, files) => { + if (err) { + return e(err); + } - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + // Add files to the test suite + files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); - try { - // Run the mocha test - mocha.run(failures => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - e(err); - } + try { + // Run the mocha test + mocha.run((failures) => { + if (failures > 0) { + e(new Error(`${failures} tests failed.`)); + } else { + c(); + } }); + } catch (err) { + e(err); + } }); + }); }; diff --git a/tsconfig.json b/tsconfig.json index 4952a79cf7..145c9aad51 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,17 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "outDir": "out", - "lib": [ - "es6", - "dom" - ], - "sourceMap": true, - "rootDir": "src", - "noUnusedLocals": true, - "noUnusedParameters": true - }, - "include": [ - "src/**/*.ts", - "./node_modules/vscode/vscode.d.ts", - "./node_modules/vscode/lib/*", - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "out", + "lib": ["es6", "dom"], + "sourceMap": true, + "rootDir": "src", + "noUnusedLocals": true, + "noUnusedParameters": true + }, + "include": [ + "src/**/*.ts", + "./node_modules/vscode/vscode.d.ts", + "./node_modules/vscode/lib/*" + ] +} diff --git a/webpack.config.js b/webpack.config.js index a5f81cf343..c4e81580f4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,37 +4,35 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const path = require('path'); const config = { - target: 'node', - node: { - __dirname: false, - __filename: false, - }, - entry: './src/extension.ts', - plugins: [ - new CleanWebpackPlugin(), + target: 'node', + node: { + __dirname: false, + __filename: false, + }, + entry: './src/extension.ts', + plugins: [new CleanWebpackPlugin()], + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'extension.js', + libraryTarget: 'commonjs2', + devtoolModuleFilenameTemplate: '../[resource-path]', + }, + devtool: 'source-map', + externals: { + vscode: 'commonjs vscode', + }, + resolve: { + extensions: ['.ts', '.js'], + }, + module: { + rules: [ + { + test: /\.ts$/, + exclude: /node_modules/, + use: 'ts-loader', + }, ], - output: { - path: path.resolve(__dirname, 'dist'), - filename: 'extension.js', - libraryTarget: 'commonjs2', - devtoolModuleFilenameTemplate: '../[resource-path]' - }, - devtool: 'source-map', - externals: { - vscode: 'commonjs vscode' - }, - resolve: { - extensions: ['.ts', '.js'] - }, - module: { - rules: [ - { - test: /\.ts$/, - exclude: /node_modules/, - use: 'ts-loader' - } - ] - } + }, }; -module.exports = config; \ No newline at end of file +module.exports = config;