mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 13:30:02 +00:00
make serialport native bindings work
This commit is contained in:
parent
041a3ce2b6
commit
f151928b6b
@ -40,6 +40,7 @@
|
|||||||
"zone.js": "^0.8.29"
|
"zone.js": "^0.8.29"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
|
"serialport": "^8.0.7",
|
||||||
"macos-native-processlist": "^1.0.2",
|
"macos-native-processlist": "^1.0.2",
|
||||||
"windows-blurbehind": "^1.0.1",
|
"windows-blurbehind": "^1.0.1",
|
||||||
"windows-native-registry": "^1.0.17",
|
"windows-native-registry": "^1.0.17",
|
||||||
|
@ -21,6 +21,7 @@ exports.builtinPlugins = [
|
|||||||
'terminus-community-color-schemes',
|
'terminus-community-color-schemes',
|
||||||
'terminus-plugin-manager',
|
'terminus-plugin-manager',
|
||||||
'terminus-ssh',
|
'terminus-ssh',
|
||||||
|
'terminus-serial',
|
||||||
]
|
]
|
||||||
exports.bundledModules = [
|
exports.bundledModules = [
|
||||||
'@angular',
|
'@angular',
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"ansi-colors": "^4.1.1",
|
"ansi-colors": "^4.1.1",
|
||||||
"cli-spinner": "^0.2.10",
|
"cli-spinner": "^0.2.10",
|
||||||
"electron-rebuild": "^1.10.0",
|
"electron-rebuild": "^1.10.0",
|
||||||
"serialport": "^8.0.0",
|
"serialport": "^8.0.7",
|
||||||
"terminus-terminal": "^1.0.98-nightly.0"
|
"terminus-terminal": "^1.0.98-nightly.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { BaseSession } from 'terminus-terminal'
|
import { BaseSession } from 'terminus-terminal'
|
||||||
import { SerialPort } from 'serialport'
|
import { SerialPort } from '@serialport/stream'
|
||||||
import { Logger } from 'terminus-core'
|
import { Logger } from 'terminus-core'
|
||||||
import { Subject, Observable } from 'rxjs'
|
import { Subject, Observable } from 'rxjs'
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ export class SerialSession extends BaseSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kill (signal?: string) {
|
kill (signal?: string) {
|
||||||
console.log('valar morghulis')
|
this.serial.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChildProcesses (): Promise<any[]> {
|
async getChildProcesses (): Promise<any[]> {
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
import { Injectable, NgZone } from '@angular/core'
|
import { Injectable, NgZone } from '@angular/core'
|
||||||
import SerialPort from 'serialport'
|
import SerialPort from '@serialport/stream'
|
||||||
import { ToastrService } from 'ngx-toastr'
|
import { ToastrService } from 'ngx-toastr'
|
||||||
import { AppService, LogService } from 'terminus-core'
|
import { AppService, LogService } from 'terminus-core'
|
||||||
import { SerialConnection, SerialSession } from '../api'
|
import { SerialConnection, SerialSession } from '../api'
|
||||||
import { SerialTabComponent } from '../components/serialTab.component'
|
import { SerialTabComponent } from '../components/serialTab.component'
|
||||||
|
|
||||||
|
try {
|
||||||
|
var bindingsNative = require('serialport/bindings/build/Release/bindings.node') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
|
||||||
|
SerialPort.binding = bindingsNative
|
||||||
|
} catch { }
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SerialService {
|
export class SerialService {
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ module.exports = {
|
|||||||
'fs',
|
'fs',
|
||||||
'keytar',
|
'keytar',
|
||||||
'path',
|
'path',
|
||||||
'serialport',
|
|
||||||
'ngx-toastr',
|
'ngx-toastr',
|
||||||
|
'serialport/bindings/build/Release/bindings.node',
|
||||||
'windows-process-tree/build/Release/windows_process_tree.node',
|
'windows-process-tree/build/Release/windows_process_tree.node',
|
||||||
/^rxjs/,
|
/^rxjs/,
|
||||||
/^@angular/,
|
/^@angular/,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user