electron-info
Advanced tools
Comparing version 1.12.0 to 1.13.0
@@ -0,1 +1,7 @@ | ||
# [1.13.0](https://github.com/ffflorian/electron-info/compare/v1.12.0...v1.13.0) (2019-09-05) | ||
### Features | ||
- Add custom HTTP timeout ([#45](https://github.com/ffflorian/electron-info/issues/45)) ([a187352](https://github.com/ffflorian/electron-info/commit/a187352)) | ||
# [1.12.0](https://github.com/ffflorian/electron-info/compare/v1.11.2...v1.12.0) (2019-08-23) | ||
@@ -2,0 +8,0 @@ |
#!/usr/bin/env node | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -32,2 +33,3 @@ }); | ||
.option('-s, --source <url>', 'Use a custom releases source URL or path') | ||
.option('-t, --timeout <number>', 'Use a custom HTTP timeout') | ||
.option('--no-colors', `Don't use colors for displaying`) | ||
@@ -41,3 +43,3 @@ .option('--no-prereleases', `Don't include Electron prereleases`) | ||
.arguments('[version]') | ||
.action((version, { parent }) => __awaiter(this, void 0, void 0, function* () { | ||
.action((version, { parent }) => __awaiter(void 0, void 0, void 0, function* () { | ||
matchedCommand = true; | ||
@@ -50,3 +52,3 @@ if (!version) { | ||
try { | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign({}, (parent.debug && { debug: true }), (parent.force && { forceUpdate: true }), (parent.limit && { limit: parseInt(parent.limit, 10) }), (parent.prereleases && { electronPrereleases: parent.prereleases }), (parent.source && { releasesUrl: parent.source }))); | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (parent.debug && { debug: true })), (parent.force && { forceUpdate: true })), (parent.limit && { limit: parseInt(parent.limit, 10) })), (parent.prereleases && { electronPrereleases: parent.prereleases })), (parent.source && { releasesUrl: parent.source })), (parent.timeout && { timeout: parseInt(parent.timeout, 10) }))); | ||
const releases = parent.raw | ||
@@ -68,3 +70,3 @@ ? yield electronInfo.getElectronReleases(version) | ||
.arguments('[version]') | ||
.action((version, { parent }) => __awaiter(this, void 0, void 0, function* () { | ||
.action((version, { parent }) => __awaiter(void 0, void 0, void 0, function* () { | ||
matchedCommand = true; | ||
@@ -77,3 +79,3 @@ if (!version) { | ||
try { | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign({}, (parent.debug && { debug: true }), (parent.force && { forceUpdate: true }), (parent.limit && { limit: parseInt(parent.limit, 10) }), (parent.prereleases && { electronPrereleases: parent.prereleases }), (parent.source && { releasesUrl: parent.source }))); | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (parent.debug && { debug: true })), (parent.force && { forceUpdate: true })), (parent.limit && { limit: parseInt(parent.limit, 10) })), (parent.prereleases && { electronPrereleases: parent.prereleases })), (parent.source && { releasesUrl: parent.source })), (parent.timeout && { timeout: parent.timeout }))); | ||
const releases = parent.raw | ||
@@ -94,6 +96,6 @@ ? yield electronInfo.getDependencyReleases(dependency, version) | ||
.description('Get informations about all releases') | ||
.action(({ parent }) => __awaiter(this, void 0, void 0, function* () { | ||
.action(({ parent }) => __awaiter(void 0, void 0, void 0, function* () { | ||
matchedCommand = true; | ||
try { | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign({}, (parent.debug && { debug: true }), (parent.force && { forceUpdate: true }), (parent.limit && { limit: parseInt(parent.limit, 10) }), (parent.prereleases && { electronPrereleases: parent.prereleases }), (parent.source && { releasesUrl: parent.source }))); | ||
const electronInfo = new ElectronInfo_1.ElectronInfo(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (parent.debug && { debug: true })), (parent.force && { forceUpdate: true })), (parent.limit && { limit: parseInt(parent.limit, 10) })), (parent.prereleases && { electronPrereleases: parent.prereleases })), (parent.source && { releasesUrl: parent.source })), (parent.timeout && { timeout: parent.timeout }))); | ||
const releases = parent.raw | ||
@@ -100,0 +102,0 @@ ? yield electronInfo.getAllReleases() |
@@ -37,2 +37,4 @@ export interface RawDeps { | ||
tempDirectory?: string; | ||
/** Use a custom HTTP timeout in milliseconds. Default is `2000`. */ | ||
timeout?: number; | ||
} | ||
@@ -39,0 +41,0 @@ export declare const SupportedDependencies: RawDeps; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -25,2 +26,3 @@ }); | ||
tempDirectory: '', | ||
timeout: 2000, | ||
}; | ||
@@ -38,3 +40,3 @@ exports.SupportedDependencies = { | ||
constructor(options) { | ||
this.options = Object.assign({}, defaultOptions, options); | ||
this.options = Object.assign(Object.assign({}, defaultOptions), options); | ||
this.options.limit = Math.max(0, this.options.limit); | ||
@@ -41,0 +43,0 @@ this.logger = logdown('electron-info/ElectronInfo', { |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -83,3 +84,11 @@ }); | ||
this.logger.log('Downloading releases file:', { downloadUrl, targetFile }); | ||
const { data: releases } = yield axios_1.default.get(downloadUrl); | ||
let releases = []; | ||
try { | ||
const response = yield axios_1.default.get(downloadUrl, { timeout: this.options.timeout }); | ||
releases = response.data; | ||
} | ||
catch (error) { | ||
this.logger.warn(`Request failed: "${error.message}"`); | ||
return []; | ||
} | ||
this.logger.info('Received data from server:', util_1.inspect(releases) | ||
@@ -86,0 +95,0 @@ .toString() |
@@ -9,3 +9,3 @@ { | ||
"chalk": "2.4.2", | ||
"commander": "3.0.0", | ||
"commander": "3.0.1", | ||
"logdown": "3.2.8", | ||
@@ -20,9 +20,7 @@ "moment": "2.24.0", | ||
"@ffflorian/prettier-config": "0.0.5", | ||
"@ffflorian/tslint-config": "0.5.0", | ||
"@ffflorian/tslint-config": "0.7.0", | ||
"@semantic-release/changelog": "3.0.4", | ||
"@semantic-release/git": "7.0.16", | ||
"@semantic-release/npm": "5.1.13", | ||
"@types/fs-extra": "8.0.0", | ||
"@types/jasmine": "3.4.0", | ||
"@types/nock": "10.0.3", | ||
"@types/node": "~12", | ||
@@ -34,9 +32,9 @@ "@types/parse-path": "4.0.0", | ||
"fs-extra": "8.1.0", | ||
"husky": "3.0.4", | ||
"husky": "3.0.5", | ||
"jasmine": "3.4.0", | ||
"lint-staged": "9.2.3", | ||
"nock": "10.0.6", | ||
"lint-staged": "9.2.5", | ||
"nock": "11.3.2", | ||
"prettier": "1.18.2", | ||
"rimraf": "3.0.0", | ||
"semantic-release": "15.13.21", | ||
"semantic-release": "15.13.24", | ||
"ts-node": "8.3.0", | ||
@@ -46,3 +44,3 @@ "tslint": "5.19.0", | ||
"tslint-plugin-prettier": "2.0.1", | ||
"typescript": "3.5.3", | ||
"typescript": "3.6.2", | ||
"uuid": "3.3.3" | ||
@@ -105,3 +103,3 @@ }, | ||
}, | ||
"version": "1.12.0" | ||
"version": "1.13.0" | ||
} |
@@ -24,22 +24,23 @@ # electron-info [![Build Status](https://action-badges.now.sh/ffflorian/electron-info)](https://github.com/ffflorian/electron-info/actions/) [![npm version](https://img.shields.io/npm/v/electron-info.svg?style=flat)](https://www.npmjs.com/package/electron-info) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ffflorian/electron-info)](https://dependabot.com) | ||
Options: | ||
-d, --debug Enable debug logging | ||
-f, --force Force downloading the latest release file | ||
-l, --limit <number> Limit output of releases | ||
-r, --raw Output raw JSON | ||
-s, --source <url> Use a custom releases source URL or path | ||
--no-colors Don't use colors for displaying | ||
--no-prereleases Don't include Electron prereleases | ||
-v, --version output the version number | ||
-h, --help output usage information | ||
-d, --debug Enable debug logging | ||
-f, --force Force downloading the latest release file | ||
-l, --limit <number> Limit output of releases | ||
-r, --raw Output raw JSON | ||
-s, --source <url> Use a custom releases source URL or path | ||
-t, --timeout <number> Use a custom HTTP timeout | ||
--no-colors Don't use colors for displaying | ||
--no-prereleases Don't include Electron prereleases | ||
-v, --version output the version number | ||
-h, --help output usage information | ||
Commands: | ||
electron|e [version] Get informations about an Electron release | ||
chrome|c [version] Get informations about a chrome release | ||
modules|m [version] Get informations about a modules release | ||
node|n [version] Get informations about a node release | ||
openssl|o [version] Get informations about an openssl release | ||
uv|u [version] Get informations about an uv release | ||
v8|v [version] Get informations about a v8 release | ||
zlib|z [version] Get informations about a zlib release | ||
all Get informations about all releases | ||
electron|e [version] Get informations about an Electron release | ||
chrome|c [version] Get informations about a chrome release | ||
modules|m [version] Get informations about a modules release | ||
node|n [version] Get informations about a node release | ||
openssl|o [version] Get informations about an openssl release | ||
uv|u [version] Get informations about an uv release | ||
v8|v [version] Get informations about a v8 release | ||
zlib|z [version] Get informations about a zlib release | ||
all|a Get informations about all releases | ||
``` | ||
@@ -46,0 +47,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56231
25
496
145
+ Addedcommander@3.0.1(transitive)
- Removedcommander@3.0.0(transitive)
Updatedcommander@3.0.1