From 1f976921edbeefbf38103f4daa5cea6af7cf79c1 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 13 Oct 2017 13:22:39 -0700 Subject: [PATCH] Fix a couple of gulpfile issues, don't create some links for now --- gulpfile.js | 50 +++++++++++++++---------- package.json | 6 ++- packages/grpc-health-check/package.json | 4 +- packages/grpc-js-core/package.json | 8 ++-- packages/grpc-native-core/package.json | 14 +++---- packages/grpc-native/gulpfile.js | 2 +- packages/grpc-protobufjs/package.json | 2 +- 7 files changed, 51 insertions(+), 35 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index dbb0af11..f18e6886 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,8 @@ const help = require('gulp-help'); // gulp-help monkeypatches tasks to have an additional description parameter const gulp = help(_gulp); +var runSequence = require('run-sequence'); + require('./packages/grpc-health-check/gulpfile'); require('./packages/grpc-js/gulpfile'); require('./packages/grpc-js-core/gulpfile'); @@ -32,34 +34,44 @@ require('./test/gulpfile'); const root = __dirname; gulp.task('install.all', 'Install dependencies for all subdirectory packages', - ['js.core.install', 'native.core.install', 'health-check.install', 'internal.test.install', - 'js.install', 'native.install']); + ['js.core.install', 'native.core.install', 'health-check.install', 'internal.test.install']); gulp.task('install.all.windows', 'Install dependencies for all subdirectory packages for MS Windows', - ['js.core.install', 'native.core.install.windows', 'health-check.install', 'internal.test.install', - 'js.install', 'native.install']); + ['js.core.install', 'native.core.install.windows', 'health-check.install', 'internal.test.install']); gulp.task('lint', 'Emit linting errors in source and test files', ['js.core.lint', 'native.core.lint']); gulp.task('build', 'Build packages', ['js.core.compile', 'native.core.build']); -gulp.task('link.create', 'Initialize npm links', - ['native.core.link.create', 'js.core.link.create', 'surface.link.create', - 'js.link.create', 'native.link.create']); +gulp.task('core.link.create', 'Initialize npm links to core packages', + ['native.core.link.create', 'js.core.link.create', 'surface.link.create']); -gulp.task('link.only', 'Link packages without rebuilding', - ['js.link.add', 'native.link.add', 'health-check.link.add', 'internal.test.link.add']); +gulp.task('core.link', 'Add links to core packages without rebuilding', + ['js.link.add', 'native.link.add']); -gulp.task('link', 'Link together packages', ['link.create'], () => { - gulp.start('link.only'); +gulp.task('surface.link.create', 'Create links to surface packages', + ['js.link.create', 'native.link.create']); + +gulp.task('surface.link', 'Link to surface packages', + ['health-check.link.add', 'internal.test.link.add']); + +gulp.task('link', 'Link together packages', (callback) => { + /* Currently, the target 'surface.link.create' doesn't work properly, and it + * is also not needed for the existing tests. The comment indicates where it + * belongs in the sequence. See npm/npm#18835 for the primary problem with it. + * This also means that 'core.link' is not needed, and the item + * 'native.core.link.create' should actually be 'core.link.create' + */ + runSequence('native.core.link.create', /* 'core.link', 'surface.link.create', */ 'surface.link', + callback); }); -gulp.task('setup', 'One-time setup for a clean repository', ['install.all'], () => { - gulp.start('link'); +gulp.task('setup', 'One-time setup for a clean repository', (callback) => { + runSequence('install.all', 'link', callback); }); -gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', ['install.all.windows'], () => { - gulp.start('link'); +gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', (callback) => { + runSequence('install.all.windows', 'link', callback); }); gulp.task('clean', 'Delete generated files', ['js.core.clean', 'native.core.clean']); @@ -71,15 +83,15 @@ gulp.task('clean.all', 'Delete all files created by tasks', gulp.task('native.test.only', 'Run tests of native code without rebuilding anything', ['native.core.test', 'internal.test.test', 'health-check.test']); -gulp.task('native.test', 'Run tests of native code', ['build'], () => { - gulp.start('native.test.only'); +gulp.task('native.test', 'Run tests of native code', (callback) => { + runSequence('build', 'native.test.only', callback); }); gulp.task('test.only', 'Run tests without rebuilding anything', ['js.core.test', 'native.test.only']); -gulp.task('test', 'Run all tests', ['build'], () => { - gulp.start('test.only'); +gulp.task('test', 'Run all tests', (callback) => { + runSequence('build', 'test.only', callback); }); gulp.task('doc.gen', 'Generate documentation', ['native.core.doc.gen']); diff --git a/package.json b/package.json index 2e9798ba..c9217ede 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,9 @@ { "name": "Google Inc." } - ] + ], + "dependencies": { + "run-sequence": "^2.2.0", + "symlink": "^2.1.0" + } } diff --git a/packages/grpc-health-check/package.json b/packages/grpc-health-check/package.json index 9a1e2b92..e049ff49 100644 --- a/packages/grpc-health-check/package.json +++ b/packages/grpc-health-check/package.json @@ -15,9 +15,9 @@ } ], "dependencies": { - "google-protobuf": "^3.0.0", + "google-protobuf": "^3.4.0", "grpc": "^1.6.0", - "lodash": "^3.9.3" + "lodash": "^3.10.1" }, "files": [ "LICENSE", diff --git a/packages/grpc-js-core/package.json b/packages/grpc-js-core/package.json index 1f679fd9..6c8b2327 100644 --- a/packages/grpc-js-core/package.json +++ b/packages/grpc-js-core/package.json @@ -14,10 +14,10 @@ "types": "src/index.ts", "license": "Apache-2.0", "devDependencies": { - "@types/lodash": "^4.14.73", - "@types/mocha": "^2.2.42", - "@types/node": "^8.0.25", - "clang-format": "^1.0.53", + "@types/lodash": "^4.14.77", + "@types/mocha": "^2.2.43", + "@types/node": "^8.0.34", + "clang-format": "^1.0.55", "google-ts-style": "^0.2.0" }, "contributors": [ diff --git a/packages/grpc-native-core/package.json b/packages/grpc-native-core/package.json index 4a0c220d..bb08ac55 100644 --- a/packages/grpc-native-core/package.json +++ b/packages/grpc-native-core/package.json @@ -29,15 +29,15 @@ ], "dependencies": { "arguejs": "^0.2.3", - "lodash": "^4.15.0", - "nan": "^2.0.0", - "node-pre-gyp": "^0.6.35", - "protobufjs": "^5.0.0" + "lodash": "^4.17.4", + "nan": "^2.7.0", + "node-pre-gyp": "^0.6.38", + "protobufjs": "^5.0.2" }, "devDependencies": { - "electron-mocha": "^3.1.1", - "google-protobuf": "^3.0.0", - "istanbul": "^0.4.4" + "electron-mocha": "^3.5.0", + "google-protobuf": "^3.4.0", + "istanbul": "^0.4.5" }, "engines": { "node": ">=4" diff --git a/packages/grpc-native/gulpfile.js b/packages/grpc-native/gulpfile.js index dcbea445..8ea6bd95 100644 --- a/packages/grpc-native/gulpfile.js +++ b/packages/grpc-native/gulpfile.js @@ -28,7 +28,7 @@ const del = require('del'); const nativeDir = __dirname; gulp.task('native.clean.links', 'Delete npm links', () => { - return del([path.resolve(nativeDir, 'node_modules/@grpc/native-core'), + return del([path.resolve(nativeDir, 'node_modules/grpc'), path.resolve(nativeDir, 'node_modules/@grpc/surface')]); }); diff --git a/packages/grpc-protobufjs/package.json b/packages/grpc-protobufjs/package.json index 10c51c12..60b3dddd 100644 --- a/packages/grpc-protobufjs/package.json +++ b/packages/grpc-protobufjs/package.json @@ -17,6 +17,6 @@ }, "dependencies": { "lodash": "^4.17.4", - "protobufjs": "~6.8.0" + "protobufjs": "^6.8.0" } }