Feat/remove icons (#310)

* feat(Icons removal): Removed all related icons commands and files

* chore: fix (remove) all gulp related imports and task for icons

* chore: removed extensions folder and switch all imports (+ small fixes)

* chore: re-added defaults.json on root

* feat(Icons removal): Added vsc-material-theme-icons dependency
This commit is contained in:
Alessio Occhipinti 2019-01-31 21:35:51 +01:00 committed by Mattia Astorino
parent 6f5dd30e11
commit 50c057184c
77 changed files with 347 additions and 3253 deletions

9
.gitignore vendored
View file

@ -1,15 +1,8 @@
*.log *.log
*.~lock *.~lock
*.js
!src/icons/partials/*.js
**/*.map **/*.map
*.gulp/**.js out/
dist/
node_modules/ node_modules/
.DS_Store .DS_Store
/themes /themes
/icons
/src/icons/svgs/*.svg
.tmp-output-remote-icons
_tmp-output-remote-icons
/ui/ /ui/

View file

@ -1,7 +1,5 @@
export const HR: string = '\n———————————————————————————————————————————————————————————————\n'; export const HR: string = '\n———————————————————————————————————————————————————————————————\n';
export const MESSAGE_BUMP_ERROR: string = ' There was an issue bumping version:\n'; export const MESSAGE_BUMP_ERROR: string = ' There was an issue bumping version:\n';
export const MESSAGE_BUMP_SUCCESS: string = ' Finished successfully\n'; export const MESSAGE_BUMP_SUCCESS: string = ' Finished successfully\n';
export const MESSAGE_ICON_ERROR: string = 'There is an error with JSON generated for icons';
export const MESSAGE_ICON_ACCENTS_ERROR: string = 'Failed to create accents icon themes, please read the log file.';
export const MESSAGE_GENERATED: string = 'Generated'; export const MESSAGE_GENERATED: string = 'Generated';
export const MESSAGE_THEME_VARIANT_PARSE_ERROR: string = 'Error when parsing json for theme variants'; export const MESSAGE_THEME_VARIANT_PARSE_ERROR: string = 'Error when parsing json for theme variants';

View file

@ -1,12 +1,7 @@
// export the tasks // export the tasks
export * from './tasks/icons';
export * from './tasks/icons-accents';
export * from './tasks/icons-variants';
export * from './tasks/icons-variants-json';
export * from './tasks/themes'; export * from './tasks/themes';
export * from './tasks/watcher'; export * from './tasks/watcher';
export * from './tasks/changelog-title'; export * from './tasks/changelog-title';
export * from './tasks/get-remote-icons';
export * from './tasks/copy-ui'; export * from './tasks/copy-ui';
// export default script // export default script

View file

@ -1,20 +0,0 @@
export interface IIcon {
/**
* Icon filename
* @type {string}
* @memberof IIcon
*/
filename: string;
/**
* If set to true, the icon is marked as last
* @type {boolean}
* @memberof IIcon
*/
last: boolean;
/**
* Icon's name
* @type {string}
* @memberof IIcon
*/
name: string;
}

View file

@ -1,8 +0,0 @@
import {IThemeIconsItem} from './itheme-icons-item';
export interface IThemeIconsAccents {
iconDefinitions: {
_folder_open: IThemeIconsItem;
_folder_open_build: IThemeIconsItem;
};
}

View file

@ -1,3 +0,0 @@
export interface IThemeIconsItem {
iconPath: string;
}

View file

@ -1,17 +0,0 @@
import {IThemeIconsItem} from './itheme-icons-item';
export interface IThemeIconsVariants {
iconDefinitions: {
_folder_dark: IThemeIconsItem;
_folder_dark_build: IThemeIconsItem;
_folder_light: IThemeIconsItem;
_folder_light_build: IThemeIconsItem;
_folder_vscode: IThemeIconsItem;
_folder_gulp: IThemeIconsItem;
_folder_node: IThemeIconsItem;
_folder_images: IThemeIconsItem;
_folder_js: IThemeIconsItem;
_folder_src: IThemeIconsItem;
_folder_assets: IThemeIconsItem;
};
}

View file

@ -1,6 +1,6 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import {CHARSET} from './../../extensions/consts/files'; import {CHARSET} from '../../src/consts/files';
export default gulp.task('changelog-title', () => { export default gulp.task('changelog-title', () => {
fs.writeFileSync( fs.writeFileSync(

View file

@ -2,18 +2,18 @@ import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import {PATHS} from '../../extensions/consts/paths'; import {PATHS} from '../../src/consts/paths';
import {ensureDir} from '../../extensions/helpers/fs'; import {ensureDir} from '../../src/helpers/fs';
export default gulp.task('build:copy-ui', callback => { export default gulp.task('build:copy-ui', callback => {
try { try {
ensureDir(path.resolve(PATHS.UI)); ensureDir(path.resolve(PATHS.UI));
fs.copyFileSync( fs.copyFileSync(
path.join(PATHS.EXT_DIR, 'webviews', 'ui', 'release-notes', 'release-notes.html'), path.join(PATHS.SRC, 'webviews', 'ui', 'release-notes', 'release-notes.html'),
path.join(PATHS.UI, 'release-notes.html') path.join(PATHS.UI, 'release-notes.html')
); );
fs.copyFileSync( fs.copyFileSync(
path.join(PATHS.EXT_DIR, 'webviews', 'ui', 'release-notes', 'style.css'), path.join(PATHS.SRC, 'webviews', 'ui', 'release-notes', 'style.css'),
path.join(PATHS.UI, 'release-notes.css') path.join(PATHS.UI, 'release-notes.css')
); );
} catch (error) { } catch (error) {

View file

@ -1,33 +0,0 @@
import * as path from 'path';
import * as gulp from 'gulp';
import * as execa from 'execa';
import * as rimraf from 'rimraf';
import {ncp} from 'ncp';
const pCopy = (src: string, dest: string) => new Promise((resolve, reject) =>
ncp(src, dest, err => err ? reject(err) : resolve())
);
const pRm = (dir: string) => new Promise((resolve, reject) =>
rimraf(dir, (err: any) => err ? reject(err) : resolve())
);
/**
* Get remote Material Icons
*/
export default gulp.task('build:get-remote-icons', callback => {
const src = 'ssh://equinsuocha@vs-ssh.visualstudio.com:22/vsc-material-theme-icons/_ssh/vsc-material-theme-icons';
const tmpDest = './_tmp-output-remote-icons';
const dest = './src/icons/svgs';
execa('git', [
'clone',
'--depth=1',
src,
tmpDest
])
.then(() => pCopy(path.join(tmpDest, dest), dest))
.then(() => pRm(tmpDest))
.then(() => callback())
.catch((err: any) => callback(err.message));
});

View file

@ -1,111 +0,0 @@
import * as fs from 'fs';
import * as gulp from 'gulp';
import * as gutil from 'gulp-util';
import * as path from 'path';
import {MESSAGE_GENERATED, MESSAGE_ICON_ACCENTS_ERROR} from './../consts/log';
import {CHARSET} from './../../extensions/consts/files';
import {IThemeIconsAccents} from './../interfaces/itheme-icons-accents';
import PATHS from './../../extensions/consts/paths';
import {IThemeIconsItem} from './../interfaces/itheme-icons-item';
import {getAccentableIcons, getDefaultValues} from './../../extensions/helpers/fs';
const BASE_ICON_THEME_PATH: string = path.join(process.cwd(), PATHS.THEMES, './Material-Theme-Icons.json');
const DEFAULTS = getDefaultValues();
/**
* Normalizes icon path
*/
function normalizeIconPath(iconPath: string): string {
return path.join(process.cwd(), PATHS.ICONS, iconPath);
}
/**
* Replaces a file name with the accented filename
*/
function replaceNameWithAccent(name: string, accentName: string): string {
return name.replace('.svg', `.accent.${ accentName }.svg`);
}
/**
* Replaces a SVG colour
*/
export function replaceSVGColour(filecontent: string, colour: string): string {
return filecontent.replace(new RegExp('#(80CBC4)', 'i'), ($0, $1) => {
const newColour = colour.replace('#', '');
console.log(`Replacing colour ${ $1 } with ${ newColour }`);
return $0.replace($1, newColour);
});
}
/**
* Replaces white spaces in accents' names
*/
function replaceWhiteSpaces(input: string): string {
return input.replace(/\s+/g, '-');
}
/**
* Writes a new svg file
*/
function writeSVGIcon(fromFile: string, toFile: string, accent: string): void {
const fileContent: string = fs.readFileSync(normalizeIconPath(fromFile), CHARSET);
const content: string = replaceSVGColour(fileContent, DEFAULTS.accents[accent]);
const pathToFile = normalizeIconPath(toFile);
gutil.log(gutil.colors.gray(`Accented icon ${pathToFile} created with colour ${ accent } (${ DEFAULTS.accents[accent] })`));
fs.writeFileSync(pathToFile, content);
}
// Exports task to index.ts
export default gulp.task('build:icons.accents', cb => {
let basetheme: IThemeIconsAccents;
try {
basetheme = require(BASE_ICON_THEME_PATH);
Object.keys(DEFAULTS.accents).forEach(key => {
const iconName = replaceWhiteSpaces(key);
const themecopy: IThemeIconsAccents = JSON.parse(JSON.stringify(basetheme));
const themePath: string = path.join(PATHS.THEMES, `./Material-Theme-Icons-${ key }.json`);
getAccentableIcons().forEach(accentableIconName => {
gutil.log(gutil.colors.gray(`Preparing ${ accentableIconName } accented icon`));
const iconOriginDefinition: IThemeIconsItem = (basetheme.iconDefinitions as any)[accentableIconName];
const iconCopyDefinition: IThemeIconsItem = (themecopy.iconDefinitions as any)[accentableIconName];
if (iconOriginDefinition !== undefined && typeof iconOriginDefinition.iconPath === 'string' && iconCopyDefinition !== undefined && typeof iconCopyDefinition.iconPath === 'string') {
iconCopyDefinition.iconPath = replaceNameWithAccent(iconOriginDefinition.iconPath, iconName);
writeSVGIcon(iconOriginDefinition.iconPath, iconCopyDefinition.iconPath, key);
} else {
gutil.log(gutil.colors.yellow(`Icon ${ accentableIconName } not found`));
}
});
// themecopy.iconDefinitions._folder_open.iconPath = replaceNameWithAccent(basetheme.iconDefinitions._folder_open.iconPath, iconName);
// themecopy.iconDefinitions._folder_open_build.iconPath = replaceNameWithAccent(basetheme.iconDefinitions._folder_open_build.iconPath, iconName);
// writeSVGIcon(basetheme.iconDefinitions._folder_open.iconPath, themecopy.iconDefinitions._folder_open.iconPath, key);
// writeSVGIcon(basetheme.iconDefinitions._folder_open_build.iconPath, themecopy.iconDefinitions._folder_open_build.iconPath, key);
// fs.writeFileSync(themePath, JSON.stringify(themecopy));
// addContributeIconTheme(id, label, themepathJSON, PACKAGE_JSON);
gutil.log(gutil.colors.green(MESSAGE_GENERATED, themePath));
});
// writePackageJSON(PACKAGE_JSON);
} catch (error) {
// http://ragefaces.memesoftware.com/faces/large/misc-le-fu-l.png
gutil.log(gutil.colors.red(MESSAGE_ICON_ACCENTS_ERROR));
cb(error);
return;
}
cb();
});

View file

@ -1,37 +0,0 @@
import * as fs from 'fs';
import * as gulp from 'gulp';
import {resolve} from 'path';
import {IDefaultsThemeIconVariant} from './../../extensions/interfaces/idefaults';
import {getDefaultValues, getVariantIcons} from './../../extensions/helpers/fs';
import {PATHS} from '../../extensions/consts/paths';
import {CHARSET} from '../../extensions/consts/files';
/**
* For each ThemeIconVariant create a Material-Theme-Icons-{variant}.json
* depends on default Material-Theme-Icons.json
*/
export default gulp.task('build:icons.variants-json', callback => {
try {
const variants: IDefaultsThemeIconVariant = getDefaultValues().themeIconVariants;
const defaults = fs.readFileSync(resolve(`${PATHS.THEMES}/Material-Theme-Icons.json`), 'utf8');
Object.keys(variants).forEach(variantName => {
const jsonDefaults = JSON.parse(defaults);
getVariantIcons().forEach(iconname => {
const newIconPath = jsonDefaults.iconDefinitions[iconname].iconPath.replace('.svg', `${variantName}.svg`);
jsonDefaults.iconDefinitions[iconname].iconPath = newIconPath;
fs.writeFileSync(
`${PATHS.THEMES}/Material-Theme-Icons-${variantName}.json`,
JSON.stringify(jsonDefaults),
{encoding: CHARSET}
);
});
});
} catch (error) {
return callback(error);
}
callback();
});

View file

@ -1,63 +0,0 @@
import * as gulp from 'gulp';
import * as path from 'path';
import * as fs from 'fs';
import {IThemeIconsVariants} from '../interfaces/itheme-icons-variants';
import {CHARSET} from './../../extensions/consts/files';
import PATHS from './../../extensions/consts/paths';
import {getDefaultValues, getVariantIcons, getPackageJSON} from './../../extensions/helpers/fs';
import {IDefaultsThemeVariant} from './../../extensions/interfaces/idefaults';
import {IThemeIconsItem} from './../interfaces/itheme-icons-item';
const PACKAGE_JSON = getPackageJSON();
const variants: IDefaultsThemeVariant = getDefaultValues().themeVariantsColours;
const writeIconVariant = (filepath: string, destpath: string, colour: string): void => {
const regexp = new RegExp('(#4a616c)', 'i');
const finalFilePath = path.join(process.cwd(), PATHS.ICONS, filepath);
const finalDestpath = path.join(process.cwd(), PATHS.ICONS, destpath);
fs.writeFileSync(
finalDestpath,
fs.readFileSync(finalFilePath, CHARSET)
.replace(regexp, ($0, $1) => $0.replace($1, colour)), {encoding: CHARSET}
);
};
export default gulp.task('build:icons.variants', callback => {
try {
Object.keys(variants).forEach(variantName => {
PACKAGE_JSON.contributes.iconThemes.forEach(contribute => {
const regexpCheck: RegExp = new RegExp(Object.keys(variants).join('|'), 'i');
if (regexpCheck.test(contribute.path) || regexpCheck.test(contribute.id)) {
return;
}
const basepath: string = path.join(process.cwd(), contribute.path);
const basetheme: IThemeIconsVariants = require(basepath);
const theme: IThemeIconsVariants = JSON.parse(JSON.stringify(basetheme));
const variant = variants[variantName];
getVariantIcons().forEach(iconName => {
const basethemeIcon: IThemeIconsItem = (basetheme.iconDefinitions as any)[iconName];
const themeIcon: IThemeIconsItem = (theme.iconDefinitions as any)[iconName];
if (themeIcon !== undefined) {
themeIcon.iconPath = themeIcon.iconPath.replace('.svg', `${ variantName }.svg`);
}
if (basethemeIcon !== undefined && themeIcon !== undefined) {
writeIconVariant(basethemeIcon.iconPath, themeIcon.iconPath, variant);
}
});
});
});
} catch (error) {
callback(error);
return;
}
callback();
});

View file

@ -1,82 +0,0 @@
import * as fs from 'fs';
import * as gulp from 'gulp';
import * as gutil from 'gulp-util';
import * as mustache from 'mustache';
import * as path from 'path';
import {HR, MESSAGE_GENERATED, MESSAGE_ICON_ERROR} from './../consts/log';
import {CHARSET} from './../../extensions/consts/files';
import {IGenericObject} from './../../extensions/interfaces/igeneric-object';
import {IIcon} from './../interfaces/iicon';
import paths from './../../extensions/consts/paths';
import {ensureDir} from './../../extensions/helpers/fs';
/**
* Returns an object implementing the IIcon interface
*/
const iconFactory = (fileName: string): IIcon => {
gutil.log(gutil.colors.gray(`Processing icon ${ fileName }`));
let name: string = path.basename(fileName, path.extname(fileName));
const filename: string = name;
const last: boolean = false;
// renaming icon for vscode
// if the icon filename starts with a folder prefix,
// the resulting name will be prefixed only by an underscore,
// otherwise the icon will be prefixed by a _file_ prefix
if (name.indexOf('folder')) {
name = name.indexOf('file') ? `_file_${ name }` : `_${ name }`;
} else {
name = `_${ name }`;
}
gutil.log(gutil.colors.gray(`VSCode icon name ${ name } with filename ${ filename }`));
return {filename, name, last} as IIcon;
};
/**
* > Build Icons
* @returns {gulp.Gulp}
*/
export default gulp.task('build:icons', cb => {
let contents: string;
const fileNames: string[] = fs.readdirSync(path.join(paths.SRC, './icons/svgs'));
const icons: IIcon[] = fileNames.map(fileName => iconFactory(fileName));
const partials: string[] = fs.readdirSync(path.join(paths.SRC, './icons/partials'));
const partialsData: IGenericObject<any> = {};
const pathTemp: string = './themes/.material-theme-icons.tmp';
ensureDir(path.join(paths.THEMES));
icons[icons.length - 1].last = true;
partials.forEach(partial => {
partialsData[path.basename(partial, path.extname(partial))] = fs.readFileSync(
path.join(paths.SRC, './icons/partials', `./${partial}`
), CHARSET);
});
contents = mustache.render(
fs.readFileSync(path.join(paths.SRC, './icons/icons-theme.json'), CHARSET),
{icons},
partialsData
);
try {
contents = JSON.stringify(JSON.parse(contents), null, 2);
} catch (error) {
gutil.log(gutil.colors.red(MESSAGE_ICON_ERROR), error);
cb(error);
return;
}
fs.writeFileSync(pathTemp, contents, {encoding: CHARSET});
gutil.log(gutil.colors.gray(HR));
gutil.log(MESSAGE_GENERATED, gutil.colors.green(pathTemp));
gutil.log(gutil.colors.gray(HR));
cb();
});

View file

@ -6,10 +6,10 @@ import * as path from 'path';
import {HR, MESSAGE_GENERATED, MESSAGE_THEME_VARIANT_PARSE_ERROR} from './../consts/log'; import {HR, MESSAGE_GENERATED, MESSAGE_THEME_VARIANT_PARSE_ERROR} from './../consts/log';
import {CHARSET} from './../../extensions/consts/files'; import {CHARSET} from './../../src/consts/files';
import {IThemeVariant} from './../interfaces/itheme-variant'; import {IThemeVariant} from './../interfaces/itheme-variant';
import paths from './../../extensions/consts/paths'; import paths from './../../src/consts/paths';
import {ensureDir, getDefaultValues} from './../../extensions/helpers/fs'; import {ensureDir, getDefaultValues} from './../../src/helpers/fs';
const commons = getDefaultValues(); const commons = getDefaultValues();

View file

@ -1,7 +1,7 @@
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as path from 'path'; import * as path from 'path';
import Paths from './../../extensions/consts/paths'; import Paths from './../../src/consts/paths';
/* /*
* > Watcher * > Watcher

20
.vscode/launch.json vendored
View file

@ -4,24 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{
"type": "node",
"request": "launch",
"name": "Gulp build-icons-variants",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"args": [
"build:icons.variants"
]
},
{
"type": "node",
"request": "launch",
"name": "Gulp build-icons",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"args": [
"build:icons.accents"
]
},
{ {
"name": "Launch Extension", "name": "Launch Extension",
"type": "extensionHost", "type": "extensionHost",
@ -53,4 +35,4 @@
"preLaunchTask": "npm" "preLaunchTask": "npm"
} }
] ]
} }

View file

@ -9,9 +9,6 @@
"**/.hg": true, "**/.hg": true,
"**/CVS": true, "**/CVS": true,
"**/.DS_Store": true, "**/.DS_Store": true,
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.js.map": true "**/*.js.map": true
}, },
"files.associations": { "files.associations": {
@ -27,4 +24,4 @@
}, },
"gulp.autoDetect": "off", "gulp.autoDetect": "off",
"npm.autoDetect": "off" "npm.autoDetect": "off"
} }

View file

@ -13,7 +13,6 @@
- [Installing and compiling source](#installing-and-compiling-source) - [Installing and compiling source](#installing-and-compiling-source)
- [Testing the theme](#testing-the-theme) - [Testing the theme](#testing-the-theme)
- [Adding new Material Theme commands](#adding-new-material-theme-commands) - [Adding new Material Theme commands](#adding-new-material-theme-commands)
- [Adding new icons](#adding-new-icons)
- [Financial contributions](#financial-contributions) - [Financial contributions](#financial-contributions)
- [Credits](#credits) - [Credits](#credits)
- [Contributors](#contributors) - [Contributors](#contributors)
@ -118,20 +117,6 @@ A test suite is currently in developing. Update soon.
Soon(ish)® Soon(ish)®
### Adding new icons
* Add your icon to the `~/src/icons/svgs` directory.
* Add the reference to that icon to the `~/src/icons/partials/fileNames.js` or if your icon is referred to a directory adds the reference to the `~/src/icons/partials/folderNames.js` file, otherwise to `~/src/icons/partials/fileExtensions.js` if is referred to a file extension.
* If you want to make the icon sensitive to be accented, modify the `~/extensions/defaults.json` file, adding the icon definition to the `accentableIcons` array (e.g. ["_folder_open", "_folder_open_build"]) and the path to the `icons.theme.iconDefinitions` object. **The same applies to variants (the variant icons array is called "variantsIcons")**
* Execute the build command.
* Start the debug
* Enjoy your new icons in Material Theme, and don't forget to pull request!
## Financial contributions ## Financial contributions

View file

@ -12,9 +12,7 @@ The most epic theme meets Visual Studio Code. You can help by reporting issues [
- [Packaged VSIX Extension](#packaged-vsix-extension) - [Packaged VSIX Extension](#packaged-vsix-extension)
- [GitHub Repository Clone](#github-repository-clone) - [GitHub Repository Clone](#github-repository-clone)
- [Activate theme](#activate-theme) - [Activate theme](#activate-theme)
- [Fix File Icons](#fix-file-icons)
- [Set the accent color](#set-the-accent-color) - [Set the accent color](#set-the-accent-color)
- [Disabling/enabling file icons auto-applying](#disablingenabling-file-icons-auto-applying)
- [Override theme colors](#override-theme-colors) - [Override theme colors](#override-theme-colors)
- [Color Scheme override](#color-scheme-override) - [Color Scheme override](#color-scheme-override)
- [Recommended settings for a better experience](#recommended-settings-for-a-better-experience) - [Recommended settings for a better experience](#recommended-settings-for-a-better-experience)
@ -80,18 +78,6 @@ Launch *Quick Open*,
Type `theme` and choose `Preferences: Color Theme`, then select one of the Material Theme variant from the list. After the activation the theme will set the correct icons theme for you, based on your picked theme variant. Type `theme` and choose `Preferences: Color Theme`, then select one of the Material Theme variant from the list. After the activation the theme will set the correct icons theme for you, based on your picked theme variant.
## Fix File Icons
If you notice that the folder icons does not match the material theme active variant you can fix it with just a command.
Launch *Quick Open*,
- <img src="https://www.kernel.org/theme/images/logos/favicon.png" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf">Linux</a> `Ctrl + Shift + P`
- <img src="https://developer.apple.com/favicon.ico" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf">macOS</a> `⌘ + Shift + P`
- <img src="https://www.microsoft.com/favicon.ico" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf">Windows</a> `Ctrl + Shift + P`
type `material theme` and select `Material Theme: Fix file icons` from the drop-down menu, this command will set the correct icon theme based on your active material theme variant.
## Set the accent color ## Set the accent color
Launch *Quick Open*, Launch *Quick Open*,
@ -102,18 +88,6 @@ Launch *Quick Open*,
Type `material theme` and choose `Material Theme: Set accent color` and pick one color from the list. Type `material theme` and choose `Material Theme: Set accent color` and pick one color from the list.
## Disabling/enabling file icons auto-applying
By default material theme will apply the correct icons theme based on your active theme variant. To disable this behavior follow these steps:
Launch *Quick Open*,
- <img src="https://www.kernel.org/theme/images/logos/favicon.png" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf">Linux</a> `Ctrl + Shift + P`
- <img src="https://developer.apple.com/favicon.ico" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf">macOS</a> `⌘ + Shift + P`
- <img src="https://www.microsoft.com/favicon.ico" width=16 height=16/> <a href="https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf">Windows</a> `Ctrl + Shift + P`
Type `material theme` and choose `Material Theme: Enable or disable icons auto-applying` and choose to disable or enable this behavior.
## Override theme colors ## Override theme colors
You can override the material theme ui and schemes colors by adding these theme-specific settings to your configuration. For advanced customisation please check the [relative section on the vs code documentation](https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme) You can override the material theme ui and schemes colors by adding these theme-specific settings to your configuration. For advanced customisation please check the [relative section on the vs code documentation](https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme)

137
defaults.json Normal file
View file

@ -0,0 +1,137 @@
{
"accents": {
"Acid Lime": "#C6FF00",
"Blue": "#2979FF",
"Breaking Bad": "#388E3C",
"Bright Teal": "#64FFDA",
"Cyan": "#00BCD4",
"Graphite": "#616161",
"Indigo": "#5C6BC0",
"Lime": "#7CB342",
"Orange": "#FF7042",
"Pink": "#FF4081",
"Purple": "#AB47BC",
"Red": "#E57373",
"Sky": "#84FFFF",
"Tomato": "#F44336",
"Teal": "#80CBC4",
"Yellow": "#FFA000"
},
"accentsProperties": {
"activityBarBadge.background": {
"alpha": 100,
"value": null
},
"list.activeSelectionForeground": {
"alpha": 100,
"value": null
},
"list.inactiveSelectionForeground": {
"alpha": 100,
"value": null
},
"list.highlightForeground": {
"alpha": 100,
"value": null
},
"scrollbarSlider.activeBackground": {
"alpha": 50,
"value": null
},
"editorSuggestWidget.highlightForeground": {
"alpha": 100,
"value": null
},
"textLink.foreground": {
"alpha": 100,
"value": null
},
"progressBar.background": {
"alpha": 100,
"value": null
},
"pickerGroup.foreground": {
"alpha": 100,
"value": null
},
"tab.activeBorder": {
"alpha": 100,
"value": null
},
"notificationLink.foreground": {
"alpha": 100,
"value": null
},
"editorWidget.resizeBorder": {
"alpha": 100,
"value": null
},
"editorWidget.border": {
"alpha": 100,
"value": null
},
"settings.modifiedItemIndicator": {
"alpha": 100,
"value": null
},
"settings.headerForeground": {
"alpha": 100,
"value": null
},
"panelTitle.activeBorder": {
"alpha": 100,
"value": null
},
"breadcrumb.activeSelectionForeground": {
"alpha": 100,
"value": null
},
"menu.selectionForeground": {
"alpha": 100,
"value": null
},
"menubar.selectionForeground": {
"alpha": 100,
"value": null
}
},
"changelog": {
"lastversion": "2.6.3"
},
"themeVariants": {
"Darker": "./themes/Material-Theme-Darker.json",
"Darker High Contrast": "./themes/Material-Theme-Darker-High-Contrast.json",
"Default": "./themes/Material-Theme-Default.json",
"Default High Contrast": "./themes/Material-Theme-Default-High-Contrast.json",
"Light": "./themes/Material-Theme-Lighter.json",
"Light High Contrast": "./themes/Material-Theme-Lighter-High-Contrast.json",
"Palenight": "./themes/Material-Theme-Palenight.json",
"Palenight High Contrast": "./themes/Material-Theme-Palenight-High-Contrast.json",
"Ocean": "./themes/Material-Theme-Ocean.json",
"Ocean High Contrast": "./themes/Material-Theme-Ocean-High-Contrast.json"
},
"themeVariantsColours": {
"Darker": "#424242",
"Darker High Contrast": "#424242",
"Default": "#4A616C",
"Default High Contrast": "#4A616C",
"Light": "#90A4AE",
"Light High Contrast": "#90A4AE",
"Palenight": "#4E5579",
"Palenight High Contrast": "#4E5579",
"Ocean": "#474C60",
"Ocean High Contrast": "#474C60"
},
"themeVariantsUITheme": {
"Darker": "vs-dark",
"Darker High Contrast": "vs-dark",
"Default": "vs-dark",
"Default High Contrast": "vs-dark",
"Light": "vs",
"Light High Contrast": "vs",
"Palenight": "vs-dark",
"Palenight High Contrast": "vs-dark",
"Ocean": "vs-dark",
"Ocean High Contrast": "vs-dark"
}
}

View file

@ -1,97 +0,0 @@
import * as fs from 'fs';
import {
getAccentableIcons,
getAbsolutePath,
getDefaultValues,
getThemeIconsByContributeID,
getThemeIconsContribute,
getIconVariantFromTheme
} from './../../helpers/fs';
import {
isAccent,
getCustomSettings,
isMaterialTheme
} from './../../helpers/settings';
import {getCurrentThemeID, setIconsID, getCurrentThemeIconsID, reloadWindow} from './../../helpers/vscode';
import {CHARSET} from './../../consts/files';
import {IPackageJSONThemeIcons} from './../../interfaces/ipackage.json';
import {IThemeIconsIconPath, IThemeIcons} from './../../interfaces/itheme-icons';
const getIconDefinition = (definitions: any, iconName: string): IThemeIconsIconPath => {
return (definitions as any)[iconName];
};
/**
* Replaces icon path with the accented one.
*/
const replaceIconPathWithAccent = (iconPath: string, accentName: string): string => {
return iconPath.replace('.svg', `.accent.${ accentName }.svg`);
};
/**
* Fix icons when flag auto-fix is active and current theme is Material
*/
export default async () => {
const deferred: any = {};
const promise = new Promise((resolve, reject) => {
deferred.resolve = resolve;
deferred.reject = reject;
});
// Current theme id set on VSCode ("label" of the package.json)
const themeLabel = getCurrentThemeID();
// If this method was called without Material Theme set, just return
if (!isMaterialTheme(themeLabel)) {
return deferred.resolve();
}
const DEFAULTS = getDefaultValues();
const CUSTOM_SETTINGS = getCustomSettings();
const materialIconVariantID: string | null = getIconVariantFromTheme(themeLabel);
const currentThemeIconsID: string = getCurrentThemeIconsID();
const newThemeIconsID = materialIconVariantID ?
`eq-material-theme-icons-${materialIconVariantID}` : 'eq-material-theme-icons';
// Just set the correct Material Theme icons variant if wasn't
// Or also change the current icons set to the Material Theme icons variant
// (this is intended: this command was called directly or `autoFix` flag was already checked by other code)
if (currentThemeIconsID !== newThemeIconsID) {
await setIconsID(newThemeIconsID);
}
// package.json iconThemes object for the current icons set
const themeIconsContribute: IPackageJSONThemeIcons = getThemeIconsContribute(newThemeIconsID);
// Actual json file of the icons theme (eg. Material-Theme-Icons-Darker.json)
const theme: IThemeIcons = getThemeIconsByContributeID(newThemeIconsID);
const newIconPath = (outIcon: IThemeIconsIconPath) => isAccent(CUSTOM_SETTINGS.accent, DEFAULTS) ?
replaceIconPathWithAccent(outIcon.iconPath, CUSTOM_SETTINGS.accent.replace(/\s+/, '-')) : outIcon.iconPath;
getAccentableIcons().forEach(iconName => {
const distIcon = getIconDefinition(theme.iconDefinitions, iconName);
const outIcon = getIconDefinition(DEFAULTS.icons.theme.iconDefinitions, iconName);
if (typeof distIcon === 'object' && typeof outIcon === 'object') {
distIcon.iconPath = newIconPath(outIcon);
}
});
// Path of the icons theme .json
const themePath: string = getAbsolutePath(themeIconsContribute.path);
fs.writeFile(themePath, JSON.stringify(theme), {
encoding: CHARSET
}, async err => {
if (err) {
deferred.reject(err);
return;
}
deferred.resolve();
});
return promise
.then(() => reloadWindow())
.catch((error: NodeJS.ErrnoException) => console.trace(error));
};

View file

@ -1,11 +0,0 @@
import * as vscode from 'vscode';
export default async (): Promise<void> => {
// shows the quick pick dropdown and wait response
const optionSelected = await vscode.window.showQuickPick(['Enable', 'Disable']);
const isEnable = optionSelected === 'Enable';
return Promise.resolve(vscode.workspace
.getConfiguration().update('materialTheme.autoApplyIcons', isEnable, true)
);
};

View file

@ -1,307 +0,0 @@
{
"accents": {
"Acid Lime": "#C6FF00",
"Blue": "#2979FF",
"Breaking Bad": "#388E3C",
"Bright Teal": "#64FFDA",
"Cyan": "#00BCD4",
"Graphite": "#616161",
"Indigo": "#5C6BC0",
"Lime": "#7CB342",
"Orange": "#FF7042",
"Pink": "#FF4081",
"Purple": "#AB47BC",
"Red": "#E57373",
"Sky": "#84FFFF",
"Tomato": "#F44336",
"Teal": "#80CBC4",
"Yellow": "#FFA000"
},
"accentableIcons": [
"_folder_open",
"_folder_root_open",
"_folder_open_build",
"_folder_vscode_open",
"_folder_gulp_open",
"_folder_node_open",
"_folder_images_open",
"_folder_js_open",
"_folder_css_open",
"_folder_sass_open",
"_folder_src_open",
"_folder_assets_open",
"_folder_bower_open",
"_folder_git_open",
"_folder_github_open",
"_folder_test_open",
"_folder_dist_open",
"_folder_ci_open"
],
"accentsProperties": {
"activityBarBadge.background": {
"alpha": 100,
"value": null
},
"list.activeSelectionForeground": {
"alpha": 100,
"value": null
},
"list.inactiveSelectionForeground": {
"alpha": 100,
"value": null
},
"list.highlightForeground": {
"alpha": 100,
"value": null
},
"scrollbarSlider.activeBackground": {
"alpha": 50,
"value": null
},
"editorSuggestWidget.highlightForeground": {
"alpha": 100,
"value": null
},
"textLink.foreground": {
"alpha": 100,
"value": null
},
"progressBar.background": {
"alpha": 100,
"value": null
},
"pickerGroup.foreground": {
"alpha": 100,
"value": null
},
"tab.activeBorder": {
"alpha": 100,
"value": null
},
"notificationLink.foreground": {
"alpha": 100,
"value": null
},
"editorWidget.resizeBorder": {
"alpha": 100,
"value": null
},
"editorWidget.border": {
"alpha": 100,
"value": null
},
"settings.modifiedItemIndicator": {
"alpha": 100,
"value": null
},
"settings.headerForeground": {
"alpha": 100,
"value": null
},
"panelTitle.activeBorder": {
"alpha": 100,
"value": null
},
"breadcrumb.activeSelectionForeground": {
"alpha": 100,
"value": null
},
"menu.selectionForeground": {
"alpha": 100,
"value": null
},
"menubar.selectionForeground": {
"alpha": 100,
"value": null
}
},
"changelog": {
"lastversion": "2.6.3"
},
"icons": {
"theme": {
"iconDefinitions": {
"_folder_sass": {
"iconPath": "../icons/folder_sass.svg"
},
"_folder_sass_open": {
"iconPath": "../icons/folder_sass_open.svg"
},
"_folder_css": {
"iconPath": "../icons/folder_css.svg"
},
"_folder_css_open": {
"iconPath": "../icons/folder_css_open.svg"
},
"_folder_ci": {
"iconPath": "../icons/folder_ci.svg"
},
"_folder_ci_open": {
"iconPath": "../icons/folder_ci_open.svg"
},
"_folder_dist": {
"iconPath": "../icons/folder_dist.svg"
},
"_folder_dist_open": {
"iconPath": "../icons/folder_dist_open.svg"
},
"_folder_test": {
"iconPath": "../icons/folder_test.svg"
},
"_folder_test_open": {
"iconPath": "../icons/folder_test_open.svg"
},
"_folder_github": {
"iconPath": "../icons/folder_github.svg"
},
"_folder_github_open": {
"iconPath": "../icons/folder_github_open.svg"
},
"_folder_git": {
"iconPath": "../icons/folder_git.svg"
},
"_folder_git_open": {
"iconPath": "../icons/folder_git_open.svg"
},
"_folder_bower": {
"iconPath": "../icons/folder_bower.svg"
},
"_folder_bower_open": {
"iconPath": "../icons/folder_bower_open.svg"
},
"_folder_assets": {
"iconPath": "../icons/folder_assets.svg"
},
"_folder_assets_open": {
"iconPath": "../icons/folder_assets_open.svg"
},
"_folder_src": {
"iconPath": "../icons/folder_src.svg"
},
"_folder_src_open": {
"iconPath": "../icons/folder_src_open.svg"
},
"_folder_js": {
"iconPath": "../icons/folder_js.svg"
},
"_folder_js_open": {
"iconPath": "../icons/folder_js_open.svg"
},
"_folder_images": {
"iconPath": "../icons/folder_images.svg"
},
"_folder_images_open": {
"iconPath": "../icons/folder_images_open.svg"
},
"_folder_gulp": {
"iconPath": "../icons/folder_gulp.svg"
},
"_folder_gulp_open": {
"iconPath": "../icons/folder_gulp_open.svg"
},
"_folder_node": {
"iconPath": "../icons/folder_node.svg"
},
"_folder_node_open": {
"iconPath": "../icons/folder_node_open.svg"
},
"_folder_vscode": {
"iconPath": "../icons/folder_vscode.svg"
},
"_folder_vscode_open": {
"iconPath": "../icons/folder_vscode_open.svg"
},
"_folder_dark": {
"iconPath": "../icons/folder_dark.svg"
},
"_folder_light": {
"iconPath": "../icons/folder_light.svg"
},
"_folder_root_dark": {
"iconPath": "../icons/folder_root_dark.svg"
},
"_folder_root_light": {
"iconPath": "../icons/folder_root_light.svg"
},
"_file_folder": {
"iconPath": "../icons/file_folder.svg"
},
"_file_folder_build": {
"iconPath": "../icons/file_folder_build.svg"
},
"_folder_open": {
"iconPath": "../icons/folder_open.svg"
},
"_folder_root_open": {
"iconPath": "../icons/folder_root_open.svg"
},
"_folder_open_build": {
"iconPath": "../icons/folder_open_build.svg"
}
}
}
},
"themeIconVariants": {
"Darker": "eq-material-theme-icons-darker",
"Light": "eq-material-theme-icons-light",
"Palenight": "eq-material-theme-icons-palenight",
"Ocean": "eq-material-theme-icons-ocean"
},
"themeVariants": {
"Darker": "./themes/Material-Theme-Darker.json",
"Darker High Contrast": "./themes/Material-Theme-Darker-High-Contrast.json",
"Default": "./themes/Material-Theme-Default.json",
"Default High Contrast": "./themes/Material-Theme-Default-High-Contrast.json",
"Light": "./themes/Material-Theme-Lighter.json",
"Light High Contrast": "./themes/Material-Theme-Lighter-High-Contrast.json",
"Palenight": "./themes/Material-Theme-Palenight.json",
"Palenight High Contrast": "./themes/Material-Theme-Palenight-High-Contrast.json",
"Ocean": "./themes/Material-Theme-Ocean.json",
"Ocean High Contrast": "./themes/Material-Theme-Ocean-High-Contrast.json"
},
"themeVariantsColours": {
"Darker": "#424242",
"Darker High Contrast": "#424242",
"Default": "#4A616C",
"Default High Contrast": "#4A616C",
"Light": "#90A4AE",
"Light High Contrast": "#90A4AE",
"Palenight": "#4E5579",
"Palenight High Contrast": "#4E5579",
"Ocean": "#474C60",
"Ocean High Contrast": "#474C60"
},
"themeVariantsUITheme": {
"Darker": "vs-dark",
"Darker High Contrast": "vs-dark",
"Default": "vs-dark",
"Default High Contrast": "vs-dark",
"Light": "vs",
"Light High Contrast": "vs",
"Palenight": "vs-dark",
"Palenight High Contrast": "vs-dark",
"Ocean": "vs-dark",
"Ocean High Contrast": "vs-dark"
},
"variantsIcons": [
"_folder_sass",
"_folder_css",
"_folder_ci",
"_folder_dist",
"_folder_test",
"_folder_github",
"_folder_git",
"_folder_bower",
"_folder_assets",
"_folder_src",
"_folder_js",
"_folder_images",
"_folder_gulp",
"_folder_node",
"_folder_vscode",
"_folder_dark",
"_folder_light",
"_folder_root_dark",
"_folder_root_light"
]
}

View file

@ -1,39 +0,0 @@
import {
ConfigurationChangeEvent
} from 'vscode';
import {isMaterialThemeIcons, isMaterialTheme, getAccent} from './settings';
import {getCurrentThemeIconsID, getCurrentThemeID} from './vscode';
import handleAutoapply from './handle-autoapply';
import {accentsSetter} from '../commands';
const onIconsChanged = () => {
const currentIconsTheme = getCurrentThemeIconsID();
return handleAutoapply(isMaterialThemeIcons(currentIconsTheme));
};
const onThemeChanged = () => {
const currentTheme = getCurrentThemeID();
return handleAutoapply(isMaterialTheme(currentTheme));
};
const onAccentChanged = () => {
const currentTheme = getCurrentThemeID();
const currentIconsTheme = getCurrentThemeIconsID();
const currentAccent = getAccent();
return accentsSetter(currentAccent)
.then(() =>
handleAutoapply(
isMaterialTheme(currentTheme) && isMaterialThemeIcons(currentIconsTheme)
)
);
};
export const onChangeConfiguration = (event: ConfigurationChangeEvent) => {
const isColorTheme = event.affectsConfiguration('workbench.colorTheme');
const isIconTheme = event.affectsConfiguration('workbench.iconTheme');
const isAccent = event.affectsConfiguration('materialTheme.accent');
return isIconTheme ? onIconsChanged() :
isColorTheme ? onThemeChanged() :
isAccent ? onAccentChanged() : null;
};

View file

@ -1,81 +0,0 @@
import * as fs from 'fs';
import * as path from 'path';
import {IPackageJSON, IPackageJSONThemeIcons} from './../interfaces/ipackage.json';
import {CHARSET} from './../consts/files';
import {IDefaults} from '../interfaces/idefaults';
import {IThemeIcons} from '../interfaces/itheme-icons';
import {PATHS} from '../consts/paths';
export function ensureDir(dirname: string): void {
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname);
}
}
export function getDefaultValues(): IDefaults {
const defaults: IDefaults = require(path.join(PATHS.VSIX_DIR, './extensions/defaults.json'));
if (defaults === undefined || defaults === null) {
throw new Error('Cannot find defaults params');
}
return defaults;
}
export function getAbsolutePath(input: string): string {
return path.join(PATHS.VSIX_DIR, input);
}
export function getAccentableIcons(): string[] {
return getDefaultValues().accentableIcons;
}
export function getVariantIcons(): string[] {
return getDefaultValues().variantsIcons;
}
export function getAccentsProperties() {
return getDefaultValues().accentsProperties;
}
/**
* Gets a theme content by a given contribute ID
*/
export function getThemeIconsByContributeID(ID: string): IThemeIcons | null {
const contribute: IPackageJSONThemeIcons = getThemeIconsContribute(ID);
return contribute !== null ? require(path.join(PATHS.VSIX_DIR, contribute.path)) : null;
}
/**
* Gets a theme by name
*/
export function getThemeIconsContribute(ID: string): IPackageJSONThemeIcons {
const contributes = getPackageJSON().contributes.iconThemes.filter(contribute => contribute.id === ID);
return contributes[0] !== undefined ? contributes[0] : null;
}
/**
* Icon variant name from theme name
*/
export function getIconVariantFromTheme(theme: string): string {
const {themeIconVariants} = getDefaultValues();
const found = Object.keys(themeIconVariants).find(variant => theme.includes(variant));
return found ? found.toLowerCase() : null;
}
/**
* Gets package JSON
*/
export function getPackageJSON(): IPackageJSON {
return require(path.join(PATHS.VSIX_DIR, './package.json'));
}
/**
* Writes a file inside the vsix directory
*/
export function writeFile(filename: string, filecontent: string): void {
const filePath = path.join(PATHS.VSIX_DIR, filename);
fs.writeFileSync(filePath, filecontent, {encoding: CHARSET});
}

View file

@ -1,27 +0,0 @@
import {isAutoApplyEnable, isReloadNotificationEnable} from './settings';
import {infoMessage} from './messages';
import {fixIcons} from '../commands';
let fixIconsRunning: boolean = false;
export default async (doubleCheck: boolean) => {
if (!doubleCheck || fixIconsRunning) {
return;
}
if (isAutoApplyEnable()) {
fixIconsRunning = true;
return fixIcons().then(() => fixIconsRunning = false);
}
if (!isReloadNotificationEnable()) {
return;
}
const result = await infoMessage();
if (result.reload) {
fixIconsRunning = true;
return fixIcons().then(() => fixIconsRunning = false);
}
};

View file

@ -1,47 +0,0 @@
import {
window as Window
} from 'vscode';
const MESSAGES = {
INFO: {
message: 'Do you want to reload to apply Material Theme Icons to enjoy the full experience?',
options: {ok: 'Yeah, reload', cancel: 'No, thank you'}
},
CHANGELOG: {
message: 'Material Theme was updated. Check the release notes for more details.',
options: {ok: 'Show me', cancel: 'Maybe later'}
},
INSTALLATION: {
message: 'Thank you for installing Material Theme! Would you like to enable the auto-application (with window reload when needed) of the Material Theme icons?',
options: {ok: 'Sure!', cancel: 'Nope :('}
}
};
export const infoMessage = async () => {
const result = await Window.showInformationMessage(
MESSAGES.INFO.message,
MESSAGES.INFO.options.ok,
MESSAGES.INFO.options.cancel
);
switch (result) {
case MESSAGES.INFO.options.ok:
return {reload: true};
default:
return {};
}
};
export const changelogMessage = async () =>
await Window.showInformationMessage(
MESSAGES.CHANGELOG.message,
MESSAGES.CHANGELOG.options.ok,
MESSAGES.CHANGELOG.options.cancel
) === MESSAGES.CHANGELOG.options.ok;
export const installationMessage = async () =>
await Window.showInformationMessage(
MESSAGES.INSTALLATION.message,
MESSAGES.INSTALLATION.options.ok,
MESSAGES.INSTALLATION.options.cancel,
) === MESSAGES.INSTALLATION.options.ok;

View file

@ -1,44 +0,0 @@
import * as vscode from 'vscode';
export function askForWindowReload(): Thenable<void> {
const PROMPT_MESSAGE: string = 'Material Theme requires VS Code reload in order to display icons correctly.';
const PROMPT_MESSAGE_CONFIRM: string = 'Ok, reload';
const PROMPT_MESSAGE_CANCEL: string = 'I will do it later';
return vscode.window.showInformationMessage(PROMPT_MESSAGE, PROMPT_MESSAGE_CONFIRM, PROMPT_MESSAGE_CANCEL)
.then(response => {
if (response === PROMPT_MESSAGE_CONFIRM) {
reloadWindow();
}
}, err => {
console.log(err);
});
}
/**
* Gets your current theme ID
*/
export function getCurrentThemeID(): string {
return vscode.workspace.getConfiguration().get<string>('workbench.colorTheme');
}
/**
* Gets your current icons theme ID
*/
export function getCurrentThemeIconsID(): string {
return vscode.workspace.getConfiguration().get<string>('workbench.iconTheme');
}
/**
* Set a specific id for icons
*/
export function setIconsID(id: string): Thenable<void> {
return vscode.workspace.getConfiguration().update('workbench.iconTheme', id, true);
}
/**
* Reloads current vscode window.
*/
export function reloadWindow(): void {
vscode.commands.executeCommand('workbench.action.reloadWindow');
}

View file

@ -1,516 +0,0 @@
export interface IThemeIconsIconPath {
iconPath: string;
}
export interface IThemeIcons {
iconDefinitions: {
_folder_dark: IThemeIconsIconPath;
_file_folder: IThemeIconsIconPath;
_folder_dark_build: IThemeIconsIconPath;
_folder_light: IThemeIconsIconPath;
_folder_light_build: IThemeIconsIconPath;
_folder_open: IThemeIconsIconPath;
_folder_open_build: IThemeIconsIconPath;
_file_dark: IThemeIconsIconPath;
_file_actionscript: IThemeIconsIconPath;
_file_ai: IThemeIconsIconPath;
_file_android: IThemeIconsIconPath;
_file_angular: IThemeIconsIconPath;
_file_applescript: IThemeIconsIconPath;
_file_arduino: IThemeIconsIconPath;
_file_assembly: IThemeIconsIconPath;
_file_autohotkey: IThemeIconsIconPath;
_file_bower: IThemeIconsIconPath;
_file_c: IThemeIconsIconPath;
_file_certificate: IThemeIconsIconPath;
_file_changelog: IThemeIconsIconPath;
_file_clojure: IThemeIconsIconPath;
_file_cmake: IThemeIconsIconPath;
_file_cmd: IThemeIconsIconPath;
_file_coffee: IThemeIconsIconPath;
_file_console: IThemeIconsIconPath;
_file_contributing: IThemeIconsIconPath;
_file_cpp: IThemeIconsIconPath;
_file_credits: IThemeIconsIconPath;
_file_csharp: IThemeIconsIconPath;
'_file_css-map': IThemeIconsIconPath;
_file_css: IThemeIconsIconPath;
_file_dart: IThemeIconsIconPath;
_file_database: IThemeIconsIconPath;
_file_dlang: IThemeIconsIconPath;
_file_docker: IThemeIconsIconPath;
_file_document: IThemeIconsIconPath;
_file_email: IThemeIconsIconPath;
_file_exe: IThemeIconsIconPath;
_file_favicon: IThemeIconsIconPath;
_file_file: IThemeIconsIconPath;
_file_flash: IThemeIconsIconPath;
_file_flow: IThemeIconsIconPath;
'_file_folder-build': IThemeIconsIconPath;
'_file_folder-light-build': IThemeIconsIconPath;
'_file_folder-light': IThemeIconsIconPath;
'_file_folder-outline-build': IThemeIconsIconPath;
'_file_folder-outline': IThemeIconsIconPath;
_file_font: IThemeIconsIconPath;
_file_fsharp: IThemeIconsIconPath;
_file_git: IThemeIconsIconPath;
_file_github: IThemeIconsIconPath;
_file_go: IThemeIconsIconPath;
_file_gopher: IThemeIconsIconPath;
_file_gradle: IThemeIconsIconPath;
_file_graphql: IThemeIconsIconPath;
_file_groovy: IThemeIconsIconPath;
_file_grunt: IThemeIconsIconPath;
_file_gulp: IThemeIconsIconPath;
_file_haml: IThemeIconsIconPath;
_file_haskell: IThemeIconsIconPath;
_file_html: IThemeIconsIconPath;
_file_image: IThemeIconsIconPath;
_file_ionic: IThemeIconsIconPath;
_file_java: IThemeIconsIconPath;
'_file_javascript-map': IThemeIconsIconPath;
_file_js: IThemeIconsIconPath;
_file_json: IThemeIconsIconPath;
_file_key: IThemeIconsIconPath;
_file_kotlin: IThemeIconsIconPath;
_file_less: IThemeIconsIconPath;
_file_lib: IThemeIconsIconPath;
_file_license: IThemeIconsIconPath;
_file_lua: IThemeIconsIconPath;
_file_markdown: IThemeIconsIconPath;
_file_markup: IThemeIconsIconPath;
_file_movie: IThemeIconsIconPath;
_file_music: IThemeIconsIconPath;
_file_mustache: IThemeIconsIconPath;
_file_mxml: IThemeIconsIconPath;
_file_nodejs: IThemeIconsIconPath;
_file_npm: IThemeIconsIconPath;
_file_ocaml: IThemeIconsIconPath;
_file_pdf: IThemeIconsIconPath;
_file_php: IThemeIconsIconPath;
_file_polymer: IThemeIconsIconPath;
_file_postcss: IThemeIconsIconPath;
_file_powerpoint: IThemeIconsIconPath;
_file_pp: IThemeIconsIconPath;
_file_procfile: IThemeIconsIconPath;
_file_pug: IThemeIconsIconPath;
_file_python: IThemeIconsIconPath;
_file_r: IThemeIconsIconPath;
_file_rails: IThemeIconsIconPath;
_file_raml: IThemeIconsIconPath;
_file_react: IThemeIconsIconPath;
_file_readme: IThemeIconsIconPath;
_file_ruby: IThemeIconsIconPath;
_file_rust: IThemeIconsIconPath;
_file_sass: IThemeIconsIconPath;
_file_settings: IThemeIconsIconPath;
_file_sketch: IThemeIconsIconPath;
_file_star: IThemeIconsIconPath;
_file_stylus: IThemeIconsIconPath;
_file_sublime: IThemeIconsIconPath;
_file_svg: IThemeIconsIconPath;
_file_swc: IThemeIconsIconPath;
_file_swift: IThemeIconsIconPath;
_file_swig: IThemeIconsIconPath;
_file_table: IThemeIconsIconPath;
_file_tex: IThemeIconsIconPath;
_file_todo: IThemeIconsIconPath;
_file_tune: IThemeIconsIconPath;
_file_twig: IThemeIconsIconPath;
_file_typescript: IThemeIconsIconPath;
_file_typescript_def: IThemeIconsIconPath;
_file_url: IThemeIconsIconPath;
_file_virtual: IThemeIconsIconPath;
_file_visualstudio: IThemeIconsIconPath;
_file_vue: IThemeIconsIconPath;
_file_webpack: IThemeIconsIconPath;
_file_word: IThemeIconsIconPath;
_file_xaml: IThemeIconsIconPath;
_file_xml: IThemeIconsIconPath;
_file_yaml: IThemeIconsIconPath;
_file_yarn: IThemeIconsIconPath;
_file_zip: IThemeIconsIconPath;
};
fileExtensions: {
cmd: string;
mustache: string;
rails: string;
styl: string;
twig: string;
swig: string;
sketch: string;
do: string;
'sublime-settings': string;
'sublime-theme': string;
'sublime-commands': string;
'sublime-menu': string;
html: string;
jade: string;
pug: string;
md: string;
'md.rendered': string;
markdown: string;
'markdown.rendered': string;
css: string;
postcss: string;
scss: string;
sass: string;
less: string;
json: string;
yaml: string;
'YAML-tmLanguage': string;
yml: string;
xml: string;
plist: string;
xsd: string;
dtd: string;
xsl: string;
xslt: string;
resx: string;
iml: string;
xquery: string;
tmLanguage: string;
png: string;
jpeg: string;
jpg: string;
gif: string;
svg: string;
eps: string;
ai: string;
ico: string;
tif: string;
tiff: string;
psd: string;
psb: string;
ami: string;
apx: string;
bmp: string;
bpg: string;
brk: string;
cur: string;
dds: string;
dng: string;
exr: string;
fpx: string;
gbr: string;
img: string;
jbig2: string;
jb2: string;
jng: string;
jxr: string;
pbm: string;
pgf: string;
pic: string;
raw: string;
webp: string;
php: string;
js: string;
ejs: string;
jsx: string;
ini: string;
dlc: string;
dll: string;
config: string;
conf: string;
esx: string;
ts: string;
tsx: string;
'd.ts': string;
pdf: string;
xlsx: string;
xls: string;
csv: string;
vscodeignore: string;
vsixmanifest: string;
suo: string;
sln: string;
pdb: string;
cs: string;
csx: string;
csproj: string;
zip: string;
tar: string;
gz: string;
xz: string;
bzip2: string;
gzip: string;
'7z': string;
'7zip': string;
pzip: string;
wim: string;
rar: string;
tgz: string;
exe: string;
msi: string;
java: string;
jar: string;
jsp: string;
c: string;
h: string;
m: string;
cc: string;
cpp: string;
'c++': string;
hpp: string;
mm: string;
cxx: string;
go: string;
py: string;
url: string;
sh: string;
bat: string;
ps1: string;
fish: string;
bash: string;
gradle: string;
doc: string;
docx: string;
rtf: string;
properties: string;
prop: string;
settings: string;
sql: string;
accdb: string;
mdb: string;
cer: string;
cert: string;
crt: string;
pub: string;
key: string;
pem: string;
asc: string;
woff: string;
woff2: string;
ttf: string;
eot: string;
suit: string;
otf: string;
bmap: string;
fnt: string;
odttf: string;
ttc: string;
font: string;
fonts: string;
sui: string;
ntf: string;
mrf: string;
lib: string;
rb: string;
erb: string;
fs: string;
fsx: string;
fsi: string;
fsproj: string;
manifest: string;
swift: string;
ino: string;
dockerignore: string;
tex: string;
bib: string;
pptx: string;
ppt: string;
pptm: string;
potx: string;
pot: string;
potm: string;
ppsx: string;
ppsm: string;
pps: string;
ppam: string;
ppa: string;
webm: string;
mkv: string;
flv: string;
vob: string;
ogv: string;
ogg: string;
gifv: string;
avi: string;
mov: string;
qt: string;
wmv: string;
yuv: string;
rm: string;
rmvb: string;
mp4: string;
m4v: string;
mpg: string;
mp2: string;
mpeg: string;
mpe: string;
mpv: string;
m2v: string;
vdi: string;
vbox: string;
'vbox-prev': string;
ics: string;
mp3: string;
flac: string;
m4a: string;
wma: string;
aiff: string;
coffee: string;
txt: string;
sqlite: string;
graphql: string;
gql: string;
props: string;
toml: string;
rs: string;
raml: string;
xaml: string;
prefs: string;
hs: string;
kt: string;
project: string;
patch: string;
dockerfile: string;
vb: string;
lua: string;
clj: string;
groovy: string;
r: string;
rst: string;
dart: string;
as: string;
mxml: string;
ahk: string;
swf: string;
swc: string;
cmake: string;
asm: string;
a51: string;
inc: string;
nasm: string;
s: string;
ms: string;
agc: string;
ags: string;
aea: string;
argus: string;
mitigus: string;
binsource: string;
vue: string;
ml: string;
mli: string;
cmx: string;
'js.map': string;
'css.map': string;
tmTheme: string;
pp: string;
applescript: string;
haml: string;
};
fileNames: {
'gruntfile.js': string;
'bower.json': string;
'.bowerrc': string;
'webpack.js': string;
'webpack.config.js': string;
'webpack.dev.js': string;
'webpack.prod.js': string;
'webpack.common.js': string;
'webpackfile.js': string;
'ionic.config.json': string;
'.io-config.json': string;
'gulpfile.js': string;
'gulpfile.babel.js': string;
'package.json': string;
'gradle.properties': string;
gradlew: string;
'.jscsrc': string;
'.jshintrc': string;
'.jshintignore': string;
'.npmignore': string;
'tsconfig.json': string;
'tslint.json': string;
'androidmanifest.xml': string;
'gradle-wrapper.properties': string;
'.editorconfig': string;
procfile: string;
'.env': string;
dockerfile: string;
license: string;
'license.md': string;
'license.md.rendered': string;
'license.txt': string;
'.babelrc': string;
'.eslintrc': string;
'.buildignore': string;
'.htaccess': string;
'composer.lock': string;
'.gitignore': string;
'.gitconfig': string;
'.gitattributes': string;
'.gitmodules': string;
'.gitkeep': string;
'yarn.lock': string;
'.yarnclean': string;
'.yarn-integrity': string;
'yarn-error.log': string;
'contributing.md': string;
'contributing.md.rendered': string;
'readme.md': string;
'readme.md.rendered': string;
'.mailmap': string;
makefile: string;
changelog: string;
'changelog.md': string;
'changelog.md.rendered': string;
CREDITS: string;
'credits.txt': string;
'credits.md': string;
'credits.md.rendered': string;
'.flowconfig': string;
'.jsbeautifyrc': string;
'git-history': string;
'angular-cli.json': string;
'app.module.ts': string;
'favicon.ico': string;
};
file: string;
folder: string;
folderExpanded: string;
languageIds:
{ git: string };
light: {
folderExpanded: string;
folder: string;
folderNames: {
node_modules: string;
'.git': string;
'.github': string;
'.gulp': string;
bower_components: string;
build: string;
dist: string;
};
folderNamesExpanded: {
node_modules: string;
'.git': string;
'.github': string;
'.gulp': string;
bower_components: string;
build: string;
dist: string;
};
};
folderNames: {
node_modules: string;
'.git': string;
'.github': string;
'.gulp': string;
bower_components: string;
build: string;
dist: string;
};
folderNamesExpanded: {
node_modules: string;
'.git': string;
'.github': string;
'.gulp': string;
bower_components: string;
build: string;
dist: string;
};
}

9
gulpfile.babel.js Normal file
View file

@ -0,0 +1,9 @@
import Gulp from 'gulp';
import GulpStats from 'gulp-stats';
import tasks from './out/.gulp';
// Use gulp-stats
GulpStats(Gulp);
// set default task
Gulp.task('default', tasks);

View file

@ -1,9 +0,0 @@
import * as Gulp from 'gulp';
import * as GulpStats from 'gulp-stats';
import * as tasks from './.gulp';
// Use gulp-stats
GulpStats(Gulp);
// set default task
Gulp.task('default', tasks.default as any);

View file

@ -1,113 +0,0 @@
[
"actionscript",
"ai",
"android",
"angular",
"arduino",
"assembly",
"autohotkey",
"bower",
"c-lang",
"certificate",
"changelog",
"clojure",
"cmake",
"cmd",
"coffee",
"console",
"contributing",
"cpp",
"credits",
"csharp",
"css-map",
"css",
"dart",
"database",
"dlang",
"docker",
"document",
"email",
"exe",
"favicon",
"file",
"flash",
"flow",
"folder-light",
"folder-outline",
"folder",
"font",
"fsharp",
"git",
"github",
"gopher",
"gradle",
"groovy",
"grunt",
"gulp",
"haskell",
"html",
"image",
"ionic",
"java",
"javascript-map",
"js",
"json",
"key",
"kotlin",
"less",
"lib",
"license",
"lua",
"markdown",
"markup",
"movie",
"music",
"mustache",
"mxml",
"nodejs",
"npm",
"ocaml",
"pdf",
"php",
"polymer",
"postcss",
"powerpoint",
"procfile",
"pug",
"python",
"r",
"rails",
"raml",
"react",
"readme",
"ruby",
"rust",
"sass",
"settings",
"sketch",
"star",
"stylus",
"sublime",
"svg",
"swc",
"swift",
"swig",
"table",
"tex",
"todo",
"tune",
"twig",
"typescript",
"typescript_def",
"url",
"virtual",
"visualstudio",
"vue",
"webpack",
"word",
"xaml",
"xml",
"yaml",
"yarn",
"zip"
]

View file

@ -23,21 +23,11 @@
"vscode": "^1.28.0" "vscode": "^1.28.0"
}, },
"scripts": { "scripts": {
"build": "yarn cleanup && yarn get-remote-icons && yarn build-icons && yarn build-themes && yarn build-icons-accents && yarn build-icons-variants && yarn build-icons-variants-json && yarn build-ui", "build": "yarn cleanup && yarn build-ts && yarn build-themes && yarn build-ui",
"build-icons": "yarn remove-icons && yarn minimize-icons && gulp build:icons && yarn minimize-json", "cleanup": "rimraf out",
"minimize-icons": "mkdir icons && svgo -f src/icons/svgs -o icons/",
"minimize-json": "json-minify themes/.material-theme-icons.tmp > themes/Material-Theme-Icons.json && yarn remove-icons-tmp",
"remove-icons": "rimraf icons && rimraf themes/Material-Theme-Icons.json",
"remove-icons-tmp": "rimraf themes/.material-theme-icons.tmp",
"get-remote-icons": "gulp build:get-remote-icons",
"cleanup": "rimraf _tmp-output-remote-icons/ && rimraf ui",
"build-icons-accents": "gulp build:icons.accents",
"build-icons-variants": "gulp build:icons.variants",
"build-icons-variants-json": "gulp build:icons.variants-json",
"build-themes": "gulp build:themes", "build-themes": "gulp build:themes",
"build-ui": "yarn copy-ui && yarn build-ui-release-notes", "build-ui": "gulp build:copy-ui && yarn build-ui-release-notes",
"copy-ui": "gulp build:copy-ui", "build-ui-release-notes": "browserify out/src/webviews/ui/release-notes/index.js > out/ui/release-notes.js",
"build-ui-release-notes": "browserify extensions/webviews/ui/release-notes/index.js > ui/release-notes.js",
"build-ui-only": "yarn cleanup && yarn build-ts && yarn build-ui", "build-ui-only": "yarn cleanup && yarn build-ts && yarn build-ui",
"build-ts": "tsc -p ./tsconfig.json", "build-ts": "tsc -p ./tsconfig.json",
"test": "tslint **.ts", "test": "tslint **.ts",
@ -54,24 +44,14 @@
"activationEvents": [ "activationEvents": [
"*" "*"
], ],
"main": "./extensions/material.theme.config.js", "main": "./out/src/material.theme.config",
"contributes": { "contributes": {
"commands": [ "commands": [
{
"command": "materialTheme.toggleApplyIcons",
"title": "Enable or disable icons auto-applying",
"category": "💅 Material Theme"
},
{ {
"command": "materialTheme.setAccent", "command": "materialTheme.setAccent",
"title": "Set accent color", "title": "Set accent color",
"category": "🎨 Material Theme" "category": "🎨 Material Theme"
}, },
{
"command": "materialTheme.fixIcons",
"title": "Fix file icons",
"category": "🛠 Material Theme"
},
{ {
"command": "materialTheme.showReleaseNotes", "command": "materialTheme.showReleaseNotes",
"title": "Release Notes", "title": "Release Notes",
@ -105,101 +85,63 @@
], ],
"description": "Current accent color selected", "description": "Current accent color selected",
"scope": "window" "scope": "window"
},
"materialTheme.autoApplyIcons": {
"type": "boolean",
"description": "Enable/disable auto-apply of Material Theme icons with window reload when needed",
"default": false,
"scope": "window"
},
"materialTheme.showReloadNotification": {
"type": "boolean",
"description": "Useful when autoApplyIcons is false and you want to be asked to reload the window when needed",
"default": true,
"scope": "window"
} }
} }
}, },
"themes": [ "themes": [
{ {
"label": "Material Theme", "label": "Material Theme",
"path": "./themes/Material-Theme-Default.json", "path": "./out/themes/Material-Theme-Default.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme High Contrast", "label": "Material Theme High Contrast",
"path": "./themes/Material-Theme-Default-High-Contrast.json", "path": "./out/themes/Material-Theme-Default-High-Contrast.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Darker", "label": "Material Theme Darker",
"path": "./themes/Material-Theme-Darker.json", "path": "./out/themes/Material-Theme-Darker.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Darker High Contrast", "label": "Material Theme Darker High Contrast",
"path": "./themes/Material-Theme-Darker-High-Contrast.json", "path": "./out/themes/Material-Theme-Darker-High-Contrast.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Palenight", "label": "Material Theme Palenight",
"path": "./themes/Material-Theme-Palenight.json", "path": "./out/themes/Material-Theme-Palenight.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Palenight High Contrast", "label": "Material Theme Palenight High Contrast",
"path": "./themes/Material-Theme-Palenight-High-Contrast.json", "path": "./out/themes/Material-Theme-Palenight-High-Contrast.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Ocean", "label": "Material Theme Ocean",
"path": "./themes/Material-Theme-Ocean.json", "path": "./out/themes/Material-Theme-Ocean.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Ocean High Contrast", "label": "Material Theme Ocean High Contrast",
"path": "./themes/Material-Theme-Ocean-High-Contrast.json", "path": "./out/themes/Material-Theme-Ocean-High-Contrast.json",
"uiTheme": "vs-dark" "uiTheme": "vs-dark"
}, },
{ {
"label": "Material Theme Lighter", "label": "Material Theme Lighter",
"path": "./themes/Material-Theme-Lighter.json", "path": "./out/themes/Material-Theme-Lighter.json",
"uiTheme": "vs" "uiTheme": "vs"
}, },
{ {
"label": "Material Theme Lighter High Contrast", "label": "Material Theme Lighter High Contrast",
"path": "./themes/Material-Theme-Lighter-High-Contrast.json", "path": "./out/themes/Material-Theme-Lighter-High-Contrast.json",
"uiTheme": "vs" "uiTheme": "vs"
} }
],
"iconThemes": [
{
"id": "eq-material-theme-icons",
"label": "Material Theme Icons",
"path": "./themes/Material-Theme-Icons.json"
},
{
"id": "eq-material-theme-icons-darker",
"label": "Material Theme Icons Darker",
"path": "./themes/Material-Theme-Icons-Darker.json"
},
{
"id": "eq-material-theme-icons-palenight",
"label": "Material Theme Icons Palenight",
"path": "./themes/Material-Theme-Icons-Palenight.json"
},
{
"id": "eq-material-theme-icons-ocean",
"label": "Material Theme Icons Ocean",
"path": "./themes/Material-Theme-Icons-Ocean.json"
},
{
"id": "eq-material-theme-icons-light",
"label": "Material Theme Icons Light",
"path": "./themes/Material-Theme-Icons-Light.json"
}
] ]
}, },
"extensionDependency": ["Equinusocio.vsc-material-theme-icons"],
"badges": [ "badges": [
{ {
"url": "https://camo.githubusercontent.com/d3c6e53aa66426dead24cdedab0e83082103bea6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f657175696e75736f63696f2f7673632d6d6174657269616c2d7468656d652e7376673f7374796c653d666c61742d737175617265", "url": "https://camo.githubusercontent.com/d3c6e53aa66426dead24cdedab0e83082103bea6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f657175696e75736f63696f2f7673632d6d6174657269616c2d7468656d652e7376673f7374796c653d666c61742d737175617265",
@ -213,42 +155,25 @@
} }
], ],
"devDependencies": { "devDependencies": {
"@types/chalk": "2.2.0",
"@types/execa": "0.9.0",
"@types/gulp": "4.0.5", "@types/gulp": "4.0.5",
"@types/gulp-if": "0.0.33", "@types/gulp-if": "0.0.33",
"@types/gulp-util": "3.0.34", "@types/gulp-util": "3.0.34",
"@types/mustache": "0.8.31", "@types/mustache": "0.8.32",
"@types/ncp": "2.0.1",
"@types/rimraf": "2.0.2", "@types/rimraf": "2.0.2",
"@types/run-sequence": "0.0.30",
"@types/through2": "2.0.33",
"@types/yamljs": "0.2.30",
"@types/yargs": "11.0.0",
"babel-core": "6.26.3", "babel-core": "6.26.3",
"babel-preset-env": "1.7.0", "babel-preset-env": "1.7.0",
"babel-preset-es2015": "6.24.1",
"babel-root-import": "4.1.8",
"browserify": "16.2.2", "browserify": "16.2.2",
"cpx": "1.5.0",
"execa": "0.10.0",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-bump": "3.1.0", "gulp-bump": "3.1.0",
"gulp-conventional-changelog": "1.1.11", "gulp-conventional-changelog": "1.1.11",
"gulp-if": "2.0.2", "gulp-if": "2.0.2",
"gulp-stats": "0.0.4", "gulp-stats": "0.0.4",
"gulp-util": "3.0.8", "gulp-util": "3.0.8",
"hoek": "5.0.3", "mustache": "3.0.1",
"json-minify": "1.0.0",
"mustache": "2.3.0",
"ncp": "2.0.0",
"run-sequence": "2.2.1",
"svgo": "1.0.5",
"tslint": "5.10.0", "tslint": "5.10.0",
"tslint-xo": "0.8.0", "tslint-xo": "0.8.0",
"typescript": "2.9.2", "typescript": "2.9.2",
"vscode": "1.1.18", "vscode": "1.1.18",
"yamljs": "0.3.0",
"yargs": "11.0.0" "yargs": "11.0.0"
}, },
"__metadata": { "__metadata": {

View file

@ -1,4 +1,2 @@
export {default as accentsSetter} from './accents-setter'; export {default as accentsSetter} from './accents-setter';
export {default as accentsQuickPick} from './accents-setter/quick-pick'; export {default as accentsQuickPick} from './accents-setter/quick-pick';
export {default as fixIcons} from './theme-icons';
export {default as toggleApplyIcons} from './toggle-apply-icons';

View file

@ -3,12 +3,11 @@ import * as path from 'path';
import {IPaths} from '../interfaces/ipaths'; import {IPaths} from '../interfaces/ipaths';
export const PATHS: IPaths = { export const PATHS: IPaths = {
DIST: './dist',
ICONS: './icons',
SRC: './src', SRC: './src',
THEMES: './themes', THEMES: './out/themes',
UI: './ui', UI: './out/ui',
VSIX_DIR: path.join(__dirname, '../../'), VSIX_SRC_DIR: path.join(__dirname, '../..'), // From "src" dir
VSIX_DIR: path.join(__dirname, '../../..'), // From "out" dir
EXT_DIR: path.join(__dirname, '..') EXT_DIR: path.join(__dirname, '..')
}; };

47
src/helpers/fs.ts Normal file
View file

@ -0,0 +1,47 @@
import * as fs from 'fs';
import * as path from 'path';
import {IPackageJSON} from '../interfaces/ipackage.json';
import {CHARSET} from './../consts/files';
import {IDefaults} from '../interfaces/idefaults';
import {PATHS} from '../consts/paths';
export function ensureDir(dirname: string): void {
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname);
}
}
export function getDefaultValues(): IDefaults {
const defaults: IDefaults = require(path.join(PATHS.VSIX_DIR, 'defaults.json'));
if (defaults === undefined || defaults === null) {
throw new Error('Cannot find defaults params');
}
return defaults;
}
export function getAbsolutePath(input: string): string {
return path.join(PATHS.VSIX_DIR, input);
}
export function getAccentsProperties() {
return getDefaultValues().accentsProperties;
}
/**
* Gets package JSON
*/
export function getPackageJSON(): IPackageJSON {
return require(path.join(PATHS.VSIX_DIR, './package.json'));
}
/**
* Writes a file inside the vsix directory
*/
export function writeFile(filename: string, filecontent: string): void {
const filePath = path.join(PATHS.VSIX_DIR, filename);
fs.writeFileSync(filePath, filecontent, {encoding: CHARSET});
}

25
src/helpers/messages.ts Normal file
View file

@ -0,0 +1,25 @@
import {
window as Window
} from 'vscode';
const MESSAGES = {
CHANGELOG: {
message: 'Material Theme was updated. Check the release notes for more details.',
options: {ok: 'Show me', cancel: 'Maybe later'}
},
INSTALLATION: {
message: 'Thank you for using Material Theme!'
}
};
export const changelogMessage = async () =>
await Window.showInformationMessage(
MESSAGES.CHANGELOG.message,
MESSAGES.CHANGELOG.options.ok,
MESSAGES.CHANGELOG.options.cancel
) === MESSAGES.CHANGELOG.options.ok;
export const installationMessage = async () =>
await Window.showInformationMessage(
MESSAGES.INSTALLATION.message
);

View file

@ -18,13 +18,6 @@ export function getCustomSettings(): IThemeCustomSettings {
return vscode.workspace.getConfiguration().get<IThemeCustomSettings>('materialTheme', {}); return vscode.workspace.getConfiguration().get<IThemeCustomSettings>('materialTheme', {});
} }
/**
* Get autoApplyIcons
*/
export function isAutoApplyEnable(): boolean {
return vscode.workspace.getConfiguration().get<boolean>('materialTheme.autoApplyIcons');
}
/** /**
* Get showReloadNotification * Get showReloadNotification
*/ */
@ -47,14 +40,6 @@ export function isMaterialTheme(themeName: string): boolean {
return Boolean(packageJSON.contributes.themes.find(contrib => contrib.label === themeName)); return Boolean(packageJSON.contributes.themes.find(contrib => contrib.label === themeName));
} }
/**
* Determines if the passing icons theme is a material theme
*/
export function isMaterialThemeIcons(themeIconsName: string): boolean {
const packageJSON = getPackageJSON();
return Boolean(packageJSON.contributes.iconThemes.find(contribute => contribute.id === themeIconsName));
}
/** /**
* Sets a custom property in custom settings * Sets a custom property in custom settings
*/ */

15
src/helpers/vscode.ts Normal file
View file

@ -0,0 +1,15 @@
import * as vscode from 'vscode';
/**
* Gets your current theme ID
*/
export function getCurrentThemeID(): string {
return vscode.workspace.getConfiguration().get<string>('workbench.colorTheme');
}
/**
* Reloads current vscode window.
*/
export function reloadWindow(): void {
vscode.commands.executeCommand('workbench.action.reloadWindow');
}

View file

@ -1,10 +1,10 @@
import * as path from 'path'; import * as path from 'path';
import {getDefaultValues, getPackageJSON, writeFile} from './fs'; import {getDefaultValues, getPackageJSON, writeFile} from './fs';
import {IDefaults} from './../interfaces/idefaults'; import {IDefaults} from '../interfaces/idefaults';
const writeDefaults = (defaults: IDefaults) => const writeDefaults = (defaults: IDefaults) =>
writeFile(path.join('./extensions/defaults.json'), JSON.stringify(defaults, null, 2)); writeFile(path.join('./defaults.json'), JSON.stringify(defaults, null, 2));
export default (): void => { export default (): void => {
const defaults = getDefaultValues(); const defaults = getDefaultValues();

View file

@ -1,10 +0,0 @@
{
"hidesExplorerArrows": true,
{{> iconDefinitions}}
{{> fileExtensions}}
{{> fileNames}}
{{> fileFolders}}
{{> languageIds}}
{{> light}}
{{> folderNames}}
}

View file

@ -1,353 +0,0 @@
"fileExtensions": {
"tf": "_file_terraform",
"story.tsx": "_file_storybook",
"stories.tsx": "_file_storybook",
"story.ts": "_file_storybook",
"stories.ts": "_file_storybook",
"story.jsx": "_file_storybook",
"stories.jsx": "_file_storybook",
"story.js": "_file_storybook",
"stories.js": "_file_storybook",
"proto": "_file_protobuf",
"hbs": "_file_handlebars",
"elm": "_file_elm",
"cabal": "_file_cabal",
"cfc": "_file_coldfusion",
"cfm": "_file_coldfusion",
"mdx": "_file_mdx",
"lnk": "_file_lnk",
"pm": "_file_perl",
"pl": "_file_perl",
"jl": "_file_julia",
"gv": "_file_graphviz",
"erl": "_file_erlang",
"slim": "_file_slim",
"hx": "_file_haxe",
"zep": "_file_zephyr",
"mjs": "_file_node",
"mjml": "_file_mjml",
"blade.php": "_file_blade",
"blade": "_file_blade",
"inky.php": "_file_blade",
"scala": "_file_scala",
"asp": "_file_html",
"aspx": "_file_html",
"ascx": "_file_html",
"cmd": "_file_cmd",
"mustache": "_file_mustache",
"rails": "_file_rails",
"styl": "_file_stylus",
"twig": "_file_twig",
"swig": "_file_swig",
"sketch": "_file_sketch",
"do": "_file_todo",
"todo": "_file_todo",
"sublime-settings": "_file_sublime",
"sublime-theme": "_file_sublime",
"sublime-commands": "_file_sublime",
"sublime-menu": "_file_sublime",
"html": "_file_html",
"jade": "_file_pug",
"pug": "_file_pug",
"md": "_file_markdown",
"md.rendered": "_file_markdown",
"markdown": "_file_markdown",
"markdown.rendered": "_file_markdown",
"css": "_file_css",
"postcss": "_file_postcss",
"pcss": "_file_postcss",
"postcssrc": "_file_postcss",
"postcss.config.js": "_file_postcss",
"postcssrc.js": "_file_postcss",
"scss": "_file_sass",
"sass": "_file_sass",
"less": "_file_less",
"json": "_file_json",
"jsonc": "_file_json",
"yaml": "_file_yaml",
"YAML-tmLanguage": "_file_yaml",
"yml": "_file_yaml",
"xml": "_file_xml",
"plist": "_file_xml",
"xsd": "_file_xml",
"dtd": "_file_xml",
"xsl": "_file_xml",
"xslt": "_file_xml",
"resx": "_file_xml",
"iml": "_file_xml",
"xquery": "_file_xml",
"tmLanguage": "_file_xml",
"png": "_file_image",
"jpeg": "_file_image",
"jpg": "_file_image",
"gif": "_file_image",
"svg": "_file_svg",
"eps": "_file_svg",
"ai": "_file_ai",
"ico": "_file_image",
"tif": "_file_image",
"tiff": "_file_image",
"psd": "_file_psd",
"psb": "_file_psd",
"ami": "_file_image",
"apx": "_file_image",
"bmp": "_file_image",
"bpg": "_file_image",
"brk": "_file_image",
"cur": "_file_image",
"dds": "_file_image",
"dng": "_file_image",
"exr": "_file_image",
"fpx": "_file_image",
"gbr": "_file_image",
"img": "_file_image",
"jbig2": "_file_image",
"jb2": "_file_image",
"jng": "_file_image",
"jxr": "_file_image",
"pbm": "_file_image",
"pgf": "_file_image",
"pic": "_file_image",
"raw": "_file_image",
"webp": "_file_image",
"php": "_file_php",
"js": "_file_js",
"ejs": "_file_html",
"jsx": "_file_react",
"ini": "_file_settings",
"dlc": "_file_settings",
"dll": "_file_settings",
"config": "_file_settings",
"conf": "_file_settings",
"esx": "_file_js",
"ts": "_file_typescript",
"tsx": "_file_react",
"d.ts": "_file_typescript_def",
"spec.ts": "_file_typescript_def",
"pdf": "_file_pdf",
"xlsx": "_file_table",
"xls": "_file_table",
"csv": "_file_table",
"vscodeignore": "_file_visualstudio",
"vsixmanifest": "_file_visualstudio",
"suo": "_file_visualstudio",
"sln": "_file_visualstudio",
"pdb": "_file_database",
"cs": "_file_csharp",
"csx": "_file_csharp",
"csproj": "_file_visualstudio",
"zip": "_file_zip",
"tar": "_file_zip",
"gz": "_file_zip",
"xz": "_file_zip",
"bzip2": "_file_zip",
"gzip": "_file_zip",
"7z": "_file_zip",
"7zip": "_file_zip",
"pzip": "_file_zip",
"wim": "_file_zip",
"rar": "_file_zip",
"tgz": "_file_zip",
"exe": "_file_exe",
"msi": "_file_exe",
"java": "_file_java",
"jar": "_file_java",
"jsp": "_file_java",
"c": "_file_c",
"h": "_file_c",
"m": "_file_matlab",
"cc": "_file_cpp",
"cpp": "_file_cpp",
"c++": "_file_cpp",
"hpp": "_file_cpp",
"hxx": "_file_cpp",
"hh": "_file_cpp",
"mm": "_file_cpp",
"cxx": "_file_cpp",
"go": "_file_go",
"py": "_file_python",
"url": "_file_url",
"sh": "_file_console",
"ksh": "_file_console",
"csh": "_file_console",
"tcsh": "_file_console",
"zsh": "_file_console",
"bash": "_file_cmd",
"bat": "_file_cmd",
"cmd": "_file_cmd",
"awk": "_file_console",
"ps1": "_file_console",
"fish": "_file_console",
"gradle": "_file_gradle",
"doc": "_file_word",
"docx": "_file_word",
"rtf": "_file_word",
"properties": "_file_settings",
"prop": "_file_settings",
"settings": "_file_settings",
"sql": "_file_database",
"db": "_file_database",
"accdb": "_file_database",
"mdb": "_file_database",
"cer": "_file_certificate",
"cert": "_file_certificate",
"crt": "_file_certificate",
"pub": "_file_key",
"key": "_file_key",
"pem": "_file_key",
"asc": "_file_key",
"woff": "_file_font",
"woff2": "_file_font",
"ttf": "_file_font",
"eot": "_file_font",
"suit": "_file_font",
"otf": "_file_font",
"bmap": "_file_font",
"fnt": "_file_font",
"odttf": "_file_font",
"ttc": "_file_font",
"font": "_file_font",
"fonts": "_file_font",
"sui": "_file_font",
"ntf": "_file_font",
"mrf": "_file_font",
"lib": "_file_lib",
"rb": "_file_ruby",
"erb": "_file_ruby",
"lock": "_file_ruby",
"fs": "_file_fsharp",
"fsx": "_file_fsharp",
"fsi": "_file_fsharp",
"fsproj": "_file_fsharp",
"manifest": "_file_xml",
"swift": "_file_swift",
"ino": "_file_arduino",
"dockerignore": "_file_docker",
"tex": "_file_tex",
"cls": "_file_tex",
"sty": "_file_tex",
"bib": "_file_lib",
"pptx": "_file_powerpoint",
"ppt": "_file_powerpoint",
"pptm": "_file_powerpoint",
"potx": "_file_powerpoint",
"pot": "_file_powerpoint",
"potm": "_file_powerpoint",
"ppsx": "_file_powerpoint",
"ppsm": "_file_powerpoint",
"pps": "_file_powerpoint",
"ppam": "_file_powerpoint",
"ppa": "_file_powerpoint",
"webm": "_file_movie",
"mkv": "_file_movie",
"flv": "_file_movie",
"vob": "_file_movie",
"ogv": "_file_movie",
"ogg": "_file_movie",
"gifv": "_file_movie",
"avi": "_file_movie",
"mov": "_file_movie",
"qt": "_file_movie",
"wmv": "_file_movie",
"yuv": "_file_movie",
"rm": "_file_movie",
"rmvb": "_file_movie",
"mp4": "_file_movie",
"m4v": "_file_movie",
"mpg": "_file_movie",
"mp2": "_file_movie",
"mpeg": "_file_movie",
"mpe": "_file_movie",
"mpv": "_file_movie",
"m2v": "_file_movie",
"vdi": "_file_virtual",
"vbox": "_file_virtual",
"vbox-prev": "_file_virtual",
"ics": "_file_email",
"coffee": "_file_coffee",
"txt": "_file_document",
"sqlite": "_file_database",
"graphql": "_file_graphql",
"graphqlconfig": "_file_graphql",
"gql": "_file_graphql",
"props": "_file_settings",
"toml": "_file_settings",
"rs": "_file_rust",
"raml": "_file_raml",
"xaml": "_file_xaml",
"prefs": "_file_settings",
"hs": "_file_haskell",
"kt": "_file_kotlin",
"project": "_file_xml",
"patch": "_file_git",
"dockerfile": "_file_docker",
"vb": "_file_visualstudio",
"lua": "_file_lua",
"clj": "_file_clojure",
"groovy": "_file_groovy",
"r": "_file_r",
"rst": "_file_markdown",
"dart": "_file_dart",
"as": "_file_actionscript",
"mxml": "_file_mxml",
"ahk": "_file_autohotkey",
"swf": "_file_flash",
"swc": "_file_swc",
"cmake": "_file_cmake",
"asm": "_file_assembly",
"a51": "_file_assembly",
"inc": "_file_assembly",
"nasm": "_file_assembly",
"s": "_file_assembly",
"ms": "_file_assembly",
"agc": "_file_assembly",
"ags": "_file_assembly",
"aea": "_file_assembly",
"argus": "_file_assembly",
"mitigus": "_file_assembly",
"binsource": "_file_assembly",
"vue": "_file_vue",
"ml": "_file_ocaml",
"mli": "_file_ocaml",
"cmx": "_file_ocaml",
"js.map": "_file_jsmap",
"css.map": "_file_cssmap",
"tmTheme": "_file_markup",
"tmcolor": "_file_markup",
"pp": "_file_puppet",
"applescript": "_file_applescript",
"mp3": "_file_audio",
"flac": "_file_audio",
"m4a": "_file_audio",
"wma": "_file_audio",
"aiff": "_file_audio",
"haml": "_file_haml",
"ex": "_file_ex",
"exs": "_file_ex",
"eex": "_file_ex",
"re": "_file_reason",
"rei": "_file_reason",
"module.ts": "_file_angular",
"module.js": "_file_angular",
"ng-template": "_file_angular",
"component.ts": "_file_angular-component",
"component.js": "_file_angular-component",
"directive.ts": "_file_angular-directive",
"directive.js": "_file_angular-directive",
"guard.ts": "_file_angular-guard",
"guard.js": "_file_angular-guard",
"service.ts": "_file_angular-service",
"service.js": "_file_angular-service",
"pipe.ts": "_file_angular-pipe",
"pipe.js": "_file_angular-pipe",
"filter.js": "_file_angular-pipe",
"resolver.ts": "_file_angular-resolver",
"resolver.js": "_file_angular-resolver",
"routing.ts": "_file_angular-routing",
"routing.js": "_file_angular-routing",
"matlab": "_file_matlab",
"liquid": "_file_liquid",
"note": "_file_note",
"js.map": "_file_js_map",
"mjs.map": "_file_js_map"
},

View file

@ -1,5 +0,0 @@
"file": "_file_dark",
"folder": "_folder_dark",
"folderExpanded": "_folder_open",
"rootFolder": "_folder_root_dark",
"rootFolderExpanded": "_folder_root_open",

View file

@ -1,149 +0,0 @@
"fileNames": {
"nuxt.config.js": "_file_nuxtconfig",
"vue.config.js": "_file_vue",
".browserslistrc": "_file_browserlist",
".nvmrc": "_file_node",
".graphqlconfig.yml": "_file_graphql",
".graphqlconfig.yaml": "_file_graphql",
"prettier.config.js": "_file_prettier",
".prettierrc.js": "_file_prettier",
".prettierrc.json": "_file_prettier",
".prettierrc.yaml": "_file_prettier",
".prettierrc.yml": "_file_prettier",
".prettierrc": "_file_prettier",
".prettierignore": "_file_prettier",
"code_of_conduct.md": "_file_conduct",
"jest.config.js": "_file_jest",
"jest.config.ts": "_file_jest",
"jest.config.json": "_file_jest",
"jest.setup.js": "_file_jest",
"jest.setup.ts": "_file_jest",
"jest.json": "_file_jest",
".jestrc": "_file_jest",
"jest.teardown.js": "_file_jest",
"jenkinsfile": "_file_jenkins",
"gatsby.config.js": "_file_gatsby",
"firebase.json": "_file_firebase",
".firebaserc": "_file_firebase",
"code_of_conduct.md.rendered": "_file_conduct",
".gitlab-ci.yml": "_file_gitlab",
"gruntfile.js": "_file_grunt",
"package-lock.json": "_file_package-lock",
"bower.json": "_file_bower",
".bowerrc": "_file_bower",
"rollup.config.js": "_file_rollup",
"rollup.config.ts": "file_rollup",
"rollup-config.js": "file_rollup",
"rollup-config.ts": "file_rollup",
"rollup.config.common.js": "file_rollup",
"rollup.config.common.ts": "file_rollup",
"rollup.config.base.js": "file_rollup",
"rollup.config.base.ts": "file_rollup",
"rollup.config.prod.js": "file_rollup",
"rollup.config.prod.ts": "file_rollup",
"rollup.config.dev.js": "file_rollup",
"rollup.config.dev.ts": "file_rollup",
"rollup.config.prod.vendor.js": "file_rollup",
"rollup.config.prod.vendor.ts": "file_rollup",
"webpack.js": "_file_webpack",
"webpack.config.js": "_file_webpack",
"webpack.dev.js": "_file_webpack",
"webpack.prod.js": "_file_webpack",
"webpack.common.js": "_file_webpack",
"webpackfile.js": "_file_webpack",
"webpack.config.ts": "_file_webpack",
"webpack.dev.ts": "_file_webpack",
"webpack.prod.ts": "_file_webpack",
"webpack.common.ts": "_file_webpack",
"webpackfile.ts": "_file_webpack",
"webpack.ts": "_file_webpack",
"webpack.config.coffee": "_file_webpack",
"webpack.dev.coffee": "_file_webpack",
"webpack.prod.coffee": "_file_webpack",
"webpack.common.coffee": "_file_webpack",
"webpackfile.coffee": "_file_webpack",
"webpack.coffee": "_file_webpack",
"ionic.config.json": "_file_ionic",
".io-config.json": "_file_ionic",
"gulpfile.js": "_file_gulp",
"gulpfile.babel.js": "_file_gulp",
"gulpfile.babel.ts": "_file_gulp",
"gulp-config.js": "_file_gulp",
"package.json": "_file_npm",
"gradle.properties": "_file_gradle",
"gradlew": "_file_gradle",
".jscsrc": "_file_json",
".jshintrc": "_file_json",
".jshintignore": "_file_settings",
".npmignore": "_file_npm",
".npmrc": "_file_npm",
"tsconfig.json": "_file_json",
"tslint.json": "_file_json",
"androidmanifest.xml": "_file_android",
"gradle-wrapper.properties": "_file_gradle",
".editorconfig": "_file_settings",
"procfile": "_file_procfile",
".env": "_file_tune",
".env.development": "_file_tune",
".env.testing": "_file_tune",
".env.staging": "_file_tune",
".env.production": "_file_tune",
"dockerfile": "_file_docker",
"license": "_file_license",
"license.md": "_file_license",
"license.md.rendered": "_file_license",
"license.txt": "_file_license",
"babel.config.js": "_file_babel",
".babelrc": "_file_babel",
".babelrc.js": "_file_babel",
".babelrc.json": "_file_babel",
".eslintrc": "_file_eslint",
".eslintignore": "_file_eslint",
".eslintrc.js": "_file_eslint",
".eslintrc.json": "_file_eslint",
".eslintrc.yml": "_file_eslint",
".eslintrc.yaml": "_file_eslint",
".stylelintrc": "_file_stylelint",
".stylelint.config.js": "_file_stylelint",
".stylelintrc.js": "_file_stylelint",
".stylelintrc.json": "_file_stylelint",
".stylelintrc.yml": "_file_stylelint",
".stylelintrc.yaml": "_file_stylelint",
".stylelintignore": "_file_stylelint",
".buildignore": "_file_settings",
".htaccess": "_file_xml",
"composer.lock": "_file_json",
".gitignore": "_file_git",
".gitconfig": "_file_git",
".gitattributes": "_file_git",
".gitmodules": "_file_git",
".gitkeep": "_file_git",
"yarn.lock": "_file_yarn-lock",
".yarnrc": "_file_yarn",
".yarnclean": "_file_yarn",
".yarn-integrity": "_file_yarn",
"yarn-error.log": "_file_yarn",
"contributing.md": "_file_contributing",
"contributing.md.rendered": "_file_contributing",
"readme.md": "_file_readme",
"readme.md.rendered": "_file_readme",
".mailmap": "_file_email",
"makefile": "_file_settings",
"changelog": "_file_changelog",
"changelog.md": "_file_changelog",
"changelog.md.rendered": "_file_changelog",
"CREDITS": "_file_credits",
"credits.txt": "_file_credits",
"credits.md": "_file_credits",
"credits.md.rendered": "_file_credits",
".flowconfig": "_file_flow",
".jsbeautifyrc": "_file_json",
"git-history": "_file_git",
"angular-cli.json": "_file_angular",
".angular-cli.json": "_file_angular",
"directive.ts": "_file_angular-directive",
"directive.js": "_file_angular-directive",
"favicon.ico": "_file_favicon",
"mix.lock": "_file_elixir-lock",
"now.json": "_file_now"
},

View file

@ -1,51 +0,0 @@
"folderNames": {
"ci": "_folder_ci",
"test": "_folder_test",
"tests": "_folder_test",
"__test__": "_folder_test",
"__tests__": "_folder_test",
"node_modules": "_folder_node",
"assets": "_folder_assets",
"bower_components": "_folder_bower",
"js": "_folder_js",
"css": "_folder_css",
"style": "_folder_style",
"sass": "_folder_sass",
"scss": "_folder_sass",
"src": "_folder_src",
"source": "_folder_src",
"images": "_folder_images",
".git": "_folder_git",
".github": "_folder_github",
".vscode": "_folder_vscode",
".gulp": "_folder_gulp",
"gulp": "_folder_gulp",
"build": "_folder_dist",
"dist": "_folder_dist",
"out": "_folder_dist"
},
"folderNamesExpanded": {
"ci": "_folder_ci_open",
"test": "_folder_test_open",
"tests": "_folder_test_open",
"__test__": "_folder_test_open",
"__tests__": "_folder_test_open",
"node_modules": "_folder_node_open",
"bower_components": "_folder_bower_open",
"assets": "_folder_assets_open",
"src": "_folder_src_open",
"source": "_folder_src_open",
"images": "_folder_images_open",
"js": "_folder_js_open",
"css": "_folder_css_open",
"style": "_folder_css_open",
"sass": "_folder_sass_open",
"scss": "_folder_scss_open",
".git": "_folder_git_open",
".github": "_folder_github_open",
".gulp": "_folder_gulp_open",
".vscode": "_folder_vscode_open",
"build": "_folder_dist_open",
"dist": "_folder_dist_open",
"out": "_folder_dist_open"
}

View file

@ -1,7 +0,0 @@
"iconDefinitions": {
{{#icons}}
"{{name}}": {
"iconPath": "../icons/{{filename}}.svg"
}{{^last}},{{/last}}
{{/icons}}
},

View file

@ -1,60 +0,0 @@
"languageIds": {
"git": "_file_git",
"ng-template": "_file_angular",
"haxe": "_file_haxe",
"hxml": "_file_haxe",
"polymer": "_file_polymer",
"matlab": "_file_matlab",
"bat": "_file_cmd",
"c": "_file_c",
"csharp": "_file_csharp",
"cpp": "_file_cpp",
"css": "_file_css",
"clojure": "_file_clojure",
"coffeescript": "_file_coffee",
"dart": "_file_dart",
"diff": "_file_git",
"dockerfile": "_file_docker",
"fsharp": "_file_fsharp",
"git-commit": "_file_git",
"git-rebase": "_file_git",
"go": "_file_go",
"groovy": "_file_groovy",
"html": "_file_html",
"handlebars": "_file_handlebars",
"ignore": "_file_git",
"ini": "_file_settings",
"json": "_file_json",
"jsonc": "_file_json",
"java": "_file_java",
"javascript": "_file_js",
"javascriptreact": "_file_react",
"less": "_file_less",
"lua": "_file_lua",
"makefile": "_file_settings",
"markdown": "_file_markdown",
"objective-c": "_file_matlab",
"objective-cpp": "_file_cpp",
"php": "_file_php",
"perl": "_file_perl",
"perl6": "_file_perl",
"plaintext": "_file_document",
"powershell": "_file_console",
"properties": "_file_settings",
"proto3": "_file_protobuf",
"jade": "_file_pug",
"python": "_file_python",
"r": "_file_r",
"ruby": "_file_ruby",
"rust": "_file_rust",
"scss": "_file_sass",
"sql": "_file_database",
"shellscript": "_file_console",
"swift": "_file_swift",
"typescript": "_file_typescript",
"typescriptreact": "_file_react",
"vb": "_file_visualstudio",
"xml": "_file_xml",
"xsl": "_file_xml",
"yaml": "_file_yaml"
},

View file

@ -1,36 +0,0 @@
"light": {
"folderExpanded": "_folder_open",
"folder": "_folder_light",
"rootFolder": "_folder_root_light",
"rootFolderExpanded": "_folder_root_open",
"folderNames": {
"test": "_folder_test",
"node_modules": "_folder_node",
"assets": "_folder_assets",
"bower_components": "_folder_bower",
"js": "_folder_js",
"src": "_folder_src",
"images": "_folder_images",
".git": "_folder_git",
".github": "_folder_github",
".vscode": "_folder_vscode",
".gulp": "_folder_gulp",
"build": "_folder_dark_build",
"dist": "_folder_dist"
},
"folderNamesExpanded": {
"test": "_folder_test_open",
"node_modules": "_folder_node_open",
"bower_components": "_folder_bower_open",
"assets": "_folder_assets_open",
"src": "_folder_src_open",
"images": "_folder_images_open",
"js": "_folder_js_open",
".git": "_folder_git_open",
".github": "_folder_github_open",
".gulp": "_folder_gulp_open",
".vscode": "_folder_vscode_open",
"build": "_folder_open_build",
"dist": "_folder_dist_open"
}
},

View file

@ -4,14 +4,10 @@ import {IAccentCustomProperty} from './iaccent-custom-property';
export interface IDefaults { export interface IDefaults {
accents: IAccents; accents: IAccents;
accentsProperties: IGenericObject <IAccentCustomProperty>; accentsProperties: IGenericObject <IAccentCustomProperty>;
accentableIcons: string[];
changelog: IChangelog; changelog: IChangelog;
icons: IDefaultsThemeIcons;
themeVariants: IDefaultsThemeVariant; themeVariants: IDefaultsThemeVariant;
themeIconVariants: IDefaultsThemeIconVariant;
themeVariantsColours: IDefaultsThemeVariant; themeVariantsColours: IDefaultsThemeVariant;
themeVariantsUITheme: IDefaultsThemeVariant; themeVariantsUITheme: IDefaultsThemeVariant;
variantsIcons: string[];
[Symbol.iterator](): IterableIterator<IDefaults>; [Symbol.iterator](): IterableIterator<IDefaults>;
} }
@ -25,31 +21,6 @@ export interface IChangelog {
[Symbol.iterator](): IterableIterator<IChangelog>; [Symbol.iterator](): IterableIterator<IChangelog>;
} }
export interface IDefaultsThemeIcons {
theme: {
iconDefinitions: {
_folder_open: {
iconPath: string;
};
_folder_open_build: {
iconPath: string;
};
_folder_dark: {
iconPath: string;
};
_folder_dark_build: {
iconPath: string;
};
_folder_light_build: {
iconPath: string;
};
_folder_light: {
iconPath: string;
};
};
};
}
export interface IDefaultsThemeVariant { export interface IDefaultsThemeVariant {
[index: string]: string; [index: string]: string;
Darker: string; Darker: string;
@ -62,11 +33,3 @@ export interface IDefaultsThemeVariant {
Ocean: string; Ocean: string;
OceanHighContrast: string; OceanHighContrast: string;
} }
export interface IDefaultsThemeIconVariant {
[index: string]: string;
Darker: string;
Light: string;
Palenight: string;
Ocean: string;
}

View file

@ -1,4 +1,4 @@
import {IGenericObject} from './../../extensions/interfaces/igeneric-object'; import {IGenericObject} from '../interfaces/igeneric-object';
export interface IPackageJSONBadge { export interface IPackageJSONBadge {
description: string; description: string;
@ -9,7 +9,6 @@ export interface IPackageJSONBadge {
export interface IPackageJSONContributes { export interface IPackageJSONContributes {
commands: IPackageJSONCommand[]; commands: IPackageJSONCommand[];
configuration: IPackageJSONConfiguration; configuration: IPackageJSONConfiguration;
iconThemes: IPackageJSONThemeIcons[];
themes: IPackageJSONTheme[]; themes: IPackageJSONTheme[];
} }
@ -29,12 +28,6 @@ export interface IPackageJSONTheme {
uiTheme: string; uiTheme: string;
} }
export interface IPackageJSONThemeIcons {
id: string;
label: string;
path: string;
}
export interface IPackageJSON { export interface IPackageJSON {
activationEvents: string[]; activationEvents: string[];
badges: IPackageJSONBadge[]; badges: IPackageJSONBadge[];

View file

@ -1,12 +1,4 @@
export interface IPaths { export interface IPaths {
/**
* Dist dir
*/
DIST: string;
/**
* Icons dir
*/
ICONS: string;
/** /**
* Src dir * Src dir
*/ */
@ -19,6 +11,7 @@ export interface IPaths {
* Extension directory * Extension directory
*/ */
VSIX_DIR: string; VSIX_DIR: string;
VSIX_SRC_DIR: string;
/** /**
* Internal Extensions directory * Internal Extensions directory
*/ */

View file

@ -1,4 +1,3 @@
export interface IThemeCustomSettings { export interface IThemeCustomSettings {
accent?: string; accent?: string;
autoApplyIcons?: boolean;
} }

View file

@ -1,37 +1,23 @@
import { import {
workspace as Workspace,
commands as Commands, commands as Commands,
ExtensionContext ExtensionContext
} from 'vscode'; } from 'vscode';
import * as ThemeCommands from './commands'; import * as ThemeCommands from './commands';
import {setCustomSetting, updateAccent} from './helpers/settings'; import {updateAccent} from './helpers/settings';
import {onChangeConfiguration} from './helpers/configuration-change';
import {changelogMessage, installationMessage} from './helpers/messages'; import {changelogMessage, installationMessage} from './helpers/messages';
import checkInstallation from './helpers/check-installation'; import checkInstallation from './helpers/check-installation';
import writeChangelog from './helpers/write-changelog'; import writeChangelog from './helpers/write-changelog';
import {ReleaseNotesWebview} from './webviews/ReleaseNotes'; import {ReleaseNotesWebview} from './webviews/ReleaseNotes';
export async function activate(context: ExtensionContext) { export async function activate(context: ExtensionContext) {
const config = Workspace.getConfiguration();
const installationType = checkInstallation(); const installationType = checkInstallation();
const releaseNotesView = new ReleaseNotesWebview(context); const releaseNotesView = new ReleaseNotesWebview(context);
writeChangelog(); writeChangelog();
// Listen on set theme: when the theme is Material Theme, just adjust icon and accent.
Workspace.onDidChangeConfiguration(onChangeConfiguration);
// Delete old configuration, must remove with next major release
if (config.has('materialTheme.cache.workbench')) {
config.update('materialTheme.cache.workbench', undefined, true);
}
if (installationType.isFirstInstall) { if (installationType.isFirstInstall) {
const enableAutoApply = await installationMessage(); await installationMessage();
await setCustomSetting('autoApplyIcons', enableAutoApply);
// Set true always on new installation
await setCustomSetting('showReloadNotification', true);
} }
const shouldShowChangelog = (installationType.isFirstInstall || installationType.isUpdate) && await changelogMessage(); const shouldShowChangelog = (installationType.isFirstInstall || installationType.isUpdate) && await changelogMessage();
@ -44,8 +30,6 @@ export async function activate(context: ExtensionContext) {
const accentPicked = await ThemeCommands.accentsQuickPick(); const accentPicked = await ThemeCommands.accentsQuickPick();
await updateAccent(accentPicked); await updateAccent(accentPicked);
}); });
Commands.registerCommand('materialTheme.fixIcons', () => ThemeCommands.fixIcons());
Commands.registerCommand('materialTheme.toggleApplyIcons', () => ThemeCommands.toggleApplyIcons());
Commands.registerCommand('materialTheme.showReleaseNotes', () => releaseNotesView.show()); Commands.registerCommand('materialTheme.showReleaseNotes', () => releaseNotesView.show());
} }

View file

@ -5,8 +5,8 @@ import {
ExtensionContext ExtensionContext
} from 'vscode'; } from 'vscode';
import {SettingsBootstrap} from './interfaces'; import {SettingsBootstrap} from './interfaces';
import {getCustomSettings} from '../../extensions/helpers/settings'; import {getCustomSettings} from '../helpers/settings';
import {getDefaultValues} from '../../extensions/helpers/fs'; import {getDefaultValues} from '../helpers/fs';
export class SettingsWebview extends WebviewController<SettingsBootstrap> { export class SettingsWebview extends WebviewController<SettingsBootstrap> {
constructor(context: ExtensionContext) { constructor(context: ExtensionContext) {

View file

@ -12,7 +12,7 @@ import {
Uri Uri
} from 'vscode'; } from 'vscode';
import {getCustomSettings} from '../../extensions/helpers/settings'; import {getCustomSettings} from '../helpers/settings';
import {Invalidates, Message, SettingsChangedMessage} from './interfaces'; import {Invalidates, Message, SettingsChangedMessage} from './interfaces';
export abstract class WebviewController<TBootstrap> extends Disposable { export abstract class WebviewController<TBootstrap> extends Disposable {
@ -42,7 +42,7 @@ export abstract class WebviewController<TBootstrap> extends Disposable {
private async getHtml(): Promise<string> { private async getHtml(): Promise<string> {
const doc = await Workspace const doc = await Workspace
.openTextDocument(this.context.asAbsolutePath(path.join('ui', this.filename))); .openTextDocument(this.context.asAbsolutePath(path.join('out/ui', this.filename)));
return doc.getText(); return doc.getText();
} }
@ -118,7 +118,7 @@ export abstract class WebviewController<TBootstrap> extends Disposable {
const html = await this.getHtml(); const html = await this.getHtml();
const rootPath = Uri const rootPath = Uri
.file(this.context.asAbsolutePath('.')) .file(this.context.asAbsolutePath('./out'))
.with({scheme: 'vscode-resource'}).toString(); .with({scheme: 'vscode-resource'}).toString();
// Replace placeholders in html content for assets and adding configurations as `window.bootstrap` // Replace placeholders in html content for assets and adding configurations as `window.bootstrap`

View file

@ -1,5 +1,5 @@
import {IThemeCustomSettings} from '../../extensions/interfaces/itheme-custom-properties'; import {IThemeCustomSettings} from '../interfaces/itheme-custom-properties';
import {IDefaults} from '../../extensions/interfaces/idefaults'; import {IDefaults} from '../interfaces/idefaults';
export interface IChangeType { export interface IChangeType {
children: { children: {

View file

@ -1,4 +1,4 @@
import {IAccents} from '../../../../../extensions/interfaces/idefaults'; import {IAccents} from '../../../../interfaces/idefaults';
const templateSingleAccent = (accentName: string, accentColor: string): string => { const templateSingleAccent = (accentName: string, accentColor: string): string => {
const dashAccentName = accentName.toLowerCase().replace(/ /gi, '-'); const dashAccentName = accentName.toLowerCase().replace(/ /gi, '-');

View file

@ -1,23 +1,26 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [ "lib": [
"es6", "es7",
"dom" "dom"
], ],
"module": "commonjs", "sourceMap": true,
"allowUnreachableCode": false, "allowUnreachableCode": false,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noImplicitAny": true, "noImplicitAny": true
"sourceMap": true,
"target": "es6"
}, },
"include": [ "include": [
"./**/*", "./.gulp/**/*",
"./.gulp/**/*" "./typings/**/*",
"./src/**/*",
"./test/**/*",
], ],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"out" ".vscode-test"
] ]
} }

679
yarn.lock

File diff suppressed because it is too large Load diff