pull in the openwhisk nodejs6 supported node_modules
diff --git a/client/.gitignore b/client/.gitignore
new file mode 100644
index 0000000..582279c
--- /dev/null
+++ b/client/.gitignore
@@ -0,0 +1 @@
+/.initDone
\ No newline at end of file
diff --git a/client/deps/nodejs6/package.json b/client/deps/nodejs6/package.json
new file mode 100644
index 0000000..d4780bb
--- /dev/null
+++ b/client/deps/nodejs6/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "openwhisk-nodejs6-prerequisites",
+ "version": "0.0.1",
+ "dependencies": {
+ "apn": "^1.7.5",
+ "async": "^1.5.2",
+ "body-parser": "^1.15.1",
+ "btoa": "^1.1.2",
+ "cheerio": "^0.20.0",
+ "cloudant": "^1.4.1",
+ "commander": "^2.9.0",
+ "consul": "^0.25.0",
+ "cookie-parser": "^1.4.2",
+ "cradle": "^0.7.1",
+ "errorhandler": "^1.4.3",
+ "express": "^4.13.4",
+ "express-session": "^1.12.1",
+ "gm": "^1.22.0",
+ "iconv-lite": "^0.4.13",
+ "log4js": "^0.6.36",
+ "merge": "^1.2.0",
+ "moment": "^2.13.0",
+ "mustache": "^2.2.1",
+ "nano": "^6.2.0",
+ "node-uuid": "^1.4.7",
+ "nodemailer": "^2.5.0",
+ "oauth2-server": "^2.4.1",
+ "pkgcloud": "^1.3.0",
+ "process": "^0.11.3",
+ "pug": "^2.0.0-beta6",
+ "request": "^2.72.0",
+ "rimraf": "^2.5.2",
+ "semver": "^5.1.0",
+ "sendgrid": "^3.0.11",
+ "serve-favicon": "^2.3.0",
+ "socket.io": "^1.4.6",
+ "socket.io-client": "^1.4.6",
+ "superagent": "^1.8.3",
+ "swagger-tools": "^0.10.1",
+ "tmp": "0.0.28",
+ "twilio": "^2.9.1",
+ "watson-developer-cloud": "^1.12.4",
+ "when": "^3.7.7",
+ "ws": "^1.1.0",
+ "xml2js": "^0.4.16",
+ "xmlhttprequest": "^1.8.0",
+ "yauzl": "^2.4.2"
+ }
+}
diff --git a/client/lib/debug-nodejs.js b/client/lib/debug-nodejs.js
index cc9ecd0..a9174a3 100644
--- a/client/lib/debug-nodejs.js
+++ b/client/lib/debug-nodejs.js
@@ -61,7 +61,8 @@
// we need to update the NODE_PATH env var, to add our local modules
var env = Object.assign({}, process.env);
env.NODE_PATH = path.join(process.cwd(), 'node_modules')
- + ':' + path.join(process.cwd(), 'lib');
+ + ':' + path.join(process.cwd(), 'lib')
+ + ':' + path.join(process.cwd(), 'deps', 'nodejs6', 'node_modules');
function trySpawnWithBrowser(webPort, debugPort) {
var spawnOpts = {
diff --git a/client/lib/init.js b/client/lib/init.js
new file mode 100644
index 0000000..07a8ed6
--- /dev/null
+++ b/client/lib/init.js
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015-2016 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var fs = require('fs'),
+ exec = require('child_process').execSync,
+ path = require('path'),
+ MARKER = '.initDone';
+
+function touch() {
+ fs.closeSync(fs.openSync(MARKER, 'w'));
+}
+function initDone() {
+ try {
+ return fs.statSync(MARKER).isFile();
+ } catch (e) {
+ return false;
+ }
+}
+
+function doInit() {
+ console.log('Doing one-time init');
+ exec('npm install', { cwd: path.join('deps', 'nodejs6'), stdio: 'inherit' });
+
+ touch();
+}
+
+exports.init = function init() {
+ if (!initDone()) {
+ doInit();
+ }
+};
diff --git a/client/wskdb.js b/client/wskdb.js
index 13832f2..9cce4d8 100644
--- a/client/wskdb.js
+++ b/client/wskdb.js
@@ -15,6 +15,7 @@
*/
var argv = require('argv'),
+ init = require('./lib/init').init,
repl = require('./lib/repl').repl,
colors = require('colors'),
events = require('events'),
@@ -34,6 +35,8 @@
path: '/ws/client/register'
};
+init();
+
var commandLineOptionsConfig = [
{name: 'use-cli-debugger', short: 'c', type: 'string', description: 'Favor the CLI for debug sessions over a GUI'},
{name: 'no-color', type: 'string', description: 'Avoid using console colors'} // this comes from the colors module