From 9ec912bea60cc6902b35e713de275f53acd5e293 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 10 Jul 2018 11:16:16 +0200 Subject: [PATCH 1/4] Update to latest light.js --- packages/fether-react/package.json | 2 +- yarn.lock | 35 +++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/packages/fether-react/package.json b/packages/fether-react/package.json index 27d1b2ff..91c759e5 100644 --- a/packages/fether-react/package.json +++ b/packages/fether-react/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "@parity/api": "^2.1.22", - "@parity/light.js": "https://github.com/parity-js/light.js#9646ce15d9dd9c4cf11776ddd613d5bd86016f94", + "@parity/light.js": "https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4", "@parity/shared": "^3.0.2", "bignumber.js": "^4.1.0", "debounce-promise": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index 20e3797c..f688ad23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -984,11 +984,10 @@ u2f-api "0.0.9" u2f-api-polyfill "0.4.3" -"@parity/light.js@https://github.com/parity-js/light.js#9646ce15d9dd9c4cf11776ddd613d5bd86016f94": +"@parity/light.js@https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4": version "1.0.0" - resolved "https://github.com/parity-js/light.js#9646ce15d9dd9c4cf11776ddd613d5bd86016f94" + resolved "https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4" dependencies: - "@babel/runtime" "^7.0.0-beta.49" "@parity/api" "^2.1.23" json-prune "^1.1.0" memoizee "^0.4.12" @@ -2548,6 +2547,19 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boom@7.x.x: + version "7.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.0.tgz#2bff24a55565767fde869ec808317eb10c48e966" + dependencies: + hoek "5.x.x" + +bounce@1.x.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/bounce/-/bounce-1.2.0.tgz#e3bac68c73fd256e38096551efc09f504873c8c8" + dependencies: + boom "7.x.x" + hoek "5.x.x" + boxen@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" @@ -6001,6 +6013,10 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hoek@5.x.x: + version "5.0.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac" + hoist-non-react-statics@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" @@ -10642,6 +10658,15 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sntp@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-3.0.1.tgz#1aa9088d3eb844ea8c0980fce1877884d4117d09" + dependencies: + boom "7.x.x" + bounce "1.x.x" + hoek "5.x.x" + teamwork "3.x.x" + sockjs-client@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.4.tgz#5babe386b775e4cf14e7520911452654016c8b12" @@ -11216,6 +11241,10 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" +teamwork@3.x.x: + version "3.0.1" + resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196" + temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" -- GitLab From b564b1c2ce374f915cbf2feff48da753ea51dc2b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 10 Jul 2018 12:03:51 +0200 Subject: [PATCH 2/4] Convert parity-electron to typescript --- packages/parity-electron/babel.config.js | 19 ------- packages/parity-electron/package.json | 3 +- .../src/{fetchParity.js => fetchParity.ts} | 56 +++++++++++-------- .../{getParityPath.js => getParityPath.ts} | 28 +++++++--- .../src/{index.js => index.ts} | 7 ++- ...{isParityRunning.js => isParityRunning.ts} | 12 ++-- .../src/{runParity.js => runParity.ts} | 14 ++++- .../{signerNewToken.js => signerNewToken.ts} | 2 +- packages/parity-electron/src/types.d.ts | 16 ++++++ .../src/utils/{cli.js => cli.ts} | 10 ++-- .../utils/{logCommand.js => logCommand.ts} | 5 +- .../src/utils/{logger.js => logger.ts} | 6 +- packages/parity-electron/tsconfig.json | 9 +++ yarn.lock | 37 ------------ 14 files changed, 113 insertions(+), 111 deletions(-) delete mode 100644 packages/parity-electron/babel.config.js rename packages/parity-electron/src/{fetchParity.js => fetchParity.ts} (68%) rename packages/parity-electron/src/{getParityPath.js => getParityPath.ts} (83%) rename packages/parity-electron/src/{index.js => index.ts} (72%) rename packages/parity-electron/src/{isParityRunning.js => isParityRunning.ts} (82%) rename packages/parity-electron/src/{runParity.js => runParity.ts} (89%) rename packages/parity-electron/src/{signerNewToken.js => signerNewToken.ts} (96%) create mode 100644 packages/parity-electron/src/types.d.ts rename packages/parity-electron/src/utils/{cli.js => cli.ts} (91%) rename packages/parity-electron/src/utils/{logCommand.js => logCommand.ts} (71%) rename packages/parity-electron/src/utils/{logger.js => logger.ts} (60%) create mode 100644 packages/parity-electron/tsconfig.json diff --git a/packages/parity-electron/babel.config.js b/packages/parity-electron/babel.config.js deleted file mode 100644 index 9fae1bf2..00000000 --- a/packages/parity-electron/babel.config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - plugins: [ - '@babel/plugin-proposal-class-properties', - [ - '@babel/plugin-transform-runtime', - { - helpers: false, - polyfill: false, - regenerator: true, - moduleName: '@babel/runtime' - } - ] - ], - presets: [ - '@babel/preset-env', - '@babel/preset-react', - ['@babel/preset-stage-0', { decoratorsLegacy: true }] - ] -}; diff --git a/packages/parity-electron/package.json b/packages/parity-electron/package.json index 94bdd479..0693013c 100644 --- a/packages/parity-electron/package.json +++ b/packages/parity-electron/package.json @@ -27,7 +27,7 @@ "main": "lib/index.js", "scripts": { "prebuild": "rimraf lib", - "build": "babel src --out-dir lib", + "build": "tsc", "start": "yarn build --watch" }, "dependencies": { @@ -40,7 +40,6 @@ "promise-any": "^0.2.0" }, "devDependencies": { - "@babel/plugin-transform-runtime": "^7.0.0-beta.51", "electron": "^2.0.2" }, "peerDependencies": { diff --git a/packages/parity-electron/src/fetchParity.js b/packages/parity-electron/src/fetchParity.ts similarity index 68% rename from packages/parity-electron/src/fetchParity.js rename to packages/parity-electron/src/fetchParity.ts index fbc3da02..c10a8575 100644 --- a/packages/parity-electron/src/fetchParity.js +++ b/packages/parity-electron/src/fetchParity.ts @@ -3,21 +3,21 @@ // // SPDX-License-Identifier: BSD-3-Clause -import { app } from 'electron'; +import { app, BrowserWindow } from 'electron'; import axios from 'axios'; -import cs from 'checksum'; +import { file } from 'checksum'; import { download } from 'electron-dl'; -import fs from 'fs'; +import { chmod, stat, unlink } from 'fs'; import { promisify } from 'util'; -import retry from 'async-retry'; +import * as retry from 'async-retry'; import { defaultParityPath, getParityPath } from './getParityPath'; import logger from './utils/logger'; -const checksum = promisify(cs.file); -const fsChmod = promisify(fs.chmod); -const fsStat = promisify(fs.stat); -const fsUnlink = promisify(fs.unlink); +const checksum = promisify(file); +const fsChmod = promisify(chmod); +const fsStat = promisify(stat); +const fsUnlink = promisify(unlink); const VANITY_URL = 'https://vanity-service.parity.io/parity-binaries'; @@ -53,7 +53,7 @@ const getOs = () => { }; /** - * Remove parity binary in the userData folder + * Remove parity binary in the userData folder, if it exists. */ export const deleteParity = async () => { try { @@ -63,16 +63,23 @@ export const deleteParity = async () => { } catch (e) {} }; -// Fetch parity from https://vanity-service.parity.io/parity-binaries -export const fetchParity = ( - mainWindow, - { onProgress, parityChannel } = { +/** + * Downloads Parity, saves it to Electron's `userData` folder, and returns the + * path to the downloaded binary once finished. + */ +export const fetchParity = async ( + mainWindow: BrowserWindow, + { + onProgress, + parityChannel + }: { onProgress: (progress: number) => void; parityChannel: string } = { + onProgress: () => {}, parityChannel: 'beta' } ) => { try { - return retry( - async (_, attempt) => { + const parityPath: string = retry( + async (_, attempt: number) => { if (attempt > 1) { logger()('@parity/electron:main')('Retrying.'); } @@ -86,7 +93,10 @@ export const fetchParity = ( const { data } = await axios.get(metadataUrl); // Get the binary's url - const { downloadUrl, checksum: expectedChecksum } = data[0].files.find( + const { + downloadUrl, + checksum: expectedChecksum + }: { downloadUrl: string; checksum: string } = data[0].files.find( ({ name }) => name === 'parity' || name === 'parity.exe' ); @@ -95,11 +105,11 @@ export const fetchParity = ( directory: app.getPath('userData'), onProgress }); - const downloadPath = downloadItem.getSavePath(); // Equal to defaultParityPath + const downloadPath: string = downloadItem.getSavePath(); // Equal to defaultParityPath // Once downloaded, we check the sha256 checksum // Calculate the actual checksum - const actualChecksum = await checksum(downloadPath, { + const actualChecksum: string = await checksum(downloadPath, { algorithm: 'sha256' }); // The 2 checksums should of course match @@ -113,16 +123,16 @@ export const fetchParity = ( await fsChmod(downloadPath, '755'); // Double-check that Parity exists now. - const parityPath = await getParityPath(); - return parityPath; + return await getParityPath(); }, { retries: 3 } ); + + return parityPath; } catch (err) { - return deleteParity().then(() => { - Promise.reject(err); - }); + await deleteParity(); + throw err; } }; diff --git a/packages/parity-electron/src/getParityPath.js b/packages/parity-electron/src/getParityPath.ts similarity index 83% rename from packages/parity-electron/src/getParityPath.js rename to packages/parity-electron/src/getParityPath.ts index 82be6a3d..851d436a 100644 --- a/packages/parity-electron/src/getParityPath.js +++ b/packages/parity-electron/src/getParityPath.ts @@ -5,16 +5,20 @@ import { app } from 'electron'; import commandExists from 'command-exists'; -import fs from 'fs'; +import { stat } from 'fs'; import promiseAny from 'promise-any'; import { promisify } from 'util'; import logger from './utils/logger'; -const fsStat = promisify(fs.stat); +const fsStat = promisify(stat); -// The default path to install parity, in case there's no other instance found -// on the machine. +/** + * The default path to install parity, in case there's no other instance found + * on the machine. + * + * @ignore + */ export const defaultParityPath = () => Promise.resolve( `${app.getPath('userData')}/parity${ @@ -22,10 +26,12 @@ export const defaultParityPath = () => }` ); -let parityPath; // The real parity path, will be populated after doesParityExist Promise resolves +let parityPath: string; // The real parity path, will be populated after doesParityExist Promise resolves /** * Test if `parity` command is in $PATH. + * + * @ignore */ const isParityInPath = async () => { const parityCommandExists = await commandExists('parity'); @@ -37,8 +43,10 @@ const isParityInPath = async () => { /** * Test if Parity is in the common OS locations. + * + * @ignore */ -const isParityInOs = async () => { +const isParityInOs = async (): Promise => { // OS locations to test if parity binary exists const locations = { linux: ['/bin/parity', '/usr/bin/parity', '/usr/local/bin/parity'], @@ -54,6 +62,8 @@ const isParityInOs = async () => { /** * Test is Parity is already downloaded in electron app's userData folder. + * + * @ignore */ const isParityInUserData = async () => { const parityPath = await defaultParityPath(); @@ -68,7 +78,8 @@ const isParityInUserData = async () => { * - finally check parity-ui's own userData folder * This function should run in node env. * - * @return Promise - Resolves to a string which is the command to run parity. + * @ignore + * @return Promise - Resolves to a string which is the command to run parity. */ const doesParityExist = async () => { try { @@ -89,6 +100,9 @@ const doesParityExist = async () => { } }; +/** + * Returns the path to Parity, or throws if parity is not found. + */ export const getParityPath = async () => { if (parityPath) { return parityPath; diff --git a/packages/parity-electron/src/index.js b/packages/parity-electron/src/index.ts similarity index 72% rename from packages/parity-electron/src/index.js rename to packages/parity-electron/src/index.ts index bd384f3e..3c8c1863 100644 --- a/packages/parity-electron/src/index.js +++ b/packages/parity-electron/src/index.ts @@ -3,6 +3,7 @@ // // SPDX-License-Identifier: BSD-3-Clause +import { CliObject, LoggerFunction } from './types'; import { setCli } from './utils/cli'; import { setLogger } from './utils/logger'; @@ -12,8 +13,10 @@ export * from './isParityRunning'; export * from './runParity'; export * from './signerNewToken'; -// Set default options for @parity/electron -export default opts => { +/** + * Set default options for @parity/electron. + */ +export default (opts: { cli: CliObject; logger: LoggerFunction }) => { if (opts.cli) { setCli(opts.cli); } diff --git a/packages/parity-electron/src/isParityRunning.js b/packages/parity-electron/src/isParityRunning.ts similarity index 82% rename from packages/parity-electron/src/isParityRunning.js rename to packages/parity-electron/src/isParityRunning.ts index 9deb4cdb..73d40c35 100644 --- a/packages/parity-electron/src/isParityRunning.js +++ b/packages/parity-electron/src/isParityRunning.ts @@ -4,12 +4,14 @@ // SPDX-License-Identifier: BSD-3-Clause import axios from 'axios'; -import retry from 'async-retry'; +import * as retry from 'async-retry'; import { cli } from './utils/cli'; import logger from './utils/logger'; -// Try to ping these hosts +/** + * Try to ping these hosts to test if Parity is running. + */ const hostsToPing = ['http://127.0.0.1:8545', 'http://127.0.0.1:8546']; if (cli.wsInterface || cli.wsPort) { // Also try custom host/port if a --ws-interface or --ws-port flag is passed @@ -20,15 +22,13 @@ if (cli.wsInterface || cli.wsPort) { /** * Detect if another instance of parity is already running or not. To achieve - * that, we just ping on the common hosts, see hostsToPing array. - * - * @return [Promise] - Promise that resolves to true or false. + * that, we just ping on the common hosts, see {@link hostsToPing} array. */ export const isParityRunning = async () => { try { // Retry to ping as many times as there are hosts in `hostsToPing` await retry( - async (_, attempt) => { + async (_, attempt: number) => { const host = hostsToPing[attempt - 1]; // Attempt starts with 1 await axios.get(host); logger()('@parity/electron:main')( diff --git a/packages/parity-electron/src/runParity.js b/packages/parity-electron/src/runParity.ts similarity index 89% rename from packages/parity-electron/src/runParity.js rename to packages/parity-electron/src/runParity.ts index 0e328cc1..76745fb0 100644 --- a/packages/parity-electron/src/runParity.js +++ b/packages/parity-electron/src/runParity.ts @@ -4,7 +4,7 @@ // SPDX-License-Identifier: BSD-3-Clause import { app } from 'electron'; -import fs from 'fs'; +import { chmod } from 'fs'; import { spawn } from 'child_process'; import { promisify } from 'util'; @@ -14,7 +14,7 @@ import { isParityRunning } from './isParityRunning'; import logCommand from './utils/logCommand'; import logger from './utils/logger'; -const fsChmod = promisify(fs.chmod); +const fsChmod = promisify(chmod); let parity = null; // Will hold the running parity instance @@ -26,7 +26,15 @@ const catchableErrors = [ 'IO error: While lock file:' ]; -export const runParity = async (additionalFlags, onParityError) => { +/** + * Spawns a child process to run Parity. If some cli flags are passed into the + * options in parityElectron, then those flags will be passed down to Parity + * itself. + */ +export const runParity = async ( + additionalFlags: string[], + onParityError: (error: Error) => void = () => {} +) => { // Do not run parity with --no-run-parity if (cli.runParity === false) { return; diff --git a/packages/parity-electron/src/signerNewToken.js b/packages/parity-electron/src/signerNewToken.ts similarity index 96% rename from packages/parity-electron/src/signerNewToken.js rename to packages/parity-electron/src/signerNewToken.ts index fdbc4a0e..6e404d0e 100644 --- a/packages/parity-electron/src/signerNewToken.js +++ b/packages/parity-electron/src/signerNewToken.ts @@ -12,7 +12,7 @@ import logger from './utils/logger'; /** * Launch a parity instance to get a secure token. */ -export const signerNewToken = () => +export const signerNewToken = (): Promise => new Promise(async (resolve, reject) => { logger()('@parity/electron:main')('Requesting new token.'); diff --git a/packages/parity-electron/src/types.d.ts b/packages/parity-electron/src/types.d.ts new file mode 100644 index 00000000..4efe9a06 --- /dev/null +++ b/packages/parity-electron/src/types.d.ts @@ -0,0 +1,16 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +export type CliObject = { + rawArgs?: string[]; + [key: string]: string | boolean | string[]; +}; + +export type LoggerFunction = (namespace: string) => (log: string) => void; + +export type Options = { + cli: CliObject; + logger: LoggerFunction; +}; diff --git a/packages/parity-electron/src/utils/cli.js b/packages/parity-electron/src/utils/cli.ts similarity index 91% rename from packages/parity-electron/src/utils/cli.js rename to packages/parity-electron/src/utils/cli.ts index f2ca25d6..1f61f8f2 100644 --- a/packages/parity-electron/src/utils/cli.js +++ b/packages/parity-electron/src/utils/cli.ts @@ -3,25 +3,25 @@ // // SPDX-License-Identifier: BSD-3-Clause -let cli = {}; +import { CliObject } from '../types'; + +let cli: CliObject = {}; /** * Set custom cli options. * * @param {*} cliOptions */ -export const setCli = cliObject => { +export const setCli = (cliObject: CliObject) => { cli = cliObject; }; /** * Camel-case the given `flag` * - * @param {String} flag - * @return {String} * @see https://github.com/tj/commander.js/blob/dcddf698c5463795401ad3d6382f5ec5ec060478/index.js#L1160-L1172 */ -const camelcase = flag => +const camelcase = (flag: string) => flag .split('-') .reduce((str, word) => str + word[0].toUpperCase() + word.slice(1)); diff --git a/packages/parity-electron/src/utils/logCommand.js b/packages/parity-electron/src/utils/logCommand.ts similarity index 71% rename from packages/parity-electron/src/utils/logCommand.js rename to packages/parity-electron/src/utils/logCommand.ts index 7f9eaa5e..f3a7ac12 100644 --- a/packages/parity-electron/src/utils/logCommand.js +++ b/packages/parity-electron/src/utils/logCommand.ts @@ -6,11 +6,8 @@ /** * Given a command and its args, returns a nice string to be logged. The * arguments to this function are the same as the ones you would pass to spawn. - * - * @param {String} command - The command to be run. - * @param {String} args - The args of the above command. */ -const logCommand = (command, args) => +const logCommand = (command: string, args: string[]) => `Running "${command.replace(' ', '\\ ')} ${args.join(' ')}".`; export default logCommand; diff --git a/packages/parity-electron/src/utils/logger.js b/packages/parity-electron/src/utils/logger.ts similarity index 60% rename from packages/parity-electron/src/utils/logger.js rename to packages/parity-electron/src/utils/logger.ts index acdb5666..2f9d48bd 100644 --- a/packages/parity-electron/src/utils/logger.js +++ b/packages/parity-electron/src/utils/logger.ts @@ -5,9 +5,11 @@ import debug from 'debug'; -let logger = debug; +import { LoggerFunction } from '../types'; -export const setLogger = _logger => { +let logger: LoggerFunction = debug; + +export const setLogger = (_logger: LoggerFunction) => { logger = _logger; }; diff --git a/packages/parity-electron/tsconfig.json b/packages/parity-electron/tsconfig.json new file mode 100644 index 00000000..bf370fe2 --- /dev/null +++ b/packages/parity-electron/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "outDir": "./lib", + "lib": ["es2015", "dom"], + "target": "es5" + }, + "exclude": ["./src/**/*.spec.ts", "./src/utils/testHelpers/*.ts"], + "include": ["./src/**/*"] +} diff --git a/yarn.lock b/yarn.lock index f688ad23..131a9fd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -706,13 +706,6 @@ dependencies: regenerator-transform "^0.12.4" -"@babel/plugin-transform-runtime@^7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.0.0-beta.51.tgz#0c9cab174f4e3e131659fd65c5ce8e3d73376820" - dependencies: - "@babel/helper-module-imports" "7.0.0-beta.51" - "@babel/helper-plugin-utils" "7.0.0-beta.51" - "@babel/plugin-transform-shorthand-properties@7.0.0-beta.51": version "7.0.0-beta.51" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.51.tgz#ddbc0b1ae1ddb3bcfe6969f2c968103f11e32bd9" @@ -2547,19 +2540,6 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boom@7.x.x: - version "7.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.0.tgz#2bff24a55565767fde869ec808317eb10c48e966" - dependencies: - hoek "5.x.x" - -bounce@1.x.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bounce/-/bounce-1.2.0.tgz#e3bac68c73fd256e38096551efc09f504873c8c8" - dependencies: - boom "7.x.x" - hoek "5.x.x" - boxen@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" @@ -6013,10 +5993,6 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" -hoek@5.x.x: - version "5.0.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac" - hoist-non-react-statics@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" @@ -10658,15 +10634,6 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -sntp@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-3.0.1.tgz#1aa9088d3eb844ea8c0980fce1877884d4117d09" - dependencies: - boom "7.x.x" - bounce "1.x.x" - hoek "5.x.x" - teamwork "3.x.x" - sockjs-client@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.4.tgz#5babe386b775e4cf14e7520911452654016c8b12" @@ -11241,10 +11208,6 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -teamwork@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196" - temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" -- GitLab From 979c24bc20e7e6a0b2be25c37be7fbe8e8e232b5 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 10 Jul 2018 13:47:10 +0200 Subject: [PATCH 3/4] Update latest light.js --- packages/fether-react/package.json | 2 +- packages/parity-electron/README.md | 3 +-- packages/parity-electron/tsconfig.json | 1 - yarn.lock | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/fether-react/package.json b/packages/fether-react/package.json index 91c759e5..ff0f1c19 100644 --- a/packages/fether-react/package.json +++ b/packages/fether-react/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "@parity/api": "^2.1.22", - "@parity/light.js": "https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4", + "@parity/light.js": "https://github.com/parity-js/light.js#4520ff71ff46cef1f5fa8b3c7f6ec97968d", "@parity/shared": "^3.0.2", "bignumber.js": "^4.1.0", "debounce-promise": "^3.1.0", diff --git a/packages/parity-electron/README.md b/packages/parity-electron/README.md index f88909a6..9b194f7e 100644 --- a/packages/parity-electron/README.md +++ b/packages/parity-electron/README.md @@ -16,8 +16,7 @@ import parityElectron, { isParityRunning } from '@parity/electron'; // Optional: override default options parityElectron({ cli: myOwnCliObject, - logger: myCustomLoggerFunction, - parityChannel: 'nightly' + logger: myCustomLoggerFunction }) isParityRunning() diff --git a/packages/parity-electron/tsconfig.json b/packages/parity-electron/tsconfig.json index bf370fe2..c95edce2 100644 --- a/packages/parity-electron/tsconfig.json +++ b/packages/parity-electron/tsconfig.json @@ -4,6 +4,5 @@ "lib": ["es2015", "dom"], "target": "es5" }, - "exclude": ["./src/**/*.spec.ts", "./src/utils/testHelpers/*.ts"], "include": ["./src/**/*"] } diff --git a/yarn.lock b/yarn.lock index 131a9fd4..15844e0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -977,9 +977,9 @@ u2f-api "0.0.9" u2f-api-polyfill "0.4.3" -"@parity/light.js@https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4": +"@parity/light.js@https://github.com/parity-js/light.js#4520ff71ff46cef1f5fa8b3c7f6ec97968d": version "1.0.0" - resolved "https://github.com/parity-js/light.js#5a0c372607e6e88de74b49df5cbb9b79a23b4cc4" + resolved "https://github.com/parity-js/light.js#4520ff71ff46cef1f5fa8b3c7f6ec97968dd1fd2" dependencies: "@parity/api" "^2.1.23" json-prune "^1.1.0" -- GitLab From 4616687a36dcf03d29ad41087f08dde9dfcdd8fe Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 10 Jul 2018 13:50:38 +0200 Subject: [PATCH 4/4] Add typescript add dev dep --- packages/parity-electron/package.json | 3 ++- yarn.lock | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/parity-electron/package.json b/packages/parity-electron/package.json index 0693013c..fe706c2b 100644 --- a/packages/parity-electron/package.json +++ b/packages/parity-electron/package.json @@ -40,7 +40,8 @@ "promise-any": "^0.2.0" }, "devDependencies": { - "electron": "^2.0.2" + "electron": "^2.0.2", + "typescript": "^2.9.2" }, "peerDependencies": { "electron": "^2.0.3" diff --git a/yarn.lock b/yarn.lock index 15844e0b..67801d85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11475,6 +11475,10 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typescript@^2.9.2: + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" + u2f-api-polyfill@0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/u2f-api-polyfill/-/u2f-api-polyfill-0.4.3.tgz#b7ad165a6f962558517a867c5c4bf9399fcf7e98" -- GitLab