From a7d1e0673ff1c0af19c16193b6890433484fdd86 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 22 Aug 2017 22:20:11 -0400 Subject: [PATCH] FAB-5879 Add support for node 8 in addition to 6 we want to introduce support for node 8, in addition to 6 (until 6 goes end of life). we don't want to cut over to node 8 outright yet because it has not yet entered LTS status, which is estimated to be in October Change-Id: Icbc10f36b56e52e8c933ce85567a5f21a118e365 Signed-off-by: Jim Zhang --- .gitignore | 1 + README.md | 4 ++-- build/tasks/watch.js | 29 ++++++++++++++++++----------- docs/tutorials/app-dev-env-setup.md | 2 +- fabric-ca-client/package.json | 4 +--- fabric-client/package.json | 4 +--- package.json | 10 ++-------- 7 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 3f287a6c07..5911ff0677 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ fabric-ca-client/lib/protos/* fabric-ca-client/lib/hash.js fabric-ca-client/lib/impl/* npm-shrinkwrap.json +package-lock.json npm-debug.log tmp .project diff --git a/README.md b/README.md index 481d2bffb0..07c07fb9f3 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The following section targets a current or future contributor to this project it ### Build and Test To build and test, the following pre-requisites must be installed first: -* node runtime version 6.9.x, note that 7.0 is not supported at this point -* npm tool version 3.10.x +* node runtime version 6.9.x or higher, and 8.4.0 or higher ( __Node v7+ is not supported__ ) +* npm tool version 3.10.x or higher * gulp command (must be installed globaly with `npm install -g gulp`) * docker (not required if you only want to run the headless tests with `npm test`, see below) diff --git a/build/tasks/watch.js b/build/tasks/watch.js index a5729acb75..8cd93bcd95 100644 --- a/build/tasks/watch.js +++ b/build/tasks/watch.js @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: Apache-2.0 */ -var gulp = require('gulp'), +let gulp = require('gulp'), watch = require('gulp-watch'), debug = require('gulp-debug'), + fs = require('fs'), ca = require('./ca.js'); gulp.task('watch', function () { @@ -13,14 +14,20 @@ gulp.task('watch', function () { .pipe(debug()) .pipe(gulp.dest('fabric-ca-client/')); - watch([ - 'fabric-client/index.js', - 'fabric-client/config/**/*', - 'fabric-client/lib/**/*', - 'fabric-ca-client/index.js', - 'fabric-ca-client/config/**/*', - 'fabric-ca-client/lib/**/*' - ], { ignoreInitial: false, base: './' }) - .pipe(debug()) - .pipe(gulp.dest('node_modules')); + // only do the following if node_modules/fabric-client and + // node_modules/fabric-ca-client are NOT created as sym links + let statsA = lstatSync('node_modules/fabric-client'); + let statsB = lstatSync('node_modules/fabric-ca-client'); + if (!statsA.isSymbolicLink() && !statsB.isSymbolicLink()) { + watch([ + 'fabric-client/index.js', + 'fabric-client/config/**/*', + 'fabric-client/lib/**/*', + 'fabric-ca-client/index.js', + 'fabric-ca-client/config/**/*', + 'fabric-ca-client/lib/**/*' + ], { ignoreInitial: false, base: './' }) + .pipe(debug()) + .pipe(gulp.dest('node_modules')); + } }); diff --git a/docs/tutorials/app-dev-env-setup.md b/docs/tutorials/app-dev-env-setup.md index 4d4763b01c..9f46784252 100755 --- a/docs/tutorials/app-dev-env-setup.md +++ b/docs/tutorials/app-dev-env-setup.md @@ -90,7 +90,7 @@ is responsible for managing the user certificates. You will need the following software: * [Docker and Docker Compose](http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#docker-and-docker-compose) - see Hyperledger Fabric for details * [Nodejs](https://nodejs.org/en/download/) -v6.2.0 - 6.10.0 ( __Node v7+ is not supported__ ) +v6.2.0 - 6.10.0, 8.4.0+ ( __Node v7+ is not supported__ ) ## Prepare crypto materials diff --git a/fabric-ca-client/package.json b/fabric-ca-client/package.json index 69e1fd2cf7..441918d005 100644 --- a/fabric-ca-client/package.json +++ b/fabric-ca-client/package.json @@ -7,11 +7,9 @@ "url": "http://gerrit.hyperledger.org/r/fabric-sdk-node" }, "engines": { - "node": ">=6.9.0 <7.0", + "node": ">=6.9.0", "npm": ">=3.10.0" }, - "engine-strict": true, - "engineStrict": true, "dependencies": { "bn.js": "^4.11.3", "elliptic": "^6.2.3", diff --git a/fabric-client/package.json b/fabric-client/package.json index c0911bb942..7f0d7cf5ca 100644 --- a/fabric-client/package.json +++ b/fabric-client/package.json @@ -10,11 +10,9 @@ "test": "node test/unit/headless-tests.js" }, "engines": { - "node": ">=6.9.0 <7.0", + "node": ">=6.9.0", "npm": ">=3.10.0" }, - "engine-strict": true, - "engineStrict": true, "dependencies": { "bn.js": "^4.11.3", "callsite": "^1.0.0", diff --git a/package.json b/package.json index 267d97a575..c4202d89bb 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,8 @@ "scripts": { "test": "gulp test-headless" }, - "engines": { - "node": ">=4.5.0", - "npm": ">=2.15.9" - }, - "engine-strict": true, - "engineStrict": true, "devDependencies": { - "bn.js": "^4.11.6", + "bn.js": "^4.11.8", "bunyan": "^1.8.10", "cloudant": "^1.7.0", "del": "^2.2.2", @@ -37,7 +31,7 @@ "intercept-stdout": "^0.1.2", "jsrsasign": "6.2.2", "log4js": "^0.6.38", - "mock-couch": "https://github.com/jimthematrix/mock-couch.git", + "mock-couch": "git+https://github.com/jimthematrix/mock-couch.git", "nano": "^6.2.0", "require-dir": "^0.3.0", "rewire": "^2.5.2",