command-line-basics
Advanced tools
Comparing version 0.6.2 to 0.7.0
# CHANGES for command-line-basics | ||
## 0.7.0 | ||
- Update: Alter API per `update-notifier` breaking change | ||
## 0.6.2 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "command-line-basics", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "Auto-add help and version CLI and update notification checks", | ||
@@ -30,26 +30,27 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"@mysticatea/eslint-plugin": "^12.0.0", | ||
"eslint": "^6.5.1", | ||
"eslint-config-ash-nazg": "^11.0.1", | ||
"@mysticatea/eslint-plugin": "^13.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-ash-nazg": "^17.1.0", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-array-func": "^3.1.3", | ||
"eslint-plugin-compat": "^3.3.0", | ||
"eslint-plugin-compat": "^3.5.1", | ||
"eslint-plugin-eslint-comments": "^3.1.2", | ||
"eslint-plugin-html": "^6.0.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jsdoc": "^15.9.10", | ||
"eslint-plugin-markdown": "^1.0.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"eslint-plugin-jsdoc": "^21.0.0", | ||
"eslint-plugin-markdown": "^1.0.1", | ||
"eslint-plugin-no-unsanitized": "^3.0.2", | ||
"eslint-plugin-no-use-extend-native": "^0.4.1", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-sonarjs": "^0.4.0", | ||
"eslint-plugin-sonarjs": "^0.5.0", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"eslint-plugin-unicorn": "^12.0.2", | ||
"typescript": "^3.6.3" | ||
"eslint-plugin-unicorn": "^16.0.0", | ||
"typescript": "^3.7.5" | ||
}, | ||
"dependencies": { | ||
"command-line-args": "^5.1.1", | ||
"command-line-usage": "^6.0.2", | ||
"update-notifier": "^3.0.1" | ||
"command-line-usage": "^6.1.0", | ||
"update-notifier": "^4.0.0" | ||
} | ||
} |
@@ -75,2 +75,14 @@ # command-line-basics | ||
cwd: __dirname, | ||
async notifierCallback (notifier) { | ||
// Do something with `notifier` instance: https://github.com/yeoman/update-notifier | ||
const { | ||
latest, current, | ||
name, | ||
type // `latest`, `major`, `minor`, `patch`, `prerelease`, `build` | ||
} = await notifier.fetchInfo(); | ||
console.log('Versions', latest, current); | ||
console.log('Package name', name); | ||
console.log('Current update type', type); | ||
}, | ||
options: { | ||
@@ -86,5 +98,2 @@ packageJsonPath: path.join(process.cwd(), 'package.json'), | ||
updateCheckInterval: 1000 * 60 * 60 * 24, | ||
callback (/* error, update */) { | ||
// Non-cached, synchronous handling (not recommended) | ||
}, | ||
shouldNotifyInNpmScript: false, | ||
@@ -99,3 +108,3 @@ distTag: 'latest' // https://docs.npmjs.com/adding-dist-tags-to-packages | ||
isGlobal: defaultsToAutoDetectBoolean, | ||
boxenOpts: { | ||
boxenOptions: { | ||
// Also `dimBorder`, `float`, and `backgroundColor` | ||
@@ -102,0 +111,0 @@ // See https://github.com/sindresorhus/boxen |
@@ -87,3 +87,3 @@ 'use strict'; | ||
exports.cliBasics = function (optionsPath, options) { | ||
exports.cliBasics = function (optionsPath, options, notifierCallback) { | ||
if (!optionsPath) { | ||
@@ -94,3 +94,3 @@ throw new TypeError(`You must include an \`optionsPath\`.`); | ||
if (typeof optionsPath === 'object') { | ||
({optionsPath, options, cwd} = optionsPath); | ||
({optionsPath, options, cwd, notifierCallback} = optionsPath); | ||
} | ||
@@ -112,2 +112,5 @@ options = options || {}; | ||
} | ||
if (notifierCallback) { | ||
notifierCallback(notifier); | ||
} | ||
@@ -114,0 +117,0 @@ const { |
13065
154
131
19
+ Addedansi-styles@4.3.0(transitive)
+ Addedboxen@4.2.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconfigstore@5.0.1(transitive)
+ Addedcrypto-random-string@2.0.0(transitive)
+ Addeddot-prop@5.3.0(transitive)
+ Addedescape-goat@2.1.1(transitive)
+ Addedglobal-dirs@2.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedini@1.3.7(transitive)
+ Addedis-installed-globally@0.3.2(transitive)
+ Addedis-npm@4.0.0(transitive)
+ Addedis-obj@2.0.0(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedpupa@2.1.1(transitive)
+ Addedsemver-diff@3.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedterm-size@2.2.1(transitive)
+ Addedtype-fest@0.8.1(transitive)
+ Addedtypedarray-to-buffer@3.1.5(transitive)
+ Addedunique-string@2.0.0(transitive)
+ Addedupdate-notifier@4.1.3(transitive)
+ Addedwidest-line@3.1.0(transitive)
+ Addedwrite-file-atomic@3.0.3(transitive)
+ Addedxdg-basedir@4.0.0(transitive)
- Removedansi-regex@3.0.14.1.1(transitive)
- Removedboxen@3.2.0(transitive)
- Removedconfigstore@4.0.0(transitive)
- Removedcross-spawn@5.1.0(transitive)
- Removedcrypto-random-string@1.0.0(transitive)
- Removeddot-prop@4.2.1(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removedexeca@0.7.0(transitive)
- Removedget-stream@3.0.0(transitive)
- Removedglobal-dirs@0.1.1(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedis-installed-globally@0.1.0(transitive)
- Removedis-npm@3.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-path-inside@1.0.1(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedpath-is-inside@1.0.2(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpify@3.0.0(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsemver-diff@2.1.0(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedstring-width@2.1.13.1.0(transitive)
- Removedstrip-ansi@4.0.05.2.0(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedterm-size@1.2.0(transitive)
- Removedtype-fest@0.3.1(transitive)
- Removedunique-string@1.0.0(transitive)
- Removedupdate-notifier@3.0.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwidest-line@2.0.1(transitive)
- Removedwrite-file-atomic@2.4.3(transitive)
- Removedxdg-basedir@3.0.0(transitive)
- Removedyallist@2.1.2(transitive)
Updatedcommand-line-usage@^6.1.0
Updatedupdate-notifier@^4.0.0