es2021 compilation

This commit is contained in:
Eugene Pankov 2021-07-06 09:40:54 +02:00
parent bf762cc4c7
commit 89f369abe6
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
15 changed files with 87 additions and 753 deletions

View File

@ -1,7 +1,6 @@
import * as glasstron from 'glasstron'
import { Subject, Observable } from 'rxjs'
import { debounceTime } from 'rxjs/operators'
import { Subject, Observable, debounceTime } from 'rxjs'
import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen, BrowserWindowConstructorOptions } from 'electron'
import ElectronConfig = require('electron-config')
import * as os from 'os'
@ -364,7 +363,7 @@ export class Window {
this.disableVibrancyWhileDragging = value
})
let moveEndedTimeout: number|null = null
let moveEndedTimeout: NodeJS.Timeout|null = null
const onBoundsChange = () => {
if (!this.lastVibrancy?.enabled || !this.disableVibrancyWhileDragging) {
return

View File

@ -31,9 +31,9 @@ module.exports = {
{
test: /\.ts$/,
use: {
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.json'),
configFile: path.resolve(__dirname, 'tsconfig.json'),
},
},
},

View File

@ -25,9 +25,9 @@ module.exports = {
{
test: /\.ts$/,
use: {
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.main.json'),
configFile: path.resolve(__dirname, 'tsconfig.main.json'),
},
},
},

View File

@ -13,7 +13,6 @@
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.28.0",
"apply-loader": "2.0.0",
"awesome-typescript-loader": "^5.2.1",
"clone-deep": "^4.0.1",
"compare-versions": "^3.6.0",
"core-js": "^3.15.2",
@ -51,9 +50,10 @@
"source-sans-pro": "3.6.0",
"style-loader": "^3.0.0",
"svg-inline-loader": "^0.8.2",
"ts-loader": "^9.2.3",
"tslib": "^2.3.0",
"typedoc": "^0.21.2",
"typescript": "^4.2.4",
"typescript": "^4.3.5",
"url-loader": "^4.1.1",
"val-loader": "4.0.0",
"webpack": "^5.42.0",

View File

@ -12,7 +12,7 @@ export function isWindowsBuild (build: number): boolean {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function getCSSFontFamily (config: any): string {
let fonts: string[] = config.terminal.font.split(',').map(x => x.trim().replace(/"/g, ''))
let fonts: string[] = config.terminal.font.split(',').map(x => x.trim().replaceAll('"', ''))
if (config.terminal.fallbackFont) {
fonts.push(config.terminal.fallbackFont)
}

View File

@ -92,10 +92,10 @@ export default class ElectronModule {
try {
let electronKeySpec = item[0]
electronKeySpec = electronKeySpec.replace('Meta', 'Super')
electronKeySpec = electronKeySpec.replace('⌘', 'Command')
electronKeySpec = electronKeySpec.replace('⌥', 'Alt')
electronKeySpec = electronKeySpec.replace(/-/g, '+')
electronKeySpec = electronKeySpec.replaceAll('Meta', 'Super')
electronKeySpec = electronKeySpec.replaceAll('⌘', 'Command')
electronKeySpec = electronKeySpec.replaceAll('⌥', 'Alt')
electronKeySpec = electronKeySpec.replaceAll('-', '+')
specs.push(electronKeySpec)
} catch (err) {
console.error('Could not register the global hotkey:', err)

View File

@ -414,9 +414,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
data = `\x1b[200~${data}\x1b[201~`
}
if (this.hostApp.platform === Platform.Windows) {
data = data.replace(/\r\n/g, '\r')
data = data.replaceAll('\r\n', '\r')
} else {
data = data.replace(/\n/g, '\r')
data = data.replaceAll('\n', '\r')
}
if (!this.alternateScreenActive) {

View File

@ -77,7 +77,7 @@ export class TerminalStreamProcessor {
gutter: 4,
divide: colors.gray(' '),
emptyHuman: colors.gray(''),
}).replace(/\n/g, '\r\n')),
}).replaceAll('\n', '\r\n')),
Buffer.from('\r\n\n'),
]))
} else {

View File

@ -23,7 +23,7 @@ export class PathDropDecorator extends TerminalDecorator {
if (path.includes(' ')) {
path = `"${path}"`
}
path = path.replace(/\\/g, '\\\\')
path = path.replaceAll('\\', '\\\\')
terminal.sendInput(path + ' ')
}
}

View File

@ -83,7 +83,7 @@ import { TerminalCLIHandler } from './cli'
],
})
export default class TerminalModule { // eslint-disable-line @typescript-eslint/no-extraneous-class
private constructor (
constructor (
hotkeys: HotkeysService,
) {
const events = [

View File

@ -1,4 +1,3 @@
const path = require('path')
const config = require('../webpack.plugin.config')
module.exports = config({
name: 'terminal',
@ -9,4 +8,3 @@ module.exports = config({
],
})
module.exports.resolve.modules.push('node_modules/xterm/src')
module.exports.module.rules.find(x => x.use.loader === 'awesome-typescript-loader').use.options.paths['*'].push(path.resolve(__dirname, './node_modules/xterm/src/*'))

View File

@ -18,16 +18,30 @@
"importHelpers": true,
"strictNullChecks": true,
"lib": [
"dom",
"es5",
"es6",
"es7",
"es2015",
"es2017",
"es2019"
"DOM",
"ES5",
"ES6",
"ES7",
"ES2015",
"ES2017",
"ES2019",
"ES2021"
],
"paths": {
"*": [
"../node_modules/*",
"../../app/node_modules/*"
],
"common*": [
"../../tabby-terminal/node_modules/xterm/src/common*"
],
"tabby-*": ["../../tabby-*/src"]
}
},
"typeAcquisition": {
"include": [
"../node_modules",
"../../app/node_modules"
]
}
}

View File

@ -55,9 +55,9 @@ module.exports = {
{
test: /\.ts$/,
use: {
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.json'),
configFile: path.resolve(__dirname, 'tsconfig.json'),
},
},
},

View File

@ -49,20 +49,10 @@ module.exports = options => {
{
test: /\.ts$/,
use: {
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
configFileName: path.resolve(options.dirname, 'tsconfig.json'),
typeRoots: [
path.resolve(options.dirname, 'node_modules/@types'),
path.resolve(options.dirname, '../node_modules/@types'),
],
paths: {
'tabby-*': [path.resolve(options.dirname, '../tabby-*')],
'*': [
path.resolve(options.dirname, '../app/node_modules/*'),
path.resolve(options.dirname, '../node_modules/*'),
],
},
configFile: path.resolve(options.dirname, 'tsconfig.json'),
allowTsInNodeModules: true,
},
},
},

753
yarn.lock

File diff suppressed because it is too large Load Diff