diff --git a/package.json b/package.json index 262e575..2ff5981 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nexe", "description": "Create a single executable out of your Node.js application", "license": "MIT", - "version": "3.0.0-beta.17", + "version": "3.0.0-beta.18", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", @@ -36,41 +36,41 @@ "@calebboyd/semaphore": "^1.3.1", "app-builder": "^5.2.0", "caw": "^2.0.1", - "chalk": "^2.4.1", - "cherow": "1.6.8", + "chalk": "^2.4.2", + "cherow": "1.6.9", "download": "^7.1.0", - "globby": "^8.0.1", - "got": "^9.5.0", + "globby": "^9.1.0", + "got": "^9.6.0", "minimist": "^1.2.0", "mkdirp": "^0.5.1", "multistream": "^2.1.1", - "ora": "^3.0.0", + "ora": "^3.2.0", "pify": "^4.0.1", - "resolve-dependencies": "^2.2.1", - "rimraf": "^2.6.2" + "resolve-dependencies": "^2.2.2", + "rimraf": "^2.6.3" }, "devDependencies": { "@types/chai": "^4.1.7", "@types/download": "^6.2.4", "@types/execa": "^0.9.0", - "@types/globby": "^8.0.0", - "@types/got": "^9.2.2", + "@types/globby": "^9.1.0", + "@types/got": "^9.4.1", "@types/minimist": "^1.2.0", "@types/mkdirp": "^0.5.2", - "@types/mocha": "^5.2.5", + "@types/mocha": "^5.2.6", "@types/multistream": "^2.1.1", - "@types/ora": "^1.3.4", + "@types/ora": "^3.2.0", "@types/pify": "3.0.2", "@types/rimraf": "2.0.2", "@types/semver": "^5.5.0", "chai": "^4.2.0", "execa": "^1.0.0", - "mocha": "^5.2.0", - "prettier": "^1.15.3", - "ts-node": "^7.0.1", - "tslint": "^5.12.0", - "tslint-config-prettier": "^1.17.0", + "mocha": "^6.0.2", + "prettier": "^1.16.4", + "ts-node": "^8.0.3", + "tslint": "^5.14.0", + "tslint-config-prettier": "^1.18.0", "tslint-plugin-prettier": "^2.0.1", - "typescript": "^3.2.2" + "typescript": "^3.4.1" } } diff --git a/src/logger.ts b/src/logger.ts index 7f8bd73..45ff0ff 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,5 +1,5 @@ -import colors = require('chalk') -import ora = require('ora') +import colors from 'chalk' +import ora from 'ora' const frameLength = 120 diff --git a/src/steps/download.ts b/src/steps/download.ts index a84a74d..85537f9 100644 --- a/src/steps/download.ts +++ b/src/steps/download.ts @@ -23,7 +23,7 @@ function fetchNodeSourceAsync(dest: string, url: string, step: LogStep, options .then(() => step.log(`Node source extracted to: ${dest}`)) } -async function fetchPrebuiltBinary (compiler: NexeCompiler, step: any) { +async function fetchPrebuiltBinary(compiler: NexeCompiler, step: any) { let downloadOptions = compiler.options.downloadOptions const target = compiler.target @@ -43,17 +43,18 @@ async function fetchPrebuiltBinary (compiler: NexeCompiler, step: any) { } const filename = compiler.getNodeExecutableLocation(target) - await download(asset.browser_download_url, dirname(filename), compiler.options.downloadOptions).on( - 'response', - (res: IncomingMessage) => { - const total = +res.headers['content-length']! - let current = 0 - res.on('data', data => { - current += data.length - step!.modify(`Downloading...${((current / total) * 100).toFixed()}%`) - }) - } - ) + await download( + asset.browser_download_url, + dirname(filename), + compiler.options.downloadOptions + ).on('response', (res: IncomingMessage) => { + const total = +res.headers['content-length']! + let current = 0 + res.on('data', data => { + current += data.length + step!.modify(`Downloading...${((current / total) * 100).toFixed()}%`) + }) + }) } /** @@ -62,17 +63,13 @@ async function fetchPrebuiltBinary (compiler: NexeCompiler, step: any) { * @param {*} next */ export default async function downloadNode(compiler: NexeCompiler, next: () => Promise) { - const { - src, - log, - target - } = compiler, - { version } = target, - { sourceUrl, downloadOptions, build } = compiler.options, - url = sourceUrl || `https://nodejs.org/dist/v${version}/node-v${version}.tar.gz` - const step = log.step(`Downloading ${build ? '' : 'pre-built '}Node.js${ - build ? `source from: ${url}` : '' - }`) + const { src, log, target } = compiler, + { version } = target, + { sourceUrl, downloadOptions, build } = compiler.options, + url = sourceUrl || `https://nodejs.org/dist/v${version}/node-v${version}.tar.gz` + const step = log.step( + `Downloading ${build ? '' : 'pre-built '}Node.js${build ? `source from: ${url}` : ''}` + ) const exeLocation = compiler.getNodeExecutableLocation(build ? undefined : target) const downloadExists = await pathExistsAsync(build ? src : exeLocation) diff --git a/src/steps/resource.ts b/src/steps/resource.ts index d49fd84..8f4d116 100644 --- a/src/steps/resource.ts +++ b/src/steps/resource.ts @@ -1,5 +1,5 @@ import { isDirectoryAsync, each } from '../util' -import * as globs from 'globby' +import globs from 'globby' import { NexeCompiler } from '../compiler' export default async function resource(compiler: NexeCompiler, next: () => Promise) {