mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-03 08:04:02 +03:00
es2021 compilation
This commit is contained in:
parent
bf762cc4c7
commit
89f369abe6
@ -1,7 +1,6 @@
|
|||||||
import * as glasstron from 'glasstron'
|
import * as glasstron from 'glasstron'
|
||||||
|
|
||||||
import { Subject, Observable } from 'rxjs'
|
import { Subject, Observable, debounceTime } from 'rxjs'
|
||||||
import { debounceTime } from 'rxjs/operators'
|
|
||||||
import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen, BrowserWindowConstructorOptions } from 'electron'
|
import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen, BrowserWindowConstructorOptions } from 'electron'
|
||||||
import ElectronConfig = require('electron-config')
|
import ElectronConfig = require('electron-config')
|
||||||
import * as os from 'os'
|
import * as os from 'os'
|
||||||
@ -364,7 +363,7 @@ export class Window {
|
|||||||
this.disableVibrancyWhileDragging = value
|
this.disableVibrancyWhileDragging = value
|
||||||
})
|
})
|
||||||
|
|
||||||
let moveEndedTimeout: number|null = null
|
let moveEndedTimeout: NodeJS.Timeout|null = null
|
||||||
const onBoundsChange = () => {
|
const onBoundsChange = () => {
|
||||||
if (!this.lastVibrancy?.enabled || !this.disableVibrancyWhileDragging) {
|
if (!this.lastVibrancy?.enabled || !this.disableVibrancyWhileDragging) {
|
||||||
return
|
return
|
||||||
|
@ -31,9 +31,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -25,9 +25,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(__dirname, 'tsconfig.main.json'),
|
configFile: path.resolve(__dirname, 'tsconfig.main.json'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
||||||
"@typescript-eslint/parser": "^4.28.0",
|
"@typescript-eslint/parser": "^4.28.0",
|
||||||
"apply-loader": "2.0.0",
|
"apply-loader": "2.0.0",
|
||||||
"awesome-typescript-loader": "^5.2.1",
|
|
||||||
"clone-deep": "^4.0.1",
|
"clone-deep": "^4.0.1",
|
||||||
"compare-versions": "^3.6.0",
|
"compare-versions": "^3.6.0",
|
||||||
"core-js": "^3.15.2",
|
"core-js": "^3.15.2",
|
||||||
@ -51,9 +50,10 @@
|
|||||||
"source-sans-pro": "3.6.0",
|
"source-sans-pro": "3.6.0",
|
||||||
"style-loader": "^3.0.0",
|
"style-loader": "^3.0.0",
|
||||||
"svg-inline-loader": "^0.8.2",
|
"svg-inline-loader": "^0.8.2",
|
||||||
|
"ts-loader": "^9.2.3",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"typedoc": "^0.21.2",
|
"typedoc": "^0.21.2",
|
||||||
"typescript": "^4.2.4",
|
"typescript": "^4.3.5",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"val-loader": "4.0.0",
|
"val-loader": "4.0.0",
|
||||||
"webpack": "^5.42.0",
|
"webpack": "^5.42.0",
|
||||||
|
@ -12,7 +12,7 @@ export function isWindowsBuild (build: number): boolean {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
export function getCSSFontFamily (config: any): string {
|
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) {
|
if (config.terminal.fallbackFont) {
|
||||||
fonts.push(config.terminal.fallbackFont)
|
fonts.push(config.terminal.fallbackFont)
|
||||||
}
|
}
|
||||||
|
@ -92,10 +92,10 @@ export default class ElectronModule {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let electronKeySpec = item[0]
|
let electronKeySpec = item[0]
|
||||||
electronKeySpec = electronKeySpec.replace('Meta', 'Super')
|
electronKeySpec = electronKeySpec.replaceAll('Meta', 'Super')
|
||||||
electronKeySpec = electronKeySpec.replace('⌘', 'Command')
|
electronKeySpec = electronKeySpec.replaceAll('⌘', 'Command')
|
||||||
electronKeySpec = electronKeySpec.replace('⌥', 'Alt')
|
electronKeySpec = electronKeySpec.replaceAll('⌥', 'Alt')
|
||||||
electronKeySpec = electronKeySpec.replace(/-/g, '+')
|
electronKeySpec = electronKeySpec.replaceAll('-', '+')
|
||||||
specs.push(electronKeySpec)
|
specs.push(electronKeySpec)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Could not register the global hotkey:', err)
|
console.error('Could not register the global hotkey:', err)
|
||||||
|
@ -414,9 +414,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
data = `\x1b[200~${data}\x1b[201~`
|
data = `\x1b[200~${data}\x1b[201~`
|
||||||
}
|
}
|
||||||
if (this.hostApp.platform === Platform.Windows) {
|
if (this.hostApp.platform === Platform.Windows) {
|
||||||
data = data.replace(/\r\n/g, '\r')
|
data = data.replaceAll('\r\n', '\r')
|
||||||
} else {
|
} else {
|
||||||
data = data.replace(/\n/g, '\r')
|
data = data.replaceAll('\n', '\r')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.alternateScreenActive) {
|
if (!this.alternateScreenActive) {
|
||||||
|
@ -77,7 +77,7 @@ export class TerminalStreamProcessor {
|
|||||||
gutter: 4,
|
gutter: 4,
|
||||||
divide: colors.gray(' | '),
|
divide: colors.gray(' | '),
|
||||||
emptyHuman: colors.gray('╳'),
|
emptyHuman: colors.gray('╳'),
|
||||||
}).replace(/\n/g, '\r\n')),
|
}).replaceAll('\n', '\r\n')),
|
||||||
Buffer.from('\r\n\n'),
|
Buffer.from('\r\n\n'),
|
||||||
]))
|
]))
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,7 +23,7 @@ export class PathDropDecorator extends TerminalDecorator {
|
|||||||
if (path.includes(' ')) {
|
if (path.includes(' ')) {
|
||||||
path = `"${path}"`
|
path = `"${path}"`
|
||||||
}
|
}
|
||||||
path = path.replace(/\\/g, '\\\\')
|
path = path.replaceAll('\\', '\\\\')
|
||||||
terminal.sendInput(path + ' ')
|
terminal.sendInput(path + ' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ import { TerminalCLIHandler } from './cli'
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
export default class TerminalModule { // eslint-disable-line @typescript-eslint/no-extraneous-class
|
export default class TerminalModule { // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
private constructor (
|
constructor (
|
||||||
hotkeys: HotkeysService,
|
hotkeys: HotkeysService,
|
||||||
) {
|
) {
|
||||||
const events = [
|
const events = [
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
const path = require('path')
|
|
||||||
const config = require('../webpack.plugin.config')
|
const config = require('../webpack.plugin.config')
|
||||||
module.exports = config({
|
module.exports = config({
|
||||||
name: 'terminal',
|
name: 'terminal',
|
||||||
@ -9,4 +8,3 @@ module.exports = config({
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
module.exports.resolve.modules.push('node_modules/xterm/src')
|
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/*'))
|
|
||||||
|
@ -18,16 +18,30 @@
|
|||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"DOM",
|
||||||
"es5",
|
"ES5",
|
||||||
"es6",
|
"ES6",
|
||||||
"es7",
|
"ES7",
|
||||||
"es2015",
|
"ES2015",
|
||||||
"es2017",
|
"ES2017",
|
||||||
"es2019"
|
"ES2019",
|
||||||
|
"ES2021"
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"*": [
|
||||||
|
"../node_modules/*",
|
||||||
|
"../../app/node_modules/*"
|
||||||
|
],
|
||||||
|
"common*": [
|
||||||
|
"../../tabby-terminal/node_modules/xterm/src/common*"
|
||||||
|
],
|
||||||
"tabby-*": ["../../tabby-*/src"]
|
"tabby-*": ["../../tabby-*/src"]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"typeAcquisition": {
|
||||||
|
"include": [
|
||||||
|
"../node_modules",
|
||||||
|
"../../app/node_modules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,9 +55,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -49,20 +49,10 @@ module.exports = options => {
|
|||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(options.dirname, 'tsconfig.json'),
|
configFile: path.resolve(options.dirname, 'tsconfig.json'),
|
||||||
typeRoots: [
|
allowTsInNodeModules: true,
|
||||||
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/*'),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user