From f4b2832850e9e77dd116adbcaf4f0f24c7044a7f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 12 May 2015 12:39:22 -0700 Subject: service_packager now properly generates service and package files --- src/node/cli/service_packager.js | 5 ++++- src/node/cli/service_packager/index.js | 3 ++- src/node/cli/service_packager/package.json.template | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/node') diff --git a/src/node/cli/service_packager.js b/src/node/cli/service_packager.js index 7bf54b1c62..41875b5420 100644 --- a/src/node/cli/service_packager.js +++ b/src/node/cli/service_packager.js @@ -78,7 +78,9 @@ function copyFile(src_path, dest_path) { function main(argv) { var args = parseArgs(argv, arg_format); var out_path = path.resolve(args.out); - var include_dirs = _.map(path.resolve, args.include); + var include_dirs = _.map(_.flatten([args.include]), function(p) { + return path.resolve(p); + }); args.grpc_version = package_json.version; generatePackage(args, function(err, rendered) { if (err) throw err; @@ -97,6 +99,7 @@ function main(argv) { 'service.json')); var pbjs_args = _.flatten(['node', 'pbjs', args._[0], + '-legacy', _.map(include_dirs, function(dir) { return "-path=" + dir; })]); diff --git a/src/node/cli/service_packager/index.js b/src/node/cli/service_packager/index.js index 8a22120ce0..811e08b89a 100644 --- a/src/node/cli/service_packager/index.js +++ b/src/node/cli/service_packager/index.js @@ -32,4 +32,5 @@ */ var grpc = require('grpc'); -module.exports = grpc.load(__dirname + '/service.json'); +exports.client = grpc.load(__dirname + '/service.json', 'json'); +exports.auth = require('google-auth-library'); diff --git a/src/node/cli/service_packager/package.json.template b/src/node/cli/service_packager/package.json.template index 4f199f2f95..9f9019172e 100644 --- a/src/node/cli/service_packager/package.json.template +++ b/src/node/cli/service_packager/package.json.template @@ -5,7 +5,8 @@ "description": "Client library for {{{name}}} built on gRPC", "license": "Apache-2.0", "dependencies": { - "grpc": "{{{grpc_version}}}" + "grpc": "{{{grpc_version}}}", + "google-auth-library": "^0.9.2" }, "main": "index.js", "files": [ -- cgit v1.2.3