Run make tsfmt and make test

This formats all the go & ts files
This commit is contained in:
Will Owens 2022-02-27 20:30:29 -05:00
parent 765000bd61
commit 1de0cc6790
7 changed files with 52 additions and 52 deletions

View file

@ -75,7 +75,7 @@ test:
if [ $$(go fmt $$(go list ./...) | wc -l) -gt 0 ]; then echo "go fmt error"; exit 1; fi
cd js && npx tsfmt -r --verify
.PHONY: fmt
.PHONY: tsfmt
tsfmt:
cd js && npx tsfmt -r

2
js/dist/main.d.ts vendored
View file

@ -1 +1 @@
export {};
export { };

View file

@ -52,11 +52,11 @@ export class Hterm {
};
setPreferences(value: object) {
Object.keys(value).forEach((key) => {
if (key != "enable-webgl") {
this.term.getPrefs().set(key, value[key]);
}
});
Object.keys(value).forEach((key) => {
if (key != "enable-webgl") {
this.term.getPrefs().set(key, value[key]);
}
});
};
onInput(callback: (input: string) => void) {
@ -77,9 +77,9 @@ export class Hterm {
};
deactivate(): void {
this.io.onVTKeystroke = function(){};
this.io.sendString = function(){};
this.io.onTerminalResize = function(){};
this.io.onVTKeystroke = function() { };
this.io.sendString = function() { };
this.io.onTerminalResize = function() { };
this.term.uninstallKeyboard();
}

View file

@ -1,9 +1,8 @@
import {lib} from "libapps";
import {IDisposable, Terminal} from 'xterm';
import {FitAddon} from "xterm-addon-fit";
import {WebglAddon} from "xterm-addon-webgl";
import { lib } from "libapps";
import { IDisposable, Terminal } from "xterm";
import { FitAddon } from "xterm-addon-fit";
import { WebglAddon } from "xterm-addon-webgl";
export class Xterm {
elem: HTMLElement;
@ -15,13 +14,13 @@ export class Xterm {
messageTimeout: number;
messageTimer: NodeJS.Timer;
fitAddon: FitAddon;
disposables: IDisposable[] = [];
fitAddon: FitAddon;
disposables: IDisposable[] = [];
constructor(elem: HTMLElement) {
this.elem = elem;
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0;
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0;
this.term = new Terminal({
cursorStyle: "block",
cursorBlink: true,
@ -30,20 +29,20 @@ export class Xterm {
fontSize: 12,
});
this.fitAddon = new FitAddon();
this.term.loadAddon(this.fitAddon);
this.fitAddon = new FitAddon();
this.term.loadAddon(this.fitAddon);
this.message = elem.ownerDocument.createElement("div");
this.message.className = "xterm-overlay";
this.messageTimeout = 2000;
this.resizeListener = () => {
this.fitAddon.fit();
this.fitAddon.fit();
this.term.scrollToBottom();
this.showMessage(String(this.term.cols) + "x" + String(this.term.rows), this.messageTimeout);
};
this.term.open(elem);
this.term.open(elem);
this.term.focus()
this.resizeListener();
@ -85,28 +84,28 @@ export class Xterm {
};
setPreferences(value: object) {
Object.keys(value).forEach((key) => {
if (key && key == "enable-webgl") {
this.term.loadAddon(new WebglAddon());
}
});
Object.keys(value).forEach((key) => {
if (key && key == "enable-webgl") {
this.term.loadAddon(new WebglAddon());
}
});
};
onInput(callback: (input: string) => void) {
this.disposables.push(this.term.onData((data) => {
callback(data);
}));
this.disposables.push(this.term.onData((data) => {
callback(data);
}));
};
onResize(callback: (colmuns: number, rows: number) => void) {
this.disposables.push(this.term.onResize((data) => {
callback(data.cols, data.rows);
}));
this.disposables.push(this.term.onResize((data) => {
callback(data.cols, data.rows);
}));
};
deactivate(): void {
this.disposables.forEach(d => d.dispose())
this.disposables.forEach(d => d.dispose())
this.term.blur();
}
@ -117,6 +116,6 @@ export class Xterm {
close(): void {
window.removeEventListener("resize", this.resizeListener);
this.term.dispose();
this.term.dispose();
}
}

View file

@ -1,20 +1,21 @@
{
"compilerOptions": {
"strictNullChecks": true,
"noUnusedLocals" : true,
"noImplicitThis": true,
"alwaysStrict": true,
"outDir": "./dist/",
"declaration": true,
"sourceMap": true,
"target": "es5",
"module": "commonJS",
"baseUrl": ".",
"paths": {
"*": ["./typings/*"]
}
"newLine": "LF",
"strictNullChecks": true,
"noUnusedLocals" : true,
"noImplicitThis": true,
"alwaysStrict": true,
"outDir": "./dist/",
"declaration": true,
"sourceMap": true,
"target": "es5",
"module": "commonJS",
"baseUrl": ".",
"paths": {
"*": ["./typings/*"]
}
},
"exclude": [
"node_modules"
"exclude": [
"node_modules"
]
}

View file

@ -37,7 +37,7 @@ export declare namespace lib {
}
export interface Memory {
new (): Storage;
new(): Storage;
Memory(): Storage
}

View file

@ -7,8 +7,8 @@ import (
"reflect"
"strings"
"github.com/urfave/cli"
"github.com/fatih/structs"
"github.com/urfave/cli"
"github.com/yudai/hcl"
"github.com/ghthor/gotty/v2/pkg/homedir"