Skip to content

Commit

Permalink
Rearranged imports
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Apr 22, 2018
1 parent 74d1055 commit 0b7a8b9
Show file tree
Hide file tree
Showing 34 changed files with 60 additions and 77 deletions.
8 changes: 4 additions & 4 deletions scripts/icons/checks/checkIconAvailability.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileIcons, folderIcons, languageIcons, lightVersion, highContrastVersion, openedFolder } from './../../../src/icons';
import { FileIcon, FolderTheme, FolderIcon, DefaultIcon } from '../../../src/models/index';
import { similarity } from '../../helpers/similarity';
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import { DefaultIcon, FileIcon, FolderIcon, FolderTheme } from '../../../src/models/index';
import * as painter from '../../helpers/painter';
import { similarity } from '../../helpers/similarity';
import { fileIcons, folderIcons, highContrastVersion, languageIcons, lightVersion, openedFolder } from './../../../src/icons';

/**
* Defines the folder where all icon files are located.
Expand Down
3 changes: 1 addition & 2 deletions scripts/icons/checks/checkIconConflicts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fileIcons, folderIcons, languageIcons } from './../../../src/icons';
import { FileIcon } from '../../../src/models/index';
import * as painter from '../../helpers/painter';
import { fileIcons, folderIcons, languageIcons } from './../../../src/icons';

/**
* Store all icons that are wrong configured
Expand Down
8 changes: 4 additions & 4 deletions scripts/icons/checks/checkIconUsage.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fileIcons, folderIcons, languageIcons, openedFolder, lightVersion, highContrastVersion } from './../../../src/icons';
import { FolderTheme, FolderIcon, DefaultIcon } from '../../../src/models/index';
import * as painter from './../../helpers/painter';
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import { DefaultIcon, FolderIcon, FolderTheme } from '../../../src/models/index';
import { fileIcons, folderIcons, highContrastVersion, languageIcons, lightVersion, openedFolder } from './../../../src/icons';
import * as painter from './../../helpers/painter';

/**
* Defines the folder where all icon files are located.
Expand Down
2 changes: 1 addition & 1 deletion scripts/icons/checks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as checkAvailability from './checkIconAvailability';
import * as checkIconUsage from './checkIconUsage';
import * as checkIconConflicts from './checkIconConflicts';
import * as checkIconUsage from './checkIconUsage';

checkAvailability.check();
checkIconUsage.check();
Expand Down
4 changes: 2 additions & 2 deletions scripts/icons/generateJson.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* This file is only a script file that should only be executed by the npm scripts.
*/
import { createIconFile } from './../../src/icons/index';
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import * as painter from '../helpers/painter';
import { createIconFile } from './../../src/icons/index';

createIconFile().then((fileName: string) => {
const filePath = path.resolve('src', fileName);
Expand Down
7 changes: 1 addition & 6 deletions scripts/preview/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { createScreenshots } from './screenshots';
import { generatePreview } from './preview';
import { fileIcons } from './../../src/icons/fileIcons';
import { folderIcons } from './../../src/icons/folderIcons';
import * as painter from './../helpers/painter';
import * as fs from 'fs';
import * as path from 'path';
import { toTitleCase } from '../helpers/titleCase';
import { generatePreview } from './preview';

const filterDuplicates = (icons: string[]) => {
return [...new Set(icons)];
Expand Down
2 changes: 1 addition & 1 deletion scripts/preview/preview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import * as painter from './../helpers/painter';
import { toTitleCase } from './../helpers/titleCase';
import { createScreenshots } from './screenshots';
Expand Down
2 changes: 1 addition & 1 deletion scripts/preview/screenshots.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as puppeteer from 'puppeteer';
import * as path from 'path';
import * as puppeteer from 'puppeteer';

export const createScreenshots = async (filePath: string, fileName: string) => {
const htmlFilePath = path.join(__dirname, '..', '..', filePath);
Expand Down
3 changes: 1 addition & 2 deletions src/commands/folderArrows.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as vscode from 'vscode';
import * as helpers from './../helpers';
import * as i18n from './../i18n';
import * as versioning from './../helpers/versioning';
import * as i18n from './../i18n';
import * as outdatedMessage from './../messages/outdated';
import { folderIcons } from '../icons';

/** Command to toggle the folder icons. */
export const toggleFolderArrows = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/folderColor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import { getDefaultIconOptions, validateHEXColorCode } from '../icons';
import * as helpers from './../helpers';
import * as i18n from './../i18n';
import { getDefaultIconOptions, validateHEXColorCode } from '../icons';

interface FolderColor {
label: string;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/folders.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import { folderIcons } from '../icons';
import * as helpers from './../helpers';
import * as i18n from './../i18n';
import { folderIcons } from '../icons';

/** Command to toggle the folder icons. */
export const changeFolderTheme = () => {
Expand Down
5 changes: 1 addition & 4 deletions src/commands/iconPacks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as vscode from 'vscode';
import { IconPack } from '../models/index';
import * as helpers from './../helpers';
import * as path from 'path';
import * as fs from 'fs';
import * as i18n from './../i18n';
import * as reload from './../messages/reload';
import { IconConfiguration, IconPack } from '../models/index';

/** Command to toggle the icons packs */
export const toggleIconPacks = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as vscode from 'vscode';
import { activateIconTheme } from './activate';
import { toggleIconPacks } from './iconPacks';
import { changeFolderTheme } from './folders';
import { restoreDefaultConfig } from './restoreConfig';
import { toggleFolderArrows } from './folderArrows';
import { changeFolderColor } from './folderColor';
import { changeFolderTheme } from './folders';
import { toggleIconPacks } from './iconPacks';
import { restoreDefaultConfig } from './restoreConfig';

// Activate theme
const activateThemeCommand = vscode.commands.registerCommand('material-icon-theme.activateIcons', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/restoreConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as helpers from './../helpers';
import { getDefaultIconOptions } from '../icons/index';
import * as helpers from './../helpers';

/** Restore all configurations to default. */
export const restoreDefaultConfig = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

import * as vscode from 'vscode';
import * as i18n from './i18n';
import * as commands from './commands';
import { showStartMessages } from './messages/start';
import { detectConfigChanges } from './helpers/change-detection';
import { checkThemeStatus } from './helpers/versioning';
import * as i18n from './i18n';
import { showStartMessages } from './messages/start';

/**
* This method is called when the extension is activated.
Expand Down
3 changes: 1 addition & 2 deletions src/helpers/change-detection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as vscode from 'vscode';
import { getExtensionConfiguration, getMaterialIconsJSON, getThemeConfig, promptToReload } from '.';
import { createIconFile } from '../icons/index';
import { getObjectPropertyValue, setObjectPropertyValue } from './objects';
import { getExtensionConfiguration, promptToReload, getMaterialIconsJSON, getThemeConfig } from '.';

/** Compare the workspace and the user configurations with the current setup of the icons. */
export const detectConfigChanges = () => {
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';
import * as reloadMessages from './../messages/reload';
import * as path from 'path';
import * as vscode from 'vscode';
import { iconJsonName } from '../icons/index';
import { AdvancedWorkspaceConfiguration } from '../models';
import { IconConfiguration } from '../models/index';
import { iconJsonName } from '../icons/index';
import * as reloadMessages from './../messages/reload';

/** Get configuration of vs code. */
export const getConfig = (section?: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/versioning.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as semver from 'semver';
import * as vscode from 'vscode';
import * as helpers from './index';
import * as semver from 'semver';

export enum ThemeStatus {
neverUsedBefore,
Expand Down
1 change: 0 additions & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as vscode from 'vscode';
import * as fs from 'fs';
import { getObjectPropertyValue } from '../helpers/objects';

// Get current language of the vs code workspace
Expand Down
4 changes: 2 additions & 2 deletions src/icons/generator/fileGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FileIcons, IconConfiguration, FileIcon, IconJsonOptions, IconAssociations } from '../../models/index';
import { iconFolderPath, lightVersion, highContrastVersion } from './constants';
import * as merge from 'lodash.merge';
import { FileIcon, FileIcons, IconAssociations, IconConfiguration, IconJsonOptions } from '../../models/index';
import { highContrastVersion, iconFolderPath, lightVersion } from './constants';

/**
* Get all file icons that can be used in this theme.
Expand Down
6 changes: 3 additions & 3 deletions src/icons/generator/folderGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { iconFolderPath, openedFolder, lightVersion, highContrastVersion } from './constants';
import { IconConfiguration, FolderTheme, FolderIcon, IconJsonOptions, DefaultIcon, IconAssociations } from '../../models/index';
import * as merge from 'lodash.merge';
import * as fs from 'fs';
import * as merge from 'lodash.merge';
import * as path from 'path';
import { DefaultIcon, FolderIcon, FolderTheme, IconAssociations, IconConfiguration, IconJsonOptions } from '../../models/index';
import { highContrastVersion, iconFolderPath, lightVersion, openedFolder } from './constants';

/**
* Get the folder icon definitions as object.
Expand Down
10 changes: 5 additions & 5 deletions src/icons/generator/jsonGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { IconConfiguration, IconPack, IconJsonOptions } from '../../models/index';
import { getFileIconDefinitions, getFolderIconDefinitions, getLanguageIconDefinitions, generateFolderIcons } from './index';
import * as fs from 'fs';
import * as merge from 'lodash.merge';
import * as path from 'path';
import { IconConfiguration, IconJsonOptions } from '../../models/index';
import { fileIcons } from '../fileIcons';
import { folderIcons } from '../folderIcons';
import { languageIcons } from '../languageIcons';
import { iconJsonName } from './constants';
import * as merge from 'lodash.merge';
import * as path from 'path';
import * as fs from 'fs';
import { generateFolderIcons, getFileIconDefinitions, getFolderIconDefinitions, getLanguageIconDefinitions } from './index';

/**
* Generate the complete icon configuration object that can be written as JSON file.
Expand Down
5 changes: 2 additions & 3 deletions src/icons/generator/languageGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { iconFolderPath, lightVersion, highContrastVersion } from './constants';
import { IconConfiguration, LanguageIcon, IconJsonOptions, DefaultIcon, IconAssociations } from '../../models/index';
import * as merge from 'lodash.merge';
import { LanguageConfiguration } from 'vscode';
import { DefaultIcon, IconAssociations, IconConfiguration, IconJsonOptions, LanguageIcon } from '../../models/index';
import { highContrastVersion, iconFolderPath, lightVersion } from './constants';

/**
* Get all file icons that can be used in this theme.
Expand Down
2 changes: 1 addition & 1 deletion src/messages/outdated.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as opn from 'opn';
import * as vscode from 'vscode';
import * as i18n from './../i18n';
import * as opn from 'opn';

/** Show message that the editor version is outdated. */
export const showOutdatedMessage = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/messages/reload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as vscode from 'vscode';
import * as i18n from './../i18n';
import * as helpers from './../helpers';
import * as i18n from './../i18n';

/** User has to confirm if he wants to reload the editor */
export const showConfirmToReloadMessage = (): Promise<boolean> => {
Expand Down
3 changes: 1 addition & 2 deletions src/messages/start.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as helpers from './../helpers';
import { ThemeStatus } from '../helpers/versioning';
import { showUpdateMessage } from './update';
import { showWelcomeMessage } from './welcome';
import { ThemeStatus } from '../helpers/versioning';

/** Initialization of the icons every time the theme get activated */
export const showStartMessages = (themeStatus: Promise<ThemeStatus>) => {
Expand Down
6 changes: 3 additions & 3 deletions src/messages/update.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as opn from 'opn';
import * as vscode from 'vscode';
import { activateIconTheme } from '../commands/activate';
import * as helpers from './../helpers';
import * as versioning from './../helpers/versioning';
import * as vscode from 'vscode';
import * as opn from 'opn';
import * as i18n from './../i18n';
import { activateIconTheme } from '../commands/activate';

/** Show the update message if the icon theme has been updated. */
export const showUpdateMessage = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/messages/welcome.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as opn from 'opn';
import * as vscode from 'vscode';
import { activateIconTheme } from '../commands/activate';
import * as helpers from './../helpers';
import * as versioning from './../helpers/versioning';
import * as vscode from 'vscode';
import * as opn from 'opn';
import * as i18n from './../i18n';
import { activateIconTheme } from '../commands/activate';

/** Show the welcome message if the icon theme has been installed the first time. */
export const showWelcomeMessage = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/models/icons/files/FileTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileIcon } from './index';
import { DefaultIcon } from '../defaultIcon';
import { FileIcon } from './index';

export class FileIcons {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/models/icons/folders/FolderTheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FolderIcon, DefaultIcon } from '../index';
import { DefaultIcon, FolderIcon } from '../index';

export interface FolderTheme {
/**
Expand Down
3 changes: 1 addition & 2 deletions test/i18n/i18n.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as assert from 'assert';
import * as vscode from 'vscode';
import * as i18n from '../../src/i18n';
import { getObjectPropertyValue } from '../../src/helpers/objects';
import * as i18n from '../../src/i18n';

suite('i18n', () => {
test('shoud initialize translations', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/icons/fileIcons.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as assert from 'assert';
import { IconConfiguration, IconJsonOptions, FileIcons, IconPack } from '../../src/models/index';
import { getDefaultIconOptions, getFileIconDefinitions } from '../../src/icons/index';
import * as merge from 'lodash.merge';
import { FileIcons, IconConfiguration, IconPack } from '../../src/models/index';

suite('file icons', () => {
test('should configure icon definitions', () => {
Expand Down
5 changes: 2 additions & 3 deletions test/icons/folderIcons.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as assert from 'assert';
import { IconConfiguration, IconJsonOptions, IconPack, FolderTheme } from '../../src/models/index';
import { getFolderIconDefinitions, getDefaultIconOptions } from '../../src/icons/index';
import * as merge from 'lodash.merge';
import { getDefaultIconOptions, getFolderIconDefinitions } from '../../src/icons/index';
import { FolderTheme, IconConfiguration, IconPack } from '../../src/models/index';

suite('folder icons', () => {
const folderIcons: FolderTheme[] = [
Expand Down
4 changes: 2 additions & 2 deletions test/icons/languageIcons.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as assert from 'assert';
import { LanguageIcon, IconConfiguration, IconPack } from '../../src/models/index';
import { getLanguageIconDefinitions, getDefaultIconOptions } from '../../src/icons/index';
import { getDefaultIconOptions, getLanguageIconDefinitions } from '../../src/icons/index';
import { IconConfiguration, IconPack, LanguageIcon } from '../../src/models/index';

suite('language icons', () => {
const iconConfig = new IconConfiguration();
Expand Down

0 comments on commit 0b7a8b9

Please sign in to comment.