From c008a3478e8534051e1b93cc8bed0487c92b139e Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 14 Jun 2019 23:47:48 +0200 Subject: [PATCH] @typescript-eslint linter --- .eslintrc.yml | 82 +++ HACKING.md | 4 +- app/src/app.module.ts | 4 +- app/src/entry.preload.ts | 6 +- app/src/entry.ts | 14 +- app/src/plugins.ts | 14 +- app/src/root.component.ts | 4 +- app/yarn.lock | 48 +- package.json | 13 +- .../src/colorSchemes.ts | 8 +- terminus-community-color-schemes/src/index.ts | 2 +- terminus-core/src/api/hotkeyProvider.ts | 6 +- terminus-core/src/api/index.ts | 4 +- .../src/api/toolbarButtonProvider.ts | 8 +- .../src/components/appRoot.component.ts | 38 +- .../src/components/checkbox.component.ts | 2 +- .../src/components/splitTab.component.ts | 80 +-- .../components/splitTabSpanner.component.ts | 6 +- .../src/components/startPage.component.ts | 6 +- .../src/components/tabHeader.component.ts | 1 - .../src/components/titleBar.component.ts | 2 +- .../src/components/toggle.component.ts | 2 +- .../src/directives/autofocus.directive.ts | 2 +- terminus-core/src/hotkeys.ts | 6 +- terminus-core/src/index.ts | 22 +- terminus-core/src/services/app.service.ts | 4 +- terminus-core/src/services/config.service.ts | 22 +- terminus-core/src/services/docking.service.ts | 15 +- .../src/services/electron.service.ts | 24 +- .../src/services/homeBase.service.ts | 6 +- terminus-core/src/services/hostApp.service.ts | 4 +- terminus-core/src/services/hotkeys.service.ts | 110 ++-- terminus-core/src/services/log.service.ts | 30 +- .../src/services/shellIntegration.service.ts | 30 +- .../src/services/tabRecovery.service.ts | 1 - terminus-core/src/services/tabs.service.ts | 3 +- .../src/services/touchbar.service.ts | 12 +- terminus-core/src/tabContextMenu.ts | 16 +- .../pluginsSettingsTab.component.ts | 20 +- terminus-plugin-manager/src/index.ts | 2 +- .../src/services/pluginManager.service.ts | 12 +- terminus-settings/src/buttonProvider.ts | 4 +- .../components/hotkeyInputModal.component.ts | 10 +- .../components/multiHotkeyInput.component.ts | 2 +- .../src/components/settingsTab.component.ts | 6 +- terminus-settings/src/config.ts | 10 +- terminus-settings/src/hotkeys.ts | 6 +- terminus-settings/src/index.ts | 2 +- terminus-ssh/src/api.ts | 2 +- terminus-ssh/src/buttonProvider.ts | 8 +- .../editConnectionModal.component.ts | 16 +- .../src/components/sshModal.component.ts | 10 +- .../components/sshSettingsTab.component.ts | 8 +- terminus-ssh/src/config.ts | 4 +- terminus-ssh/src/index.ts | 2 +- terminus-ssh/src/services/ssh.service.ts | 24 +- terminus-ssh/tsconfig0.typings.json | 14 + .../src/api/baseTerminalTab.component.ts | 262 ++++---- .../src/api/colorSchemeProvider.ts | 4 +- terminus-terminal/src/api/decorator.ts | 4 +- terminus-terminal/src/api/interfaces.ts | 4 +- terminus-terminal/src/api/shellProvider.ts | 4 +- terminus-terminal/src/buttonProvider.ts | 12 +- terminus-terminal/src/colorSchemes.ts | 10 +- .../appearanceSettingsTab.component.ts | 28 +- .../src/components/searchPanel.component.ts | 6 +- .../components/shellSettingsTab.component.ts | 6 +- .../src/components/terminalTab.component.ts | 14 +- terminus-terminal/src/config.ts | 38 +- terminus-terminal/src/contextMenu.ts | 10 +- terminus-terminal/src/frontends/frontend.ts | 12 +- terminus-terminal/src/frontends/hterm.ts | 6 +- .../src/frontends/htermFrontend.ts | 20 +- .../src/frontends/xtermFrontend.ts | 20 +- terminus-terminal/src/hotkeys.ts | 8 +- terminus-terminal/src/index.ts | 9 +- terminus-terminal/src/pathDrop.ts | 2 +- .../src/services/dockMenu.service.ts | 2 +- .../src/services/sessions.service.ts | 50 +- .../src/services/terminal.service.ts | 38 +- .../src/services/terminalFrontend.service.ts | 8 +- terminus-terminal/src/shells/cmder.ts | 8 +- terminus-terminal/src/shells/custom.ts | 4 +- terminus-terminal/src/shells/cygwin32.ts | 12 +- terminus-terminal/src/shells/cygwin64.ts | 12 +- terminus-terminal/src/shells/gitBash.ts | 14 +- terminus-terminal/src/shells/linuxDefault.ts | 4 +- terminus-terminal/src/shells/macDefault.ts | 4 +- terminus-terminal/src/shells/posix.ts | 4 +- .../src/shells/powershellCore.ts | 12 +- terminus-terminal/src/shells/winDefault.ts | 4 +- terminus-terminal/src/shells/windowsStock.ts | 6 +- terminus-terminal/src/shells/wsl.ts | 22 +- terminus-terminal/src/tabContextMenu.ts | 6 +- tslint.json | 21 - yarn.lock | 611 +++++++++++++++--- 96 files changed, 1334 insertions(+), 810 deletions(-) create mode 100644 .eslintrc.yml create mode 100644 terminus-ssh/tsconfig0.typings.json delete mode 100644 tslint.json diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..20da7bad --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,82 @@ +parser: '@typescript-eslint/parser' +parserOptions: + project: tsconfig.json +extends: + - 'plugin:@typescript-eslint/all' +plugins: + - '@typescript-eslint' +env: + browser: true + es6: true + node: true + commonjs: true +rules: + '@typescript-eslint/semi': + - error + - never + '@typescript-eslint/indent': + - error + - 4 + '@typescript-eslint/explicit-member-accessibility': + - error + - accessibility: no-public + overrides: + parameterProperties: explicit + '@typescript-eslint/no-require-imports': off + '@typescript-eslint/no-parameter-properties': off + '@typescript-eslint/explicit-function-return-type': off + '@typescript-eslint/no-explicit-any': off + '@typescript-eslint/no-magic-numbers': off + '@typescript-eslint/member-delimiter-style': off + '@typescript-eslint/promise-function-async': off + '@typescript-eslint/no-unnecessary-type-assertion': off + '@typescript-eslint/require-array-sort-compare': off + '@typescript-eslint/no-use-before-define': + - error + - classes: false + no-duplicate-imports: error + array-bracket-spacing: + - error + - never + block-scoped-var: error + brace-style: + - error + - 1tbs + - allowSingleLine: true + computed-property-spacing: + - error + - never + comma-dangle: + - error + - always-multiline + curly: error + eol-last: error + eqeqeq: + - error + - smart + linebreak-style: + - error + - unix + max-depth: + - 1 + - 5 + max-statements: + - 1 + - 80 + no-multiple-empty-lines: error + no-mixed-spaces-and-tabs: error + no-trailing-spaces: error + '@typescript-eslint/no-unused-vars': + - error + - vars: all + args: after-used + argsIgnorePattern: ^_ + no-undef: error + object-curly-spacing: + - error + - always + quote-props: + - warn + - as-needed + - keywords: true + numbers: true diff --git a/HACKING.md b/HACKING.md index 31e89587..c7525235 100644 --- a/HACKING.md +++ b/HACKING.md @@ -92,11 +92,11 @@ Plugins provide functionality by exporting singular or multi providers: ```javascript import { NgModule, Injectable } from '@angular/core' -import { ToolbarButtonProvider, IToolbarButton } from 'terminus-core' +import { ToolbarButtonProvider, ToolbarButton } from 'terminus-core' @Injectable() export class MyButtonProvider extends ToolbarButtonProvider { - provide (): IToolbarButton[] { + provide (): ToolbarButton[] { return [{ icon: 'star', title: 'Foobar', diff --git a/app/src/app.module.ts b/app/src/app.module.ts index 205f40b4..f792c8e0 100644 --- a/app/src/app.module.ts +++ b/app/src/app.module.ts @@ -16,7 +16,7 @@ export function getRootModule (plugins: any[]) { }), ] const bootstrap = [ - ...(plugins.filter(x => x.bootstrap).map(x => x.bootstrap)), + ...plugins.filter(x => x.bootstrap).map(x => x.bootstrap), ] if (bootstrap.length === 0) { @@ -26,7 +26,7 @@ export function getRootModule (plugins: any[]) { @NgModule({ imports, bootstrap, - }) class RootModule { } + }) class RootModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class return RootModule } diff --git a/app/src/entry.preload.ts b/app/src/entry.preload.ts index 5262da92..a425d4a8 100644 --- a/app/src/entry.preload.ts +++ b/app/src/entry.preload.ts @@ -21,15 +21,15 @@ Raven.config( return splitArray[splitArray.length - 1] } - data.exception.values[0].stacktrace.frames.forEach(frame => { + data.exception.values[0].stacktrace.frames.forEach((frame: any) => { frame.filename = normalize(frame.filename) }) data.culprit = data.exception.values[0].stacktrace.frames[0].filename return data - } - } + }, + }, ) process.on('uncaughtException' as any, (err) => { diff --git a/app/src/entry.ts b/app/src/entry.ts index ee166339..801f385b 100644 --- a/app/src/entry.ts +++ b/app/src/entry.ts @@ -2,19 +2,19 @@ import 'zone.js' import 'core-js/proposals/reflect-metadata' import 'rxjs' -import isDev = require('electron-is-dev') +import * as isDev from 'electron-is-dev' import './global.scss' import './toastr.scss' -// Always land on the start view -location.hash = '' - import { enableProdMode, NgModuleRef } from '@angular/core' import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' import { getRootModule } from './app.module' -import { findPlugins, loadPlugins, IPluginInfo } from './plugins' +import { findPlugins, loadPlugins, PluginInfo } from './plugins' + +// Always land on the start view +location.hash = '' ;(process as any).enablePromiseAPI = true @@ -28,12 +28,12 @@ if (isDev) { enableProdMode() } -async function bootstrap (plugins: IPluginInfo[], safeMode = false): Promise> { +async function bootstrap (plugins: PluginInfo[], safeMode = false): Promise> { if (safeMode) { plugins = plugins.filter(x => x.isBuiltin) } const pluginsModules = await loadPlugins(plugins, (current, total) => { - (document.querySelector('.progress .bar') as HTMLElement).style.width = 100 * current / total + '%' + (document.querySelector('.progress .bar') as HTMLElement).style.width = `${100 * current / total}%` // eslint-disable-line }) const module = getRootModule(pluginsModules) window['rootModule'] = module diff --git a/app/src/plugins.ts b/app/src/plugins.ts index ebba100b..029d9f41 100644 --- a/app/src/plugins.ts +++ b/app/src/plugins.ts @@ -1,6 +1,6 @@ import * as fs from 'mz/fs' import * as path from 'path' -const nodeModule = require('module') +const nodeModule = require('module') // eslint-disable-line @typescript-eslint/no-var-requires const nodeRequire = (global as any).require function normalizePath (path: string): string { @@ -38,9 +38,9 @@ if (process.env.TERMINUS_PLUGINS) { process.env.TERMINUS_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x))) } -export declare type ProgressCallback = (current: number, total: number) => void +export type ProgressCallback = (current: number, total: number) => void // eslint-disable-line @typescript-eslint/no-type-alias -export interface IPluginInfo { +export interface PluginInfo { name: string description: string packageName: string @@ -87,9 +87,9 @@ const originalRequire = (global as any).require return originalRequire.apply(this, arguments) } -export async function findPlugins (): Promise { +export async function findPlugins (): Promise { const paths = nodeModule.globalPaths - let foundPlugins: IPluginInfo[] = [] + let foundPlugins: PluginInfo[] = [] const candidateLocations: { pluginDir: string, packageName: string }[] = [] const PREFIX = 'terminus-' @@ -102,7 +102,7 @@ export async function findPlugins (): Promise { if (await fs.exists(path.join(pluginDir, 'package.json'))) { candidateLocations.push({ pluginDir: path.dirname(pluginDir), - packageName: path.basename(pluginDir) + packageName: path.basename(pluginDir), }) } for (const packageName of pluginNames) { @@ -152,7 +152,7 @@ export async function findPlugins (): Promise { return foundPlugins } -export async function loadPlugins (foundPlugins: IPluginInfo[], progress: ProgressCallback): Promise { +export async function loadPlugins (foundPlugins: PluginInfo[], progress: ProgressCallback): Promise { const plugins: any[] = [] progress(0, 1) let index = 0 diff --git a/app/src/root.component.ts b/app/src/root.component.ts index dee7aff9..8d2bd18c 100644 --- a/app/src/root.component.ts +++ b/app/src/root.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core' @Component({ - template: '' + template: '', }) -export class RootComponent { } +export class RootComponent { } // eslint-disable-line @typescript-eslint/no-extraneous-class diff --git a/app/yarn.lock b/app/yarn.lock index 6d1e2752..f38e8878 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -630,7 +630,7 @@ debug@^4.1.1: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -1220,7 +1220,7 @@ import-lazy@^2.1.0: resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -1516,7 +1516,7 @@ libnpm@^2.0.1: read-package-json "^2.0.13" stringify-package "^1.0.0" -libnpmaccess@*, libnpmaccess@^3.0.1: +libnpmaccess@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-3.0.1.tgz#5b3a9de621f293d425191aa2e779102f84167fa8" integrity sha512-RlZ7PNarCBt+XbnP7R6PoVgOq9t+kou5rvhaInoNibhPO7eMlRfS0B8yjatgn2yaHIwWNyoJDolC/6Lc5L/IQA== @@ -1545,7 +1545,7 @@ libnpmhook@^5.0.2: get-stream "^4.0.0" npm-registry-fetch "^3.8.0" -libnpmorg@*, libnpmorg@^1.0.0: +libnpmorg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/libnpmorg/-/libnpmorg-1.0.0.tgz#979b868c48ba28c5820e3bb9d9e73c883c16a232" integrity sha512-o+4eVJBoDGMgRwh2lJY0a8pRV2c/tQM/SxlqXezjcAg26Qe9jigYVs+Xk0vvlYDWCDhP0g74J8UwWeAgsB7gGw== @@ -1570,7 +1570,7 @@ libnpmpublish@^1.1.0: semver "^5.5.1" ssri "^6.0.1" -libnpmsearch@*, libnpmsearch@^2.0.0: +libnpmsearch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/libnpmsearch/-/libnpmsearch-2.0.0.tgz#de05af47ada81554a5f64276a69599070d4a5685" integrity sha512-vd+JWbTGzOSfiOc+72MU6y7WqmBXn49egCCrIXp27iE/88bX8EpG64ST1blWQI1bSMUr9l1AKPMVsqa2tS5KWA== @@ -1579,7 +1579,7 @@ libnpmsearch@*, libnpmsearch@^2.0.0: get-stream "^4.0.0" npm-registry-fetch "^3.8.0" -libnpmteam@*, libnpmteam@^1.0.1: +libnpmteam@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/libnpmteam/-/libnpmteam-1.0.1.tgz#ff704b1b6c06ea674b3b1101ac3e305f5114f213" integrity sha512-gDdrflKFCX7TNwOMX1snWojCoDE5LoRWcfOC0C/fqF7mBq8Uz9zWAX4B2RllYETNO7pBupBaSyBDkTAC15cAMg== @@ -1634,11 +1634,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -1647,33 +1642,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._root@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" @@ -1689,11 +1662,6 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.union@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" @@ -2051,7 +2019,7 @@ npm-pick-manifest@^2.2.3: npm-package-arg "^6.0.0" semver "^5.4.1" -npm-profile@*, npm-profile@^4.0.1: +npm-profile@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-4.0.1.tgz#d350f7a5e6b60691c7168fbb8392c3603583f5aa" integrity sha512-NQ1I/1Q7YRtHZXkcuU1/IyHeLy6pd+ScKg4+DQHdfsm769TGq6HPrkbuNJVJS4zwE+0mvvmeULzQdWn2L2EsVA== @@ -2645,7 +2613,7 @@ readable-stream@~1.1.10: isarray "0.0.1" string_decoder "~0.10.x" -readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= diff --git a/package.json b/package.json index bff44059..9f544128 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "@types/js-yaml": "^3.12.1", "@types/node": "^12.0.8", "@types/webpack-env": "1.13.9", + "@typescript-eslint/eslint-plugin": "^1.10.2", + "@typescript-eslint/parser": "^1.10.2", "app-builder-lib": "^20.43.0", "apply-loader": "2.0.0", "awesome-typescript-loader": "^5.0.0", @@ -17,6 +19,7 @@ "electron-builder": "^20.43.0", "electron-installer-snap": "^3.2.0", "electron-rebuild": "^1.8.5", + "eslint": "^5.16.0", "file-loader": "^4.0.0", "graceful-fs": "^4.1.15", "html-loader": "0.5.5", @@ -40,9 +43,6 @@ "style-loader": "^0.23.1", "svg-inline-loader": "^0.8.0", "to-string-loader": "1.1.5", - "tslint": "^5.17.0", - "tslint-config-standard": "^8.0.1", - "tslint-eslint-rules": "^5.4.0", "typedoc": "^0.14.2", "typescript": "^3.5.2", "url-loader": "^2.0.0", @@ -131,8 +131,11 @@ "start": "cross-env TERMINUS_DEV=1 electron app --debug", "prod": "cross-env TERMINUS_DEV=1 electron app", "docs": "typedoc --out docs/api terminus-core/src && typedoc --out docs/api/terminal --tsconfig terminus-terminal/tsconfig.typings.json terminus-terminal/src && typedoc --out docs/api/settings --tsconfig terminus-settings/tsconfig.typings.json terminus-settings/src", - "lint": "tslint -c tslint.json -t stylish terminus-*/src/**/*.ts terminus-*/src/*.ts app/src/*.ts", + "lint": "eslint --ext ts */src", "postinstall": "node ./scripts/install-deps.js" }, - "repository": "eugeny/terminus" + "repository": "eugeny/terminus", + "dependencies": { + "eslint-plugin-import": "^2.17.3" + } } diff --git a/terminus-community-color-schemes/src/colorSchemes.ts b/terminus-community-color-schemes/src/colorSchemes.ts index cb57c669..97452db5 100644 --- a/terminus-community-color-schemes/src/colorSchemes.ts +++ b/terminus-community-color-schemes/src/colorSchemes.ts @@ -1,12 +1,12 @@ import { Injectable } from '@angular/core' -import { TerminalColorSchemeProvider, ITerminalColorScheme } from 'terminus-terminal' +import { TerminalColorSchemeProvider, TerminalColorScheme } from 'terminus-terminal' const schemeContents = require.context('../schemes/', true, /.*/) @Injectable() export class ColorSchemes extends TerminalColorSchemeProvider { - async getSchemes (): Promise { - const schemes: ITerminalColorScheme[] = [] + async getSchemes (): Promise { + const schemes: TerminalColorScheme[] = [] schemeContents.keys().forEach(schemeFile => { const lines = (schemeContents(schemeFile).default as string).split('\n') @@ -16,7 +16,7 @@ export class ColorSchemes extends TerminalColorSchemeProvider { lines .filter(x => x.startsWith('#define')) .map(x => x.split(' ').map(v => v.trim())) - .forEach(([ignore, variableName, variableValue]) => { + .forEach(([_, variableName, variableValue]) => { variables[variableName] = variableValue }) diff --git a/terminus-community-color-schemes/src/index.ts b/terminus-community-color-schemes/src/index.ts index 7c4ddb90..757dc81d 100644 --- a/terminus-community-color-schemes/src/index.ts +++ b/terminus-community-color-schemes/src/index.ts @@ -8,4 +8,4 @@ import { ColorSchemes } from './colorSchemes' { provide: TerminalColorSchemeProvider, useClass: ColorSchemes, multi: true }, ], }) -export default class PopularThemesModule { } +export default class PopularThemesModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class diff --git a/terminus-core/src/api/hotkeyProvider.ts b/terminus-core/src/api/hotkeyProvider.ts index 54bc6b0f..8e153a73 100644 --- a/terminus-core/src/api/hotkeyProvider.ts +++ b/terminus-core/src/api/hotkeyProvider.ts @@ -1,4 +1,4 @@ -export interface IHotkeyDescription { +export interface HotkeyDescription { id: string name: string } @@ -8,7 +8,7 @@ export interface IHotkeyDescription { * must also provide the `hotkeys.foo` config options with the default values */ export abstract class HotkeyProvider { - hotkeys: IHotkeyDescription[] = [] + hotkeys: HotkeyDescription[] = [] - abstract provide (): Promise + abstract provide (): Promise } diff --git a/terminus-core/src/api/index.ts b/terminus-core/src/api/index.ts index 21d227f1..7112d09e 100644 --- a/terminus-core/src/api/index.ts +++ b/terminus-core/src/api/index.ts @@ -1,9 +1,9 @@ export { BaseTabComponent, BaseTabProcess } from '../components/baseTab.component' export { SplitTabComponent, SplitContainer } from '../components/splitTab.component' export { TabRecoveryProvider, RecoveredTab } from './tabRecovery' -export { ToolbarButtonProvider, IToolbarButton } from './toolbarButtonProvider' +export { ToolbarButtonProvider, ToolbarButton } from './toolbarButtonProvider' export { ConfigProvider } from './configProvider' -export { HotkeyProvider, IHotkeyDescription } from './hotkeyProvider' +export { HotkeyProvider, HotkeyDescription } from './hotkeyProvider' export { Theme } from './theme' export { TabContextMenuItemProvider } from './tabContextMenuProvider' diff --git a/terminus-core/src/api/toolbarButtonProvider.ts b/terminus-core/src/api/toolbarButtonProvider.ts index 12e8b019..c801ec1f 100644 --- a/terminus-core/src/api/toolbarButtonProvider.ts +++ b/terminus-core/src/api/toolbarButtonProvider.ts @@ -3,7 +3,7 @@ import { SafeHtml } from '@angular/platform-browser' /** * See [[ToolbarButtonProvider]] */ -export interface IToolbarButton { +export interface ToolbarButton { /** * Raw SVG icon code */ @@ -25,15 +25,15 @@ export interface IToolbarButton { click?: () => void - submenu?: () => Promise + submenu?: () => Promise /** @hidden */ - submenuItems?: IToolbarButton[] + submenuItems?: ToolbarButton[] } /** * Extend to add buttons to the toolbar */ export abstract class ToolbarButtonProvider { - abstract provide (): IToolbarButton[] + abstract provide (): ToolbarButton[] } diff --git a/terminus-core/src/components/appRoot.component.ts b/terminus-core/src/components/appRoot.component.ts index 1010f292..47601368 100644 --- a/terminus-core/src/components/appRoot.component.ts +++ b/terminus-core/src/components/appRoot.component.ts @@ -15,7 +15,7 @@ import { TouchbarService } from '../services/touchbar.service' import { BaseTabComponent } from './baseTab.component' import { SafeModeModalComponent } from './safeModeModal.component' -import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api' +import { AppService, ToolbarButton, ToolbarButtonProvider } from '../api' /** @hidden */ @Component({ @@ -26,36 +26,36 @@ import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api' trigger('animateTab', [ state('in', style({ 'flex-basis': '200px', - 'width': '200px', + width: '200px', })), transition(':enter', [ style({ 'flex-basis': '1px', - 'width': '1px', + width: '1px', }), animate('250ms ease-in-out', style({ 'flex-basis': '200px', - 'width': '200px', - })) + width: '200px', + })), ]), transition(':leave', [ style({ 'flex-basis': '200px', - 'width': '200px', + width: '200px', }), animate('250ms ease-in-out', style({ 'flex-basis': '1px', - 'width': '1px', - })) - ]) - ]) - ] + width: '1px', + })), + ]), + ]), + ], }) export class AppRootComponent { Platform = Platform @Input() ready = false - @Input() leftToolbarButtons: IToolbarButton[] - @Input() rightToolbarButtons: IToolbarButton[] + @Input() leftToolbarButtons: ToolbarButton[] + @Input() rightToolbarButtons: ToolbarButton[] @HostBinding('class.platform-win32') platformClassWindows = process.platform === 'win32' @HostBinding('class.platform-darwin') platformClassMacOS = process.platform === 'darwin' @HostBinding('class.platform-linux') platformClassLinux = process.platform === 'linux' @@ -89,7 +89,7 @@ export class AppRootComponent { this.updateIcon = domSanitizer.bypassSecurityTrustHtml(require('../icons/gift.svg')), - this.hotkeys.matchedHotkey.subscribe((hotkey) => { + this.hotkeys.matchedHotkey.subscribe((hotkey: string) => { if (hotkey.startsWith('tab-')) { const index = parseInt(hotkey.split('-')[1]) if (index <= this.app.tabs.length) { @@ -233,20 +233,20 @@ export class AppRootComponent { }) } - async generateButtonSubmenu (button: IToolbarButton) { + async generateButtonSubmenu (button: ToolbarButton) { if (button.submenu) { button.submenuItems = await button.submenu() } } - private getToolbarButtons (aboveZero: boolean): IToolbarButton[] { - let buttons: IToolbarButton[] = [] + private getToolbarButtons (aboveZero: boolean): ToolbarButton[] { + let buttons: ToolbarButton[] = [] this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => { buttons = buttons.concat(provider.provide()) }) return buttons - .filter((button) => (button.weight > 0) === aboveZero) - .sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0)) + .filter(button => button.weight > 0 === aboveZero) + .sort((a: ToolbarButton, b: ToolbarButton) => (a.weight || 0) - (b.weight || 0)) } private updateVibrancy () { diff --git a/terminus-core/src/components/checkbox.component.ts b/terminus-core/src/components/checkbox.component.ts index 24bab6cf..5cb5ebd5 100644 --- a/terminus-core/src/components/checkbox.component.ts +++ b/terminus-core/src/components/checkbox.component.ts @@ -8,7 +8,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' styles: [require('./checkbox.component.scss')], providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }, - ] + ], }) export class CheckboxComponent implements ControlValueAccessor { @HostBinding('class.active') @Input() model: boolean diff --git a/terminus-core/src/components/splitTab.component.ts b/terminus-core/src/components/splitTab.component.ts index 9f9eb776..a13aaa3b 100644 --- a/terminus-core/src/components/splitTab.component.ts +++ b/terminus-core/src/components/splitTab.component.ts @@ -6,8 +6,8 @@ import { TabsService } from '../services/tabs.service' import { HotkeysService } from '../services/hotkeys.service' import { TabRecoveryService } from '../services/tabRecovery.service' -export declare type SplitOrientation = 'v' | 'h' -export declare type SplitDirection = 'r' | 't' | 'b' | 'l' +export type SplitOrientation = 'v' | 'h' // eslint-disable-line @typescript-eslint/no-type-alias +export type SplitDirection = 'r' | 't' | 'b' | 'l' // eslint-disable-line @typescript-eslint/no-type-alias /** * Describes a horizontal or vertical split row or column @@ -198,33 +198,33 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes return } switch (hotkey) { - case 'split-right': - this.splitTab(this.focusedTab, 'r') - break - case 'split-bottom': - this.splitTab(this.focusedTab, 'b') - break - case 'split-top': - this.splitTab(this.focusedTab, 't') - break - case 'split-left': - this.splitTab(this.focusedTab, 'l') - break - case 'pane-nav-left': - this.navigate('l') - break - case 'pane-nav-right': - this.navigate('r') - break - case 'pane-nav-up': - this.navigate('t') - break - case 'pane-nav-down': - this.navigate('b') - break - case 'close-pane': - this.removeTab(this.focusedTab) - break + case 'split-right': + this.splitTab(this.focusedTab, 'r') + break + case 'split-bottom': + this.splitTab(this.focusedTab, 'b') + break + case 'split-top': + this.splitTab(this.focusedTab, 't') + break + case 'split-left': + this.splitTab(this.focusedTab, 'l') + break + case 'pane-nav-left': + this.navigate('l') + break + case 'pane-nav-right': + this.navigate('r') + break + case 'pane-nav-up': + this.navigate('t') + break + case 'pane-nav-down': + this.navigate('b') + break + case 'close-pane': + this.removeTab(this.focusedTab) + break } }) } @@ -291,11 +291,11 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes let insertIndex = target.children.indexOf(relative) if ( - (target.orientation === 'v' && ['l', 'r'].includes(side)) || - (target.orientation === 'h' && ['t', 'b'].includes(side)) + target.orientation === 'v' && ['l', 'r'].includes(side) || + target.orientation === 'h' && ['t', 'b'].includes(side) ) { const newContainer = new SplitContainer() - newContainer.orientation = (target.orientation === 'v') ? 'h' : 'v' + newContainer.orientation = target.orientation === 'v' ? 'h' : 'v' newContainer.children = [relative] newContainer.ratios = [1] target.children[insertIndex] = newContainer @@ -306,7 +306,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes if (insertIndex === -1) { insertIndex = 0 } else { - insertIndex += (side === 'l' || side === 't') ? 0 : 1 + insertIndex += side === 'l' || side === 't' ? 0 : 1 } for (let i = 0; i < target.children.length; i++) { @@ -419,7 +419,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes } private attachTabView (tab: BaseTabComponent) { - const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef + const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion this.viewRefs.set(tab, ref) ref.rootNodes[0].addEventListener('click', () => this.focus(tab)) @@ -448,7 +448,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes } private layoutInternal (root: SplitContainer, x: number, y: number, w: number, h: number) { - const size = (root.orientation === 'v') ? h : w + const size = root.orientation === 'v' ? h : w const sizes = root.ratios.map(x => x * size) root.x = x @@ -458,10 +458,10 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes let offset = 0 root.children.forEach((child, i) => { - const childX = (root.orientation === 'v') ? x : (x + offset) - const childY = (root.orientation === 'v') ? (y + offset) : y - const childW = (root.orientation === 'v') ? w : sizes[i] - const childH = (root.orientation === 'v') ? sizes[i] : h + const childX = root.orientation === 'v' ? x : x + offset + const childY = root.orientation === 'v' ? y + offset : y + const childW = root.orientation === 'v' ? w : sizes[i] + const childH = root.orientation === 'v' ? sizes[i] : h if (child instanceof SplitContainer) { this.layoutInternal(child, childX, childY, childW, childH) } else { @@ -472,7 +472,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes element.style.width = `${childW}%` element.style.height = `${childH}%` - element.style.opacity = (child === this.focusedTab) ? 1 : 0.75 + element.style.opacity = child === this.focusedTab ? 1 : 0.75 } offset += sizes[i] diff --git a/terminus-core/src/components/splitTabSpanner.component.ts b/terminus-core/src/components/splitTabSpanner.component.ts index 803f7c6d..af53be27 100644 --- a/terminus-core/src/components/splitTabSpanner.component.ts +++ b/terminus-core/src/components/splitTabSpanner.component.ts @@ -23,13 +23,13 @@ export class SplitTabSpannerComponent { constructor (private element: ElementRef) { } ngAfterViewInit () { - this.element.nativeElement.addEventListener('mousedown', e => { + this.element.nativeElement.addEventListener('mousedown', (e: MouseEvent) => { this.isActive = true const start = this.isVertical ? e.pageY : e.pageX let current = start - const oldPosition = this.isVertical ? this.element.nativeElement.offsetTop : this.element.nativeElement.offsetLeft + const oldPosition: number = this.isVertical ? this.element.nativeElement.offsetTop : this.element.nativeElement.offsetLeft - const dragHandler = e => { + const dragHandler = (e: MouseEvent) => { current = this.isVertical ? e.pageY : e.pageX const newPosition = oldPosition + (current - start) if (this.isVertical) { diff --git a/terminus-core/src/components/startPage.component.ts b/terminus-core/src/components/startPage.component.ts index 53442f24..51e90dab 100644 --- a/terminus-core/src/components/startPage.component.ts +++ b/terminus-core/src/components/startPage.component.ts @@ -1,7 +1,7 @@ import { Component, Inject } from '@angular/core' import { ConfigService } from '../services/config.service' import { HomeBaseService } from '../services/homeBase.service' -import { IToolbarButton, ToolbarButtonProvider } from '../api' +import { ToolbarButton, ToolbarButtonProvider } from '../api' /** @hidden */ @Component({ @@ -19,11 +19,11 @@ export class StartPageComponent { ) { } - getButtons (): IToolbarButton[] { + getButtons (): ToolbarButton[] { return this.config.enabledServices(this.toolbarButtonProviders) .map(provider => provider.provide()) .reduce((a, b) => a.concat(b)) .filter(x => !!x.click) - .sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0)) + .sort((a: ToolbarButton, b: ToolbarButton) => (a.weight || 0) - (b.weight || 0)) } } diff --git a/terminus-core/src/components/tabHeader.component.ts b/terminus-core/src/components/tabHeader.component.ts index 42f06d57..0aabb01b 100644 --- a/terminus-core/src/components/tabHeader.component.ts +++ b/terminus-core/src/components/tabHeader.component.ts @@ -85,7 +85,6 @@ export class TabHeaderComponent { contextMenu.popup({ x: $event.pageX, y: $event.pageY, - async: true, }) } } diff --git a/terminus-core/src/components/titleBar.component.ts b/terminus-core/src/components/titleBar.component.ts index 70e390f1..9e8b088b 100644 --- a/terminus-core/src/components/titleBar.component.ts +++ b/terminus-core/src/components/titleBar.component.ts @@ -6,4 +6,4 @@ import { Component } from '@angular/core' template: require('./titleBar.component.pug'), styles: [require('./titleBar.component.scss')], }) -export class TitleBarComponent { } +export class TitleBarComponent { } // eslint-disable-line @typescript-eslint/no-extraneous-class diff --git a/terminus-core/src/components/toggle.component.ts b/terminus-core/src/components/toggle.component.ts index c07b40b0..a417b1b6 100644 --- a/terminus-core/src/components/toggle.component.ts +++ b/terminus-core/src/components/toggle.component.ts @@ -17,7 +17,7 @@ import { CheckboxComponent } from './checkbox.component' styles: [require('./toggle.component.scss')], providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true }, - ] + ], }) export class ToggleComponent extends CheckboxComponent { } diff --git a/terminus-core/src/directives/autofocus.directive.ts b/terminus-core/src/directives/autofocus.directive.ts index 43743bf6..26849b8c 100644 --- a/terminus-core/src/directives/autofocus.directive.ts +++ b/terminus-core/src/directives/autofocus.directive.ts @@ -2,7 +2,7 @@ import { Directive, AfterViewInit, ElementRef } from '@angular/core' /** @hidden */ @Directive({ - selector: '[autofocus]' + selector: '[autofocus]', }) export class AutofocusDirective implements AfterViewInit { constructor (private el: ElementRef) { } diff --git a/terminus-core/src/hotkeys.ts b/terminus-core/src/hotkeys.ts index eb18d6a5..1ee22240 100644 --- a/terminus-core/src/hotkeys.ts +++ b/terminus-core/src/hotkeys.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core' -import { IHotkeyDescription, HotkeyProvider } from './api/hotkeyProvider' +import { HotkeyDescription, HotkeyProvider } from './api/hotkeyProvider' /** @hidden */ @Injectable() export class AppHotkeyProvider extends HotkeyProvider { - hotkeys: IHotkeyDescription[] = [ + hotkeys: HotkeyDescription[] = [ { id: 'new-window', name: 'New window', @@ -115,7 +115,7 @@ export class AppHotkeyProvider extends HotkeyProvider { }, ] - async provide (): Promise { + async provide (): Promise { return this.hotkeys } } diff --git a/terminus-core/src/index.ts b/terminus-core/src/index.ts index 5e807d4a..4fb42fd0 100644 --- a/terminus-core/src/index.ts +++ b/terminus-core/src/index.ts @@ -39,6 +39,12 @@ import { TaskCompletionContextMenu, CommonOptionsContextMenu, CloseContextMenu } import 'perfect-scrollbar/css/perfect-scrollbar.css' import 'ng2-dnd/bundles/style.css' +// PerfectScrollbar fix +import { fromEvent } from 'rxjs/internal/observable/fromEvent' +import { merge } from 'rxjs/internal/observable/merge' +require('rxjs').fromEvent = fromEvent +require('rxjs').merge = merge + const PROVIDERS = [ { provide: HotkeyProvider, useClass: AppHotkeyProvider, multi: true }, { provide: Theme, useClass: StandardTheme, multi: true }, @@ -49,7 +55,7 @@ const PROVIDERS = [ { provide: TabContextMenuItemProvider, useClass: CloseContextMenu, multi: true }, { provide: TabContextMenuItemProvider, useClass: TaskCompletionContextMenu, multi: true }, { provide: TabRecoveryProvider, useClass: SplitTabRecoveryProvider, multi: true }, - { provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true } } + { provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true } }, ] /** @hidden */ @@ -88,9 +94,9 @@ const PROVIDERS = [ CheckboxComponent, ToggleComponent, AutofocusDirective, - ] + ], }) -export default class AppModule { +export default class AppModule { // eslint-disable-line @typescript-eslint/no-extraneous-class constructor (app: AppService, config: ConfigService) { app.ready$.subscribe(() => { if (config.store.enableWelcomeTab) { @@ -107,11 +113,9 @@ export default class AppModule { } } -// PerfectScrollbar fix -import { fromEvent } from 'rxjs/internal/observable/fromEvent' -import { merge } from 'rxjs/internal/observable/merge' -require('rxjs').fromEvent = fromEvent -require('rxjs').merge = merge - export { AppRootComponent as bootstrap } export * from './api' + +// Deprecations +export { ToolbarButton as IToolbarButton } from './api' +export { HotkeyDescription as IHotkeyDescription } from './api' diff --git a/terminus-core/src/services/app.service.ts b/terminus-core/src/services/app.service.ts index cb847b96..69d18325 100644 --- a/terminus-core/src/services/app.service.ts +++ b/terminus-core/src/services/app.service.ts @@ -21,7 +21,7 @@ class CompletionObserver { } async tick () { - if (!(await this.tab.getCurrentProcess())) { + if (!await this.tab.getCurrentProcess()) { this.done.next(null) this.stop() } @@ -81,7 +81,7 @@ export class AppService { }) } - private addTabRaw (tab: BaseTabComponent) { + addTabRaw (tab: BaseTabComponent) { this.tabs.push(tab) this.selectTab(tab) this.tabsChanged.next() diff --git a/terminus-core/src/services/config.service.ts b/terminus-core/src/services/config.service.ts index 8ecda488..157521c4 100644 --- a/terminus-core/src/services/config.service.ts +++ b/terminus-core/src/services/config.service.ts @@ -14,7 +14,7 @@ function isStructuralMember (v) { Object.keys(v).length > 0 && !v.__nonStructural } -function isNonStructuralObjectMember (v) { +function isNonStructuralObjectMember (v): boolean { return v instanceof Object && !(v instanceof Array) && v.__nonStructural } @@ -46,13 +46,13 @@ export class ConfigProxy { get: () => this.getValue(key), set: (value) => { this.setValue(key, value) - } + }, } ) } } - this.getValue = (key: string) => { + this.getValue = (key: string) => { // eslint-disable-line @typescript-eslint/unbound-method if (real[key] !== undefined) { return real[key] } else { @@ -66,13 +66,13 @@ export class ConfigProxy { } } - this.setValue = (key: string, value: any) => { + this.setValue = (key: string, value: any) => { // eslint-disable-line @typescript-eslint/unbound-method real[key] = value } } - getValue (key: string): any { } // tslint:disable-line - setValue (key: string, value: any) { } // tslint:disable-line + getValue (_key: string): any { } + setValue (_key: string, _value: any) { } } @Injectable({ providedIn: 'root' }) @@ -160,10 +160,6 @@ export class ConfigService { this.emitChange() } - private emitChange (): void { - this.changed.next() - } - requestRestart (): void { this.restartRequested = true } @@ -179,7 +175,7 @@ export class ConfigService { this.servicesCache = {} const ngModule = window['rootModule'].ngInjectorDef for (const imp of ngModule.imports) { - const module = (imp['ngModule'] || imp) + const module = imp['ngModule'] || imp if (module.ngInjectorDef && module.ngInjectorDef.providers) { this.servicesCache[module['pluginName']] = module.ngInjectorDef.providers.map(provider => { return provider['useClass'] || provider @@ -196,4 +192,8 @@ export class ConfigService { return true }) } + + private emitChange (): void { + this.changed.next() + } } diff --git a/terminus-core/src/services/docking.service.ts b/terminus-core/src/services/docking.service.ts index 9109e825..20f368db 100644 --- a/terminus-core/src/services/docking.service.ts +++ b/terminus-core/src/services/docking.service.ts @@ -3,11 +3,6 @@ import { ConfigService } from '../services/config.service' import { ElectronService } from '../services/electron.service' import { HostAppService, Bounds } from '../services/hostApp.service' -export interface IScreen { - id: string - name: string -} - @Injectable({ providedIn: 'root' }) export class DockingService { /** @hidden */ @@ -29,7 +24,7 @@ export class DockingService { } let display = this.electron.screen.getAllDisplays() - .filter((x) => x.id === this.config.store.appearance.dockScreen)[0] + .filter(x => x.id === this.config.store.appearance.dockScreen)[0] if (!display) { display = this.getCurrentScreen() } @@ -71,10 +66,10 @@ export class DockingService { return this.electron.screen.getAllDisplays().map((display, index) => { return { id: display.id, - name: { - 0: 'Primary display', - 1: 'Secondary display', - }[index] || `Display ${index + 1}` + name: [ + 'Primary display', + 'Secondary display', + ][index] || `Display ${index + 1}`, } }) } diff --git a/terminus-core/src/services/electron.service.ts b/terminus-core/src/services/electron.service.ts index 745d5162..c570f598 100644 --- a/terminus-core/src/services/electron.service.ts +++ b/terminus-core/src/services/electron.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core' -import { TouchBar, BrowserWindow, Menu, MenuItem } from 'electron' +import { TouchBar, BrowserWindow, Menu, MenuItem, NativeImage } from 'electron' export interface MessageBoxResponse { response: number @@ -8,16 +8,16 @@ export interface MessageBoxResponse { @Injectable({ providedIn: 'root' }) export class ElectronService { - app: any - ipcRenderer: any - shell: any - dialog: any - clipboard: any - globalShortcut: any - nativeImage: any - screen: any - remote: any - autoUpdater: any + app: Electron.App + ipcRenderer: Electron.IpcRenderer + shell: Electron.Shell + dialog: Electron.Dialog + clipboard: Electron.Clipboard + globalShortcut: Electron.GlobalShortcut + nativeImage: typeof NativeImage + screen: Electron.Screen + remote: Electron.Remote + autoUpdater: Electron.AutoUpdater TouchBar: typeof TouchBar BrowserWindow: typeof BrowserWindow Menu: typeof Menu @@ -52,7 +52,7 @@ export class ElectronService { } } - showMessageBox ( + async showMessageBox ( browserWindow: Electron.BrowserWindow, options: Electron.MessageBoxOptions ): Promise { diff --git a/terminus-core/src/services/homeBase.service.ts b/terminus-core/src/services/homeBase.service.ts index ddbec383..934a2484 100644 --- a/terminus-core/src/services/homeBase.service.ts +++ b/terminus-core/src/services/homeBase.service.ts @@ -2,8 +2,8 @@ import * as os from 'os' import { Injectable } from '@angular/core' import { ElectronService } from './electron.service' import { ConfigService } from './config.service' -import mixpanel = require('mixpanel') -import uuidv4 = require('uuid/v4') +import * as mixpanel from 'mixpanel' +import * as uuidv4 from 'uuid/v4' @Injectable({ providedIn: 'root' }) export class HomeBaseService { @@ -53,7 +53,7 @@ export class HomeBaseService { getAnalyticsProperties () { return { - distinct_id: window.localStorage.analyticsUserID, + distinct_id: window.localStorage.analyticsUserID, // eslint-disable-line @typescript-eslint/camelcase platform: process.platform, os: os.release(), version: this.appVersion, diff --git a/terminus-core/src/services/hostApp.service.ts b/terminus-core/src/services/hostApp.service.ts index 7816d717..52d7c3f2 100644 --- a/terminus-core/src/services/hostApp.service.ts +++ b/terminus-core/src/services/hostApp.service.ts @@ -1,5 +1,5 @@ import * as path from 'path' -import shellEscape = require('shell-escape') +import * as shellEscape from 'shell-escape' import { Observable, Subject } from 'rxjs' import { Injectable, NgZone, EventEmitter } from '@angular/core' import { ElectronService } from './electron.service' @@ -97,7 +97,7 @@ export class HostAppService { this.platform = { win32: Platform.Windows, darwin: Platform.macOS, - linux: Platform.Linux + linux: Platform.Linux, }[process.platform] this.windowId = parseInt(location.search.substring(1)) diff --git a/terminus-core/src/services/hotkeys.service.ts b/terminus-core/src/services/hotkeys.service.ts index bfd46236..16b01417 100644 --- a/terminus-core/src/services/hotkeys.service.ts +++ b/terminus-core/src/services/hotkeys.service.ts @@ -1,5 +1,5 @@ import { Injectable, Inject, NgZone, EventEmitter } from '@angular/core' -import { IHotkeyDescription, HotkeyProvider } from '../api/hotkeyProvider' +import { HotkeyDescription, HotkeyProvider } from '../api/hotkeyProvider' import { stringifyKeySequence } from './hotkeys.util' import { ConfigService } from '../services/config.service' import { ElectronService } from '../services/electron.service' @@ -24,7 +24,7 @@ export class HotkeysService { globalHotkey = new EventEmitter() private currentKeystrokes: EventBufferEntry[] = [] private disabledLevel = 0 - private hotkeyDescriptions: IHotkeyDescription[] = [] + private hotkeyDescriptions: HotkeyDescription[] = [] /** @hidden */ constructor ( @@ -94,56 +94,7 @@ export class HotkeysService { return stringifyKeySequence(this.currentKeystrokes.map(x => x.event)) } - private registerGlobalHotkey () { - this.electron.globalShortcut.unregisterAll() - let value = this.config.store.hotkeys['toggle-window'] || [] - if (typeof value === 'string') { - value = [value] - } - value.forEach((item: string | string[]) => { - item = (typeof item === 'string') ? [item] : item - - try { - let electronKeySpec = item[0] - electronKeySpec = electronKeySpec.replace('⌘', 'Command') - electronKeySpec = electronKeySpec.replace('⌥', 'Alt') - electronKeySpec = electronKeySpec.replace(/-/g, '+') - this.electron.globalShortcut.register(electronKeySpec, () => { - this.globalHotkey.emit() - }) - } catch (err) { - console.error('Could not register the global hotkey:', err) - } - }) - } - - private getHotkeysConfig () { - return this.getHotkeysConfigRecursive(this.config.store.hotkeys) - } - - private getHotkeysConfigRecursive (branch: any) { - const keys = {} - for (const key in branch) { - let value = branch[key] - if (value instanceof Object && !(value instanceof Array)) { - const subkeys = this.getHotkeysConfigRecursive(value) - for (const subkey in subkeys) { - keys[key + '.' + subkey] = subkeys[subkey] - } - } else { - if (typeof value === 'string') { - value = [value] - } - if (value) { - value = value.map((item: string | string[]) => (typeof item === 'string') ? [item] : item) - keys[key] = value - } - } - } - return keys - } - - private getCurrentFullyMatchedHotkey (): string { + getCurrentFullyMatchedHotkey (): string { const currentStrokes = this.getCurrentKeystrokes() const config = this.getHotkeysConfig() for (const id in config) { @@ -178,7 +129,7 @@ export class HotkeysService { result.push({ matchedLength: matchLength, id, - strokes: sequence + strokes: sequence, }) break } @@ -188,7 +139,7 @@ export class HotkeysService { return result } - getHotkeyDescription (id: string): IHotkeyDescription { + getHotkeyDescription (id: string): HotkeyDescription { return this.hotkeyDescriptions.filter((x) => x.id === id)[0] } @@ -204,7 +155,7 @@ export class HotkeysService { return this.disabledLevel === 0 } - async getHotkeyDescriptions (): Promise { + async getHotkeyDescriptions (): Promise { return ( await Promise.all( this.config.enabledServices(this.hotkeyProviders) @@ -212,4 +163,53 @@ export class HotkeysService { ) ).reduce((a, b) => a.concat(b)) } + + private registerGlobalHotkey () { + this.electron.globalShortcut.unregisterAll() + let value = this.config.store.hotkeys['toggle-window'] || [] + if (typeof value === 'string') { + value = [value] + } + value.forEach((item: string | string[]) => { + item = typeof item === 'string' ? [item] : item + + try { + let electronKeySpec = item[0] + electronKeySpec = electronKeySpec.replace('⌘', 'Command') + electronKeySpec = electronKeySpec.replace('⌥', 'Alt') + electronKeySpec = electronKeySpec.replace(/-/g, '+') + this.electron.globalShortcut.register(electronKeySpec, () => { + this.globalHotkey.emit() + }) + } catch (err) { + console.error('Could not register the global hotkey:', err) + } + }) + } + + private getHotkeysConfig () { + return this.getHotkeysConfigRecursive(this.config.store.hotkeys) + } + + private getHotkeysConfigRecursive (branch: any) { + const keys = {} + for (const key in branch) { + let value = branch[key] + if (value instanceof Object && !(value instanceof Array)) { + const subkeys = this.getHotkeysConfigRecursive(value) + for (const subkey in subkeys) { + keys[key + '.' + subkey] = subkeys[subkey] + } + } else { + if (typeof value === 'string') { + value = [value] + } + if (value) { + value = value.map((item: string | string[]) => typeof item === 'string' ? [item] : item) + keys[key] = value + } + } + } + return keys + } } diff --git a/terminus-core/src/services/log.service.ts b/terminus-core/src/services/log.service.ts index feb0076f..5879935d 100644 --- a/terminus-core/src/services/log.service.ts +++ b/terminus-core/src/services/log.service.ts @@ -20,9 +20,9 @@ const initializeWinston = (electron: ElectronService) => { handleExceptions: false, maxsize: 5242880, maxFiles: 5, - }) + }), ], - exitOnError: false + exitOnError: false, }) } @@ -32,18 +32,32 @@ export class Logger { private name: string, ) {} + debug (...args: any[]) { + this.doLog('debug', ...args) + } + + info (...args: any[]) { + this.doLog('info', ...args) + } + + warn (...args: any[]) { + this.doLog('warn', ...args) + } + + error (...args: any[]) { + this.doLog('error', ...args) + } + + log (...args: any[]) { + this.doLog('log', ...args) + } + private doLog (level: string, ...args: any[]) { console[level](`%c[${this.name}]`, 'color: #aaa', ...args) if (this.winstonLogger) { this.winstonLogger[level](...args) } } - - debug (...args: any[]) { this.doLog('debug', ...args) } - info (...args: any[]) { this.doLog('info', ...args) } - warn (...args: any[]) { this.doLog('warn', ...args) } - error (...args: any[]) { this.doLog('error', ...args) } - log (...args: any[]) { this.doLog('log', ...args) } } @Injectable({ providedIn: 'root' }) diff --git a/terminus-core/src/services/shellIntegration.service.ts b/terminus-core/src/services/shellIntegration.service.ts index 439b9f26..2078c626 100644 --- a/terminus-core/src/services/shellIntegration.service.ts +++ b/terminus-core/src/services/shellIntegration.service.ts @@ -5,9 +5,11 @@ import { Injectable } from '@angular/core' import { ElectronService } from './electron.service' import { HostAppService, Platform } from './hostApp.service' +/* eslint-disable block-scoped-var */ + try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch (_) { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch (_) { } @Injectable({ providedIn: 'root' }) export class ShellIntegrationService { @@ -17,11 +19,11 @@ export class ShellIntegrationService { private registryKeys = [ { path: 'Software\\Classes\\Directory\\Background\\shell\\Open Terminus here', - command: 'open "%V"' + command: 'open "%V"', }, { path: 'Software\\Classes\\*\\shell\\Paste path into Terminus', - command: 'paste "%V"' + command: 'paste "%V"', }, ] constructor ( @@ -40,15 +42,6 @@ export class ShellIntegrationService { this.updatePaths() } - private async updatePaths (): Promise { - // Update paths in case of an update - if (this.hostApp.platform === Platform.Windows) { - if (await this.isInstalled()) { - await this.install() - } - } - } - async isInstalled (): Promise { if (this.hostApp.platform === Platform.macOS) { return fs.exists(path.join(this.automatorWorkflowsDestination, this.automatorWorkflows[0])) @@ -59,7 +52,7 @@ export class ShellIntegrationService { } async install () { - const exe = process.env.PORTABLE_EXECUTABLE_FILE || this.electron.app.getPath('exe') + const exe: string = process.env.PORTABLE_EXECUTABLE_FILE || this.electron.app.getPath('exe') if (this.hostApp.platform === Platform.macOS) { for (const wf of this.automatorWorkflows) { await exec(`cp -r "${this.automatorWorkflowsLocation}/${wf}" "${this.automatorWorkflowsDestination}"`) @@ -85,4 +78,13 @@ export class ShellIntegrationService { } } } + + private async updatePaths (): Promise { + // Update paths in case of an update + if (this.hostApp.platform === Platform.Windows) { + if (await this.isInstalled()) { + await this.install() + } + } + } } diff --git a/terminus-core/src/services/tabRecovery.service.ts b/terminus-core/src/services/tabRecovery.service.ts index 5769b7a8..47fdcf7e 100644 --- a/terminus-core/src/services/tabRecovery.service.ts +++ b/terminus-core/src/services/tabRecovery.service.ts @@ -54,5 +54,4 @@ export class TabRecoveryService { } return [] } - } diff --git a/terminus-core/src/services/tabs.service.ts b/terminus-core/src/services/tabs.service.ts index 32ba7bf4..90e752e6 100644 --- a/terminus-core/src/services/tabs.service.ts +++ b/terminus-core/src/services/tabs.service.ts @@ -2,7 +2,8 @@ import { Injectable, ComponentFactoryResolver, Injector } from '@angular/core' import { BaseTabComponent } from '../components/baseTab.component' import { TabRecoveryService } from './tabRecovery.service' -export declare type TabComponentType = new (...args: any[]) => BaseTabComponent +// eslint-disable-next-line @typescript-eslint/no-type-alias +export type TabComponentType = new (...args: any[]) => BaseTabComponent @Injectable({ providedIn: 'root' }) export class TabsService { diff --git a/terminus-core/src/services/touchbar.service.ts b/terminus-core/src/services/touchbar.service.ts index c58f1052..10261200 100644 --- a/terminus-core/src/services/touchbar.service.ts +++ b/terminus-core/src/services/touchbar.service.ts @@ -4,7 +4,7 @@ import { AppService } from './app.service' import { ConfigService } from './config.service' import { ElectronService } from './electron.service' import { HostAppService, Platform } from './hostApp.service' -import { IToolbarButton, ToolbarButtonProvider } from '../api' +import { ToolbarButton, ToolbarButtonProvider } from '../api' /** @hidden */ @Injectable({ providedIn: 'root' }) @@ -61,7 +61,7 @@ export class TouchbarService { return } - let buttons: IToolbarButton[] = [] + let buttons: ToolbarButton[] = [] this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => { buttons = buttons.concat(provider.provide()) }) @@ -76,7 +76,7 @@ export class TouchbarService { selectedIndex: this.app.tabs.indexOf(this.app.activeTab), change: (selectedIndex) => this.zone.run(() => { this.app.selectTab(this.app.tabs[selectedIndex]) - }) + }), }) this.buttonsSegmentedControl = new this.electron.TouchBar.TouchBarSegmentedControl({ @@ -84,7 +84,7 @@ export class TouchbarService { mode: 'buttons', change: (selectedIndex) => this.zone.run(() => { buttons[selectedIndex].click() - }) + }), }) const touchBar = new this.electron.TouchBar({ @@ -93,12 +93,12 @@ export class TouchbarService { new this.electron.TouchBar.TouchBarSpacer({ size: 'flexible' }), new this.electron.TouchBar.TouchBarSpacer({ size: 'small' }), this.buttonsSegmentedControl, - ] + ], }) this.hostApp.setTouchBar(touchBar) } - private getButton (button: IToolbarButton): Electron.SegmentedControlSegment { + private getButton (button: ToolbarButton): Electron.SegmentedControlSegment { return { label: button.touchBarNSImage ? null : this.shortenTitle(button.touchBarTitle || button.title), icon: button.touchBarNSImage ? this.getCachedNSImage(button.touchBarNSImage) : null, diff --git a/terminus-core/src/tabContextMenu.ts b/terminus-core/src/tabContextMenu.ts index 0a7f5899..f8894ee7 100644 --- a/terminus-core/src/tabContextMenu.ts +++ b/terminus-core/src/tabContextMenu.ts @@ -22,7 +22,7 @@ export class CloseContextMenu extends TabContextMenuItemProvider { label: 'Close', click: () => this.zone.run(() => { this.app.closeTab(tab, true) - }) + }), }, { label: 'Close other tabs', @@ -30,7 +30,7 @@ export class CloseContextMenu extends TabContextMenuItemProvider { for (const t of this.app.tabs.filter(x => x !== tab)) { this.app.closeTab(t, true) } - }) + }), }, { label: 'Close tabs to the right', @@ -38,7 +38,7 @@ export class CloseContextMenu extends TabContextMenuItemProvider { for (const t of this.app.tabs.slice(this.app.tabs.indexOf(tab) + 1)) { this.app.closeTab(t, true) } - }) + }), }, { label: 'Close tabs to the left', @@ -46,7 +46,7 @@ export class CloseContextMenu extends TabContextMenuItemProvider { for (const t of this.app.tabs.slice(0, this.app.tabs.indexOf(tab))) { this.app.closeTab(t, true) } - }) + }), }, ] } @@ -78,11 +78,11 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider { return [ { label: 'Rename', - click: () => this.zone.run(() => tabHeader.showRenameTabModal()) + click: () => this.zone.run(() => tabHeader.showRenameTabModal()), }, { label: 'Duplicate', - click: () => this.zone.run(() => this.app.duplicateTab(tab)) + click: () => this.zone.run(() => this.app.duplicateTab(tab)), }, { label: 'Color', @@ -95,7 +95,7 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider { tab.color = color.value }), })) as Electron.MenuItemConstructorOptions[], - } + }, ] } } @@ -138,7 +138,7 @@ export class TaskCompletionContextMenu extends TabContextMenuItemProvider { } else { this.app.stopObservingTabCompletion(tab) } - }) + }), }, ] } diff --git a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts index 2c1cf1e4..a80ddffb 100644 --- a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts +++ b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts @@ -4,7 +4,7 @@ import * as semver from 'semver' import { Component, Input } from '@angular/core' import { ConfigService, ElectronService } from 'terminus-core' -import { IPluginInfo, PluginManagerService } from '../services/pluginManager.service' +import { PluginInfo, PluginManagerService } from '../services/pluginManager.service' enum BusyState { Installing, Uninstalling } @@ -15,10 +15,10 @@ enum BusyState { Installing, Uninstalling } }) export class PluginsSettingsTabComponent { BusyState = BusyState - @Input() availablePlugins$: Observable + @Input() availablePlugins$: Observable @Input() availablePluginsQuery$ = new BehaviorSubject('') @Input() availablePluginsReady = false - @Input() knownUpgrades: {[id: string]: IPluginInfo} = {} + @Input() knownUpgrades: {[id: string]: PluginInfo} = {} @Input() busy: {[id: string]: BusyState} = {} @Input() erroredPlugin: string @Input() errorMessage: string @@ -58,11 +58,11 @@ export class PluginsSettingsTabComponent { this.availablePluginsQuery$.next(query) } - isAlreadyInstalled (plugin: IPluginInfo): boolean { + isAlreadyInstalled (plugin: PluginInfo): boolean { return this.pluginManager.installedPlugins.some(x => x.name === plugin.name) } - async installPlugin (plugin: IPluginInfo): Promise { + async installPlugin (plugin: PluginInfo): Promise { this.busy[plugin.name] = BusyState.Installing try { await this.pluginManager.installPlugin(plugin) @@ -76,7 +76,7 @@ export class PluginsSettingsTabComponent { } } - async uninstallPlugin (plugin: IPluginInfo): Promise { + async uninstallPlugin (plugin: PluginInfo): Promise { this.busy[plugin.name] = BusyState.Uninstalling try { await this.pluginManager.uninstallPlugin(plugin) @@ -90,21 +90,21 @@ export class PluginsSettingsTabComponent { } } - async upgradePlugin (plugin: IPluginInfo): Promise { + async upgradePlugin (plugin: PluginInfo): Promise { return this.installPlugin(this.knownUpgrades[plugin.name]) } - showPluginInfo (plugin: IPluginInfo) { + showPluginInfo (plugin: PluginInfo) { this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName) } - enablePlugin (plugin: IPluginInfo) { + enablePlugin (plugin: PluginInfo) { this.config.store.pluginBlacklist = this.config.store.pluginBlacklist.filter(x => x !== plugin.name) this.config.save() this.config.requestRestart() } - disablePlugin (plugin: IPluginInfo) { + disablePlugin (plugin: PluginInfo) { this.config.store.pluginBlacklist = [...this.config.store.pluginBlacklist, plugin.name] this.config.save() this.config.requestRestart() diff --git a/terminus-plugin-manager/src/index.ts b/terminus-plugin-manager/src/index.ts index d9d74588..14da0428 100644 --- a/terminus-plugin-manager/src/index.ts +++ b/terminus-plugin-manager/src/index.ts @@ -27,6 +27,6 @@ import { PluginsSettingsTabProvider } from './settings' PluginsSettingsTabComponent, ], }) -export default class PluginManagerModule { } +export default class PluginManagerModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class export { PluginManagerService } diff --git a/terminus-plugin-manager/src/services/pluginManager.service.ts b/terminus-plugin-manager/src/services/pluginManager.service.ts index 1940a034..3e35a6e1 100644 --- a/terminus-plugin-manager/src/services/pluginManager.service.ts +++ b/terminus-plugin-manager/src/services/pluginManager.service.ts @@ -8,7 +8,7 @@ const NAME_PREFIX = 'terminus-' const KEYWORD = 'terminus-plugin' const OFFICIAL_NPM_ACCOUNT = 'eugenepankov' -export interface IPluginInfo { +export interface PluginInfo { name: string description: string packageName: string @@ -25,7 +25,7 @@ export class PluginManagerService { logger: Logger builtinPluginsPath: string = (window as any).builtinPluginsPath userPluginsPath: string = (window as any).userPluginsPath - installedPlugins: IPluginInfo[] = (window as any).installedPlugins + installedPlugins: PluginInfo[] = (window as any).installedPlugins private npmReady: Promise private npm: any @@ -57,12 +57,12 @@ export class PluginManagerService { return this.npm } - listAvailable (query?: string): Observable { + listAvailable (query?: string): Observable { return from( axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, { headers: { 'x-spiferack': '1', - } + }, }) ).pipe( map(response => response.data.objects.map(item => ({ @@ -78,7 +78,7 @@ export class PluginManagerService { ) } - async installPlugin (plugin: IPluginInfo) { + async installPlugin (plugin: PluginInfo) { (await this.getNPM()).commands.install([`${plugin.packageName}@${plugin.version}`], err => { if (err) { this.logger.error(err) @@ -88,7 +88,7 @@ export class PluginManagerService { }) } - async uninstallPlugin (plugin: IPluginInfo) { + async uninstallPlugin (plugin: PluginInfo) { (await this.getNPM()).commands.remove([plugin.packageName], err => { if (err) { this.logger.error(err) diff --git a/terminus-settings/src/buttonProvider.ts b/terminus-settings/src/buttonProvider.ts index a9392e98..545aa360 100644 --- a/terminus-settings/src/buttonProvider.ts +++ b/terminus-settings/src/buttonProvider.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' -import { ToolbarButtonProvider, IToolbarButton, AppService, HostAppService, HotkeysService } from 'terminus-core' +import { ToolbarButtonProvider, ToolbarButton, AppService, HostAppService, HotkeysService } from 'terminus-core' import { SettingsTabComponent } from './components/settingsTab.component' @@ -23,7 +23,7 @@ export class ButtonProvider extends ToolbarButtonProvider { }) } - provide (): IToolbarButton[] { + provide (): ToolbarButton[] { return [{ icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/cog.svg')), title: 'Settings', diff --git a/terminus-settings/src/components/hotkeyInputModal.component.ts b/terminus-settings/src/components/hotkeyInputModal.component.ts index 9127e3cc..b5ee061d 100644 --- a/terminus-settings/src/components/hotkeyInputModal.component.ts +++ b/terminus-settings/src/components/hotkeyInputModal.component.ts @@ -21,7 +21,7 @@ const INPUT_TIMEOUT = 1000 animate('250ms ease-out', style({ transform: 'translateX(0)', opacity: '1', - })) + })), ]), transition(':leave', [ style({ @@ -31,10 +31,10 @@ const INPUT_TIMEOUT = 1000 animate('250ms ease-in', style({ transform: 'translateX(25px)', opacity: '0', - })) - ]) - ]) - ] + })), + ]), + ]), + ], }) export class HotkeyInputModalComponent { @Input() value: string[] = [] diff --git a/terminus-settings/src/components/multiHotkeyInput.component.ts b/terminus-settings/src/components/multiHotkeyInput.component.ts index b2971bd8..78f444ef 100644 --- a/terminus-settings/src/components/multiHotkeyInput.component.ts +++ b/terminus-settings/src/components/multiHotkeyInput.component.ts @@ -24,7 +24,7 @@ export class MultiHotkeyInputComponent { if (typeof this.model === 'string') { this.model = [this.model] } - this.model = this.model.map(item => (typeof item === 'string') ? [item] : item) + this.model = this.model.map(item => typeof item === 'string' ? [item] : item) } editItem (item) { diff --git a/terminus-settings/src/components/settingsTab.component.ts b/terminus-settings/src/components/settingsTab.component.ts index f1ac818a..23ebff1c 100644 --- a/terminus-settings/src/components/settingsTab.component.ts +++ b/terminus-settings/src/components/settingsTab.component.ts @@ -6,14 +6,14 @@ import { ElectronService, DockingService, ConfigService, - IHotkeyDescription, + HotkeyDescription, HotkeysService, BaseTabComponent, Theme, HostAppService, Platform, HomeBaseService, - ShellIntegrationService + ShellIntegrationService, } from 'terminus-core' import { SettingsTabProvider } from '../api' @@ -30,7 +30,7 @@ import { SettingsTabProvider } from '../api' export class SettingsTabComponent extends BaseTabComponent { @Input() activeTab: string hotkeyFilter = '' - hotkeyDescriptions: IHotkeyDescription[] + hotkeyDescriptions: HotkeyDescription[] screens: any[] Platform = Platform configDefaults: any diff --git a/terminus-settings/src/config.ts b/terminus-settings/src/config.ts index e5c79a47..4ac51d6e 100644 --- a/terminus-settings/src/config.ts +++ b/terminus-settings/src/config.ts @@ -7,17 +7,17 @@ export class SettingsConfigProvider extends ConfigProvider { [Platform.macOS]: { hotkeys: { settings: ['⌘-,'], - } + }, }, [Platform.Windows]: { hotkeys: { - settings: ['Ctrl-,'] - } + settings: ['Ctrl-,'], + }, }, [Platform.Linux]: { hotkeys: { - settings: ['Ctrl-,'] - } + settings: ['Ctrl-,'], + }, }, } } diff --git a/terminus-settings/src/hotkeys.ts b/terminus-settings/src/hotkeys.ts index e506133c..db62ec24 100644 --- a/terminus-settings/src/hotkeys.ts +++ b/terminus-settings/src/hotkeys.ts @@ -1,17 +1,17 @@ import { Injectable } from '@angular/core' -import { IHotkeyDescription, HotkeyProvider } from 'terminus-core' +import { HotkeyDescription, HotkeyProvider } from 'terminus-core' /** @hidden */ @Injectable() export class SettingsHotkeyProvider extends HotkeyProvider { - hotkeys: IHotkeyDescription[] = [ + hotkeys: HotkeyDescription[] = [ { id: 'settings', name: 'Open Settings', }, ] - async provide (): Promise { + async provide (): Promise { return this.hotkeys } } diff --git a/terminus-settings/src/index.ts b/terminus-settings/src/index.ts index 3bc0ff94..7708b149 100644 --- a/terminus-settings/src/index.ts +++ b/terminus-settings/src/index.ts @@ -42,7 +42,7 @@ import { SettingsConfigProvider } from './config' SettingsTabBodyComponent, ], }) -export default class SettingsModule { } +export default class SettingsModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class export * from './api' export { SettingsTabComponent } diff --git a/terminus-ssh/src/api.ts b/terminus-ssh/src/api.ts index a6a28d8a..ead3db4a 100644 --- a/terminus-ssh/src/api.ts +++ b/terminus-ssh/src/api.ts @@ -141,7 +141,7 @@ export class SSHSession extends BaseSession { } } -export interface ISSHConnectionGroup { +export interface SSHConnectionGroup { name: string connections: SSHConnection[] } diff --git a/terminus-ssh/src/buttonProvider.ts b/terminus-ssh/src/buttonProvider.ts index 9d7b56f6..3cbc9c1e 100644 --- a/terminus-ssh/src/buttonProvider.ts +++ b/terminus-ssh/src/buttonProvider.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { HotkeysService, ToolbarButtonProvider, IToolbarButton } from 'terminus-core' +import { HotkeysService, ToolbarButtonProvider, ToolbarButton } from 'terminus-core' import { SSHModalComponent } from './components/sshModal.component' /** @hidden */ @@ -13,7 +13,7 @@ export class ButtonProvider extends ToolbarButtonProvider { hotkeys: HotkeysService, ) { super() - hotkeys.matchedHotkey.subscribe(async (hotkey) => { + hotkeys.matchedHotkey.subscribe(async (hotkey: string) => { if (hotkey === 'ssh') { this.activate() } @@ -24,7 +24,7 @@ export class ButtonProvider extends ToolbarButtonProvider { this.ngbModal.open(SSHModalComponent) } - provide (): IToolbarButton[] { + provide (): ToolbarButton[] { return [{ icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/globe.svg')), weight: 5, @@ -32,7 +32,7 @@ export class ButtonProvider extends ToolbarButtonProvider { touchBarNSImage: 'NSTouchBarOpenInBrowserTemplate', click: async () => { this.activate() - } + }, }] } } diff --git a/terminus-ssh/src/components/editConnectionModal.component.ts b/terminus-ssh/src/components/editConnectionModal.component.ts index cb89059f..4b1c6540 100644 --- a/terminus-ssh/src/components/editConnectionModal.component.ts +++ b/terminus-ssh/src/components/editConnectionModal.component.ts @@ -27,23 +27,25 @@ export class EditConnectionModalComponent { this.newScript = { expect: '', send: '' } for (const k of Object.values(SSHAlgorithmType)) { - this.supportedAlgorithms[k] = ALGORITHMS[{ + const supportedAlg = { [SSHAlgorithmType.KEX]: 'SUPPORTED_KEX', [SSHAlgorithmType.HOSTKEY]: 'SUPPORTED_SERVER_HOST_KEY', [SSHAlgorithmType.CIPHER]: 'SUPPORTED_CIPHER', [SSHAlgorithmType.HMAC]: 'SUPPORTED_HMAC', - }[k]] - this.defaultAlgorithms[k] = ALGORITHMS[{ + }[k] + const defaultAlg = { [SSHAlgorithmType.KEX]: 'KEX', [SSHAlgorithmType.HOSTKEY]: 'SERVER_HOST_KEY', [SSHAlgorithmType.CIPHER]: 'CIPHER', [SSHAlgorithmType.HMAC]: 'HMAC', - }[k]] + }[k] + this.supportedAlgorithms[k] = ALGORITHMS[supportedAlg] + this.defaultAlgorithms[k] = ALGORITHMS[defaultAlg] } } async ngOnInit () { - this.hasSavedPassword = !!(await this.passwordStorage.loadPassword(this.connection)) + this.hasSavedPassword = !!await this.passwordStorage.loadPassword(this.connection) this.connection.algorithms = this.connection.algorithms || {} for (const k of Object.values(SSHAlgorithmType)) { if (!this.connection.algorithms[k]) { @@ -77,8 +79,8 @@ export class EditConnectionModalComponent { save () { for (const k of Object.values(SSHAlgorithmType)) { this.connection.algorithms[k] = Object.entries(this.algorithms[k]) - .filter(([k, v]) => !!v) - .map(([k, v]) => k) + .filter(([_k, v]) => !!v) + .map(([k, _v]) => k) } this.modalInstance.close(this.connection) } diff --git a/terminus-ssh/src/components/sshModal.component.ts b/terminus-ssh/src/components/sshModal.component.ts index b084f53e..ea8958fc 100644 --- a/terminus-ssh/src/components/sshModal.component.ts +++ b/terminus-ssh/src/components/sshModal.component.ts @@ -4,7 +4,7 @@ import { ToastrService } from 'ngx-toastr' import { ConfigService, AppService } from 'terminus-core' import { SettingsTabComponent } from 'terminus-settings' import { SSHService } from '../services/ssh.service' -import { SSHConnection, ISSHConnectionGroup } from '../api' +import { SSHConnection, SSHConnectionGroup } from '../api' /** @hidden */ @Component({ @@ -13,10 +13,10 @@ import { SSHConnection, ISSHConnectionGroup } from '../api' }) export class SSHModalComponent { connections: SSHConnection[] - childFolders: ISSHConnectionGroup[] + childFolders: SSHConnectionGroup[] quickTarget: string lastConnection: SSHConnection - childGroups: ISSHConnectionGroup[] + childGroups: SSHConnectionGroup[] groupCollapsed: {[id: string]: boolean} = {} constructor ( @@ -49,7 +49,9 @@ export class SSHModalComponent { const connection: SSHConnection = { name: this.quickTarget, - host, user, port + host, + user, + port, } window.localStorage.lastConnection = JSON.stringify(connection) this.connect(connection) diff --git a/terminus-ssh/src/components/sshSettingsTab.component.ts b/terminus-ssh/src/components/sshSettingsTab.component.ts index bda5bf03..1a6ed4bb 100644 --- a/terminus-ssh/src/components/sshSettingsTab.component.ts +++ b/terminus-ssh/src/components/sshSettingsTab.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { ConfigService, ElectronService, HostAppService } from 'terminus-core' -import { SSHConnection, ISSHConnectionGroup } from '../api' +import { SSHConnection, SSHConnectionGroup } from '../api' import { EditConnectionModalComponent } from './editConnectionModal.component' import { PromptModalComponent } from './promptModal.component' @@ -11,7 +11,7 @@ import { PromptModalComponent } from './promptModal.component' }) export class SSHSettingsTabComponent { connections: SSHConnection[] - childGroups: ISSHConnectionGroup[] + childGroups: SSHConnectionGroup[] groupCollapsed: {[id: string]: boolean} = {} constructor ( @@ -70,7 +70,7 @@ export class SSHSettingsTabComponent { } } - editGroup (group: ISSHConnectionGroup) { + editGroup (group: SSHConnectionGroup) { const modal = this.ngbModal.open(PromptModalComponent) modal.componentInstance.prompt = 'New group name' modal.componentInstance.value = group.name @@ -86,7 +86,7 @@ export class SSHSettingsTabComponent { }) } - async deleteGroup (group: ISSHConnectionGroup) { + async deleteGroup (group: SSHConnectionGroup) { if ((await this.electron.showMessageBox( this.hostApp.getWindow(), { diff --git a/terminus-ssh/src/config.ts b/terminus-ssh/src/config.ts index 3f6172ed..d32160df 100644 --- a/terminus-ssh/src/config.ts +++ b/terminus-ssh/src/config.ts @@ -6,10 +6,10 @@ export class SSHConfigProvider extends ConfigProvider { ssh: { connections: [], options: { - } + }, }, hotkeys: { - 'ssh': [ + ssh: [ 'Alt-S', ], }, diff --git a/terminus-ssh/src/index.ts b/terminus-ssh/src/index.ts index 8b85e83d..3ab6e1fa 100644 --- a/terminus-ssh/src/index.ts +++ b/terminus-ssh/src/index.ts @@ -47,4 +47,4 @@ import { RecoveryProvider } from './recoveryProvider' SSHTabComponent, ], }) -export default class SSHModule { } +export default class SSHModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index 40079e0c..82e7abe4 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -9,13 +9,12 @@ import { SSHConnection, SSHSession } from '../api' import { PromptModalComponent } from '../components/promptModal.component' import { SSHTabComponent } from '../components/sshTab.component' import { PasswordStorageService } from './passwordStorage.service' -const { SSH2Stream } = require('ssh2-streams') +import { SSH2Stream } from 'ssh2-streams' -let windowsProcessTree +/* eslint-disable block-scoped-var */ try { - windowsProcessTree = require('windows-process-tree/build/Release/windows_process_tree.node') -} catch (e) { -} // tslint:disable-line + var windowsProcessTree = require('windows-process-tree/build/Release/windows_process_tree.node') // eslint-disable-line @typescript-eslint/no-var-requires +} catch (_) { } @Injectable({ providedIn: 'root' }) export class SSHService { @@ -46,10 +45,10 @@ export class SSHService { let privateKeyPath = session.connection.privateKey if (!logCallback) { - logCallback = (s) => null + logCallback = () => null } - const log = s => { + const log = (s: any) => { logCallback(s) this.logger.info(s) } @@ -84,7 +83,7 @@ export class SSHService { modal.componentInstance.password = true try { privateKeyPassphrase = await modal.result - } catch (_err) { } // tslint:disable-line + } catch (e) { } } } } @@ -214,11 +213,11 @@ export class SSHService { session.shell = shell shell.on('greeting', greeting => { - log('Shell Greeting: ' + greeting) + log(`Shell Greeting: ${greeting}`) }) shell.on('banner', banner => { - log('Shell Banner: ' + banner) + log(`Shell Banner: ${banner}`) }) } catch (error) { this.toastr.error(error.message) @@ -227,7 +226,8 @@ export class SSHService { } } +/* eslint-disable */ const _authPassword = SSH2Stream.prototype.authPassword -SSH2Stream.prototype.authPassword = async function (username, passwordFn) { +SSH2Stream.prototype.authPassword = async function (username, passwordFn: any) { _authPassword.bind(this)(username, await passwordFn()) -} +} as any diff --git a/terminus-ssh/tsconfig0.typings.json b/terminus-ssh/tsconfig0.typings.json new file mode 100644 index 00000000..c0d2273c --- /dev/null +++ b/terminus-ssh/tsconfig0.typings.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "exclude": ["node_modules", "dist", "typings"], + "compilerOptions": { + "baseUrl": "src", + "emitDeclarationOnly": true, + "declaration": true, + "declarationDir": "./typings", + "paths": { + "terminus-*": ["../../terminus-*"], + "*": ["../../app/node_modules/*"] + } + } +} diff --git a/terminus-terminal/src/api/baseTerminalTab.component.ts b/terminus-terminal/src/api/baseTerminalTab.component.ts index 03c21b31..73cced17 100644 --- a/terminus-terminal/src/api/baseTerminalTab.component.ts +++ b/terminus-terminal/src/api/baseTerminalTab.component.ts @@ -22,11 +22,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit static animations: AnimationTriggerMetadata[] = [trigger('slideInOut', [ transition(':enter', [ style({ transform: 'translateY(-25%)' }), - animate('100ms ease-in-out', style({ transform: 'translateY(0%)' })) + animate('100ms ease-in-out', style({ transform: 'translateY(0%)' })), ]), transition(':leave', [ - animate('100ms ease-in-out', style({ transform: 'translateY(-25%)' })) - ]) + animate('100ms ease-in-out', style({ transform: 'translateY(-25%)' })), + ]), ])] session: BaseSession @@ -90,53 +90,53 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit return } switch (hotkey) { - case 'ctrl-c': - if (this.frontend.getSelection()) { + case 'ctrl-c': + if (this.frontend.getSelection()) { + this.frontend.copySelection() + this.frontend.clearSelection() + this.toastr.info('Copied') + } else { + this.sendInput('\x03') + } + break + case 'copy': this.frontend.copySelection() this.frontend.clearSelection() this.toastr.info('Copied') - } else { - this.sendInput('\x03') - } - break - case 'copy': - this.frontend.copySelection() - this.frontend.clearSelection() - this.toastr.info('Copied') - break - case 'paste': - this.paste() - break - case 'clear': - this.frontend.clear() - break - case 'zoom-in': - this.zoomIn() - break - case 'zoom-out': - this.zoomOut() - break - case 'reset-zoom': - this.resetZoom() - break - case 'previous-word': - this.sendInput('\x1bb') - break - case 'next-word': - this.sendInput('\x1bf') - break - case 'delete-previous-word': - this.sendInput('\x1b\x7f') - break - case 'delete-next-word': - this.sendInput('\x1bd') - break - case 'search': - this.showSearchPanel = true - setImmediate(() => { - this.element.nativeElement.querySelector('.search-input').focus() - }) - break + break + case 'paste': + this.paste() + break + case 'clear': + this.frontend.clear() + break + case 'zoom-in': + this.zoomIn() + break + case 'zoom-out': + this.zoomOut() + break + case 'reset-zoom': + this.resetZoom() + break + case 'previous-word': + this.sendInput('\x1bb') + break + case 'next-word': + this.sendInput('\x1bf') + break + case 'delete-previous-word': + this.sendInput('\x1b\x7f') + break + case 'delete-next-word': + this.sendInput('\x1bd') + break + case 'search': + this.showSearchPanel = true + setImmediate(() => { + this.element.nativeElement.querySelector('.search-input').focus() + }) + break } }) this.bellPlayer = document.createElement('audio') @@ -219,89 +219,6 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit return items } - protected detachTermContainerHandlers () { - for (const subscription of this.termContainerSubscriptions) { - subscription.unsubscribe() - } - this.termContainerSubscriptions = [] - } - - protected attachTermContainerHandlers () { - this.detachTermContainerHandlers() - - const maybeConfigure = () => { - if (this.hasFocus) { - setTimeout(() => this.configure(), 250) - } - } - - this.termContainerSubscriptions = [ - this.frontend.title$.subscribe(title => this.zone.run(() => this.setTitle(title))), - - this.focused$.subscribe(() => this.frontend.enableResizing = true), - this.blurred$.subscribe(() => this.frontend.enableResizing = false), - - this.frontend.mouseEvent$.subscribe(async event => { - if (event.type === 'mousedown') { - if (event.which === 2) { - this.paste() - event.preventDefault() - event.stopPropagation() - return - } - if (event.which === 3) { - if (this.config.store.terminal.rightClick === 'menu') { - this.hostApp.popupContextMenu(await this.buildContextMenu()) - } else if (this.config.store.terminal.rightClick === 'paste') { - this.paste() - } - event.preventDefault() - event.stopPropagation() - return - } - } - if (event.type === 'mousewheel') { - let wheelDeltaY = 0 - - if ('wheelDeltaY' in event) { - wheelDeltaY = (event as MouseWheelEvent)['wheelDeltaY'] - } else { - wheelDeltaY = (event as MouseWheelEvent)['deltaY'] - } - if (event.ctrlKey || event.metaKey) { - - if (wheelDeltaY > 0) { - this.zoomIn() - } else { - this.zoomOut() - } - } else if (event.altKey) { - event.preventDefault() - const delta = Math.round(wheelDeltaY / 50) - this.sendInput(((delta > 0) ? '\u001bOA' : '\u001bOB').repeat(Math.abs(delta))) - } - } - }), - - this.frontend.input$.subscribe(data => { - this.sendInput(data) - }), - - this.frontend.resize$.subscribe(({ columns, rows }) => { - this.logger.debug(`Resizing to ${columns}x${rows}`) - this.size = { columns, rows } - this.zone.run(() => { - if (this.session && this.session.open) { - this.session.resize(columns, rows) - } - }) - }), - - this.hostApp.displayMetricsChanged$.subscribe(maybeConfigure), - this.hostApp.windowMoved$.subscribe(maybeConfigure), - ] - } - /** * Feeds input into the active session */ @@ -330,7 +247,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit } paste () { - let data = this.electron.clipboard.readText() + let data = this.electron.clipboard.readText() as string if (this.config.store.terminal.bracketedPaste) { data = '\x1b[200~' + data + '\x1b[201~' } @@ -401,6 +318,89 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit } } + protected detachTermContainerHandlers () { + for (const subscription of this.termContainerSubscriptions) { + subscription.unsubscribe() + } + this.termContainerSubscriptions = [] + } + + protected attachTermContainerHandlers () { + this.detachTermContainerHandlers() + + const maybeConfigure = () => { + if (this.hasFocus) { + setTimeout(() => this.configure(), 250) + } + } + + this.termContainerSubscriptions = [ + this.frontend.title$.subscribe(title => this.zone.run(() => this.setTitle(title))), + + this.focused$.subscribe(() => this.frontend.enableResizing = true), + this.blurred$.subscribe(() => this.frontend.enableResizing = false), + + this.frontend.mouseEvent$.subscribe(async event => { + if (event.type === 'mousedown') { + if (event.which === 2) { + this.paste() + event.preventDefault() + event.stopPropagation() + return + } + if (event.which === 3) { + if (this.config.store.terminal.rightClick === 'menu') { + this.hostApp.popupContextMenu(await this.buildContextMenu()) + } else if (this.config.store.terminal.rightClick === 'paste') { + this.paste() + } + event.preventDefault() + event.stopPropagation() + return + } + } + if (event.type === 'mousewheel') { + let wheelDeltaY = 0 + + if ('wheelDeltaY' in event) { + wheelDeltaY = (event as MouseWheelEvent)['wheelDeltaY'] + } else { + wheelDeltaY = (event as MouseWheelEvent)['deltaY'] + } + if (event.ctrlKey || event.metaKey) { + + if (wheelDeltaY > 0) { + this.zoomIn() + } else { + this.zoomOut() + } + } else if (event.altKey) { + event.preventDefault() + const delta = Math.round(wheelDeltaY / 50) + this.sendInput((delta > 0 ? '\u001bOA' : '\u001bOB').repeat(Math.abs(delta))) + } + } + }), + + this.frontend.input$.subscribe(data => { + this.sendInput(data) + }), + + this.frontend.resize$.subscribe(({ columns, rows }) => { + this.logger.debug(`Resizing to ${columns}x${rows}`) + this.size = { columns, rows } + this.zone.run(() => { + if (this.session && this.session.open) { + this.session.resize(columns, rows) + } + }) + }), + + this.hostApp.displayMetricsChanged$.subscribe(maybeConfigure), + this.hostApp.windowMoved$.subscribe(maybeConfigure), + ] + } + protected attachSessionHandlers () { // this.session.output$.bufferTime(10).subscribe((datas) => { this.session.output$.subscribe(data => { diff --git a/terminus-terminal/src/api/colorSchemeProvider.ts b/terminus-terminal/src/api/colorSchemeProvider.ts index 7c365049..4e47d103 100644 --- a/terminus-terminal/src/api/colorSchemeProvider.ts +++ b/terminus-terminal/src/api/colorSchemeProvider.ts @@ -1,8 +1,8 @@ -import { ITerminalColorScheme } from './interfaces' +import { TerminalColorScheme } from './interfaces' /** * Extend to add more terminal color schemes */ export abstract class TerminalColorSchemeProvider { - abstract async getSchemes (): Promise + abstract async getSchemes (): Promise } diff --git a/terminus-terminal/src/api/decorator.ts b/terminus-terminal/src/api/decorator.ts index 08bfac9f..b0ec0a17 100644 --- a/terminus-terminal/src/api/decorator.ts +++ b/terminus-terminal/src/api/decorator.ts @@ -7,10 +7,10 @@ export abstract class TerminalDecorator { /** * Called when a new terminal tab starts */ - attach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty + attach (terminal: BaseTerminalTabComponent): void { } // eslint-disable-line /** * Called before a terminal tab is destroyed */ - detach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty + detach (terminal: BaseTerminalTabComponent): void { } // eslint-disable-line } diff --git a/terminus-terminal/src/api/interfaces.ts b/terminus-terminal/src/api/interfaces.ts index 2c277ec3..7477bc1c 100644 --- a/terminus-terminal/src/api/interfaces.ts +++ b/terminus-terminal/src/api/interfaces.ts @@ -24,7 +24,7 @@ export interface Profile { icon?: SafeHtml } -export interface ITerminalColorScheme { +export interface TerminalColorScheme { name: string foreground: string background: string @@ -32,7 +32,7 @@ export interface ITerminalColorScheme { colors: string[] } -export interface IShell { +export interface Shell { id: string name?: string command: string diff --git a/terminus-terminal/src/api/shellProvider.ts b/terminus-terminal/src/api/shellProvider.ts index 5601e19b..2025ae54 100644 --- a/terminus-terminal/src/api/shellProvider.ts +++ b/terminus-terminal/src/api/shellProvider.ts @@ -1,8 +1,8 @@ -import { IShell } from './interfaces' +import { Shell } from './interfaces' /** * Extend to add support for more shells */ export abstract class ShellProvider { - abstract async provide (): Promise + abstract async provide (): Promise } diff --git a/terminus-terminal/src/buttonProvider.ts b/terminus-terminal/src/buttonProvider.ts index 2291c03a..fd1ba078 100644 --- a/terminus-terminal/src/buttonProvider.ts +++ b/terminus-terminal/src/buttonProvider.ts @@ -1,7 +1,7 @@ import * as fs from 'mz/fs' import { Injectable } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' -import { HotkeysService, ToolbarButtonProvider, IToolbarButton, HostAppService, ElectronService } from 'terminus-core' +import { ToolbarButtonProvider, ToolbarButton, ElectronService } from 'terminus-core' import { TerminalService } from './services/terminal.service' @@ -9,11 +9,9 @@ import { TerminalService } from './services/terminal.service' @Injectable() export class ButtonProvider extends ToolbarButtonProvider { constructor ( + electron: ElectronService, private terminal: TerminalService, private domSanitizer: DomSanitizer, - hostApp: HostAppService, - electron: ElectronService, - hotkeys: HotkeysService, ) { super() if (!electron.remote.process.env.TERMINUS_DEV) { @@ -30,7 +28,7 @@ export class ButtonProvider extends ToolbarButtonProvider { } } - provide (): IToolbarButton[] { + provide (): ToolbarButton[] { return [ { icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/plus.svg')), @@ -38,7 +36,7 @@ export class ButtonProvider extends ToolbarButtonProvider { touchBarNSImage: 'NSTouchBarAddDetailTemplate', click: async () => { this.terminal.openTab() - } + }, }, { icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/profiles.svg')), @@ -50,7 +48,7 @@ export class ButtonProvider extends ToolbarButtonProvider { title: profile.name, click: () => this.terminal.openTab(profile), })) - } + }, }, ] } diff --git a/terminus-terminal/src/colorSchemes.ts b/terminus-terminal/src/colorSchemes.ts index e3a322f4..44d5b212 100644 --- a/terminus-terminal/src/colorSchemes.ts +++ b/terminus-terminal/src/colorSchemes.ts @@ -2,17 +2,19 @@ import * as fs from 'mz/fs' import * as path from 'path' import { Injectable } from '@angular/core' import { TerminalColorSchemeProvider } from './api/colorSchemeProvider' -import { ITerminalColorScheme } from './api/interfaces' +import { TerminalColorScheme } from './api/interfaces' /** @hidden */ @Injectable() export class HyperColorSchemes extends TerminalColorSchemeProvider { - async getSchemes (): Promise { + async getSchemes (): Promise { const pluginsPath = path.join(process.env.HOME, '.hyper_plugins', 'node_modules') - if (!(await fs.exists(pluginsPath))) return [] + if (!await fs.exists(pluginsPath)) { + return [] + } const plugins = await fs.readdir(pluginsPath) - const themes: ITerminalColorScheme[] = [] + const themes: TerminalColorScheme[] = [] plugins.forEach(plugin => { try { diff --git a/terminus-terminal/src/components/appearanceSettingsTab.component.ts b/terminus-terminal/src/components/appearanceSettingsTab.component.ts index 4d8b3e50..49108d4c 100644 --- a/terminus-terminal/src/components/appearanceSettingsTab.component.ts +++ b/terminus-terminal/src/components/appearanceSettingsTab.component.ts @@ -1,13 +1,13 @@ import { Observable } from 'rxjs' import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators' import { exec } from 'mz/child_process' -import deepEqual = require('deep-equal') -const fontManager = require('fontmanager-redux') +import deepEqual from 'deep-equal' +const fontManager = require('fontmanager-redux') // eslint-disable-line import { Component, Inject } from '@angular/core' import { ConfigService, HostAppService, Platform, ElectronService } from 'terminus-core' import { TerminalColorSchemeProvider } from '../api/colorSchemeProvider' -import { ITerminalColorScheme } from '../api/interfaces' +import { TerminalColorScheme } from '../api/interfaces' import { getCSSFontFamily } from '../utils' /** @hidden */ @@ -17,9 +17,9 @@ import { getCSSFontFamily } from '../utils' }) export class AppearanceSettingsTabComponent { fonts: string[] = [] - colorSchemes: ITerminalColorScheme[] = [] + colorSchemes: TerminalColorScheme[] = [] equalComparator = deepEqual - editingColorScheme: ITerminalColorScheme + editingColorScheme: TerminalColorScheme schemeChanged = false constructor ( @@ -32,7 +32,7 @@ export class AppearanceSettingsTabComponent { async ngOnInit () { if (this.hostApp.platform === Platform.Windows || this.hostApp.platform === Platform.macOS) { const fonts = await new Promise((resolve) => fontManager.findFonts({ monospace: true }, resolve)) - this.fonts = fonts.map(x => (x.family + ' ' + x.style).trim()) + this.fonts = fonts.map(x => `${x.family} ${x.style}`.trim()) this.fonts.sort() } if (this.hostApp.platform === Platform.Linux) { @@ -50,14 +50,14 @@ export class AppearanceSettingsTabComponent { fontAutocomplete = (text$: Observable) => { return text$.pipe( - debounceTime(200), - distinctUntilChanged(), - map(query => this.fonts.filter(v => new RegExp(query, 'gi').test(v))), - map(list => Array.from(new Set(list))), - ) + debounceTime(200), + distinctUntilChanged(), + map(query => this.fonts.filter(v => new RegExp(query, 'gi').test(v))), + map(list => Array.from(new Set(list))), + ) } - editScheme (scheme: ITerminalColorScheme) { + editScheme (scheme: TerminalColorScheme) { this.editingColorScheme = scheme this.schemeChanged = false } @@ -75,7 +75,7 @@ export class AppearanceSettingsTabComponent { this.editingColorScheme = null } - async deleteScheme (scheme: ITerminalColorScheme) { + async deleteScheme (scheme: TerminalColorScheme) { if ((await this.electron.showMessageBox( this.hostApp.getWindow(), { @@ -92,7 +92,7 @@ export class AppearanceSettingsTabComponent { } } - isCustomScheme (scheme: ITerminalColorScheme) { + isCustomScheme (scheme: TerminalColorScheme) { return this.config.store.terminal.customColorSchemes.some(x => deepEqual(x, scheme)) } diff --git a/terminus-terminal/src/components/searchPanel.component.ts b/terminus-terminal/src/components/searchPanel.component.ts index ffac9b26..e75a9d5f 100644 --- a/terminus-terminal/src/components/searchPanel.component.ts +++ b/terminus-terminal/src/components/searchPanel.component.ts @@ -1,6 +1,6 @@ import { Component, Input, Output, EventEmitter } from '@angular/core' import { ToastrService } from 'ngx-toastr' -import { Frontend, ISearchOptions } from '../frontends/frontend' +import { Frontend, SearchOptions } from '../frontends/frontend' @Component({ selector: 'search-panel', @@ -8,11 +8,11 @@ import { Frontend, ISearchOptions } from '../frontends/frontend' styles: [require('./searchPanel.component.scss')], }) export class SearchPanelComponent { + static globalOptions: SearchOptions = {} @Input() query: string @Input() frontend: Frontend notFound = false - static globalOptions: ISearchOptions = {} - options: ISearchOptions = SearchPanelComponent.globalOptions + options: SearchOptions = SearchPanelComponent.globalOptions @Output() close = new EventEmitter() diff --git a/terminus-terminal/src/components/shellSettingsTab.component.ts b/terminus-terminal/src/components/shellSettingsTab.component.ts index d73e2753..e6b810eb 100644 --- a/terminus-terminal/src/components/shellSettingsTab.component.ts +++ b/terminus-terminal/src/components/shellSettingsTab.component.ts @@ -4,7 +4,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { Subscription } from 'rxjs' import { ConfigService, ElectronService, HostAppService, Platform } from 'terminus-core' import { EditProfileModalComponent } from './editProfileModal.component' -import { IShell, Profile } from '../api/interfaces' +import { Shell, Profile } from '../api/interfaces' import { TerminalService } from '../services/terminal.service' import { WIN_BUILD_CONPTY_SUPPORTED, WIN_BUILD_CONPTY_STABLE, isWindowsBuild } from '../utils' @@ -13,7 +13,7 @@ import { WIN_BUILD_CONPTY_SUPPORTED, WIN_BUILD_CONPTY_STABLE, isWindowsBuild } f template: require('./shellSettingsTab.component.pug'), }) export class ShellSettingsTabComponent { - shells: IShell[] = [] + shells: Shell[] = [] profiles: Profile[] = [] Platform = Platform isConPTYAvailable: boolean @@ -64,7 +64,7 @@ export class ShellSettingsTabComponent { } } - newProfile (shell: IShell) { + newProfile (shell: Shell) { const profile: Profile = { name: shell.name, sessionOptions: this.terminalService.optionsFromShell(shell), diff --git a/terminus-terminal/src/components/terminalTab.component.ts b/terminus-terminal/src/components/terminalTab.component.ts index 8fdcdaf9..0caff623 100644 --- a/terminus-terminal/src/components/terminalTab.component.ts +++ b/terminus-terminal/src/components/terminalTab.component.ts @@ -29,12 +29,12 @@ export class TerminalTabComponent extends BaseTerminalTabComponent { return } switch (hotkey) { - case 'home': - this.sendInput(isConPTY ? '\x1b[H' : '\x1bOH') - break - case 'end': - this.sendInput(isConPTY ? '\x1b[F' : '\x1bOF') - break + case 'home': + this.sendInput(isConPTY ? '\x1b[H' : '\x1bOH') + break + case 'end': + this.sendInput(isConPTY ? '\x1b[F' : '\x1bOF') + break } }) @@ -74,7 +74,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent { return null } return { - name: children[0].command + name: children[0].command, } } diff --git a/terminus-terminal/src/config.ts b/terminus-terminal/src/config.ts index 19f326a9..7d733860 100644 --- a/terminus-terminal/src/config.ts +++ b/terminus-terminal/src/config.ts @@ -51,7 +51,7 @@ export class TerminalConfigProvider extends ConfigProvider { '#C792EA', '#89DDFF', '#ffffff', - ] + ], }, customColorSchemes: [], environment: {}, @@ -69,12 +69,12 @@ export class TerminalConfigProvider extends ConfigProvider { }, hotkeys: { 'ctrl-c': ['Ctrl-C'], - 'copy': [ + copy: [ '⌘-C', ], - 'paste': [ + paste: [ ], - 'clear': [ + clear: [ '⌘-K', ], 'zoom-in': [ @@ -92,13 +92,13 @@ export class TerminalConfigProvider extends ConfigProvider { '⌘-T', '⌘-N', ], - 'home': ['⌘-Left', 'Home'], - 'end': ['⌘-Right', 'End'], + home: ['⌘-Left', 'Home'], + end: ['⌘-Right', 'End'], 'previous-word': ['⌥-Left'], 'next-word': ['⌥-Right'], 'delete-previous-word': ['⌥-Backspace'], 'delete-next-word': ['⌥-Delete'], - 'search': [ + search: [ '⌘-F', ], }, @@ -113,13 +113,13 @@ export class TerminalConfigProvider extends ConfigProvider { }, hotkeys: { 'ctrl-c': ['Ctrl-C'], - 'copy': [ + copy: [ 'Ctrl-Shift-C', ], - 'paste': [ + paste: [ 'Ctrl-Shift-V', ], - 'clear': [ + clear: [ 'Ctrl-L', ], 'zoom-in': [ @@ -136,13 +136,13 @@ export class TerminalConfigProvider extends ConfigProvider { 'new-tab': [ 'Ctrl-Shift-T', ], - 'home': ['Home'], - 'end': ['End'], + home: ['Home'], + end: ['End'], 'previous-word': ['Ctrl-Left'], 'next-word': ['Ctrl-Right'], 'delete-previous-word': ['Ctrl-Backspace'], 'delete-next-word': ['Ctrl-Delete'], - 'search': [ + search: [ 'Ctrl-Shift-F', ], }, @@ -155,13 +155,13 @@ export class TerminalConfigProvider extends ConfigProvider { }, hotkeys: { 'ctrl-c': ['Ctrl-C'], - 'copy': [ + copy: [ 'Ctrl-Shift-C', ], - 'paste': [ + paste: [ 'Ctrl-Shift-V', ], - 'clear': [ + clear: [ 'Ctrl-L', ], 'zoom-in': [ @@ -178,13 +178,13 @@ export class TerminalConfigProvider extends ConfigProvider { 'new-tab': [ 'Ctrl-Shift-T', ], - 'home': ['Home'], - 'end': ['End'], + home: ['Home'], + end: ['End'], 'previous-word': ['Ctrl-Left'], 'next-word': ['Ctrl-Right'], 'delete-previous-word': ['Ctrl-Backspace'], 'delete-next-word': ['Ctrl-Delete'], - 'search': [ + search: [ 'Ctrl-Shift-F', ], }, diff --git a/terminus-terminal/src/contextMenu.ts b/terminus-terminal/src/contextMenu.ts index 9aacadf6..051c8773 100644 --- a/terminus-terminal/src/contextMenu.ts +++ b/terminus-terminal/src/contextMenu.ts @@ -28,7 +28,7 @@ export class NewTabContextMenu extends TerminalContextMenuItemProvider { label: 'New terminal', click: () => this.zone.run(() => { this.terminalService.openTabWithOptions((tab as any).sessionOptions) - }) + }), }, { label: 'New with profile', @@ -37,7 +37,7 @@ export class NewTabContextMenu extends TerminalContextMenuItemProvider { click: () => this.zone.run(async () => { this.terminalService.openTab(profile, await tab.session.getWorkingDirectory()) }), - })) + })), }, ] @@ -49,7 +49,7 @@ export class NewTabContextMenu extends TerminalContextMenuItemProvider { click: () => this.zone.run(async () => { this.terminalService.openTabWithOptions({ ...profile.sessionOptions, - runAsAdministrator: true + runAsAdministrator: true, }) }), })), @@ -83,13 +83,13 @@ export class CopyPasteContextMenu extends TerminalContextMenuItemProvider { this.toastr.info('Copied') }) }) - } + }, }, { label: 'Paste', click: () => { this.zone.run(() => tab.paste()) - } + }, }, ] } diff --git a/terminus-terminal/src/frontends/frontend.ts b/terminus-terminal/src/frontends/frontend.ts index da787c98..70c75fca 100644 --- a/terminus-terminal/src/frontends/frontend.ts +++ b/terminus-terminal/src/frontends/frontend.ts @@ -2,7 +2,7 @@ import { Observable, Subject, AsyncSubject, ReplaySubject, BehaviorSubject } fro import { ResizeEvent } from '../api/interfaces' import { ConfigService, ThemesService, HotkeysService } from 'terminus-core' -export interface ISearchOptions { +export interface SearchOptions { regex?: boolean wholeWord?: boolean caseSensitive?: boolean @@ -39,9 +39,6 @@ export abstract class Frontend { get dragOver$ (): Observable { return this.dragOver } get drop$ (): Observable { return this.drop } - abstract attach (host: HTMLElement): void - detach (host: HTMLElement): void { } // tslint:disable-line - destroy (): void { for (const o of [ this.ready, @@ -59,6 +56,9 @@ export abstract class Frontend { } } + abstract attach (host: HTMLElement): void + detach (host: HTMLElement): void { } // eslint-disable-line + abstract getSelection (): string abstract copySelection (): void abstract clearSelection (): void @@ -71,6 +71,6 @@ export abstract class Frontend { abstract configure (): void abstract setZoom (zoom: number): void - abstract findNext (term: string, searchOptions?: ISearchOptions): boolean - abstract findPrevious (term: string, searchOptions?: ISearchOptions): boolean + abstract findNext (term: string, searchOptions?: SearchOptions): boolean + abstract findPrevious (term: string, searchOptions?: SearchOptions): boolean } diff --git a/terminus-terminal/src/frontends/hterm.ts b/terminus-terminal/src/frontends/hterm.ts index 476d6b41..43d5649c 100644 --- a/terminus-terminal/src/frontends/hterm.ts +++ b/terminus-terminal/src/frontends/hterm.ts @@ -1,3 +1,5 @@ +/* eslint-disable */ + /** @hidden */ export const hterm = require('hterm-umdjs') @@ -114,7 +116,5 @@ const _collapseToEnd = Selection.prototype.collapseToEnd Selection.prototype.collapseToEnd = function () { try { _collapseToEnd.apply(this) - } catch (err) { - // tslint-disable-line - } + } catch (e) { } } diff --git a/terminus-terminal/src/frontends/htermFrontend.ts b/terminus-terminal/src/frontends/htermFrontend.ts index ae07deeb..2111a28d 100644 --- a/terminus-terminal/src/frontends/htermFrontend.ts +++ b/terminus-terminal/src/frontends/htermFrontend.ts @@ -1,4 +1,4 @@ -import { Frontend, ISearchOptions } from './frontend' +import { Frontend, SearchOptions } from './frontend' import { hterm, preferenceManager } from './hterm' import { getCSSFontFamily } from '../utils' @@ -98,7 +98,7 @@ export class HTermFrontend extends Frontend { return } - let css = require('./hterm.userCSS.scss') + let css = require('./hterm.userCSS.scss') // eslint-disable-line if (!config.terminal.ligatures) { css += ` * { @@ -156,6 +156,14 @@ export class HTermFrontend extends Frontend { this.term.scrollEnd() } + findNext (_term: string, _searchOptions?: SearchOptions): boolean { + return false + } + + findPrevious (_term: string, _searchOptions?: SearchOptions): boolean { + return false + } + private setFontSize () { const size = this.configuredFontSize * Math.pow(1.1, this.zoom) preferenceManager.set('font-size', size) @@ -269,12 +277,4 @@ export class HTermFrontend extends Frontend { _onCursorBlink() } } - - findNext (term: string, searchOptions?: ISearchOptions): boolean { - return false - } - - findPrevious (term: string, searchOptions?: ISearchOptions): boolean { - return false - } } diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index faebb25e..545d3674 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -1,16 +1,16 @@ -import { Frontend } from './frontend' +import { Frontend, SearchOptions } from './frontend' import { Terminal, ITheme } from 'xterm' import { getCSSFontFamily } from '../utils' import { FitAddon } from 'xterm-addon-fit' import { enableLigatures } from 'xterm-addon-ligatures' -import { SearchAddon, ISearchOptions } from 'xterm-addon-search' +import { SearchAddon } from 'xterm-addon-search' import './xterm.css' -import deepEqual = require('deep-equal') +import deepEqual from 'deep-equal' import { Attributes, AttributeData, CellData } from 'xterm/src/common/buffer/BufferLine' const COLOR_NAMES = [ 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', - 'brightBlack', 'brightRed', 'brightGreen', 'brightYellow', 'brightBlue', 'brightMagenta', 'brightCyan', 'brightWhite' + 'brightBlack', 'brightRed', 'brightGreen', 'brightYellow', 'brightBlue', 'brightMagenta', 'brightCyan', 'brightWhite', ] /** @hidden */ @@ -127,7 +127,7 @@ export class XTermFrontend extends Frontend { ro.observe(host) } - detach (host: HTMLElement): void { + detach (_host: HTMLElement): void { window.removeEventListener('resize', this.resizeHandler) } @@ -138,7 +138,7 @@ export class XTermFrontend extends Frontend { copySelection (): void { require('electron').remote.clipboard.write({ text: this.getSelection(), - html: this.getSelectionAsHTML() + html: this.getSelectionAsHTML(), }) } @@ -184,7 +184,7 @@ export class XTermFrontend extends Frontend { this.xterm.setOption('fontFamily', getCSSFontFamily(config.terminal.font)) this.xterm.setOption('bellStyle', config.terminal.bell) this.xterm.setOption('cursorStyle', { - beam: 'bar' + beam: 'bar', }[config.terminal.cursor] || config.terminal.cursor) this.xterm.setOption('cursorBlink', config.terminal.cursorBlink) this.xterm.setOption('macOptionIsMeta', config.terminal.altIsMeta) @@ -196,7 +196,7 @@ export class XTermFrontend extends Frontend { const theme: ITheme = { foreground: config.terminal.colorScheme.foreground, - background: (config.terminal.background === 'colorScheme') ? config.terminal.colorScheme.background : (config.appearance.vibrancy ? 'transparent' : this.themesService.findCurrentTheme().terminalBackground), + background: config.terminal.background === 'colorScheme' ? config.terminal.colorScheme.background : config.appearance.vibrancy ? 'transparent' : this.themesService.findCurrentTheme().terminalBackground, cursor: config.terminal.colorScheme.cursor, } @@ -219,11 +219,11 @@ export class XTermFrontend extends Frontend { this.setFontSize() } - findNext (term: string, searchOptions?: ISearchOptions): boolean { + findNext (term: string, searchOptions?: SearchOptions): boolean { return this.search.findNext(term, searchOptions) } - findPrevious (term: string, searchOptions?: ISearchOptions): boolean { + findPrevious (term: string, searchOptions?: SearchOptions): boolean { return this.search.findPrevious(term, searchOptions) } diff --git a/terminus-terminal/src/hotkeys.ts b/terminus-terminal/src/hotkeys.ts index 0fd9fa9c..bb6b33c2 100644 --- a/terminus-terminal/src/hotkeys.ts +++ b/terminus-terminal/src/hotkeys.ts @@ -1,12 +1,12 @@ import slug from 'slug' import { Injectable } from '@angular/core' -import { IHotkeyDescription, HotkeyProvider } from 'terminus-core' +import { HotkeyDescription, HotkeyProvider } from 'terminus-core' import { TerminalService } from './services/terminal.service' /** @hidden */ @Injectable() export class TerminalHotkeyProvider extends HotkeyProvider { - hotkeys: IHotkeyDescription[] = [ + hotkeys: HotkeyDescription[] = [ { id: 'copy', name: 'Copy to clipboard', @@ -73,13 +73,13 @@ export class TerminalHotkeyProvider extends HotkeyProvider { private terminal: TerminalService, ) { super() } - async provide (): Promise { + async provide (): Promise { const profiles = await this.terminal.getProfiles() return [ ...this.hotkeys, ...profiles.map(profile => ({ id: `profile.${slug(profile.name).toLowerCase()}`, - name: `New tab: ${profile.name}` + name: `New tab: ${profile.name}`, })), ] } diff --git a/terminus-terminal/src/index.ts b/terminus-terminal/src/index.ts index d832edb8..8edb51d6 100644 --- a/terminus-terminal/src/index.ts +++ b/terminus-terminal/src/index.ts @@ -98,7 +98,7 @@ import { XTermFrontend, XTermWebGLFrontend } from './frontends/xtermFrontend' // For WindowsDefaultShellProvider PowerShellCoreShellProvider, WSLShellProvider, - WindowsStockShellsProvider + WindowsStockShellsProvider, ], entryComponents: [ TerminalTabComponent, @@ -122,7 +122,7 @@ import { XTermFrontend, XTermWebGLFrontend } from './frontends/xtermFrontend' EnvironmentEditorComponent, ], }) -export default class TerminalModule { +export default class TerminalModule { // eslint-disable-line @typescript-eslint/no-extraneous-class constructor ( app: AppService, config: ConfigService, @@ -199,7 +199,7 @@ export default class TerminalModule { hostApp.cliPaste$.subscribe(text => { if (app.activeTab instanceof TerminalTabComponent && app.activeTab.session) { - (app.activeTab as TerminalTabComponent).sendInput(text) + app.activeTab.sendInput(text) hostApp.bringToFront() } }) @@ -222,3 +222,6 @@ export { TerminalService, BaseSession, TerminalTabComponent, TerminalFrontendSer export { Frontend, XTermFrontend, XTermWebGLFrontend, HTermFrontend } export { BaseTerminalTabComponent } from './api/baseTerminalTab.component' export * from './api/interfaces' + +// Deprecations +export { TerminalColorScheme as ITerminalColorScheme, Shell as IShell } from './api/interfaces' diff --git a/terminus-terminal/src/pathDrop.ts b/terminus-terminal/src/pathDrop.ts index dc55431a..e3405edb 100644 --- a/terminus-terminal/src/pathDrop.ts +++ b/terminus-terminal/src/pathDrop.ts @@ -25,7 +25,7 @@ export class PathDropDecorator extends TerminalDecorator { } injectPath (terminal: TerminalTabComponent, path: string) { - if (path.indexOf(' ') >= 0) { + if (path.includes(' ')) { path = `"${path}"` } path = path.replace(/\\/g, '\\\\') diff --git a/terminus-terminal/src/services/dockMenu.service.ts b/terminus-terminal/src/services/dockMenu.service.ts index 103ed623..b1ac1528 100644 --- a/terminus-terminal/src/services/dockMenu.service.ts +++ b/terminus-terminal/src/services/dockMenu.service.ts @@ -29,7 +29,7 @@ export class DockMenuService { title: profile.name, iconPath: process.execPath, iconIndex: 0, - })) + })), }] : null) } if (this.hostApp.platform === Platform.macOS) { diff --git a/terminus-terminal/src/services/sessions.service.ts b/terminus-terminal/src/services/sessions.service.ts index d94f3ab3..f8a4ec1a 100644 --- a/terminus-terminal/src/services/sessions.service.ts +++ b/terminus-terminal/src/services/sessions.service.ts @@ -1,4 +1,4 @@ -import psNode = require('ps-node') +import * as psNode from 'ps-node' import * as fs from 'mz/fs' import * as os from 'os' import * as nodePTY from 'node-pty' @@ -11,21 +11,23 @@ import { exec } from 'mz/child_process' import { SessionOptions } from '../api/interfaces' import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils' -try { - var macOSNativeProcessList = require('macos-native-processlist') // tslint:disable-line -} catch { } // tslint:disable-line +/* eslint-disable block-scoped-var */ try { - var windowsProcessTree = require('@terminus-term/windows-process-tree') // tslint:disable-line -} catch { } // tslint:disable-line + var macOSNativeProcessList = require('macos-native-processlist') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } -export interface IChildProcess { +try { + var windowsProcessTree = require('@terminus-term/windows-process-tree') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } + +export interface ChildProcess { pid: number ppid: number command: string } -const windowsDirectoryRegex = /([a-zA-Z]:[^\:\[\]\?\"\<\>\|]+)/mi // tslint:disable-line +const windowsDirectoryRegex = /([a-zA-Z]:[^\:\[\]\?\"\<\>\|]+)/mi const OSC1337Prefix = '\x1b]1337;' const OSC1337Suffix = '\x07' @@ -61,14 +63,6 @@ export abstract class BaseSession { this.initialDataBuffer = null } - abstract start (options: SessionOptions): void - abstract resize (columns: number, rows: number): void - abstract write (data: string): void - abstract kill (signal?: string): void - abstract async getChildProcesses (): Promise - abstract async gracefullyKillProcess (): Promise - abstract async getWorkingDirectory (): Promise - async destroy (): Promise { if (this.open) { this.open = false @@ -78,6 +72,14 @@ export abstract class BaseSession { await this.gracefullyKillProcess() } } + + abstract start (options: SessionOptions): void + abstract resize (columns: number, rows: number): void + abstract write (data: string): void + abstract kill (signal?: string): void + abstract async getChildProcesses (): Promise + abstract async gracefullyKillProcess (): Promise + abstract async getWorkingDirectory (): Promise } /** @hidden */ @@ -128,12 +130,12 @@ export class Session extends BaseSession { cwd, env: env, // `1` instead of `true` forces ConPTY even if unstable - experimentalUseConpty: ((isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED) && this.config.store.terminal.useConPTY) ? 1 : false) as any, + experimentalUseConpty: (isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED) && this.config.store.terminal.useConPTY ? 1 : false) as any, }) this.guessedCWD = cwd - this.truePID = (this.pty as any).pid + this.truePID = this.pty['pid'] setTimeout(async () => { // Retrieve any possible single children now that shell has fully started @@ -173,7 +175,7 @@ export class Session extends BaseSession { this.pauseAfterExit = options.pauseAfterExit } - processOSC1337 (data) { + processOSC1337 (data: string) { if (data.includes(OSC1337Prefix)) { const preData = data.substring(0, data.indexOf(OSC1337Prefix)) let params = data.substring(data.indexOf(OSC1337Prefix) + OSC1337Prefix.length) @@ -183,7 +185,7 @@ export class Session extends BaseSession { if (params.startsWith('CurrentDir=')) { this.reportedCWD = params.split('=')[1] if (this.reportedCWD.startsWith('~')) { - this.reportedCWD = os.homedir + this.reportedCWD.substring(1) + this.reportedCWD = os.homedir() + this.reportedCWD.substring(1) } data = preData + postData } @@ -211,7 +213,7 @@ export class Session extends BaseSession { this.pty.kill(signal) } - async getChildProcesses (): Promise { + async getChildProcesses (): Promise { if (!this.truePID) { return [] } @@ -224,7 +226,7 @@ export class Session extends BaseSession { })) } if (process.platform === 'win32') { - return new Promise(resolve => { + return new Promise(resolve => { windowsProcessTree.getProcessTree(this.truePID, tree => { resolve(tree ? tree.children.map(child => ({ pid: child.pid, @@ -234,12 +236,12 @@ export class Session extends BaseSession { }) }) } - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { psNode.lookup({ ppid: this.truePID }, (err, processes) => { if (err) { return reject(err) } - resolve(processes as IChildProcess[]) + resolve(processes as ChildProcess[]) }) }) } diff --git a/terminus-terminal/src/services/terminal.service.ts b/terminus-terminal/src/services/terminal.service.ts index c57f1577..ee551822 100644 --- a/terminus-terminal/src/services/terminal.service.ts +++ b/terminus-terminal/src/services/terminal.service.ts @@ -4,19 +4,19 @@ import { Observable, AsyncSubject } from 'rxjs' import { Injectable, Inject } from '@angular/core' import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell, SessionOptions, Profile } from '../api/interfaces' +import { Shell, SessionOptions, Profile } from '../api/interfaces' import { TerminalTabComponent } from '../components/terminalTab.component' import { UACService } from './uac.service' @Injectable({ providedIn: 'root' }) export class TerminalService { - private shells = new AsyncSubject() + private shells = new AsyncSubject() private logger: Logger /** * A fresh list of all available shells */ - get shells$ (): Observable { return this.shells } + get shells$ (): Observable { return this.shells } /** @hidden */ constructor ( @@ -34,11 +34,6 @@ export class TerminalService { }) } - private async getShells (): Promise { - const shellLists = await Promise.all(this.config.enabledServices(this.shellProviders).map(x => x.provide())) - return shellLists.reduce((a, b) => a.concat(b), []) - } - async getProfiles (includeHidden?: boolean): Promise { const shells = await this.shells$.toPromise() return [ @@ -47,19 +42,11 @@ export class TerminalService { name: shell.name, icon: shell.icon, sessionOptions: this.optionsFromShell(shell), - isBuiltin: true - })) + isBuiltin: true, + })), ] } - private async reloadShells () { - this.shells = new AsyncSubject() - const shells = await this.getShells() - this.logger.debug('Shells list:', shells) - this.shells.next(shells) - this.shells.complete() - } - /** * Launches a new terminal with a specific shell and CWD * @param pause Wait for a keypress when the shell exits @@ -102,7 +89,7 @@ export class TerminalService { return this.openTabWithOptions(sessionOptions) } - optionsFromShell (shell: IShell): SessionOptions { + optionsFromShell (shell: Shell): SessionOptions { return { command: shell.command, args: shell.args || [], @@ -124,4 +111,17 @@ export class TerminalService { { sessionOptions } ) as TerminalTabComponent } + + private async getShells (): Promise { + const shellLists = await Promise.all(this.config.enabledServices(this.shellProviders).map(x => x.provide())) + return shellLists.reduce((a, b) => a.concat(b), []) + } + + private async reloadShells () { + this.shells = new AsyncSubject() + const shells = await this.getShells() + this.logger.debug('Shells list:', shells) + this.shells.next(shells) + this.shells.complete() + } } diff --git a/terminus-terminal/src/services/terminalFrontend.service.ts b/terminus-terminal/src/services/terminalFrontend.service.ts index 3b40a958..046995a0 100644 --- a/terminus-terminal/src/services/terminalFrontend.service.ts +++ b/terminus-terminal/src/services/terminalFrontend.service.ts @@ -18,11 +18,11 @@ export class TerminalFrontendService { getFrontend (session?: BaseSession): Frontend { if (!session) { - const frontend: Frontend = new ({ - 'xterm': XTermFrontend, + const frontend: Frontend = new { + xterm: XTermFrontend, 'xterm-webgl': XTermWebGLFrontend, - 'hterm': HTermFrontend, - }[this.config.store.terminal.frontend])() + hterm: HTermFrontend, + }[this.config.store.terminal.frontend]() frontend.configService = this.config frontend.themesService = this.themes frontend.hotkeysService = this.hotkeys diff --git a/terminus-terminal/src/shells/cmder.ts b/terminus-terminal/src/shells/cmder.ts index 7ad33c53..b9b5dbb8 100644 --- a/terminus-terminal/src/shells/cmder.ts +++ b/terminus-terminal/src/shells/cmder.ts @@ -4,7 +4,7 @@ import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -16,7 +16,7 @@ export class CmderShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -37,7 +37,7 @@ export class CmderShellProvider extends ShellProvider { icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/cmder.svg')), env: { TERM: 'cygwin', - } + }, }, { id: 'cmderps', @@ -50,7 +50,7 @@ export class CmderShellProvider extends ShellProvider { '-noprofile', '-noexit', '-command', - `Invoke-Expression '. ''${path.join(process.env.CMDER_ROOT, 'vendor', 'profile.ps1')}'''` + `Invoke-Expression '. ''${path.join(process.env.CMDER_ROOT, 'vendor', 'profile.ps1')}'''`, ], icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/cmder-powershell.svg')), env: {}, diff --git a/terminus-terminal/src/shells/custom.ts b/terminus-terminal/src/shells/custom.ts index 42c6e99e..d1e29e6c 100644 --- a/terminus-terminal/src/shells/custom.ts +++ b/terminus-terminal/src/shells/custom.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core' import { ConfigService } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -13,7 +13,7 @@ export class CustomShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { const args = this.config.store.terminal.customShell.split(' ') return [{ id: 'custom', diff --git a/terminus-terminal/src/shells/cygwin32.ts b/terminus-terminal/src/shells/cygwin32.ts index 3fe17e04..cebc72e2 100644 --- a/terminus-terminal/src/shells/cygwin32.ts +++ b/terminus-terminal/src/shells/cygwin32.ts @@ -4,11 +4,13 @@ import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' + +/* eslint-disable block-scoped-var */ try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } /** @hidden */ @Injectable() @@ -20,7 +22,7 @@ export class Cygwin32ShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -38,7 +40,7 @@ export class Cygwin32ShellProvider extends ShellProvider { icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/cygwin.svg')), env: { TERM: 'cygwin', - } + }, }] } } diff --git a/terminus-terminal/src/shells/cygwin64.ts b/terminus-terminal/src/shells/cygwin64.ts index 81d24f4a..d75dbc1a 100644 --- a/terminus-terminal/src/shells/cygwin64.ts +++ b/terminus-terminal/src/shells/cygwin64.ts @@ -4,11 +4,13 @@ import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' + +/* eslint-disable block-scoped-var */ try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } /** @hidden */ @Injectable() @@ -20,7 +22,7 @@ export class Cygwin64ShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -38,7 +40,7 @@ export class Cygwin64ShellProvider extends ShellProvider { icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/cygwin.svg')), env: { TERM: 'cygwin', - } + }, }] } } diff --git a/terminus-terminal/src/shells/gitBash.ts b/terminus-terminal/src/shells/gitBash.ts index 721d87b3..f197bad1 100644 --- a/terminus-terminal/src/shells/gitBash.ts +++ b/terminus-terminal/src/shells/gitBash.ts @@ -4,11 +4,13 @@ import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' + +/* eslint-disable block-scoped-var */ try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } /** @hidden */ @Injectable() @@ -20,7 +22,7 @@ export class GitBashShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -39,11 +41,11 @@ export class GitBashShellProvider extends ShellProvider { id: 'git-bash', name: 'Git-Bash', command: path.join(gitBashPath, 'bin', 'bash.exe'), - args: [ '--login', '-i' ], + args: ['--login', '-i'], icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/git-bash.svg')), env: { TERM: 'cygwin', - } + }, }] } } diff --git a/terminus-terminal/src/shells/linuxDefault.ts b/terminus-terminal/src/shells/linuxDefault.ts index 4467d5bf..903db827 100644 --- a/terminus-terminal/src/shells/linuxDefault.ts +++ b/terminus-terminal/src/shells/linuxDefault.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core' import { HostAppService, Platform, LogService, Logger } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -18,7 +18,7 @@ export class LinuxDefaultShellProvider extends ShellProvider { this.logger = log.create('linuxDefaultShell') } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Linux) { return [] } diff --git a/terminus-terminal/src/shells/macDefault.ts b/terminus-terminal/src/shells/macDefault.ts index 45ef60d5..17da9d48 100644 --- a/terminus-terminal/src/shells/macDefault.ts +++ b/terminus-terminal/src/shells/macDefault.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -14,7 +14,7 @@ export class MacOSDefaultShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.macOS) { return [] } diff --git a/terminus-terminal/src/shells/posix.ts b/terminus-terminal/src/shells/posix.ts index cb217ab9..a1c55544 100644 --- a/terminus-terminal/src/shells/posix.ts +++ b/terminus-terminal/src/shells/posix.ts @@ -4,7 +4,7 @@ import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -15,7 +15,7 @@ export class POSIXShellsProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform === Platform.Windows) { return [] } diff --git a/terminus-terminal/src/shells/powershellCore.ts b/terminus-terminal/src/shells/powershellCore.ts index 1e91ddf9..ae98d407 100644 --- a/terminus-terminal/src/shells/powershellCore.ts +++ b/terminus-terminal/src/shells/powershellCore.ts @@ -2,11 +2,13 @@ import { Injectable } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' + +/* eslint-disable block-scoped-var */ try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } /** @hidden */ @Injectable() @@ -18,7 +20,7 @@ export class PowerShellCoreShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -37,7 +39,7 @@ export class PowerShellCoreShellProvider extends ShellProvider { icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/powershell-core.svg')), env: { TERM: 'cygwin', - } + }, }] } } diff --git a/terminus-terminal/src/shells/winDefault.ts b/terminus-terminal/src/shells/winDefault.ts index d8b988d1..729d7f94 100644 --- a/terminus-terminal/src/shells/winDefault.ts +++ b/terminus-terminal/src/shells/winDefault.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' import { WSLShellProvider } from './wsl' import { PowerShellCoreShellProvider } from './powershellCore' @@ -27,7 +27,7 @@ export class WindowsDefaultShellProvider extends ShellProvider { ] } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } diff --git a/terminus-terminal/src/shells/windowsStock.ts b/terminus-terminal/src/shells/windowsStock.ts index e780fe3d..bacf0949 100644 --- a/terminus-terminal/src/shells/windowsStock.ts +++ b/terminus-terminal/src/shells/windowsStock.ts @@ -4,7 +4,7 @@ import { DomSanitizer } from '@angular/platform-browser' import { HostAppService, Platform, ElectronService } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' /** @hidden */ @Injectable() @@ -17,7 +17,7 @@ export class WindowsStockShellsProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -55,7 +55,7 @@ export class WindowsStockShellsProvider extends ShellProvider { icon: this.domSanitizer.bypassSecurityTrustHtml(require('../icons/powershell.svg')), env: { TERM: 'cygwin', - } + }, }, ] } diff --git a/terminus-terminal/src/shells/wsl.ts b/terminus-terminal/src/shells/wsl.ts index c51b3cb0..5709eee9 100644 --- a/terminus-terminal/src/shells/wsl.ts +++ b/terminus-terminal/src/shells/wsl.ts @@ -5,12 +5,14 @@ import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' import { ShellProvider } from '../api/shellProvider' -import { IShell } from '../api/interfaces' +import { Shell } from '../api/interfaces' import { isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from '../utils' +/* eslint-disable block-scoped-var */ + try { - var wnr = require('windows-native-registry') // tslint:disable-line -} catch { } // tslint:disable-line + var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires +} catch { } /** @hidden */ @Injectable() @@ -21,7 +23,7 @@ export class WSLShellProvider extends ShellProvider { super() } - async provide (): Promise { + async provide (): Promise { if (this.hostApp.platform !== Platform.Windows) { return [] } @@ -29,14 +31,14 @@ export class WSLShellProvider extends ShellProvider { const bashPath = `${process.env.windir}\\system32\\bash.exe` const wslPath = `${process.env.windir}\\system32\\wsl.exe` - const shells: IShell[] = [{ + const shells: Shell[] = [{ id: 'wsl', name: 'WSL / Default distro', command: wslPath, env: { TERM: 'xterm-color', COLORTERM: 'truecolor', - } + }, }] const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss' @@ -50,13 +52,13 @@ export class WSLShellProvider extends ShellProvider { env: { TERM: 'xterm-color', COLORTERM: 'truecolor', - } + }, }] } else { return [] } } - for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath)) { + for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath) as string[]) { const childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child) if (!childKey.DistributionName) { continue @@ -67,11 +69,11 @@ export class WSLShellProvider extends ShellProvider { name: `WSL / ${name}`, command: wslPath, args: ['-d', name], - fsBase: childKey.BasePath.value + '\\rootfs', + fsBase: childKey.BasePath.value as string + '\\rootfs', env: { TERM: 'xterm-color', COLORTERM: 'truecolor', - } + }, }) } diff --git a/terminus-terminal/src/tabContextMenu.ts b/terminus-terminal/src/tabContextMenu.ts index a7fe08d7..7cc1eb61 100644 --- a/terminus-terminal/src/tabContextMenu.ts +++ b/terminus-terminal/src/tabContextMenu.ts @@ -25,7 +25,7 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider { const profile = { sessionOptions: { ...tab.sessionOptions, - cwd: (await tab.session.getWorkingDirectory()) || tab.sessionOptions.cwd, + cwd: await tab.session.getWorkingDirectory() || tab.sessionOptions.cwd, }, name: tab.sessionOptions.command, } @@ -35,8 +35,8 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider { ] this.config.save() this.toastr.info('Saved') - }) - } + }), + }, ] } } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 07137965..00000000 --- a/tslint.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": [ - "tslint-eslint-rules", - "tslint-config-standard" - ], - "rules": { - "radix": false, - "indent": [ - true, - "spaces" - ], - "ter-indent": [true, 4], - "prefer-const": true, - "trailing-comma": [ - true, - { - "singleline": "never" - } - ] - } -} diff --git a/yarn.lock b/yarn.lock index a20395fb..b64ec1e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -68,6 +68,11 @@ dependencies: electron-debug "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -148,6 +153,43 @@ resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.9.tgz#a67287861c928ebf4159a908d1fb1a2a34d4097a" integrity sha512-p8zp5xqkly3g4cCmo2mKOHI9+Z/kObmDj0BmjbDDJQlgDTiEGTbm17MEwTAusV6XceCy+bNw9q/ZHXHyKo3zkg== +"@typescript-eslint/eslint-plugin@^1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz#552fc64cfcb19c6162190360217c945e8faa330a" + integrity sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw== + dependencies: + "@typescript-eslint/experimental-utils" "1.10.2" + eslint-utils "^1.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.7.0" + +"@typescript-eslint/experimental-utils@1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz#cd548c03fc1a2b3ba5c136d1599001a1ede24215" + integrity sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg== + dependencies: + "@typescript-eslint/typescript-estree" "1.10.2" + eslint-scope "^4.0.0" + +"@typescript-eslint/parser@^1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.10.2.tgz#36cfe8c6bf1b6c1dd81da56f88c8588f4b1a852b" + integrity sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "1.10.2" + "@typescript-eslint/typescript-estree" "1.10.2" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz#8403585dd74b6cfb6f78aa98b6958de158b5897b" + integrity sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -305,6 +347,11 @@ acorn-globals@^3.0.0: dependencies: acorn "^4.0.4" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + acorn@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -313,7 +360,7 @@ acorn@^4.0.1, acorn@^4.0.4, acorn@~4.0.2: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^6.0.5: +acorn@^6.0.5, acorn@^6.0.7: version "6.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" @@ -344,7 +391,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.2: +ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1, ajv@^6.9.2: version "6.10.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" dependencies: @@ -378,6 +425,11 @@ ansi-align@^3.0.0: dependencies: string-width "^3.0.0" +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -497,6 +549,14 @@ array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -555,6 +615,11 @@ ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -868,7 +933,7 @@ builder-util@10.0.2, builder-util@~10.0.2: stat-mode "^0.3.0" temp-file "^3.3.2" -builtin-modules@^1.0.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -984,6 +1049,11 @@ call-limit@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/call-limit/-/call-limit-1.1.0.tgz#6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea" +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -1044,7 +1114,7 @@ chalk@^1.0.0, chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" dependencies: @@ -1058,6 +1128,11 @@ character-parser@^2.1.1: dependencies: is-regex "^1.0.3" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" @@ -1145,6 +1220,11 @@ cli-spinners@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7" +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -1260,7 +1340,7 @@ commander@2.17.x, commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" -commander@^2.12.1, commander@^2.19.0, commander@^2.9.0, commander@~2.20.0: +commander@^2.19.0, commander@^2.9.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -1358,6 +1438,11 @@ constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -1542,7 +1627,7 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@2.6.9, debug@^2.1.2, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.5.1, debug@^2.6.8: +debug@2.6.9, debug@^2.1.2, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.5.1, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1560,7 +1645,7 @@ debug@^3.0.0, debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.1: +debug@^4.0.1, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" dependencies: @@ -1589,6 +1674,11 @@ deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -1659,10 +1749,6 @@ dezalgo@^1.0.0, dezalgo@~1.0.3: asap "^2.0.0" wrappy "1" -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - diffie-hellman@^5.0.0: version "5.0.3" resolved "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -1685,12 +1771,20 @@ dmg-builder@6.6.4: parse-color "^1.0.0" sanitize-filename "^1.6.1" -doctrine@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= dependencies: - esutils "^1.1.6" - isarray "0.0.1" + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" doctypes@^1.1.0: version "1.1.0" @@ -1958,6 +2052,27 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: version "0.10.46" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" @@ -2003,6 +2118,39 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-import-resolver-node@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-module-utils@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" + integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== + dependencies: + debug "^2.6.8" + pkg-dir "^2.0.0" + +eslint-plugin-import@^2.17.3: + version "2.17.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz#00548b4434c18faebaba04b24ae6198f280de189" + integrity sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q== + dependencies: + array-includes "^3.0.3" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" + read-pkg-up "^2.0.0" + resolve "^1.11.0" + eslint-scope@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" @@ -2010,6 +2158,75 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -2018,20 +2235,23 @@ esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" -estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -esutils@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" - esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -2118,6 +2338,15 @@ extend@~3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -2156,6 +2385,11 @@ fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" @@ -2170,6 +2404,20 @@ figgy-pudding@^3.1.0, figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + file-loader@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-4.0.0.tgz#c3570783fefb6e1bc0978a856f4bf5825b966c2a" @@ -2206,7 +2454,7 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.1.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: @@ -2227,6 +2475,20 @@ findup-sync@^2.0.0: micromatch "^3.0.4" resolve-dir "^1.0.1" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + flush-write-stream@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" @@ -2394,6 +2656,11 @@ function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2508,6 +2775,11 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globule@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" @@ -2636,7 +2908,7 @@ has-yarn@^2.1.0: resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== -has@^1.0.1: +has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" dependencies: @@ -2804,6 +3076,19 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -2869,6 +3154,25 @@ init-package-json@~1.10.1: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" +inquirer@^6.2.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" + integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + interpret@^1.0.0, interpret@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" @@ -2917,6 +3221,11 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -2941,6 +3250,11 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -3044,7 +3358,7 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-promise@^2.0.0: +is-promise@^2.0.0, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -3056,7 +3370,7 @@ is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" -is-regex@^1.0.3: +is-regex@^1.0.3, is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" dependencies: @@ -3070,6 +3384,13 @@ is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -3155,7 +3476,7 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.10.0, js-yaml@^3.12.1, js-yaml@^3.13.1, js-yaml@^3.5.2: +js-yaml@^3.10.0, js-yaml@^3.12.1, js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.5.2: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" dependencies: @@ -3187,6 +3508,11 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -3318,6 +3644,14 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + libnpx@10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/libnpx/-/libnpx-10.2.0.tgz#1bf4a1c9f36081f64935eb014041da10855e3102" @@ -3341,6 +3675,16 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + loader-runner@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" @@ -3426,6 +3770,11 @@ lodash.tail@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash.union@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" @@ -3772,7 +4121,7 @@ ms@^2.0.0, ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" -mute-stream@~0.0.4: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -3800,6 +4149,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + needle@^2.2.1: version "2.2.3" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.3.tgz#c1b04da378cd634d8befe2de965dc2cfb0fd65ca" @@ -4298,6 +4652,18 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + ora@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318" @@ -4348,7 +4714,7 @@ os-locale@^3.1.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -4471,6 +4837,13 @@ param-case@2.1.x: dependencies: no-case "^2.2.0" +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.1" resolved "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" @@ -4530,7 +4903,7 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1, path-is-inside@~1.0.2: +path-is-inside@^1.0.1, path-is-inside@^1.0.2, path-is-inside@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -4550,6 +4923,13 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + pbkdf2@^3.0.3: version "3.0.16" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" @@ -4595,6 +4975,13 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -4676,6 +5063,11 @@ postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.5, postcss@^7.0. source-map "^0.6.1" supports-color "^6.1.0" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -5077,6 +5469,14 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -5085,6 +5485,15 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + read@1, read@~1.0.1, read@~1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" @@ -5162,6 +5571,11 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + registry-auth-token@^3.0.1: version "3.3.2" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" @@ -5293,11 +5707,16 @@ resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.5.0: version "1.11.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" dependencies: @@ -5331,7 +5750,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.1: +rimraf@2, rimraf@2.6.3, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.1: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" dependencies: @@ -5344,6 +5763,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -5356,6 +5782,13 @@ rxjs@^6.3.1: dependencies: tslib "^1.9.0" +rxjs@^6.4.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + dependencies: + tslib "^1.9.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -5429,11 +5862,16 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + semver@^6.0.0, semver@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" @@ -5532,6 +5970,15 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + slide@^1.1.3, slide@^1.1.5, slide@~1.1.3, slide@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -5789,7 +6236,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -5842,6 +6289,11 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -5894,6 +6346,16 @@ svg-inline-loader@^0.8.0: object-assign "^4.0.1" simple-html-tokenizer "^0.1.1" +table@^5.2.3: + version "5.4.0" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.0.tgz#d772a3216e68829920a41a32c18eda286c95d780" + integrity sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + tapable@^1.0.0, tapable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.0.tgz#0d076a172e3d9ba088fd2272b2668fb8d194b78c" @@ -5975,7 +6437,7 @@ terser@^3.8.1: source-map "~0.6.1" source-map-support "~0.5.6" -text-table@~0.2.0: +text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -5997,7 +6459,7 @@ through2@~0.2.3: readable-stream "~1.1.9" xtend "~2.1.1" -"through@>=2.2.7 <3", through@~2.3.6: +"through@>=2.2.7 <3", through@^2.3.6, through@~2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -6026,6 +6488,13 @@ tmp@0.1.0: dependencies: rimraf "^2.6.3" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -6110,57 +6579,14 @@ truncate-utf8-bytes@^1.0.0: dependencies: utf8-byte-length "^1.0.1" -tslib@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" - -tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.8.1, tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" -tslint-config-standard@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/tslint-config-standard/-/tslint-config-standard-8.0.1.tgz#e4dd3128e84b0e34b51990b68715a641f2b417e4" - dependencies: - tslint-eslint-rules "^5.3.1" - -tslint-eslint-rules@^5.3.1, tslint-eslint-rules@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz#e488cc9181bf193fe5cd7bfca213a7695f1737b5" - dependencies: - doctrine "0.7.2" - tslib "1.9.0" - tsutils "^3.0.0" - -tslint@^5.17.0: - version "5.17.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.17.0.tgz#f9f0ce2011d8e90debaa6e9b4975f24cd16852b8" - integrity sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^3.2.0" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - -tsutils@^3.0.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.5.2.tgz#6fd3c2d5a731e83bb21b070a173ec0faf3a8f6d3" +tsutils@^3.7.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77" + integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw== dependencies: tslib "^1.8.1" @@ -6178,6 +6604,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + type-fest@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" @@ -6604,6 +7037,11 @@ wordwrap@~0.0.2: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + worker-farm@^1.5.2: version "1.6.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" @@ -6653,6 +7091,13 @@ write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"