Comparing version 6.5.3 to 6.5.4
@@ -13,6 +13,7 @@ #!/usr/bin/env node | ||
const { coroutine } = require('bluebird') | ||
const updateNotifier = require('@zeit/check-updates') | ||
const { red } = require('chalk') | ||
const checkForUpdate = require('update-check') | ||
const { red, bold } = require('chalk') | ||
const nodeVersion = require('node-version') | ||
const cert = require('openssl-self-signed-certificate') | ||
const boxen = require('boxen') | ||
@@ -35,8 +36,2 @@ // Utilities | ||
// Let user know if there's an update | ||
// This isn't important when deployed to production | ||
if (process.env.NODE_ENV !== 'production' && pkg.dist) { | ||
updateNotifier(pkg, 'serve') | ||
} | ||
// Register the list of options | ||
@@ -90,3 +85,20 @@ args.options(options) | ||
detect(port).then(open => { | ||
detect(port).then(async open => { | ||
const { NODE_ENV } = process.env | ||
const update = await checkForUpdate(pkg) | ||
if (NODE_ENV !== 'production' && update) { | ||
const message = `${bold( | ||
'UPDATE AVAILABLE:' | ||
)} The latest version of \`serve\` is ${update.latest}` | ||
console.log( | ||
boxen(message, { | ||
padding: 1, | ||
borderColor: 'green', | ||
margin: 1 | ||
}) | ||
) | ||
} | ||
let inUse = open !== port | ||
@@ -93,0 +105,0 @@ |
{ | ||
"name": "serve", | ||
"version": "6.5.3", | ||
"version": "6.5.4", | ||
"description": "Static file serving and directory listing", | ||
@@ -54,3 +54,2 @@ "scripts": { | ||
"dependencies": { | ||
"@zeit/check-updates": "1.1.0", | ||
"args": "3.0.8", | ||
@@ -76,4 +75,5 @@ "basic-auth": "2.0.0", | ||
"path-type": "3.0.0", | ||
"send": "0.16.2" | ||
"send": "0.16.2", | ||
"update-check": "1.2.0" | ||
} | ||
} |
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
28629
739
+ Addedupdate-check@1.2.0
+ Addedregistry-auth-token@3.3.2(transitive)
+ Addedupdate-check@1.2.0(transitive)
- Removed@zeit/check-updates@1.1.0
- Removed@zeit/check-updates@1.1.0(transitive)
- Removedcapture-stack-trace@1.0.2(transitive)
- Removedchalk@2.3.0(transitive)
- Removedconfigstore@3.1.5(transitive)
- Removedcreate-error-class@3.0.2(transitive)
- Removedcrypto-random-string@1.0.0(transitive)
- Removeddot-prop@4.2.1(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedglobal-dirs@0.1.1(transitive)
- Removedgot@6.7.1(transitive)
- Removedimport-lazy@2.1.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedis-installed-globally@0.1.0(transitive)
- Removedis-npm@1.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-path-inside@1.0.1(transitive)
- Removedis-redirect@1.0.0(transitive)
- Removedis-retry-allowed@1.2.0(transitive)
- Removedlatest-version@3.1.0(transitive)
- Removedlowercase-keys@1.0.1(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removedms@2.1.1(transitive)
- Removedpackage-json@4.0.1(transitive)
- Removedprepend-http@1.0.4(transitive)
- Removedregistry-auth-token@3.4.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsemver-diff@2.1.0(transitive)
- Removedtimed-out@4.0.1(transitive)
- Removedunique-string@1.0.0(transitive)
- Removedunzip-response@2.0.1(transitive)
- Removedupdate-notifier@2.3.0(transitive)
- Removedurl-parse-lax@1.0.0(transitive)
- Removedwrite-file-atomic@2.4.3(transitive)
- Removedxdg-basedir@3.0.0(transitive)