diff --git a/CHANGELOG.md b/CHANGELOG.md index a252856..b1d5275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Released] +## [1.0.2] + +### Security +- Addressed dependency from security audit for package `bl`: [bl npm advisory](https://npmjs.com/advisories/1555) + +## [1.0.1] + +### Fixed +- Reading of extension settings by name: [commit](https://github.com/clarkio/vscode-twitch-highlighter/commit/5b6844bd999d5eefb5ec186f76510b0a62704d4e) + ## [1.0.0] First full release and no longer in preview! @@ -128,6 +138,8 @@ This is a complete rewrite of the extension. The extension now has an API that o - Pre-release version to gather feedback from the community and help identify gaps. +[1.0.2]: https://github.com/clarkio/vscode-twitch-highlighter/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/clarkio/vscode-twitch-highlighter/compare/1.0.0...1.0.1 [1.0.0]: https://github.com/clarkio/vscode-twitch-highlighter/compare/0.5.1...1.0.0 [0.5.1]: https://github.com/clarkio/vscode-twitch-highlighter/compare/0.5.0...0.5.1 [0.5.0]: https://github.com/clarkio/vscode-twitch-highlighter/compare/0.2.3...0.5.0 diff --git a/README.md b/README.md index 123e1d7..45728d3 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ In order to use this extension you will need the following things before going t - An installed version of [VS Code](https://code.visualstudio.com) - A Twitch account for yourself or a separate one to be used as a chat bot ([sign up here](https://www.twitch.tv/signup)) -- While logged in as your own account or as a separate account go to this site to generate a token for the chat bot: http://www.twitchapps.com/tmi - - Save this token temporarily in a safe place as you will need it later in the [Getting Started](#getting-started) section. ## Getting Started diff --git a/package-lock.json b/package-lock.json index b816744..9aecea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "twitch-highlighter", - "version": "0.6.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -778,9 +778,9 @@ } }, "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "dev": true, "requires": { "buffer": "^5.5.0", @@ -939,13 +939,13 @@ } }, "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.0.tgz", + "integrity": "sha512-cd+5r1VLBwUqTrmnzW+D7ABkJUM6mr7uv1dv+6jRw4Rcl7tFIFHDqHPL98LhpGFn3dbAt3gtLxtrWp4m1kFrqg==", "dev": true, "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, "buffer-from": { diff --git a/package.json b/package.json index 88331bd..b74d5e5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "twitch-highlighter", "displayName": "Twitch Highlighter", "description": "Allow your Twitch viewers to help in spotting bugs, typos, etc. by sending a command in chat that will highlight the line of code they want you to check.", - "version": "1.0.0", + "version": "1.0.2", "preview": false, "publisher": "clarkio", "engines": { diff --git a/src/app.ts b/src/app.ts index b9eff0b..184b331 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,13 +1,13 @@ import * as vscode from 'vscode'; - import { HighlighterAPI } from './api'; -import { Commands, LogLevel, Configuration, Settings, AppContexts } from './enums'; -import { Logger, log } from './logger'; +import { AppContexts, Commands, Configuration, LogLevel, Settings } from './enums'; import { HighlightManager, - HighlightTreeItem, - HighlightTreeDataProvider + + HighlightTreeDataProvider, HighlightTreeItem } from './highlight'; +import { log, Logger } from './logger'; + export class App implements vscode.Disposable { private readonly _highlightManager: HighlightManager; @@ -159,9 +159,9 @@ export class App implements vscode.Disposable { } return vscode.window.createTextEditorDecorationType({ - backgroundColor: configuration.get(Configuration.highlightBackgroundColor) || 'green', - border: configuration.get(Configuration.highlightBorderStyle) || '2px solid white', - color: configuration.get(Configuration.highlightForegroundColor) || 'white' + backgroundColor: configuration.get(Settings.highlightColor) || 'green', + border: configuration.get(Settings.highlightBorder) || '2px solid white', + color: configuration.get(Settings.highlightFontColor) || 'white' }); } @@ -183,8 +183,8 @@ export class App implements vscode.Disposable { private get isActiveTextEditor(): boolean { const editor = vscode.window.activeTextEditor; return (editor !== undefined && - editor.document.languageId !== 'log' && - editor.document.getText().length > 0); + editor.document.languageId !== 'log' && + editor.document.getText().length > 0); } private async highlightHandler(): Promise { @@ -204,7 +204,7 @@ export class App implements vscode.Disposable { this._highlightManager.Add(editor!.document, 'self', +(value || 0)); } } - catch ( err ) { + catch (err) { this.log(LogLevel.Error, err); } @@ -232,7 +232,7 @@ export class App implements vscode.Disposable { this._highlightManager.Remove(fileName, 'self', +(lineNumber)); } } - catch ( err ) { + catch (err) { this.log(LogLevel.Error, err); } } @@ -249,7 +249,7 @@ export class App implements vscode.Disposable { let pickerOptions: Array = new Array(); const highlights = this._highlightManager.GetHighlightDetails(); highlights.forEach(highlight => { - pickerOptions = [ ...pickerOptions, highlight ]; + pickerOptions = [...pickerOptions, highlight]; }); try { @@ -261,7 +261,7 @@ export class App implements vscode.Disposable { const [pickedFile, lineNumber] = pickedOption.split(': '); this._highlightManager.Remove(pickedFile, 'self', +(lineNumber)); } - catch ( err ) { + catch (err) { this.log(LogLevel.Error, err); } } diff --git a/src/ttvchat/ChatClient.ts b/src/ttvchat/ChatClient.ts index 4dfcd6f..2604814 100644 --- a/src/ttvchat/ChatClient.ts +++ b/src/ttvchat/ChatClient.ts @@ -1,25 +1,18 @@ import { - EventEmitter, - Event, - Disposable, - workspace, - WorkspaceConfiguration, - ExtensionContext, - ConfigurationChangeEvent, - OutputChannel -} from 'vscode'; -import { - Client, - Options, - ChatUserstate, - Badges + Badges, ChatUserstate, Client, + Options } from "tmi.js"; - -import { log } from '../logger'; +import { + ConfigurationChangeEvent, Disposable, Event, EventEmitter, + ExtensionContext, workspace, + WorkspaceConfiguration +} from 'vscode'; import { keytar } from "../common"; -import { LogLevel, KeytarKeys, Configuration, Settings } from "../enums"; +import { Configuration, KeytarKeys, LogLevel, Settings } from "../enums"; +import { log } from '../logger'; import { API } from './api'; + interface IBadges extends Badges { [key: string]: string | undefined; follower: string; @@ -45,7 +38,7 @@ export class ChatClient implements Disposable { private leaveMessage: string = ""; private requiredBadges: string[] = []; - constructor(private log: log) {} + constructor(private log: log) { } public initialize(context: ExtensionContext) { this.config = workspace.getConfiguration(Configuration.sectionIdentifier); @@ -159,7 +152,7 @@ export class ChatClient implements Disposable { } private async onDidChangeConfigurationHandler(event: ConfigurationChangeEvent) { - if (event.affectsConfiguration(Configuration.sectionIdentifier)) { + if (event.affectsConfiguration(Configuration.sectionIdentifier) && this.isConnected) { await this.disconnect(); await this.connect(); }