@oclif/plugin-warn-if-update-available
Advanced tools
Comparing version 1.7.0 to 2.0.0
@@ -5,6 +5,7 @@ "use strict"; | ||
const http_call_1 = require("http-call"); | ||
// eslint-disable-next-line max-params | ||
async function run(name, file, version, registry, authorization) { | ||
const url = [ | ||
registry.replace(/\/+$/, ''), | ||
name.replace('/', '%2f') // scoped packages need escaped separator | ||
name.replace('/', '%2f'), // scoped packages need escaped separator | ||
].join('/'); | ||
@@ -14,6 +15,6 @@ const headers = authorization ? { authorization } : {}; | ||
const { body } = await http_call_1.default.get(url, { headers, timeout: 5000 }); | ||
await fs.outputJSON(file, Object.assign({}, body['dist-tags'], { current: version, authorization })); | ||
process.exit(0); | ||
await fs.outputJSON(file, Object.assign(Object.assign({}, body['dist-tags']), { current: version, authorization })); | ||
process.exit(0); // eslint-disable-line unicorn/no-process-exit, no-process-exit | ||
} | ||
run(process.argv[2], process.argv[3], process.argv[4], process.argv[5], process.argv[6]) | ||
.catch(require('@oclif/errors/handle')); | ||
.catch(require('@oclif/core/handle')); |
@@ -1,3 +0,3 @@ | ||
import { Hook } from '@oclif/config'; | ||
import { Hook } from '@oclif/core'; | ||
declare const hook: Hook<'init'>; | ||
export default hook; |
@@ -19,3 +19,3 @@ "use strict"; | ||
if (config.version.includes('-')) { | ||
// TODO: handle channels | ||
// to-do: handle channels | ||
return; | ||
@@ -31,5 +31,5 @@ } | ||
} | ||
catch (err) { | ||
if (err.code !== 'ENOENT') | ||
throw err; | ||
catch (error) { | ||
if (error.code !== 'ENOENT') | ||
throw error; | ||
} | ||
@@ -40,7 +40,7 @@ }; | ||
const { mtime } = await fs.stat(file); | ||
const staleAt = new Date(mtime.valueOf() + 1000 * 60 * 60 * 24 * timeoutInDays); | ||
const staleAt = new Date(mtime.valueOf() + (1000 * 60 * 60 * 24 * timeoutInDays)); | ||
return staleAt < new Date(); | ||
} | ||
catch (err) { | ||
debug(err); | ||
catch (error) { | ||
debug(error); | ||
return true; | ||
@@ -51,3 +51,3 @@ } | ||
debug('spawning version refresh'); | ||
child_process_1.spawn(process.execPath, [path.join(__dirname, '../../../lib/get-version'), config.name, file, config.version, registry, authorization], { | ||
(0, child_process_1.spawn)(process.execPath, [path.join(__dirname, '../../../lib/get-version'), config.name, file, config.version, registry, authorization], { | ||
detached: !config.windows, | ||
@@ -54,0 +54,0 @@ stdio: 'ignore', |
@@ -1,1 +0,1 @@ | ||
{"version":"1.7.0","commands":{}} | ||
{"version":"2.0.0","commands":{}} |
{ | ||
"name": "@oclif/plugin-warn-if-update-available", | ||
"description": "warns if there is a newer version of CLI released", | ||
"version": "1.7.0", | ||
"version": "2.0.0", | ||
"author": "Jeff Dickey @jdxcode", | ||
"bugs": "https://github.com/oclif/plugin-warn-if-update-available/issues", | ||
"dependencies": { | ||
"@oclif/command": "^1.5.10", | ||
"@oclif/config": "^1.12.8", | ||
"@oclif/errors": "^1.2.2", | ||
"chalk": "^2.4.1", | ||
"@oclif/core": "^0.5.39", | ||
"chalk": "^4.1.0", | ||
"debug": "^4.1.0", | ||
"fs-extra": "^7.0.0", | ||
"fs-extra": "^9.0.1", | ||
"http-call": "^5.2.2", | ||
"lodash.template": "^4.4.0", | ||
"semver": "^5.6.0" | ||
"semver": "^7.3.2" | ||
}, | ||
"devDependencies": { | ||
"@oclif/dev-cli": "^1.19.1", | ||
"@oclif/test": "^1.2.4", | ||
"@oclif/tslint": "^3.1.0", | ||
"@types/chai": "^4.1.6", | ||
"@types/fs-extra": "^5.0.5", | ||
"@types/fs-extra": "^9.0.1", | ||
"@types/lodash.template": "^4.4.5", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.9.4", | ||
"@types/semver": "^5.5.0", | ||
"@types/mocha": "^8.0.0", | ||
"@types/node": "^14.0.14", | ||
"@types/semver": "^7.3.1", | ||
"chai": "^4.2.0", | ||
"globby": "^9.0.0", | ||
"mocha": "^6.0.0", | ||
"ts-node": "^8.0.2", | ||
"tslib": "^1.9.3", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.3.3" | ||
"eslint": "^7.3.1", | ||
"eslint-config-oclif": "^3.1.0", | ||
"eslint-config-oclif-typescript": "^0.2.0", | ||
"globby": "^11.0.1", | ||
"mocha": "^8.0.1", | ||
"oclif": "^2.0.0-main.5", | ||
"ts-node": "^9.1.1", | ||
"tslib": "^2.0.0", | ||
"typescript": "4.4.3" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
@@ -60,10 +59,11 @@ "files": [ | ||
"clean": "rm -f oclif.manifest.json", | ||
"lint": "tsc -p test --noEmit && tslint -p test -t stylish", | ||
"lint": "eslint . --ext .ts --config .eslintrc", | ||
"pretest": "yarn build --noEmit && tsc -p test --noEmit", | ||
"test": "mocha --forbid-only \"test/**/*.test.ts\"", | ||
"posttest": "yarn lint", | ||
"prepublishOnly": "yarn run build && oclif manifest . && oclif readme", | ||
"postpublish": "yarn run clean", | ||
"posttest": "yarn run lint", | ||
"prepublishOnly": "yarn run build && oclif-dev manifest && oclif-dev readme", | ||
"preversion": "yarn run clean", | ||
"test": "mocha --forbid-only \"test/**/*.test.ts\"", | ||
"version": "oclif-dev readme && git add README.md" | ||
"version": "oclif readme && git add README.md" | ||
} | ||
} |
@@ -9,3 +9,2 @@ @oclif/plugin-warn-if-update-available | ||
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/oclif/plugin-warn-if-update-available?branch=master&svg=true)](https://ci.appveyor.com/project/oclif/plugin-warn-if-update-available/branch/master) | ||
[![Codecov](https://codecov.io/gh/oclif/plugin-warn-if-update-available/branch/master/graph/badge.svg)](https://codecov.io/gh/oclif/plugin-warn-if-update-available) | ||
[![Downloads/week](https://img.shields.io/npm/dw/@oclif/plugin-warn-if-update-available.svg)](https://npmjs.org/package/@oclif/plugin-warn-if-update-available) | ||
@@ -12,0 +11,0 @@ [![License](https://img.shields.io/npm/l/@oclif/plugin-warn-if-update-available.svg)](https://github.com/oclif/plugin-warn-if-update-available/blob/master/package.json) |
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
7
84
16344
17
71
+ Added@oclif/core@^0.5.39
+ Added@oclif/core@0.5.41(transitive)
+ Added@oclif/screen@1.0.4(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansicolors@0.3.2(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedcardinal@2.1.1(transitive)
+ Addedcli-progress@3.12.0(transitive)
+ Addedcli-ux@5.6.7(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedextract-stack@2.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedget-package-type@0.1.0(transitive)
+ Addedhyperlinker@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addednatural-orderby@2.0.3(transitive)
+ Addedobject-treeify@1.1.33(transitive)
+ Addedpassword-prompt@1.1.3(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedredeyed@2.1.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedsupports-color@8.1.1(transitive)
+ Addedsupports-hyperlinks@2.3.0(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedwhich@2.0.2(transitive)
- Removed@oclif/command@^1.5.10
- Removed@oclif/config@^1.12.8
- Removed@oclif/errors@^1.2.2
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfs-extra@7.0.1(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^4.1.0
Updatedfs-extra@^9.0.1
Updatedsemver@^7.3.2