auth0 / webtask-bundle

Module and CLI to bundle your code for use on https://webtask.io
28 stars 6 forks source link

Version check no long skips 'native' cloud dependencies #20

Open scott-parsons opened 7 years ago

scott-parsons commented 7 years ago

Commit bf25f66 inadvertently removed the logic for skipping 'native' cloud versions when performing the semver check. (Note that the local function checkVersion() is no longer called).

If the app's package.json references a dependency that has a 'native' cloud version, wt bundle will fail:

$ wt bundle analyze
C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:293
    throw new TypeError('Invalid Version: ' + version);
    ^

TypeError: Invalid Version: native
    at new SemVer (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:293:11)
    at Range.test (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:1036:15)
    at satisfies (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:1085:16)
    at C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:1091:12
    at Array.filter (native)
    at Function.maxSatisfying (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\semver\semver.js:1090:19)
    at C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\webtask-bundle\lib\checker.js:156:44
    at Array.forEach (native)
    at C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\webtask-bundle\lib\checker.js:149:47
    at Request.callback (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\superagent\lib\node\index.js:691:12)
    at IncomingMessage.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\wt-cli\node_modules\superagent\lib\node\index.js:922:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

The workaround in this particular case was to remove any modules with 'native' implementations from the app's package.json dependency list, since they really didn't need to be there anyway...