From e4b76936855e19c96cf4aa7321259f97001560e6 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 1 Mar 2020 17:02:49 +0100 Subject: [PATCH] dropped slug --- terminus-terminal/package.json | 3 +-- .../components/shellSettingsTab.component.pug | 2 +- .../components/shellSettingsTab.component.ts | 4 ++-- terminus-terminal/src/hotkeys.ts | 4 ++-- terminus-terminal/src/index.ts | 4 ++-- .../src/services/terminal.service.ts | 4 ++-- terminus-terminal/src/shells/posix.ts | 4 ++-- terminus-terminal/src/shells/wsl.ts | 4 ++-- terminus-terminal/yarn.lock | 20 ++++--------------- tsconfig.json | 2 +- 10 files changed, 19 insertions(+), 32 deletions(-) diff --git a/terminus-terminal/package.json b/terminus-terminal/package.json index 9aea59aa..e987bb6c 100644 --- a/terminus-terminal/package.json +++ b/terminus-terminal/package.json @@ -18,7 +18,6 @@ "license": "MIT", "devDependencies": { "@types/deep-equal": "^1.0.0", - "@types/slug": "^0.9.1", "ansi-colors": "^4.1.1", "dataurl": "0.1.0", "deep-equal": "1.1.0", @@ -26,7 +25,7 @@ "mz": "^2.6.0", "ps-node": "^0.1.6", "runes": "^0.4.2", - "slug": "^2.0.0", + "slugify": "^1.4.0", "uuid": "^7.0.1", "xterm": "^4.5.0-beta.9", "xterm-addon-fit": "^0.4.0-beta2", diff --git a/terminus-terminal/src/components/shellSettingsTab.component.pug b/terminus-terminal/src/components/shellSettingsTab.component.pug index 761bf33f..4c60fe10 100644 --- a/terminus-terminal/src/components/shellSettingsTab.component.pug +++ b/terminus-terminal/src/components/shellSettingsTab.component.pug @@ -11,7 +11,7 @@ h3.mb-3 Shell ) option( *ngFor='let profile of profiles', - [ngValue]='slug(profile.name).toLowerCase()' + [ngValue]='slugify(profile.name).toLowerCase()' ) {{profile.name}} diff --git a/terminus-terminal/src/components/shellSettingsTab.component.ts b/terminus-terminal/src/components/shellSettingsTab.component.ts index 8009640e..83ccad01 100644 --- a/terminus-terminal/src/components/shellSettingsTab.component.ts +++ b/terminus-terminal/src/components/shellSettingsTab.component.ts @@ -1,4 +1,4 @@ -import slug from 'slug' +import slugify from 'slugify' import { Component } from '@angular/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { Subscription } from 'rxjs' @@ -17,7 +17,7 @@ export class ShellSettingsTabComponent { Platform = Platform isConPTYAvailable: boolean isConPTYStable: boolean - slug = slug + slugify = slugify private configSubscription: Subscription constructor ( diff --git a/terminus-terminal/src/hotkeys.ts b/terminus-terminal/src/hotkeys.ts index bb6b33c2..39e8290c 100644 --- a/terminus-terminal/src/hotkeys.ts +++ b/terminus-terminal/src/hotkeys.ts @@ -1,4 +1,4 @@ -import slug from 'slug' +import slugify from 'slugify' import { Injectable } from '@angular/core' import { HotkeyDescription, HotkeyProvider } from 'terminus-core' import { TerminalService } from './services/terminal.service' @@ -78,7 +78,7 @@ export class TerminalHotkeyProvider extends HotkeyProvider { return [ ...this.hotkeys, ...profiles.map(profile => ({ - id: `profile.${slug(profile.name).toLowerCase()}`, + id: `profile.${slugify(profile.name).toLowerCase()}`, name: `New tab: ${profile.name}`, })), ] diff --git a/terminus-terminal/src/index.ts b/terminus-terminal/src/index.ts index 6af1a801..fd924002 100644 --- a/terminus-terminal/src/index.ts +++ b/terminus-terminal/src/index.ts @@ -1,5 +1,5 @@ import * as fs from 'mz/fs' -import slug from 'slug' +import slugify from 'slugify' import { NgModule } from '@angular/core' import { BrowserModule } from '@angular/platform-browser' @@ -182,7 +182,7 @@ export default class TerminalModule { // eslint-disable-line @typescript-eslint/ } if (hotkey.startsWith('profile.')) { const profiles = await terminal.getProfiles() - const profile = profiles.find(x => slug(x.name).toLowerCase() === hotkey.split('.')[1]) + const profile = profiles.find(x => slugify(x.name).toLowerCase() === hotkey.split('.')[1]) if (profile) { terminal.openTabWithOptions(profile.sessionOptions) } diff --git a/terminus-terminal/src/services/terminal.service.ts b/terminus-terminal/src/services/terminal.service.ts index 85184a33..f1fea4ff 100644 --- a/terminus-terminal/src/services/terminal.service.ts +++ b/terminus-terminal/src/services/terminal.service.ts @@ -1,5 +1,5 @@ import * as fs from 'mz/fs' -import slug from 'slug' +import slugify from 'slugify' import { Observable, AsyncSubject } from 'rxjs' import { Injectable, Inject } from '@angular/core' import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core' @@ -54,7 +54,7 @@ export class TerminalService { async openTab (profile?: Profile, cwd?: string|null, pause?: boolean): Promise { if (!profile) { const profiles = await this.getProfiles(true) - profile = profiles.find(x => slug(x.name).toLowerCase() === this.config.store.terminal.profile) || profiles[0] + profile = profiles.find(x => slugify(x.name).toLowerCase() === this.config.store.terminal.profile) || profiles[0] } cwd = cwd || profile.sessionOptions.cwd diff --git a/terminus-terminal/src/shells/posix.ts b/terminus-terminal/src/shells/posix.ts index a1c55544..6545f113 100644 --- a/terminus-terminal/src/shells/posix.ts +++ b/terminus-terminal/src/shells/posix.ts @@ -1,5 +1,5 @@ import * as fs from 'mz/fs' -import slug from 'slug' +import slugify from 'slugify' import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'terminus-core' @@ -24,7 +24,7 @@ export class POSIXShellsProvider extends ShellProvider { .map(x => x.trim()) .filter(x => x && !x.startsWith('#')) .map(x => ({ - id: slug(x), + id: slugify(x), name: x.split('/')[2], command: x, args: ['-l'], diff --git a/terminus-terminal/src/shells/wsl.ts b/terminus-terminal/src/shells/wsl.ts index 9f4af037..7bfccf77 100644 --- a/terminus-terminal/src/shells/wsl.ts +++ b/terminus-terminal/src/shells/wsl.ts @@ -1,5 +1,5 @@ import * as fs from 'mz/fs' -import slug from 'slug' +import slugify from 'slugify' import { Injectable } from '@angular/core' import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from 'terminus-core' @@ -90,7 +90,7 @@ export class WSLShellProvider extends ShellProvider { } const name = childKey.DistributionName.value const shell: Shell = { - id: `wsl-${slug(name)}`, + id: `wsl-${slugify(name)}`, name: `WSL / ${name}`, command: wslPath, args: ['-d', name], diff --git a/terminus-terminal/yarn.lock b/terminus-terminal/yarn.lock index 97459433..216f6371 100644 --- a/terminus-terminal/yarn.lock +++ b/terminus-terminal/yarn.lock @@ -7,11 +7,6 @@ resolved "https://registry.yarnpkg.com/@types/deep-equal/-/deep-equal-1.0.1.tgz#71cfabb247c22bcc16d536111f50c0ed12476b03" integrity sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg== -"@types/slug@^0.9.1": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@types/slug/-/slug-0.9.1.tgz#16dbf8b77d73e0a09ce51a96400878f33806ab32" - integrity sha512-zR/u8WFQ4/6uCIikjI00a5uB084XjgEGNRAvM4a1BL39Bw9yEiDQFiPS2DgJ8lPDkR2Qd/vZ26dCR9XqlKbDqQ== - ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -193,12 +188,10 @@ runes@^0.4.2: resolved "https://registry.yarnpkg.com/runes/-/runes-0.4.3.tgz#32f7738844bc767b65cc68171528e3373c7bb355" integrity sha512-K6p9y4ZyL9wPzA+PMDloNQPfoDGTiFYDvdlXznyGKgD10BJpcAosvATKrExRKOrNLgD8E7Um7WGW0lxsnOuNLg== -slug@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slug/-/slug-2.1.0.tgz#293f8d53de7e55c15871846fd1bc36114841a8c7" - integrity sha512-Q4foEgcE7E8UB/BFg4kEzFUICoppzsbbfRjrdKiOM4Z4EFZF5tdn6amkgeaGur3kI4lMWP2BoMv7XJcKZvLg9Q== - dependencies: - unicode ">= 0.3.1" +slugify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.4.0.tgz#c9557c653c54b0c7f7a8e786ef3431add676d2cb" + integrity sha512-FtLNsMGBSRB/0JOE2A0fxlqjI6fJsgHGS13iTuVT28kViI4JjUiNqp/vyis0ZXYcMnpR3fzGNkv+6vRlI2GwdQ== table-parser@^0.1.3: version "0.1.3" @@ -226,11 +219,6 @@ tiny-inflate@^1.0.2: resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.2.tgz#93d9decffc8805bd57eae4310f0b745e9b6fb3a7" integrity sha1-k9nez/yIBb1X6uQxDwt0Xptvs6c= -"unicode@>= 0.3.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/unicode/-/unicode-11.0.1.tgz#735bd422ec75cf28d396eb224d535d168d5f1db6" - integrity sha512-+cHtykLb+eF1yrSLWTwcYBrqJkTfX7Quoyg7Juhe6uylF43ZbMdxMuSHNYlnyLT8T7POAvavgBthzUF9AIaQvQ== - uuid@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.1.tgz#95ed6ff3d8c881cbf85f0f05cc3915ef994818ef" diff --git a/tsconfig.json b/tsconfig.json index 24b87f1c..92bce4f8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "es2015", - "target": "es2017", + "target": "es2016", "moduleResolution": "node", "noImplicitAny": false, "removeComments": false,