Przeglądaj źródła

es2021 compilation

Eugene Pankov 4 lat temu
rodzic
commit
89f369abe6

+ 2 - 3
app/lib/window.ts

@@ -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

+ 2 - 2
app/webpack.config.js

@@ -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'),
                     },
                 },
             },

+ 2 - 2
app/webpack.main.config.js

@@ -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'),
                     },
                 },
             },

+ 2 - 2
package.json

@@ -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",

+ 1 - 1
tabby-core/src/utils.ts

@@ -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)
     }

+ 4 - 4
tabby-electron/src/index.ts

@@ -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)

+ 2 - 2
tabby-terminal/src/api/baseTerminalTab.component.ts

@@ -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) {

+ 1 - 1
tabby-terminal/src/api/streamProcessing.ts

@@ -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 {

+ 1 - 1
tabby-terminal/src/features/pathDrop.ts

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

+ 1 - 1
tabby-terminal/src/index.ts

@@ -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 = [

+ 0 - 2
tabby-terminal/webpack.config.js

@@ -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/*'))

+ 21 - 7
tsconfig.json

@@ -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"
+    ]
   }
 }

+ 2 - 2
web/webpack.config.js

@@ -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'),
                     },
                 },
             },

+ 3 - 13
webpack.plugin.config.js

@@ -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,
                         },
                     },
                 },

Plik diff jest za duży
+ 23 - 561
yarn.lock


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików