diff --git a/docs/USER-DOCUMENTATION.md b/docs/USER-DOCUMENTATION.md index cb361c85..0fa329ed 100644 --- a/docs/USER-DOCUMENTATION.md +++ b/docs/USER-DOCUMENTATION.md @@ -166,7 +166,7 @@ Run the following command in `Terminal.app`, replacing `N` by the corresponding disk number, which you can find by running `diskutil list`: ```sh -diskutil eraseDisk free UNTITLED /dev/diskN +diskutil eraseDisk FAT32 UNTITLED MBRFormat /dev/diskN ``` ### GNU/Linux diff --git a/lib/gui/app/components/drive-selector/DriveSelectorModal.tsx b/lib/gui/app/components/drive-selector/DriveSelectorModal.tsx index 97aaad52..c93f3f68 100644 --- a/lib/gui/app/components/drive-selector/DriveSelectorModal.tsx +++ b/lib/gui/app/components/drive-selector/DriveSelectorModal.tsx @@ -173,7 +173,7 @@ export function DriveSelectorModal({ close }: { close: () => void }) {
  • attribute but used by css rule) + // @ts-ignore (FIXME: not a valid
  • attribute but used by css rule) disabled={!isDriveValid(drive, selectionState.getImage())} onDoubleClick={() => selectDriveAndClose(drive)} onClick={() => toggleDrive(drive)} @@ -243,7 +243,7 @@ export function DriveSelectorModal({ close }: { close: () => void }) { {isDriveValid(drive, selectionState.getImage()) && ( attribute but used by css rule) + // @ts-ignore (FIXME: not a valid attribute but used by css rule) disabled={!selectionState.isDriveSelected(drive.device)} > )} diff --git a/lib/gui/app/components/finish/finish.tsx b/lib/gui/app/components/finish/finish.tsx index 5e19c7ce..dc1cb194 100644 --- a/lib/gui/app/components/finish/finish.tsx +++ b/lib/gui/app/components/finish/finish.tsx @@ -18,7 +18,6 @@ import * as _ from 'lodash'; import * as React from 'react'; import * as uuidV4 from 'uuid/v4'; -import * as messages from '../../../../shared/messages'; import * as flashState from '../../models/flash-state'; import * as selectionState from '../../models/selection-state'; import { store } from '../../models/store'; @@ -67,18 +66,12 @@ const formattedErrors = () => { }; function FinishPage({ goToMain }: { goToMain: () => void }) { - // @ts-ignore const results = flashState.getFlashResults().results || {}; - const progressMessage = messages.progress; return (
    - + restart(options, goToMain)} diff --git a/lib/gui/app/components/flash-results/flash-results.tsx b/lib/gui/app/components/flash-results/flash-results.tsx index 90b27e20..a3d9f925 100644 --- a/lib/gui/app/components/flash-results/flash-results.tsx +++ b/lib/gui/app/components/flash-results/flash-results.tsx @@ -16,36 +16,48 @@ import * as _ from 'lodash'; import * as React from 'react'; +import { Txt } from 'rendition'; import styled from 'styled-components'; import { left, position, space, top } from 'styled-system'; + +import { progress } from '../../../../shared/messages'; +import { bytesToMegabytes } from '../../../../shared/units'; import { Underline } from '../../styled-components'; -const Div: any = styled.div` +const Div = styled.div` ${position} ${top} ${left} ${space} `; -export const FlashResults: any = ({ +export function FlashResults({ errors, results, - message, }: { - errors: () => string; - results: any; - message: any; -}) => { + errors: string; + results: { + averageFlashingSpeed: number; + devices: { failed: number; successful: number }; + }; +}) { + const averageSpeed = _.round( + bytesToMegabytes(results.averageFlashingSpeed), + 1, + ); return (

    Flash Complete!

    -
    - - {_.map(results.devices, (quantity, type) => { - return quantity ? ( +
    + {_.map(results.devices, (quantity, type) => { + return quantity ? ( +
    {quantity} - {message[type](quantity)} + {progress[type](quantity)}
    - ) : null; - })} -
    + + ) : null; + })} + + Writing speed: {averageSpeed} MB/s +
    ); -}; +} diff --git a/lib/gui/app/components/image-selector/image-selector.tsx b/lib/gui/app/components/image-selector/image-selector.tsx index a95795e2..6f30e98a 100644 --- a/lib/gui/app/components/image-selector/image-selector.tsx +++ b/lib/gui/app/components/image-selector/image-selector.tsx @@ -220,10 +220,9 @@ export class ImageSelector extends React.Component< return; } - const source = new sdk.sourceDestination.File( - imagePath, - sdk.sourceDestination.File.OpenFlags.Read, - ); + const source = new sdk.sourceDestination.File({ + path: imagePath, + }); try { const innerSource = await source.getInnerSource(); const metadata = (await innerSource.getMetadata()) as sdk.sourceDestination.Metadata & { diff --git a/lib/gui/app/components/settings/settings.tsx b/lib/gui/app/components/settings/settings.tsx index 066a07ca..3ff61072 100644 --- a/lib/gui/app/components/settings/settings.tsx +++ b/lib/gui/app/components/settings/settings.tsx @@ -137,7 +137,6 @@ export const SettingsModal: any = styled( setting, value, dangerous, - // @ts-ignore applicationSessionUuid: store.getState().toJS().applicationSessionUuid, }); diff --git a/lib/gui/app/models/flash-state.ts b/lib/gui/app/models/flash-state.ts index 524eaaab..4c2c1d56 100644 --- a/lib/gui/app/models/flash-state.ts +++ b/lib/gui/app/models/flash-state.ts @@ -87,7 +87,6 @@ export function setProgressState( return null; }), - totalSpeed: _.attempt(() => { if (_.isFinite(state.totalSpeed)) { return _.round(bytesToMegabytes(state.totalSpeed), PRECISION); diff --git a/lib/gui/app/models/store.ts b/lib/gui/app/models/store.ts index e05552da..412e5ba8 100644 --- a/lib/gui/app/models/store.ts +++ b/lib/gui/app/models/store.ts @@ -71,8 +71,10 @@ const DEFAULT_STATE = Immutable.fromJS({ failed: 0, percentage: 0, speed: null, + averageSpeed: null, totalSpeed: null, }, + lastAverageFlashingSpeed: null, }); /** @@ -263,7 +265,11 @@ function storeReducer( }); } - return state.set('flashState', Immutable.fromJS(action.data)); + let ret = state.set('flashState', Immutable.fromJS(action.data)); + if (action.data.flashing) { + ret = ret.set('lastAverageFlashingSpeed', action.data.averageSpeed); + } + return ret; } case Actions.RESET_FLASH_STATE: { @@ -326,9 +332,19 @@ function storeReducer( }); } + if (action.data.results) { + action.data.results.averageFlashingSpeed = state.get( + 'lastAverageFlashingSpeed', + ); + } + return state .set('isFlashing', false) .set('flashResults', Immutable.fromJS(action.data)) + .set( + 'lastAverageFlashingSpeed', + DEFAULT_STATE.get('lastAverageFlashingSpeed'), + ) .set('flashState', DEFAULT_STATE.get('flashState')); } diff --git a/lib/gui/app/modules/drive-scanner.ts b/lib/gui/app/modules/drive-scanner.ts index e7b5946d..5d236e19 100644 --- a/lib/gui/app/modules/drive-scanner.ts +++ b/lib/gui/app/modules/drive-scanner.ts @@ -27,7 +27,7 @@ function includeSystemDrives() { } const adapters: sdk.scanner.adapters.Adapter[] = [ - new sdk.scanner.adapters.BlockDeviceAdapter(includeSystemDrives), + new sdk.scanner.adapters.BlockDeviceAdapter({ includeSystemDrives }), ]; // Can't use permissions.isElevated() here as it returns a promise and we need to set diff --git a/lib/gui/app/modules/image-writer.ts b/lib/gui/app/modules/image-writer.ts index 81d79661..e0f5a9c2 100644 --- a/lib/gui/app/modules/image-writer.ts +++ b/lib/gui/app/modules/image-writer.ts @@ -185,7 +185,6 @@ export function performWrite( cancelled = true; }); - // @ts-ignore ipc.server.on('state', onProgress); ipc.server.on('ready', (_data, socket) => { diff --git a/lib/gui/app/pages/main/MainPage.tsx b/lib/gui/app/pages/main/MainPage.tsx index cd6b9a77..2be480c5 100644 --- a/lib/gui/app/pages/main/MainPage.tsx +++ b/lib/gui/app/pages/main/MainPage.tsx @@ -46,7 +46,6 @@ function getDrivesTitle() { const drives = selectionState.getSelectedDrives(); if (drives.length === 1) { - // @ts-ignore return drives[0].description || 'Untitled Device'; } diff --git a/lib/gui/app/pages/main/styles/_main.scss b/lib/gui/app/pages/main/styles/_main.scss index 3da1468b..66570361 100644 --- a/lib/gui/app/pages/main/styles/_main.scss +++ b/lib/gui/app/pages/main/styles/_main.scss @@ -165,7 +165,6 @@ img[disabled] { .target-status-line { display: flex; align-items: baseline; - margin-bottom: 9px; > .target-status-dot { width: 12px; diff --git a/lib/gui/css/main.css b/lib/gui/css/main.css index f59bef03..542c5c30 100644 --- a/lib/gui/css/main.css +++ b/lib/gui/css/main.css @@ -6347,8 +6347,7 @@ img[disabled] { .target-status-line { display: flex; - align-items: baseline; - margin-bottom: 9px; } + align-items: baseline; } .target-status-line > .target-status-dot { width: 12px; height: 12px; diff --git a/lib/gui/modules/child-writer.ts b/lib/gui/modules/child-writer.ts index d479a89d..dd4d90d3 100644 --- a/lib/gui/modules/child-writer.ts +++ b/lib/gui/modules/child-writer.ts @@ -97,24 +97,22 @@ async function writeAndValidate( ): Promise { let innerSource: sdk.sourceDestination.SourceDestination = await source.getInnerSource(); if (trim && (await innerSource.canRead())) { - // @ts-ignore FIXME: ts thinks that SparseReadStream can't be assigned to SparseReadable (which it implements) - innerSource = new sdk.sourceDestination.ConfiguredSource( - innerSource, - trim, - // Create stream from file-disk (not source stream) - true, - ); + innerSource = new sdk.sourceDestination.ConfiguredSource({ + source: innerSource, + shouldTrimPartitions: trim, + createStreamFromDisk: true, + }); } const { failures, bytesWritten, } = await sdk.multiWrite.pipeSourceToDestinations( innerSource, - // @ts-ignore FIXME: ts thinks that BlockWriteStream can't be assigned to WritableStream (which it implements) destinations, onFail, onProgress, verify, + 32, ); const result: WriteResult = { bytesWritten, @@ -125,8 +123,9 @@ async function writeAndValidate( errors: [], }; for (const [destination, error] of failures) { - (error as Error & { device: string }).device = destination.drive.device; - result.errors.push(error); + const err = error as Error & { device: string }; + err.device = (destination as sdk.sourceDestination.BlockDevice).device; + result.errors.push(err); } return result; } @@ -218,18 +217,18 @@ ipc.connectTo(IPC_SERVER_ID, () => { log(`Validate on success: ${options.validateWriteOnSuccess}`); log(`Trim: ${options.trim}`); const dests = _.map(options.destinations, destination => { - return new sdk.sourceDestination.BlockDevice( - destination, - options.unmountOnSuccess, - ); + return new sdk.sourceDestination.BlockDevice({ + drive: destination, + unmountOnSuccess: options.unmountOnSuccess, + write: true, + direct: true, + }); + }); + const source = new sdk.sourceDestination.File({ + path: options.imagePath, }); - const source = new sdk.sourceDestination.File( - options.imagePath, - sdk.sourceDestination.File.OpenFlags.Read, - ); try { const results = await writeAndValidate( - // @ts-ignore FIXME: ts thinks that SparseWriteStream can't be assigned to SparseWritable (which it implements) source, dests, options.validateWriteOnSuccess, diff --git a/lib/shared/messages.ts b/lib/shared/messages.ts index 32ca61e6..c0537226 100644 --- a/lib/shared/messages.ts +++ b/lib/shared/messages.ts @@ -14,7 +14,9 @@ * limitations under the License. */ -export const progress = { +import { Dictionary } from 'lodash'; + +export const progress: Dictionary<(quantity: number) => string> = { successful: (quantity: number) => { const plural = quantity === 1 ? '' : 's'; return `Successful device${plural}`; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 86426f46..a9465d01 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -343,6 +343,19 @@ "fastq": "^1.6.0" } }, + "@ronomon/direct-io": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@ronomon/direct-io/-/direct-io-3.0.1.tgz", + "integrity": "sha512-NkKB32bjq7RfMdAMiWayphMlVWzsfPiKelK+btXLqggv1vDVgv2xELqeo0z4uYLLt86fVReLPxQj7qpg0zWvow==", + "requires": { + "@ronomon/queue": "^3.0.1" + } + }, + "@ronomon/queue": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@ronomon/queue/-/queue-3.0.1.tgz", + "integrity": "sha512-STcqSvk+c7ArMrZgYxhM92p6O6F7t0SUbGr+zm8s9fJple5EdJAMwP3dXqgdXeF95xWhBpha5kjEqNAIdI0r4w==" + }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", @@ -416,9 +429,9 @@ "dev": true }, "@types/bluebird": { - "version": "3.5.29", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.29.tgz", - "integrity": "sha512-kmVtnxTuUuhCET669irqQmPAez4KFnFVKvpleVRyfC3g+SHD1hIkFZcWLim9BVcwUBLO59o8VZE4yGCmTif8Yw==", + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.30.tgz", + "integrity": "sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw==", "dev": true }, "@types/caseless": { @@ -1840,17 +1853,28 @@ } }, "bl": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", - "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", + "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", "requires": { - "readable-stream": "^3.0.1" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" }, "dependencies": { + "buffer": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1869,9 +1893,9 @@ } }, "blockmap": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/blockmap/-/blockmap-4.0.0.tgz", - "integrity": "sha512-ykHgcaMZ3cPFEWku4Xz7+s7AsdfUE1x6dR7ZmaKIipu77eyq+XnBCI06Ez0VWpQfmLV/9Bsl9Qw+7cvNCNFWJA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/blockmap/-/blockmap-4.0.1.tgz", + "integrity": "sha512-ktam+finx4xUQQNbKRBD6VXiULFCb814/N50QBWyD2e6nrWc3QvuMISDLKnSnK64pTnQUMA9dRWpyGFK9ZIchw==", "requires": { "debug": "^3.1.0", "xml-js": "^1.6.11" @@ -1883,9 +1907,9 @@ "integrity": "sha1-E/kwNaTtPG0pUwgkkkWg7XZ7NeI=" }, "bluebird": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", - "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==" + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "bluebird-lst": { "version": "1.0.9", @@ -5402,13 +5426,13 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "etcher-sdk": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-2.0.17.tgz", - "integrity": "sha512-9RgYlugEFLFo+nMuXeBNPT9ODg89CmEsjjJW597MKx4WNIZWoCQXQJR1qw2uu3ZT5JuqPq82xz1/9PaiW2mSng==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-3.0.1.tgz", + "integrity": "sha512-Jd30W0OfKNwbQZ4NdsNLCItyPYNP3hIugJrG/V5uzBtpL4R+gldMrUopkJ1L0x59d9NwWavQ/CqM6gxrv3tVlw==", "requires": { - "@types/node": "^6.0.112", + "@ronomon/direct-io": "^3.0.1", "axios": "^0.18.0", - "blockmap": "^4.0.0", + "blockmap": "^4.0.1", "bluebird": "^3.5.1", "crc": "^3.8.0", "debug": "^3.1.0", @@ -5416,26 +5440,19 @@ "file-disk": "^6.0.1", "file-type": "^8.0.0", "lodash": "^4.17.10", - "lzma-native": "^4.0.5", + "lzma-native": "^6.0.0", "mountutils": "^1.3.18", "node-raspberrypi-usbboot": "^0.2.4", "outdent": "^0.7.0", "partitioninfo": "^5.3.4", - "readable-stream": "^2.3.6", "resin-image-fs": "^5.0.8", + "rwmutex": "^1.0.0", "speedometer": "^1.0.0", - "udif": "^0.15.7", + "udif": "^0.17.0", "unbzip2-stream": "github:balena-io-modules/unbzip2-stream#942fc218013c14adab01cf693b0500cf6ac83193", "unzip-stream": "^0.3.0", "xxhash": "^0.3.0", "yauzl": "^2.9.2" - }, - "dependencies": { - "@types/node": { - "version": "6.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-6.14.9.tgz", - "integrity": "sha512-leP/gxHunuazPdZaCvsCefPQxinqUDsCxCR5xaDUrY2MkYxQRFZZwU5e7GojyYsGB7QVtCi7iVEl/hoFXQYc+w==" - } } }, "event-emitter": { @@ -8375,14 +8392,14 @@ } }, "lzma-native": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lzma-native/-/lzma-native-4.0.6.tgz", - "integrity": "sha512-1kiSs/KAcAuh9vyyd00ATXZFfrg6W8UCBqH1RKlWg/tBP5aQez6HYOY+SihmsZfpy0RVDioW5SLI76dZ3Mq5Rw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lzma-native/-/lzma-native-6.0.0.tgz", + "integrity": "sha512-rf5f4opPymsPHotgY2d0cUP3kbVxERSxWDGEbi2gnbnxuWGokFrBaQ02Oe9pssIwsgp0r0PnbSNg7VPY3AYe7w==", "requires": { - "nan": "^2.14.0", + "node-addon-api": "^1.6.0", "node-pre-gyp": "^0.11.0", "readable-stream": "^2.3.5", - "rimraf": "^2.6.1" + "rimraf": "^2.7.1" } }, "make-dir": { @@ -8698,9 +8715,9 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "mimic-response": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", - "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" }, "minify": { "version": "4.1.3", @@ -8847,6 +8864,11 @@ } } }, + "mkdirp-classic": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.2.tgz", + "integrity": "sha512-ejdnDQcR75gwknmMw/tx02AuRs8jCtqFoFqDZMjiNxsu85sRIJVXDKHuLYvUUPRBUtV2FpSZa9bL1BUa3BdR2g==" + }, "mocha": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.1.tgz", @@ -9272,14 +9294,14 @@ } }, "napi-build-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", - "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, "needle": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.2.tgz", - "integrity": "sha512-DUzITvPVDUy6vczKKYTnWc/pBZ0EnjMJnQ3y+Jo5zfKFimJs7S3HFCxCRZYB9FUZcrzUQr3WsmvZgddMEIZv6w==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.1.tgz", + "integrity": "sha512-x/gi6ijr4B7fwl6WYL9FwlCvRQKGlUNvnceho8wxkwXqN8jvVmmmATTmZPRRG7b/yC1eode26C2HO9jl78Du9g==", "requires": { "debug": "^3.2.6", "iconv-lite": "^0.4.4", @@ -9326,13 +9348,18 @@ } }, "node-abi": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.14.0.tgz", - "integrity": "sha512-y54KGgEOHnRHlGQi7E5UiryRkH8bmksmQLj/9iLAjoje743YS+KaKB/sDYXgqtT0J16JT3c3AYJZNI98aU/kYg==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.15.0.tgz", + "integrity": "sha512-FeLpTS0F39U7hHZU1srAK4Vx+5AHNVOTP+hxBNQknR/54laTHSFIJkDWDqiquY1LeLUgTfPN7sLPhMubx0PLAg==", "requires": { "semver": "^5.4.1" } }, + "node-addon-api": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.1.tgz", + "integrity": "sha512-2+DuKodWvwRTrCfKOeR24KIc5unKjOh8mz17NCzVnHWfjAdDqbfbjqh7gUT+BkXBRQM52+xCHciKWonJ3CbJMQ==" + }, "node-environment-flags": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", @@ -9553,9 +9580,9 @@ "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" }, "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "requires": { "abbrev": "1", "osenv": "^0.1.4" @@ -9908,9 +9935,9 @@ } }, "outdent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.7.0.tgz", - "integrity": "sha512-Ue462G+UIFoyQmOzapGIKWS3d/9NHeD/018WGEDZIhN2/VaQpVXbofMcZX0socv1fw4/tmEn7Vd3McOdPZfKzQ==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.7.1.tgz", + "integrity": "sha512-VjIzdUHunL74DdhcwMDt5FhNDQ8NYmTkuW0B+usIV2afS9aWT/1c9z1TsnFW349TP3nxmYeUl7Z++XpJRByvgg==" }, "p-cancelable": { "version": "1.1.0", @@ -11122,9 +11149,9 @@ } }, "resin-image-fs": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/resin-image-fs/-/resin-image-fs-5.0.8.tgz", - "integrity": "sha512-m3DPKAdErmgxMkOhGP9NOyqZor0DADkuDKb38XSjlhxj5lJMEtLi7AuZauyl4ysINc4u+ljMDW9IqGNpXhFcXw==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/resin-image-fs/-/resin-image-fs-5.0.9.tgz", + "integrity": "sha512-fBCJjF6GeqRveum3cJCBf9E0AtIA7qtVccXU6bmoyEEixA0AxWDqp/nJ5+PjIL26/bpaX95vo7Mscyr8Q1UNfQ==", "requires": { "bluebird": "^3.5.1", "ext2fs": "^1.0.28", @@ -11382,6 +11409,14 @@ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", "integrity": "sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q=" }, + "rwmutex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rwmutex/-/rwmutex-1.0.0.tgz", + "integrity": "sha1-/dHqaoe3f0SecteF+eonTL4UDe0=", + "requires": { + "debug": "^3.0.1" + } + }, "rx-lite": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", @@ -12727,22 +12762,22 @@ } }, "tar-fs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", - "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz", + "integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==", "requires": { "chownr": "^1.1.1", - "mkdirp": "^0.5.1", + "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.0.0" } }, "tar-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", - "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz", + "integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==", "requires": { - "bl": "^3.0.0", + "bl": "^4.0.1", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", @@ -12750,9 +12785,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -13263,14 +13298,26 @@ "integrity": "sha512-8OaIKfzL5cpx8eCMAhhvTlft8GYF8b2eQr6JkCyVdrgjcytyOmPCXrqXFcUnhonRpLlh5yxEZVohm6mzaowUOw==" }, "udif": { - "version": "0.15.7", - "resolved": "https://registry.npmjs.org/udif/-/udif-0.15.7.tgz", - "integrity": "sha512-rLzT/RZs6aD13oKHcuU4XiKeJXWX0ZiL6GgTpXt21XWM4jSxOjZHurRwaPkXYmFpTqt+VSht06oUd5mx1KjpyA==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/udif/-/udif-0.17.0.tgz", + "integrity": "sha512-59bQzrlk/MjbEg3Sv+jrCGOc44V4whyXE2ZlI5O3GWMECUpnM4Wfb5CUc20AV2Plbw8Owq6SaBJRbkkK1DSMPw==", "requires": { "apple-data-compression": "^0.4.0", "plist": "^3.0.1", - "readable-stream": "^2.3.6", + "readable-stream": "^3.3.0", "seek-bzip": "^1.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "uglify-js": { @@ -14469,4 +14516,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 031ef756..f95c955d 100644 --- a/package.json +++ b/package.json @@ -55,13 +55,13 @@ "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.7", "bindings": "^1.3.0", - "bluebird": "^3.5.3", + "bluebird": "^3.7.2", "bootstrap-sass": "^3.3.6", "color": "^2.0.1", "d3": "^4.13.0", "debug": "^3.1.0", "electron-updater": "4.0.6", - "etcher-sdk": "^2.0.17", + "etcher-sdk": "^3.0.1", "flexboxgrid": "^6.3.0", "immutable": "^3.8.1", "inactivity-timer": "^1.0.0", @@ -88,6 +88,7 @@ }, "devDependencies": { "@types/bindings": "^1.3.0", + "@types/bluebird": "^3.5.30", "@types/chai": "^4.2.7", "@types/mime-types": "^2.1.0", "@types/mocha": "^5.2.7", diff --git a/tests/gui/models/flash-state.spec.ts b/tests/gui/models/flash-state.spec.ts index c9323f71..c1af703c 100644 --- a/tests/gui/models/flash-state.spec.ts +++ b/tests/gui/models/flash-state.spec.ts @@ -36,6 +36,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -51,6 +52,7 @@ describe('Model: flashState', function() { failed: 0, percentage: 0, speed: null, + averageSpeed: null, totalSpeed: null, }); }); @@ -106,6 +108,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -126,6 +129,7 @@ describe('Model: flashState', function() { percentage: 0, eta: 15, speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -146,6 +150,7 @@ describe('Model: flashState', function() { percentage: 101, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 1, bytes: 0, position: 0, @@ -166,6 +171,7 @@ describe('Model: flashState', function() { percentage: -1, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 1, bytes: 0, position: 0, @@ -186,6 +192,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 0, speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -207,6 +214,7 @@ describe('Model: flashState', function() { // @ts-ignore eta: '15', speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -227,6 +235,7 @@ describe('Model: flashState', function() { type: 'flashing', percentage: 50, eta: 15, + averageSpeed: 0, totalSpeed: 1, bytes: 0, position: 0, @@ -247,6 +256,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 1, bytes: 0, position: 0, @@ -268,6 +278,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 1, + averageSpeed: 1, bytes: 0, position: 0, active: 0, @@ -287,6 +298,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 0, bytes: 0, position: 0, @@ -306,6 +318,7 @@ describe('Model: flashState', function() { percentage: 50.253559459485, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 1, bytes: 0, position: 0, @@ -330,6 +343,7 @@ describe('Model: flashState', function() { percentage: 0, eta: 0, speed: 0, + averageSpeed: 0, totalSpeed: 0, bytes: 0, position: 0, @@ -350,6 +364,7 @@ describe('Model: flashState', function() { percentage: 0, eta: 0, speed: 0, + averageSpeed: 0, totalSpeed: 0, bytes: 0, position: 0, @@ -386,6 +401,7 @@ describe('Model: flashState', function() { failed: 0, percentage: 0, speed: null, + averageSpeed: null, totalSpeed: null, }); }); @@ -399,6 +415,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 0, bytes: 0, position: 0, @@ -417,6 +434,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 0, + averageSpeed: 0, totalSpeed: 0, bytes: 0, position: 0, @@ -522,6 +540,7 @@ describe('Model: flashState', function() { percentage: 50, eta: 15, speed: 100000000000, + averageSpeed: 100000000000, totalSpeed: 200000000000, bytes: 0, position: 0, @@ -535,6 +554,7 @@ describe('Model: flashState', function() { failed: 0, percentage: 0, speed: 0, + averageSpeed: 0, totalSpeed: 0, }); @@ -550,6 +570,7 @@ describe('Model: flashState', function() { failed: 0, percentage: 0, speed: null, + averageSpeed: null, totalSpeed: null, }); });