diff --git a/electron/decorators/loggable.js b/electron/decorators/loggable.js deleted file mode 100644 index 06a9de64d2..0000000000 --- a/electron/decorators/loggable.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function loggable(constructor) { - const constructorsClass = constructor.prototype; - Object.getOwnPropertyNames(constructorsClass) - .filter(name => typeof constructorsClass[name] === 'function') - .forEach(propertyName => { - const descriptor = Object.getOwnPropertyDescriptor(constructorsClass, propertyName); - ; - const originalMethod = descriptor.value; - descriptor.value = function (...args) { - console.log("Method's name " + propertyName); - const result = originalMethod.apply(this, args); - console.log("The return value is: " + result); - return result; - }; - Object.defineProperty(constructorsClass, propertyName, descriptor); - }); -} -exports.default = loggable; -//# sourceMappingURL=loggable.js.map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 446ecf96d1..438481bf6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1958,15 +1958,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, - "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -7048,8 +7046,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -7070,14 +7067,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7092,20 +7087,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -7222,8 +7214,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -7235,7 +7226,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7250,7 +7240,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7258,14 +7247,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7284,7 +7271,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -7372,8 +7358,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -7385,7 +7370,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -7471,8 +7455,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -7508,7 +7491,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7528,7 +7510,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7572,14 +7553,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -7715,15 +7694,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, - "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -12686,8 +12663,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", diff --git a/scripts/dataServicesTask.ts b/scripts/dataServicesTask.ts index bb7aa37159..0aadbdd6b0 100644 --- a/scripts/dataServicesTask.ts +++ b/scripts/dataServicesTask.ts @@ -1,16 +1,16 @@ import { TaskFunction } from 'gulp'; import { createSpawn } from './utils'; +import { normalize } from 'path'; export function createDataServicesTask(): TaskFunction { return async function dataServicesTask() { - await createSpawn('node', [ - './node_modules/.bin/tsc', - '-p', './data-service' + + await createSpawn(normalize('./node_modules/.bin/tsc'), [ + '-p', normalize('./data-service') ]); - await createSpawn('node', [ - './node_modules/.bin/browserify', - 'data-service/index.js', + await createSpawn(normalize('./node_modules/.bin/browserify'), [ + normalize('data-service/index.js'), '-s', 'ds', '-u', 'ts-utils', '-u', 'ramda', @@ -19,15 +19,14 @@ export function createDataServicesTask(): TaskFunction { '-u', '@waves/signature-generator', '-u', '@waves/signature-adapter', '--no-bf', - '-o', './data-service-dist/data-service-es6.js' + '-o', normalize('./data-service-dist/data-service-es6.js') ]); - await createSpawn('node', [ - './node_modules/.bin/babel', - './data-service-dist/data-service-es6.js', + await createSpawn(normalize('./node_modules/.bin/babel'), [ + normalize('./data-service-dist/data-service-es6.js'), '--presets=es2015', '--plugins=transform-decorators-legacy,transform-class-properties,transform-object-rest-spread', - '-o', './data-service-dist/data-service.js' + '-o', normalize('./data-service-dist/data-service.js') ]); - } -} + }; +} \ No newline at end of file diff --git a/scripts/eslintTask.ts b/scripts/eslintTask.ts index aff3a5b80c..789eb198b1 100644 --- a/scripts/eslintTask.ts +++ b/scripts/eslintTask.ts @@ -1,12 +1,12 @@ import { TaskFunction } from 'gulp'; import { createSpawn } from './utils'; +import { normalize } from 'path'; export function createEslintTask(): TaskFunction { return function eslintTask() { - return createSpawn('node', [ - './node_modules/.bin/eslint', + return createSpawn(normalize('./node_modules/.bin/eslint'), [ '-c', '.eslintrc.json', - './src/modules/' + normalize('./src/modules/') ]); } } diff --git a/scripts/utils.ts b/scripts/utils.ts index 3bc584d976..c9ba540bf3 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -2,19 +2,20 @@ import { spawn } from 'child_process'; export function createSpawn(command: string, args?: string[]): Promise { return new Promise((resolve, reject) => { - const sp = spawn(command, args); + const sp = process.platform === 'win32' && command !== 'rm' + ? spawn('sh', [command, ...args], { + stdio: [null, process.stdout, process.stderr] + }) + : spawn(command, args, { + stdio: [null, process.stdout, process.stderr] + }); - sp.stdout.pipe(process.stdout); - sp.stderr.pipe(process.stderr); - - sp.on('error', reject); - - sp.on('exit', (code, signal) => { + sp.on('close', (code) => { if (code === 0) { - resolve(signal); + resolve(); } else { - reject(signal); + reject(); } - }) + }); }); }