externals

This commit is contained in:
peter
2019-08-24 10:11:18 +02:00
parent 65400b2e2d
commit ce5081f700
8 changed files with 2346 additions and 6888 deletions
+2080
View File
File diff suppressed because it is too large Load Diff
-7
View File
@@ -1,7 +0,0 @@
{
"transform": {
"^.+\\.(t|j)sx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
}
+259 -6855
View File
File diff suppressed because it is too large Load Diff
+2 -56
View File
@@ -21,84 +21,30 @@
"author": "frontblock.me", "author": "frontblock.me",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@angular/common": "^8.2.1",
"@angular/compiler": "^8.2.1",
"@angular/core": "^8.2.1",
"@angular/forms": "^8.2.1",
"@angular/platform-browser": "^8.2.1",
"@angular/platform-browser-dynamic": "^8.2.1",
"@angular/router": "^8.2.1",
"@clr/ui": "^2.1.1",
"@uirouter/angularjs": "^1.0.5",
"adm-zip": "^0.4.13",
"angular": "^1.7.8",
"bip39": "^3.0.2",
"bitcoinjs-lib": "^5.0.4",
"bsert": "0.0.10", "bsert": "0.0.10",
"bsock": "^0.1.9", "bsock": "^0.1.9",
"easy-unzip": "^1.1.0", "child-process-promise": "^2.2.1",
"express": "^4.16.4", "express": "^4.16.4",
"frontblock": "^0.9.9", "frontblock": "^0.9.9",
"frontblock-generic": "latest", "frontblock-generic": "latest",
"git-cherrypicker": "0.0.3", "git-cherrypicker": "0.0.3",
"git-describe": "^4.0.4", "git-describe": "^4.0.4",
"hdkey": "^1.1.1",
"http": "0.0.0", "http": "0.0.0",
"key-file-storage": "^2.2.4",
"log4js": "^4.4.0", "log4js": "^4.4.0",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"memfs": "^2.15.5",
"minimist": "^1.2.0",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"path": "^0.12.7", "path": "^0.12.7",
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"rollup": "^0.55.1",
"rollup-plugin-node-externals": "^2.0.0",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.5.2",
"simple-git": "^1.124.0", "simple-git": "^1.124.0",
"socket.io": "^2.2.0", "uuid": "^3.3.2"
"stream-buffers": "^3.0.2",
"unzip": "^0.1.11",
"uuid": "^3.3.2",
"zone.js": "^0.9.1"
}, },
"devDependencies": { "devDependencies": {
"@types/angular": "^1.6.27",
"@types/express": "^4.17.0", "@types/express": "^4.17.0",
"@types/jest": "^24.0.15",
"@types/node": "^11.13.19", "@types/node": "^11.13.19",
"@types/semver": "^6.0.1", "@types/semver": "^6.0.1",
"@types/webpack-env": "^1.14.0",
"autoprefixer": "^9.4.7",
"clean-webpack-plugin": "^1.0.1",
"css-loader": "^2.1.0",
"cssnano": "^4.1.8",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.7.1",
"less": "^3.9.0",
"less-loader": "^4.0.5",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.5.3",
"postcss-loader": "^3.0.0",
"prettier": "^1.18.2",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-typescript": "^0.8.1",
"rollup-plugin-typescript2": "^0.10.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.4.1", "terser-webpack-plugin": "^1.4.1",
"ts-jest": "^24.0.2",
"ts-loader": "^5.3.3", "ts-loader": "^5.3.3",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"tslint-loader": "^3.5.3",
"typescript": "^3.5.3", "typescript": "^3.5.3",
"typescript-declaration-webpack-plugin": "^0.1.1",
"uglifyjs-webpack-plugin": "^2.1.3",
"url-loader": "^1.1.2",
"webpack": "^4.39.2", "webpack": "^4.39.2",
"webpack-cli": "^3.3.5" "webpack-cli": "^3.3.5"
}, },
+4 -4
View File
@@ -11,8 +11,7 @@ import { promises as fs } from "fs"
import { GitUpdater, RepoFolderStatus, } from "./GitUpdater"; import { GitUpdater, RepoFolderStatus, } from "./GitUpdater";
import * as path from "path" import * as path from "path"
import { UpdateManager } from './UpdateManger'; import { UpdateManager } from './UpdateManger';
var exec = require('child-process-promise').exec;
const kfs = require("key-file-storage").default('kfs')
Logger.configure({ Logger.configure({
appenders: appenders:
@@ -85,6 +84,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
private async initialize(){ private async initialize(){
await this.updateManager.updateAdmin() await this.updateManager.updateAdmin()
await this.updateManager.updatePlatformDependencies()
await this.updateManager.updateDashboard() await this.updateManager.updateDashboard()
await this.updateManager.updateFrontblockLib() await this.updateManager.updateFrontblockLib()
@@ -184,7 +184,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
return return
} }
let port:number = this.conf.httpPort let port:number = this.getConfig().httpPort
this.express = express() this.express = express()
this.express.use('/', express.static('static')) this.express.use('/', express.static('static'))
@@ -240,7 +240,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
private restartWebserver(port:number){ private restartWebserver(port:number){
this.stopWebserver() this.stopWebserver()
kfs[this.name+".conf"] = <AdminConf>{ httpPort: port } this.setConfigKey("httpPort", port)
this.startWebserver() this.startWebserver()
} }
+15 -1
View File
@@ -2,6 +2,9 @@ import { Plugin, socketioRPC } from "frontblock-generic/Plugin";
import { GitUpdater, RepoFolderStatus } from "./GitUpdater"; import { GitUpdater, RepoFolderStatus } from "./GitUpdater";
import { FrontblockCherryPicker } from "git-cherrypicker"; import { FrontblockCherryPicker } from "git-cherrypicker";
import * as Logger from 'log4js' import * as Logger from 'log4js'
import { mkdirSync } from "fs";
var exec = require('child-process-promise').exec;
Logger.configure({ Logger.configure({
appenders: appenders:
{ {
@@ -61,6 +64,17 @@ export class UpdateManager implements Plugin{
}] }]
} }
async updatePlatformDependencies(){
logger.info("installing npm stuff")
const res = await exec('npm install --prefix ./externals knex sqlite3')
logger.warn(res.stderr)
logger.info(res.stdout)
//mkdirSync("./test", {recursive:true})
//await npmInstallAsync(["sqlite3"], "./test")
}
async updateAdmin(force:boolean = false){ async updateAdmin(force:boolean = false){
this.adminUpdater = new GitUpdater("./dist") this.adminUpdater = new GitUpdater("./dist")
let status = await this.adminUpdater.getStatus() let status = await this.adminUpdater.getStatus()
@@ -108,7 +122,7 @@ export class UpdateManager implements Plugin{
let str = "../plugins/"+name+"/Plugin" let str = "../plugins/"+name+"/Plugin"
const pluginClass = await import(str) const pluginClass = await eval('require')(str)
const pluginObj = new pluginClass.default() const pluginObj = new pluginClass.default()
await pluginObj.start() await pluginObj.start()
this.loadedPlugins[name] = pluginObj this.loadedPlugins[name] = pluginObj
+24 -3
View File
@@ -1,12 +1,33 @@
const path = require('path'); const path = require('path');
module.exports = { module.exports = [{
mode: 'production', mode: 'production',
target: "web", target: "web",
entry: path.resolve(__dirname, '../../dist/FrontblockLib.js'), entry: path.resolve(__dirname, '../../lib/FrontblockLib.js'),
output: { output: {
path: path.resolve(__dirname, '../../dist'), path: path.resolve(__dirname, '../../dist'),
filename: 'FrontblockLib.js', filename: 'FrontblockLib.js',
} }
} },{
mode: 'production',
target: "node",
node: {
global: true,
process: true,
__filename: false,
__dirname: false,
Buffer: true,
},
externals:[
'knex'
],
optimization: {
minimize: false
},
entry: path.resolve(__dirname, '../../lib/FrontblockAdmin.js'),
output: {
path: path.resolve(__dirname, '../../dist'),
filename: 'FrontblockAdmin.js',
}
}]
+1 -1
View File
@@ -5,7 +5,7 @@
"target": "ESnext", "target": "ESnext",
"module": "commonjs", "module": "commonjs",
"declaration": true, "declaration": true,
"outDir": "./dist", "outDir": "./lib",
"strict": true, "strict": true,
"experimentalDecorators": true "experimentalDecorators": true
}, },