Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oclif/plugin-warn-if-update-available

Package Overview
Dependencies
Maintainers
6
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/plugin-warn-if-update-available - npm Package Compare versions

Comparing version 1.7.0 to 2.0.0

9

lib/get-version.js

@@ -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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc