bumped angular & webpack

This commit is contained in:
Eugene Pankov
2018-05-20 16:12:05 +02:00
parent 7cb6642f1e
commit 7bfc13dae5
31 changed files with 3246 additions and 1308 deletions

View File

@@ -12,14 +12,14 @@
"watch": "webpack --progress --color --watch" "watch": "webpack --progress --color --watch"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "4.3.0", "@angular/animations": "6.0.2",
"@angular/common": "4.3.0", "@angular/common": "6.0.2",
"@angular/compiler": "4.3.0", "@angular/compiler": "6.0.2",
"@angular/core": "4.3.0", "@angular/core": "6.0.2",
"@angular/forms": "4.3.0", "@angular/forms": "6.0.2",
"@angular/platform-browser": "4.3.0", "@angular/platform-browser": "6.0.2",
"@angular/platform-browser-dynamic": "4.3.0", "@angular/platform-browser-dynamic": "6.0.2",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.2", "@ng-bootstrap/ng-bootstrap": "^2.0.0",
"devtron": "1.4.0", "devtron": "1.4.0",
"electron-config": "0.2.1", "electron-config": "0.2.1",
"electron-debug": "^1.0.1", "electron-debug": "^1.0.1",
@@ -27,10 +27,10 @@
"electron-squirrel-startup": "^1.0.0", "electron-squirrel-startup": "^1.0.0",
"js-yaml": "3.8.2", "js-yaml": "3.8.2",
"mz": "^2.6.0", "mz": "^2.6.0",
"ngx-toastr": "^8.0.0", "ngx-toastr": "^8.7.3",
"path": "0.12.7", "path": "0.12.7",
"rxjs": "5.3.0", "rxjs": "^6.1.0",
"zone.js": "0.8.12" "zone.js": "~0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@types/mz": "0.0.31" "@types/mz": "0.0.31"

View File

@@ -62,3 +62,7 @@
.modal-dialog { .modal-dialog {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
[ngbradiogroup] input[type="radio"] {
display: none;
}

View File

@@ -21,28 +21,34 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
options: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), options: {
configFileName: path.resolve(__dirname, 'tsconfig.json'),
}
} }
}, },
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] }, { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] }, { test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ {
test: /\.(png|svg)$/, test: /\.(png|svg)$/,
loader: "file-loader", use: {
options: { loader: 'file-loader',
name: 'images/[name].[ext]' options: {
name: 'images/[name].[ext]'
}
} }
}, },
{ {
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/, test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader", use: {
options: { loader: 'file-loader',
name: 'fonts/[name].[ext]' options: {
name: 'fonts/[name].[ext]'
}
} }
} }
] ]

View File

@@ -2,51 +2,51 @@
# yarn lockfile v1 # yarn lockfile v1
"@angular/animations@4.3.0": "@angular/animations@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-4.3.0.tgz#56f34b84649379202ac359929b82eb0b915e9c72" resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.2.tgz#92063f612c3b33d962eddc9ad538cadd231fbe47"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/common@4.3.0": "@angular/common@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-4.3.0.tgz#13a54a6929dd52f9729b16ae446fad58fe163053" resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.2.tgz#e4cbb7d45d8d2f35e918d62f0cbfd8c87e9168f7"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/compiler@4.3.0": "@angular/compiler@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-4.3.0.tgz#55503bf27a1f062f71b9495393f3311903a8fc43" resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.2.tgz#b9d29b7e032c767179967540f1ed7f8777a615a1"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/core@4.3.0": "@angular/core@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-4.3.0.tgz#bd2249c3de1224a7c6536c4aba728d6565329334" resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.2.tgz#d183730d73182a4590a5d71083db45655f210e69"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/forms@4.3.0": "@angular/forms@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-4.3.0.tgz#7d0c7a854737e9a30a5fd9665f8d4f56a1b91bd8" resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-6.0.2.tgz#a0647930e8b6e7fbd48f55eb69b399a41bcd091a"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/platform-browser-dynamic@4.3.0": "@angular/platform-browser-dynamic@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-4.3.0.tgz#551fb18851b27ee8f3e4b0ee25aad10bd7b312e3" resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.2.tgz#755689df9f02bbcb270c7872a75a2ffe7e0b0c33"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@angular/platform-browser@4.3.0": "@angular/platform-browser@6.0.2":
version "4.3.0" version "6.0.2"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-4.3.0.tgz#02389489185185c3becf06359346100e5479c7e1" resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.2.tgz#19f56f6efbd0e7af5f35fe2f8cde3557dc8ba689"
dependencies: dependencies:
tslib "^1.7.1" tslib "^1.9.0"
"@ng-bootstrap/ng-bootstrap@^1.0.0-beta.2": "@ng-bootstrap/ng-bootstrap@^2.0.0":
version "1.0.0-beta.2" version "2.0.0"
resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-1.0.0-beta.2.tgz#3d4b567b0334a9ee631b73c72156cd3a9d3cd29f" resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-2.0.0.tgz#65f78c7dd5a8ac424f44bb2050a9eab247cdeb0c"
"@types/mz@0.0.31": "@types/mz@0.0.31":
version "0.0.31" version "0.0.31"
@@ -195,9 +195,11 @@ mz@^2.6.0:
object-assign "^4.0.1" object-assign "^4.0.1"
thenify-all "^1.0.0" thenify-all "^1.0.0"
ngx-toastr@^8.0.0: ngx-toastr@^8.7.3:
version "8.0.0" version "8.7.3"
resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-8.0.0.tgz#f3bc53146b2f7da3eabf3daa1b1bbdf65cb49697" resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-8.7.3.tgz#d3b7a8077ba1c860dd8a44779ccad38c5ea15c92"
dependencies:
tslib "^1.9.0"
object-assign@^4.0.1: object-assign@^4.0.1:
version "4.1.1" version "4.1.1"
@@ -236,20 +238,16 @@ process@^0.11.1:
version "0.11.10" version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
rxjs@5.3.0: rxjs@^6.1.0:
version "5.3.0" version "6.1.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.1.0.tgz#833447de4e4f6427b9cec3e5eb9f56415cd28315"
dependencies: dependencies:
symbol-observable "^1.0.1" tslib "^1.9.0"
sprintf-js@~1.0.2: sprintf-js@~1.0.2:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
symbol-observable@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
thenify-all@^1.0.0: thenify-all@^1.0.0:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
@@ -262,9 +260,9 @@ thenify-all@^1.0.0:
dependencies: dependencies:
any-promise "^1.0.0" any-promise "^1.0.0"
tslib@^1.7.1: tslib@^1.9.0:
version "1.7.1" version "1.9.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7"
util@^0.10.3: util@^0.10.3:
version "0.10.3" version "0.10.3"
@@ -272,6 +270,6 @@ util@^0.10.3:
dependencies: dependencies:
inherits "2.0.1" inherits "2.0.1"
zone.js@0.8.12: zone.js@~0.8.26:
version "0.8.12" version "0.8.26"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.12.tgz#86ff5053c98aec291a0bf4bbac501d694a05cfbb" resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.26.tgz#7bdd72f7668c5a7ad6b118148b4ea39c59d08d2d"

View File

@@ -5,7 +5,7 @@
"@types/node": "7.0.5", "@types/node": "7.0.5",
"@types/webpack-env": "1.13.0", "@types/webpack-env": "1.13.0",
"apply-loader": "0.1.0", "apply-loader": "0.1.0",
"awesome-typescript-loader": "3.1.2", "awesome-typescript-loader": "^5.0.0",
"core-js": "2.4.1", "core-js": "2.4.1",
"cross-env": "4.0.0", "cross-env": "4.0.0",
"css-loader": "0.28.0", "css-loader": "0.28.0",
@@ -13,7 +13,7 @@
"electron-builder": "17.1.1", "electron-builder": "17.1.1",
"electron-builder-squirrel-windows": "17.0.1", "electron-builder-squirrel-windows": "17.0.1",
"electron-rebuild": "1.5.11", "electron-rebuild": "1.5.11",
"file-loader": "0.9.0", "file-loader": "^1.1.11",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"graceful-fs": "^4.1.11", "graceful-fs": "^4.1.11",
"html-loader": "0.4.4", "html-loader": "0.4.4",
@@ -25,13 +25,13 @@
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"npmlog": "4.1.0", "npmlog": "4.1.0",
"npx": "^9.7.1", "npx": "^9.7.1",
"pug": "2.0.0-beta11", "pug": "^2.0.3",
"pug-html-loader": "1.0.9", "pug-html-loader": "1.0.9",
"pug-loader": "2.3.0", "pug-loader": "^2.4.0",
"pug-static-loader": "0.0.1", "pug-static-loader": "0.0.1",
"raven-js": "3.16.0", "raven-js": "3.16.0",
"raw-loader": "0.5.1", "raw-loader": "0.5.1",
"sass-loader": "6.0.3", "sass-loader": "^7.0.1",
"shelljs": "0.7.7", "shelljs": "0.7.7",
"source-sans-pro": "2.0.10", "source-sans-pro": "2.0.10",
"style-loader": "0.13.1", "style-loader": "0.13.1",
@@ -39,10 +39,11 @@
"tslint": "5.1.0", "tslint": "5.1.0",
"tslint-config-standard": "5.0.2", "tslint-config-standard": "5.0.2",
"tslint-eslint-rules": "4.0.0", "tslint-eslint-rules": "4.0.0",
"typescript": "2.2.2", "typescript": "^2.8.3",
"url-loader": "0.5.7", "url-loader": "0.5.7",
"val-loader": "0.5.0", "val-loader": "0.5.0",
"webpack": "^3.0.0", "webpack": "^4.8.3",
"webpack-cli": "^2.1.3",
"yaml-loader": "0.4.0", "yaml-loader": "0.4.0",
"yarn": "^1.3.2" "yarn": "^1.3.2"
}, },

View File

@@ -18,20 +18,22 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
options: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), options: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
} }
} }
}, },
{ test: /[\\\/]schemes[\\\/]/, loader: "raw-loader" }, { test: /[\\\/]schemes[\\\/]/, use: "raw-loader" },
] ]
}, },
externals: [ externals: [

View File

@@ -25,8 +25,7 @@
"bootstrap": "4.0.0-alpha.6", "bootstrap": "4.0.0-alpha.6",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"electron-updater": "^2.8.9", "electron-updater": "^2.8.9",
"ngx-perfect-scrollbar": "4.0.0", "ngx-perfect-scrollbar": "^6.0.0"
"typescript": "^2.4.1"
}, },
"peerDependencies": { "peerDependencies": {
"@angular/animations": "4.0.1", "@angular/animations": "4.0.1",

View File

@@ -7,7 +7,7 @@ import { BaseTabComponent } from '../components/baseTab.component'
<perfect-scrollbar [config]="{ suppressScrollX: true }" *ngIf="scrollable"> <perfect-scrollbar [config]="{ suppressScrollX: true }" *ngIf="scrollable">
<ng-template #scrollablePlaceholder></ng-template> <ng-template #scrollablePlaceholder></ng-template>
</perfect-scrollbar> </perfect-scrollbar>
<template #nonScrollablePlaceholder [ngIf]="!scrollable"></template> <ng-template #nonScrollablePlaceholder *ngIf="!scrollable"></ng-template>
`, `,
styles: [ styles: [
require('./tabBody.component.scss'), require('./tabBody.component.scss'),

View File

@@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { FormsModule } from '@angular/forms' import { FormsModule } from '@angular/forms'
import { NgbModule } from '@ng-bootstrap/ng-bootstrap' import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar' import { PerfectScrollbarModule, PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar'
import { AppService } from './services/app.service' import { AppService } from './services/app.service'
import { ConfigService } from './services/config.service' import { ConfigService } from './services/config.service'
@@ -34,7 +34,7 @@ import { Theme } from './api/theme'
import { StandardTheme, StandardCompactTheme } from './theme' import { StandardTheme, StandardCompactTheme } from './theme'
import { CoreConfigProvider } from './config' import { CoreConfigProvider } from './config'
import 'perfect-scrollbar/dist/css/perfect-scrollbar.css' import 'perfect-scrollbar/css/perfect-scrollbar.css'
const PROVIDERS = [ const PROVIDERS = [
AppService, AppService,
@@ -52,6 +52,7 @@ const PROVIDERS = [
{ provide: Theme, useClass: StandardTheme, multi: true }, { provide: Theme, useClass: StandardTheme, multi: true },
{ provide: Theme, useClass: StandardCompactTheme, multi: true }, { provide: Theme, useClass: StandardCompactTheme, multi: true },
{ provide: ConfigProvider, useClass: CoreConfigProvider, multi: true }, { provide: ConfigProvider, useClass: CoreConfigProvider, multi: true },
{ provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true }}
] ]
@NgModule({ @NgModule({
@@ -60,9 +61,7 @@ const PROVIDERS = [
BrowserAnimationsModule, BrowserAnimationsModule,
FormsModule, FormsModule,
NgbModule.forRoot(), NgbModule.forRoot(),
PerfectScrollbarModule.forRoot({ PerfectScrollbarModule,
suppressScrollX: true,
}),
], ],
declarations: [ declarations: [
AppRootComponent, AppRootComponent,
@@ -92,5 +91,11 @@ export default class AppModule {
} }
} }
// PerfectScrollbar fix
import { fromEvent } from 'rxjs/internal/observable/fromEvent'
import { merge } from 'rxjs/internal/observable/merge'
require('rxjs').fromEvent = fromEvent
require('rxjs').merge = merge
export { AppRootComponent as bootstrap } export { AppRootComponent as bootstrap }
export * from './api' export * from './api'

View File

@@ -6,7 +6,6 @@ import { Injectable, Inject } from '@angular/core'
import { ConfigProvider } from '../api/configProvider' import { ConfigProvider } from '../api/configProvider'
import { ElectronService } from './electron.service' import { ElectronService } from './electron.service'
import { HostAppService } from './hostApp.service' import { HostAppService } from './hostApp.service'
import * as Reflect from 'core-js/es7/reflect'
const configMerge = (a, b) => require('deepmerge')(a, b, { arrayMerge: (_d, s) => s }) const configMerge = (a, b) => require('deepmerge')(a, b, { arrayMerge: (_d, s) => s })
@@ -104,12 +103,11 @@ export class ConfigService {
enabledServices<T> (services: T[]): T[] { enabledServices<T> (services: T[]): T[] {
if (!this.servicesCache) { if (!this.servicesCache) {
this.servicesCache = {} this.servicesCache = {}
let ngModule = Reflect.getMetadata('annotations', window['rootModule'])[0] let ngModule = window['rootModule'].ngInjectorDef
for (let imp of ngModule.imports) { for (let imp of ngModule.imports) {
let module = imp['module'] || imp let module = (imp['ngModule'] || imp)
let annotations = Reflect.getMetadata('annotations', module) if (module.ngInjectorDef && module.ngInjectorDef.providers) {
if (annotations) { this.servicesCache[module['pluginName']] = module.ngInjectorDef.providers.map(provider => {
this.servicesCache[module['pluginName']] = annotations[0].providers.map(provider => {
return provider['useClass'] || provider return provider['useClass'] || provider
}) })
} }

View File

@@ -6,6 +6,7 @@ module.exports = {
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname, context: __dirname,
mode: 'development',
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'index.js', filename: 'index.js',
@@ -18,16 +19,18 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
options: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), options: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
} }
} }
}, },

View File

@@ -185,15 +185,20 @@ ms@2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
ngx-perfect-scrollbar@4.0.0: ngx-perfect-scrollbar@^6.0.0:
version "4.0.0" version "6.0.0"
resolved "https://registry.yarnpkg.com/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-4.0.0.tgz#f1e19449fa97d7f16e1ceb1fe1739e4bb646bebe" resolved "https://registry.yarnpkg.com/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-6.0.0.tgz#92b51957c04ed6a6d416beca2707bab005667b68"
dependencies: dependencies:
perfect-scrollbar "~0.6.0" perfect-scrollbar "^1.3.0"
resize-observer-polyfill "^1.4.0"
perfect-scrollbar@~0.6.0: perfect-scrollbar@^1.3.0:
version "0.6.16" version "1.3.0"
resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-0.6.16.tgz#b1d61a5245cf3962bb9a8407a3fc669d923212fc" resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.3.0.tgz#61da56f94b58870d8e0a617bce649cee17d1e3b2"
resize-observer-polyfill@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69"
sax@^1.2.1: sax@^1.2.1:
version "1.2.4" version "1.2.4"

View File

@@ -1,4 +1,5 @@
import { BehaviorSubject, Observable } from 'rxjs' import { BehaviorSubject, Observable } from 'rxjs'
import { debounceTime, distinctUntilChanged, first, tap, flatMap } from 'rxjs/operators'
import * as semver from 'semver' import * as semver from 'semver'
import { Component, Input } from '@angular/core' import { Component, Input } from '@angular/core'
@@ -33,15 +34,18 @@ export class PluginsSettingsTabComponent {
ngOnInit () { ngOnInit () {
this.availablePlugins$ = this.availablePluginsQuery$ this.availablePlugins$ = this.availablePluginsQuery$
.debounceTime(200) .asObservable()
.distinctUntilChanged() .pipe(
.flatMap(query => { debounceTime(200),
this.availablePluginsReady = false distinctUntilChanged(),
return this.pluginManager.listAvailable(query).do(() => { flatMap(query => {
this.availablePluginsReady = true this.availablePluginsReady = false
return this.pluginManager.listAvailable(query).pipe(tap(() => {
this.availablePluginsReady = true
}))
}) })
}) )
this.availablePlugins$.first().subscribe(available => { this.availablePlugins$.pipe(first()).subscribe(available => {
for (let plugin of this.pluginManager.installedPlugins) { for (let plugin of this.pluginManager.installedPlugins) {
this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semver.gt(x.version, plugin.version)) this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semver.gt(x.version, plugin.version))
} }

View File

@@ -2,7 +2,8 @@ import * as path from 'path'
import * as fs from 'mz/fs' import * as fs from 'mz/fs'
import { exec } from 'mz/child_process' import { exec } from 'mz/child_process'
import axios from 'axios' import axios from 'axios'
import { Observable } from 'rxjs' import { Observable, from } from 'rxjs'
import { map } from 'rxjs/operators'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { Logger, LogService, ConfigService, HostAppService, Platform } from 'terminus-core' import { Logger, LogService, ConfigService, HostAppService, Platform } from 'terminus-core'
@@ -70,15 +71,14 @@ export class PluginManagerService {
} }
listAvailable (query?: string): Observable<IPluginInfo[]> { listAvailable (query?: string): Observable<IPluginInfo[]> {
return Observable return from(
.fromPromise( axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, {
axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, { headers: {
headers: { 'x-spiferack': '1',
'x-spiferack': '1', }
} })
}) ).pipe(
) map(response => response.data.objects.map(item => ({
.map(response => response.data.objects.map(item => ({
name: item.package.name.substring(NAME_PREFIX.length), name: item.package.name.substring(NAME_PREFIX.length),
packageName: item.package.name, packageName: item.package.name,
description: item.package.description, description: item.package.description,
@@ -86,8 +86,9 @@ export class PluginManagerService {
homepage: item.package.links.homepage, homepage: item.package.links.homepage,
author: (item.package.author || {}).name, author: (item.package.author || {}).name,
isOfficial: item.package.publisher.username === OFFICIAL_NPM_ACCOUNT, isOfficial: item.package.publisher.username === OFFICIAL_NPM_ACCOUNT,
}))) }))),
.map(plugins => plugins.filter(x => x.packageName.startsWith(NAME_PREFIX))) map(plugins => plugins.filter(x => x.packageName.startsWith(NAME_PREFIX))),
)
} }
async installPlugin (plugin: IPluginInfo) { async installPlugin (plugin: IPluginInfo) {

View File

@@ -18,16 +18,18 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
query: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), query: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
} }
} }
}, },

View File

@@ -1,4 +1,5 @@
import { Component, Input, trigger, transition, style, animate } from '@angular/core' import { Component, Input } from '@angular/core'
import { trigger, transition, style, animate } from '@angular/animations'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { Subscription } from 'rxjs' import { Subscription } from 'rxjs'
import { HotkeysService } from 'terminus-core' import { HotkeysService } from 'terminus-core'

View File

@@ -14,8 +14,8 @@ import { SettingsTabProvider } from '../api'
export class SettingsTabComponent extends BaseTabComponent { export class SettingsTabComponent extends BaseTabComponent {
@Input() activeTab: string @Input() activeTab: string
hotkeyFilter = '' hotkeyFilter = ''
private hotkeyDescriptions: IHotkeyDescription[] hotkeyDescriptions: IHotkeyDescription[]
private screens screens: any[]
constructor ( constructor (
public config: ConfigService, public config: ConfigService,

View File

@@ -8,7 +8,7 @@ import { SettingsTabProvider } from '../api'
export class SettingsTabBodyComponent { export class SettingsTabBodyComponent {
@Input() provider: SettingsTabProvider @Input() provider: SettingsTabProvider
@ViewChild('placeholder', {read: ViewContainerRef}) placeholder: ViewContainerRef @ViewChild('placeholder', {read: ViewContainerRef}) placeholder: ViewContainerRef
private component: ComponentRef<Component> component: ComponentRef<Component>
constructor (private componentFactoryResolver: ComponentFactoryResolver) { } constructor (private componentFactoryResolver: ComponentFactoryResolver) { }

View File

@@ -18,16 +18,18 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
options: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), options: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
} }
} }
}, },

View File

@@ -19,12 +19,8 @@
"devDependencies": { "devDependencies": {
"@types/ssh2": "^0.5.35", "@types/ssh2": "^0.5.35",
"@types/webpack-env": "^1.13.0", "@types/webpack-env": "^1.13.0",
"apply-loader": "^2.0.0",
"awesome-typescript-loader": "^3.1.2",
"electron": "^1.6.11", "electron": "^1.6.11",
"ngx-toastr": "^8.0.0", "ngx-toastr": "^8.0.0",
"pug": "^2.0.0-rc.3",
"pug-loader": "^2.3.0",
"rxjs": "^5.4.0", "rxjs": "^5.4.0",
"typescript": "^2.2.2", "typescript": "^2.2.2",
"webpack": "^2.3.3" "webpack": "^2.3.3"

View File

@@ -17,16 +17,18 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
query: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), options: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
} }
} }
}, },

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,21 @@
import * as fs from 'mz/fs' import * as fs from 'mz/fs'
import * as path from 'path' import * as path from 'path'
import { first } from 'rxjs/operators'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, HostAppService, ElectronService, Logger, LogService } from 'terminus-core' import { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, HostAppService, ElectronService } from 'terminus-core'
import { TerminalService } from './services/terminal.service' import { TerminalService } from './services/terminal.service'
@Injectable() @Injectable()
export class ButtonProvider extends ToolbarButtonProvider { export class ButtonProvider extends ToolbarButtonProvider {
private logger: Logger
constructor ( constructor (
private terminal: TerminalService, private terminal: TerminalService,
private config: ConfigService, private config: ConfigService,
log: LogService,
hostApp: HostAppService, hostApp: HostAppService,
electron: ElectronService, electron: ElectronService,
hotkeys: HotkeysService, hotkeys: HotkeysService,
) { ) {
super() super()
this.logger = log.create('newTerminalButton')
hotkeys.matchedHotkey.subscribe(async (hotkey) => { hotkeys.matchedHotkey.subscribe(async (hotkey) => {
if (hotkey === 'new-tab') { if (hotkey === 'new-tab') {
this.openNewTab() this.openNewTab()
@@ -47,7 +44,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
} }
async openNewTab (cwd?: string): Promise<void> { async openNewTab (cwd?: string): Promise<void> {
let shells = await this.terminal.shells$.first().toPromise() let shells = await this.terminal.shells$.pipe(first()).toPromise()
let shell = shells.find(x => x.id === this.config.store.terminal.shell) let shell = shells.find(x => x.id === this.config.store.terminal.shell)
this.terminal.openTab(shell, cwd) this.terminal.openTab(shell, cwd)
} }

View File

@@ -1,4 +1,5 @@
import { Observable } from 'rxjs' import { Observable } from 'rxjs'
import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators'
import { exec } from 'mz/child_process' import { exec } from 'mz/child_process'
const equal = require('deep-equal') const equal = require('deep-equal')
const fontManager = require('font-manager') const fontManager = require('font-manager')
@@ -51,11 +52,12 @@ export class TerminalSettingsTabComponent {
} }
fontAutocomplete = (text$: Observable<string>) => { fontAutocomplete = (text$: Observable<string>) => {
return text$ return text$.pipe(
.debounceTime(200) debounceTime(200),
.distinctUntilChanged() distinctUntilChanged(),
.map(query => this.fonts.filter(v => new RegExp(query, 'gi').test(v))) map(query => this.fonts.filter(v => new RegExp(query, 'gi').test(v))),
.map(list => Array.from(new Set(list))) map(list => Array.from(new Set(list))),
)
} }
editScheme (scheme: ITerminalColorScheme) { editScheme (scheme: ITerminalColorScheme) {

View File

@@ -1,4 +1,5 @@
import { BehaviorSubject, Subject, Subscription } from 'rxjs' import { Observable, BehaviorSubject, Subject, Subscription } from 'rxjs'
import { first } from 'rxjs/operators'
import { ToastrService } from 'ngx-toastr' import { ToastrService } from 'ngx-toastr'
import { Component, NgZone, Inject, Optional, ViewChild, HostBinding, Input } from '@angular/core' import { Component, NgZone, Inject, Optional, ViewChild, HostBinding, Input } from '@angular/core'
import { AppService, ConfigService, BaseTabComponent, ElectronService, ThemesService, HostAppService, HotkeysService, Platform } from 'terminus-core' import { AppService, ConfigService, BaseTabComponent, ElectronService, ThemesService, HostAppService, HotkeysService, Platform } from 'terminus-core'
@@ -32,7 +33,8 @@ export class TerminalTabComponent extends BaseTabComponent {
hotkeysSubscription: Subscription hotkeysSubscription: Subscription
bell$ = new Subject() bell$ = new Subject()
size: ResizeEvent size: ResizeEvent
resize$ = new Subject<ResizeEvent>() resize$: Observable<ResizeEvent>
private resize_ = new Subject<ResizeEvent>()
input$ = new Subject<string>() input$ = new Subject<string>()
output$ = new Subject<string>() output$ = new Subject<string>()
contentUpdated$ = new Subject<void>() contentUpdated$ = new Subject<void>()
@@ -58,9 +60,10 @@ export class TerminalTabComponent extends BaseTabComponent {
@Optional() @Inject(TerminalDecorator) private decorators: TerminalDecorator[], @Optional() @Inject(TerminalDecorator) private decorators: TerminalDecorator[],
) { ) {
super() super()
this.resize$ = this.resize_.asObservable()
this.decorators = this.decorators || [] this.decorators = this.decorators || []
this.setTitle('Terminal') this.setTitle('Terminal')
this.resize$.first().subscribe(async (resizeEvent) => { this.resize$.pipe(first()).subscribe(async resizeEvent => {
if (!this.session) { if (!this.session) {
this.session = this.sessions.addSession( this.session = this.sessions.addSession(
Object.assign({}, this.sessionOptions, resizeEvent) Object.assign({}, this.sessionOptions, resizeEvent)
@@ -330,7 +333,7 @@ export class TerminalTabComponent extends BaseTabComponent {
if (this.session) { if (this.session) {
this.session.resize(columns, rows) this.session.resize(columns, rows)
} }
this.resize$.next(this.size) this.resize_.next(this.size)
}) })
} }
} }
@@ -452,7 +455,7 @@ export class TerminalTabComponent extends BaseTabComponent {
if (this.sessionCloseSubscription) { if (this.sessionCloseSubscription) {
this.sessionCloseSubscription.unsubscribe() this.sessionCloseSubscription.unsubscribe()
} }
this.resize$.complete() this.resize_.complete()
this.input$.complete() this.input$.complete()
this.output$.complete() this.output$.complete()
this.contentUpdated$.complete() this.contentUpdated$.complete()

View File

@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'
import { execFileSync } from 'child_process' import { execFileSync } from 'child_process'
import * as AsyncLock from 'async-lock' import * as AsyncLock from 'async-lock'
import { ConnectableObservable, AsyncSubject, Subject } from 'rxjs' import { ConnectableObservable, AsyncSubject, Subject } from 'rxjs'
import { first, publish } from 'rxjs/operators'
import * as childProcess from 'child_process' import * as childProcess from 'child_process'
import { Logger } from 'terminus-core' import { Logger } from 'terminus-core'
@@ -102,7 +103,7 @@ export class TMuxCommandProcess {
} }
}) })
this.response$ = this.block$.publish() this.response$ = this.block$.asObservable().pipe(publish()) as ConnectableObservable<TMuxBlock>
this.response$.connect() this.response$.connect()
this.block$.subscribe(block => { this.block$.subscribe(block => {
@@ -116,7 +117,7 @@ export class TMuxCommandProcess {
command (command: string): Promise<TMuxBlock> { command (command: string): Promise<TMuxBlock> {
return this.lock.acquire('key', () => { return this.lock.acquire('key', () => {
let p = this.response$.take(1).toPromise() let p = this.response$.pipe(first()).toPromise()
this.logger.debug('command:', command) this.logger.debug('command:', command)
this.process.stdin.write(command + '\n') this.process.stdin.write(command + '\n')
return p return p

View File

@@ -1,7 +1,8 @@
const psNode = require('ps-node') const psNode = require('ps-node')
let nodePTY let nodePTY
import * as fs from 'mz/fs' import * as fs from 'mz/fs'
import { Subject } from 'rxjs' import { Observable, Subject } from 'rxjs'
import { first } from 'rxjs/operators'
import { Injectable, Inject } from '@angular/core' import { Injectable, Inject } from '@angular/core'
import { Logger, LogService, ElectronService, ConfigService } from 'terminus-core' import { Logger, LogService, ElectronService, ConfigService } from 'terminus-core'
import { exec } from 'mz/child_process' import { exec } from 'mz/child_process'
@@ -17,25 +18,34 @@ export interface IChildProcess {
export abstract class BaseSession { export abstract class BaseSession {
open: boolean open: boolean
name: string name: string
output$ = new Subject<string>()
closed$ = new Subject<void>()
destroyed$ = new Subject<void>()
recoveryId: string recoveryId: string
truePID: number truePID: number
output$: Observable<string>
closed$: Observable<void>
destroyed$: Observable<void>
protected output_ = new Subject<string>()
protected closed_ = new Subject<void>()
protected destroyed_ = new Subject<void>()
private initialDataBuffer = '' private initialDataBuffer = ''
private initialDataBufferReleased = false private initialDataBufferReleased = false
constructor () {
this.output$ = this.output_.asObservable()
this.closed$ = this.closed_.asObservable()
this.destroyed$ = this.destroyed_.asObservable()
}
emitOutput (data: string) { emitOutput (data: string) {
if (!this.initialDataBufferReleased) { if (!this.initialDataBufferReleased) {
this.initialDataBuffer += data this.initialDataBuffer += data
} else { } else {
this.output$.next(data) this.output_.next(data)
} }
} }
releaseInitialDataBuffer () { releaseInitialDataBuffer () {
this.initialDataBufferReleased = true this.initialDataBufferReleased = true
this.output$.next(this.initialDataBuffer) this.output_.next(this.initialDataBuffer)
this.initialDataBuffer = null this.initialDataBuffer = null
} }
@@ -49,9 +59,9 @@ export abstract class BaseSession {
async destroy (): Promise<void> { async destroy (): Promise<void> {
if (this.open) { if (this.open) {
this.open = false this.open = false
this.closed$.next() this.closed_.next()
this.destroyed$.next() this.destroyed_.next()
this.output$.complete() this.output_.complete()
await this.gracefullyKillProcess() await this.gracefullyKillProcess()
} }
} }
@@ -220,7 +230,7 @@ export class SessionsService {
options.name = `session-${this.lastID}` options.name = `session-${this.lastID}`
let session = new Session(options) let session = new Session(options)
let persistence = this.getPersistence() let persistence = this.getPersistence()
session.destroyed$.first().subscribe(() => { session.destroyed$.pipe(first()).subscribe(() => {
delete this.sessions[session.name] delete this.sessions[session.name]
if (persistence) { if (persistence) {
persistence.terminateSession(session.recoveryId) persistence.terminateSession(session.recoveryId)

View File

@@ -1,4 +1,4 @@
import { AsyncSubject } from 'rxjs' import { Observable, AsyncSubject } from 'rxjs'
import { Injectable, Inject } from '@angular/core' import { Injectable, Inject } from '@angular/core'
import { AppService, Logger, LogService, ConfigService } from 'terminus-core' import { AppService, Logger, LogService, ConfigService } from 'terminus-core'
import { IShell, ShellProvider } from '../api' import { IShell, ShellProvider } from '../api'
@@ -7,7 +7,8 @@ import { TerminalTabComponent } from '../components/terminalTab.component'
@Injectable() @Injectable()
export class TerminalService { export class TerminalService {
shells$ = new AsyncSubject<IShell[]>() shells$: Observable<IShell[]>
private shells_ = new AsyncSubject<IShell[]>()
private logger: Logger private logger: Logger
constructor ( constructor (
@@ -26,10 +27,11 @@ export class TerminalService {
} }
async reloadShells () { async reloadShells () {
this.shells$ = new AsyncSubject<IShell[]>() this.shells_ = new AsyncSubject<IShell[]>()
this.shells$ = this.shells_.asObservable()
let shellLists = await Promise.all(this.config.enabledServices(this.shellProviders).map(x => x.provide())) let shellLists = await Promise.all(this.config.enabledServices(this.shellProviders).map(x => x.provide()))
this.shells$.next(shellLists.reduce((a, b) => a.concat(b))) this.shells_.next(shellLists.reduce((a, b) => a.concat(b)))
this.shells$.complete() this.shells_.complete()
} }
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> { async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {

View File

@@ -18,27 +18,31 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', use: {
query: { loader: 'awesome-typescript-loader',
configFileName: path.resolve(__dirname, 'tsconfig.json'), query: {
typeRoots: [path.resolve(__dirname, 'node_modules/@types')], configFileName: path.resolve(__dirname, 'tsconfig.json'),
paths: { typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
"terminus-*": [path.resolve(__dirname, '../terminus-*')], paths: {
"*": [path.resolve(__dirname, '../app/node_modules/*')], "terminus-*": [path.resolve(__dirname, '../terminus-*')],
} "*": [path.resolve(__dirname, '../app/node_modules/*')],
} }
},
},
}, },
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] }, { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] }, { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['to-string-loader', 'css-loader'] }, { test: /\.css$/, use: ['to-string-loader', 'css-loader'] },
{ {
test: /\.(ttf|eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, test: /\.(ttf|eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader", use: {
options: { loader: 'url-loader',
limit: 999999999999, options: {
limit: 999999999999,
}
} }
}, },
] ]

View File

@@ -2,9 +2,9 @@
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "es2016", "target": "es2016",
"declaration": false,
"noImplicitAny": false, "noImplicitAny": false,
"removeComments": false, "removeComments": false,
"emitDeclarationOnly": false,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"sourceMap": true, "sourceMap": true,

3295
yarn.lock

File diff suppressed because it is too large Load Diff