From 194330216aba4977811ce0476a08a2d199ebd7bc Mon Sep 17 00:00:00 2001 From: Tony Kovanen Date: Sun, 15 May 2016 18:32:44 +0300 Subject: [PATCH 1/2] Read and send `now-engines` --- lib/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index fdf815c..94838e9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -70,6 +70,8 @@ export default class Now extends EventEmitter { this._files = hashes; + const engines = pkg['now-engines']; + const deployment = await retry(async (bail) => { if (this._debug) console.time('> [debug] /now/create'); const res = await this._fetch('/now/create', { @@ -89,7 +91,8 @@ export default class Now extends EventEmitter { file: toRelative(name, this._path) }; }); - })) + })), + engines } }); if (this._debug) console.timeEnd('> [debug] /now/create'); From 18ce4229629e69a8efe375bd3cd4d7c2c463000c Mon Sep 17 00:00:00 2001 From: Tony Kovanen Date: Mon, 16 May 2016 00:00:53 +0300 Subject: [PATCH 2/2] Add warnings for unfound node version match --- lib/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 94838e9..c6c92bd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -115,8 +115,9 @@ export default class Now extends EventEmitter { // we report about files whose sizes are too big if (deployment.warnings) { let sizeExceeded = 0; - deployment.warnings.forEach(({ reason, sha, limit }) => { - if ('size_limit_exceeded' === reason) { + deployment.warnings.forEach((warning) => { + if ('size_limit_exceeded' === warning.reason) { + const { sha, limit } = warning; const name = hashes.get(sha).names.pop(); console.error('> \u001b[31mWarning!\u001b[39m Skipping file %s (size exceeded %s)', name, @@ -124,6 +125,12 @@ export default class Now extends EventEmitter { ); hashes.get(sha).names.unshift(name); // move name (hack, if duplicate matches we report them in order) sizeExceeded++; + } else if ('node_version_not_found' === warning.reason) { + const { wanted, used } = warning; + console.error('> \u001b[31mWarning!\u001b[39m Requested node version %s is not available, using default version %s', + wanted, + used + ); } });