electron-info
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -0,1 +1,7 @@ | ||
# [1.7.0](https://github.com/ffflorian/electron-info/compare/v1.6.1...v1.7.0) (2019-07-25) | ||
### Features | ||
- Don't return void ([#6](https://github.com/ffflorian/electron-info/issues/6)) ([77a6e56](https://github.com/ffflorian/electron-info/commit/77a6e56)) | ||
## [1.6.1](https://github.com/ffflorian/electron-info/compare/v1.6.0...v1.6.1) (2019-07-25) | ||
@@ -2,0 +8,0 @@ |
@@ -44,3 +44,3 @@ #!/usr/bin/env node | ||
})); | ||
for (const dependency of ElectronInfo_1.SupportedDependencies) { | ||
for (const dependency in ElectronInfo_1.SupportedDependencies) { | ||
program | ||
@@ -47,0 +47,0 @@ .command(dependency) |
@@ -32,3 +32,3 @@ export interface RawDeps { | ||
} | ||
export declare const SupportedDependencies: Array<keyof RawDeps>; | ||
export declare const SupportedDependencies: RawDeps; | ||
export declare class ElectronInfo { | ||
@@ -39,6 +39,6 @@ private readonly options; | ||
getAllReleases(formatted: true, colored?: boolean): Promise<string>; | ||
getDependencyReleases(dependency: keyof RawDeps, version: string, formatted?: false): Promise<RawReleaseInfo[] | void>; | ||
getDependencyReleases(dependency: keyof RawDeps, version: string, formatted: true, colored?: boolean): Promise<RawReleaseInfo[] | string | void>; | ||
getElectronReleases(version: string, formatted?: false): Promise<RawReleaseInfo[] | void>; | ||
getElectronReleases(version: string, formatted: true, colored?: boolean): Promise<string | void>; | ||
getDependencyReleases(dependency: keyof RawDeps, version: string, formatted?: false): Promise<RawReleaseInfo[]>; | ||
getDependencyReleases(dependency: keyof RawDeps, version: string, formatted: true, colored?: boolean): Promise<RawReleaseInfo[] | string>; | ||
getElectronReleases(version: string, formatted?: false): Promise<RawReleaseInfo[]>; | ||
getElectronReleases(version: string, formatted: true, colored?: boolean): Promise<string>; | ||
private buildFoundString; | ||
@@ -45,0 +45,0 @@ private fileIsReadable; |
@@ -30,3 +30,11 @@ "use strict"; | ||
}; | ||
exports.SupportedDependencies = ['chrome', 'modules', 'node', 'openssl', 'uv', 'v8', 'zlib']; | ||
exports.SupportedDependencies = { | ||
chrome: 'Chrome', | ||
modules: 'Modules', | ||
node: 'Node.js', | ||
openssl: 'OpenSSL', | ||
uv: 'uv', | ||
v8: 'V8', | ||
zlib: 'zlib', | ||
}; | ||
class ElectronInfo { | ||
@@ -50,8 +58,6 @@ constructor(options) { | ||
const filteredReleases = allReleases.filter(release => release.deps && parsedVersions.includes(release.deps[dependency])); | ||
if (filteredReleases) { | ||
if (formatted) { | ||
return this.formatDependencyReleases(filteredReleases, colored); | ||
} | ||
return filteredReleases; | ||
if (formatted) { | ||
return this.formatDependencyReleases(filteredReleases, colored); | ||
} | ||
return filteredReleases; | ||
}); | ||
@@ -64,8 +70,6 @@ } | ||
const electronReleases = allReleases.filter(release => parsedVersions.includes(release.version)); | ||
if (electronReleases) { | ||
if (formatted) { | ||
return this.formatReleases(electronReleases, colored); | ||
} | ||
return electronReleases; | ||
if (formatted) { | ||
return this.formatReleases(electronReleases, colored); | ||
} | ||
return electronReleases; | ||
}); | ||
@@ -109,11 +113,11 @@ } | ||
buildRawTables(releases, colored = false) { | ||
const coloredOrNot = (text, style, colored = false) => colored ? style(text) : text; | ||
const coloredOrNot = (text, style) => (colored ? style(text) : text); | ||
return releases.map(release => { | ||
const electronVersion = `${release.version}${release.prerelease ? ' (prerelease)' : ''}`; | ||
const table = [ | ||
[coloredOrNot('Dependency', bold, colored), coloredOrNot('Version', bold, colored)], | ||
[coloredOrNot('Electron', bold, colored), electronVersion], | ||
[coloredOrNot('Dependency', bold), coloredOrNot('Version', bold)], | ||
[coloredOrNot('Electron', bold), electronVersion], | ||
]; | ||
if (release.deps) { | ||
table.push([coloredOrNot('Node.js', bold.red, colored), release.deps.node], [coloredOrNot('Chrome', bold.green, colored), release.deps.chrome], [coloredOrNot('OpenSSL', bold.blue, colored), release.deps.openssl], [coloredOrNot('Modules', bold.yellow, colored), release.deps.modules], [coloredOrNot('uv', bold.cyan, colored), release.deps.uv], [coloredOrNot('V8', bold.gray, colored), release.deps.v8], [coloredOrNot('zlib', bold.magenta, colored), release.deps.zlib]); | ||
table.push([coloredOrNot('Node.js', bold.red), release.deps.node], [coloredOrNot('Chrome', bold.green), release.deps.chrome], [coloredOrNot('OpenSSL', bold.blue), release.deps.openssl], [coloredOrNot('Modules', bold.yellow), release.deps.modules], [coloredOrNot('uv', bold.cyan), release.deps.uv], [coloredOrNot('V8', bold.gray), release.deps.v8], [coloredOrNot('zlib', bold.magenta), release.deps.zlib]); | ||
} | ||
@@ -120,0 +124,0 @@ return table; |
@@ -20,7 +20,13 @@ { | ||
"@semantic-release/npm": "5.1.13", | ||
"@types/fs-extra": "8.0.0", | ||
"@types/jasmine": "3.3.15", | ||
"@types/nock": "10.0.3", | ||
"@types/node": "~12", | ||
"@types/semver": "6.0.1", | ||
"@types/table": "4.0.6", | ||
"fs-extra": "8.1.0", | ||
"husky": "3.0.1", | ||
"jasmine": "3.4.0", | ||
"lint-staged": "9.2.1", | ||
"nock": "10.0.6", | ||
"prettier": "1.18.2", | ||
@@ -48,2 +54,6 @@ "rimraf": "2.6.3", | ||
"cli", | ||
"info", | ||
"electron", | ||
"release", | ||
"version", | ||
"typescript" | ||
@@ -70,14 +80,16 @@ ], | ||
"dist": "yarn clean && yarn build", | ||
"fix": "yarn fix:other && yarn fix:ts", | ||
"fix": "yarn fix:other && yarn fix:ts && yarn fix:ts:tests", | ||
"fix:other": "yarn prettier --write", | ||
"fix:ts": "yarn lint:ts --fix", | ||
"lint": "yarn lint:ts && yarn lint:other", | ||
"fix:ts:tests": "yarn lint:ts:tests --fix", | ||
"lint": "yarn lint:other && yarn lint:ts && yarn lint:ts:tests", | ||
"lint:other": "yarn prettier --list-different", | ||
"lint:ts": "tslint --project tsconfig.json", | ||
"lint:ts:tests": "tslint --project tsconfig.jasmine.json", | ||
"prettier": "prettier \"*.{json,md}\"", | ||
"release": "semantic-release", | ||
"start": "ts-node src/cli.ts", | ||
"test": "exit 0" | ||
"test": "ts-node -P tsconfig.jasmine.json node_modules/.bin/jasmine" | ||
}, | ||
"version": "1.6.1" | ||
"version": "1.7.0" | ||
} |
@@ -1,13 +0,11 @@ | ||
# electron-info [![Build Status](https://action-badges.now.sh/ffflorian/electron-info)](https://github.com/ffflorian/electron-info/actions/) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ffflorian/electron-info)](https://dependabot.com) | ||
# 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) | ||
Get informations about Electron versions. | ||
Get informations about Electron versions. Uses [electron-releases](https://unpkg.com/electron-releases@latest/lite.json). | ||
## Installation | ||
``` | ||
yarn global add electron-info | ||
# or | ||
npm i -g electron-info | ||
``` | ||
Just run `npx electron-info`. | ||
If you'd like to install it permanently, run `yarn global add electron-info` or `npm i -g electron-info`. | ||
## CLI Usage | ||
@@ -42,4 +40,4 @@ | ||
``` | ||
electron-info electron 4 | ||
```shell | ||
$ electron-info electron 4 | ||
╔════════════╤═══════════════════════╗ | ||
@@ -78,3 +76,3 @@ ║ Dependency │ Version ║ | ||
``` | ||
```shell | ||
$ electron-info chrome 71 | ||
@@ -81,0 +79,0 @@ ╔════════════╤═════════════════════════════════════╗ |
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
33364
308
24
112