Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.2 Release #130

Merged
merged 16 commits into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
28 changes: 14 additions & 14 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -159,9 +159,9 @@ export class App implements vscode.Disposable {
}

return vscode.window.createTextEditorDecorationType({
backgroundColor: configuration.get<string>(Configuration.highlightBackgroundColor) || 'green',
border: configuration.get<string>(Configuration.highlightBorderStyle) || '2px solid white',
color: configuration.get<string>(Configuration.highlightForegroundColor) || 'white'
backgroundColor: configuration.get<string>(Settings.highlightColor) || 'green',
border: configuration.get<string>(Settings.highlightBorder) || '2px solid white',
color: configuration.get<string>(Settings.highlightFontColor) || 'white'
});
}

Expand All @@ -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<void> {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
}
}
Expand All @@ -249,7 +249,7 @@ export class App implements vscode.Disposable {
let pickerOptions: Array<string> = new Array<string>();
const highlights = this._highlightManager.GetHighlightDetails();
highlights.forEach(highlight => {
pickerOptions = [ ...pickerOptions, highlight ];
pickerOptions = [...pickerOptions, highlight];
});

try {
Expand All @@ -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);
}
}
Expand Down
31 changes: 12 additions & 19 deletions src/ttvchat/ChatClient.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}
Expand Down