Skip to content

Commit

Permalink
Fix JSDoc and regenerate scaffolding. (#39)
Browse files Browse the repository at this point in the history
* Fix JSDoc and regenerate scaffolding.

* updating GAPIC generated files

* fix contributors, regenerate scaffolding

* run CI as non-root user to speed up grpc module install

* Remove temp fix for #38
  • Loading branch information
jmdobry authored and alexander-fenster committed Jan 12, 2018
1 parent 4d41791 commit 53f1505
Show file tree
Hide file tree
Showing 28 changed files with 1,498 additions and 2,029 deletions.
27 changes: 25 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
node4:
docker:
- image: node:4
user: node
steps:
- checkout
- run:
Expand All @@ -106,44 +107,57 @@ jobs:
node6:
docker:
- image: node:6
user: node
<<: *unit_tests
node7:
docker:
- image: node:7
user: node
<<: *unit_tests
node8:
docker:
- image: node:8
user: node
<<: *unit_tests
node9:
docker:
- image: node:9
user: node
<<: *unit_tests

lint:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
name: Install modules and dependencies.
command: |
mkdir /home/node/.npm-global
npm install
npm link
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Link the module being tested to the samples.
command: |
cd samples/
npm link @google-cloud/pubsub
npm install
cd ..
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Run linting.
command: npm run lint
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global

docs:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -156,6 +170,7 @@ jobs:
sample_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -167,30 +182,37 @@ jobs:
- run:
name: Install and link the module.
command: |
mkdir /home/node/.npm-global
npm install
npm link
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Link the module being tested to the samples.
command: |
cd samples/
npm link @google-cloud/pubsub
npm install
cd ..
environment:
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Run sample tests.
command: npm run samples-test
environment:
GCLOUD_PROJECT: long-door-651
GOOGLE_APPLICATION_CREDENTIALS: /var/pubsub/.circleci/key.json
GOOGLE_APPLICATION_CREDENTIALS: /home/node/pubsub-samples/.circleci/key.json
NPM_CONFIG_PREFIX: /home/node/.npm-global
- run:
name: Remove unencrypted key.
command: rm .circleci/key.json
when: always
working_directory: /var/pubsub/
working_directory: /home/node/pubsub-samples

system_tests:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand All @@ -215,6 +237,7 @@ jobs:
publish_npm:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Luke Sneeringer <lukesneeringer@google.com> Luke Sneeringer <luke@sneeringer.com
Stephen Sawchuk <sawchuk@gmail.com> Stephen Sawchuk <stephenplusplus@users.noreply.github.com>
Stephen Sawchuk <sawchuk@gmail.com> Stephen Sawchuk <stephenplusplusplus@gmail.com>
Stephen Sawchuk <sawchuk@gmail.com> Stephen <stephenplusplus@users.noreply.github.com>
Alexander Fenster <fenster@google.com> Alexander Fenster <github@fenster.name>
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Matthew Arbesfeld <arbesfeld@gmail.com>
Song Wang <songwang@google.com>
Stephen Sawchuk <sawchuk@gmail.com>
Tim Swast <swast@google.com>
greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>
mkamioner <mkamioner@gmail.com>
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# [Google Cloud Pub/Sub: Node.js Client](https://github.com/googleapis/nodejs-pubsub)

[![Greenkeeper badge](https://badges.greenkeeper.io/googleapis/nodejs-pubsub.svg)](https://greenkeeper.io/)

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-pubsub.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-pubsub)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-pubsub?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-pubsub)
Expand Down Expand Up @@ -72,20 +70,21 @@ const PubSub = require('@google-cloud/pubsub');
const projectId = 'YOUR_PROJECT_ID';

// Instantiates a client
const pubsubClient = PubSub({
projectId: projectId
const pubsubClient = new PubSub({
projectId: projectId,
});

// The name for the new topic
const topicName = 'my-new-topic';

// Creates the new topic
pubsubClient.createTopic(topicName)
.then((results) => {
pubsubClient
.createTopic(topicName)
.then(results => {
const topic = results[0];
console.log(`Topic ${topic.name} created.`);
})
.catch((err) => {
.catch(err => {
console.error('ERROR:', err);
});
```
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
"Jun Mukai <jun.mukai@gmail.com>",
"Justin King <jcking@mtu.edu>",
"Matthew Arbesfeld <arbesfeld@gmail.com>",
"Mo Kamioner <mkamioner@gmail.com>",
"Song Wang <songwang@google.com>",
"Stephen Sawchuk <sawchuk@gmail.com>",
"Tim Swast <swast@google.com>"
"Tim Swast <swast@google.com>",
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"mkamioner <mkamioner@gmail.com>"
],
"scripts": {
"system-test": "repo-tools test run --cmd mocha -- system-test/*.js --no-timeouts",
Expand Down
2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"node": ">=4.3.2"
},
"scripts": {
"ava": "ava -T 20s --verbose test/*.test.js system-test/*.test.js",
"ava": "ava -T 20s --verbose system-test/*.test.js",
"cover": "nyc --reporter=lcov --cache ava -T 20s --verbose test/*.test.js system-test/*.test.js && nyc report",
"test": "repo-tools test run --cmd npm -- run cover"
},
Expand Down
2 changes: 1 addition & 1 deletion samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PubSub = require('@google-cloud/pubsub');
const projectId = 'YOUR_PROJECT_ID';

// Instantiates a client
const pubsubClient = PubSub({
const pubsubClient = new PubSub({
projectId: projectId,
});

Expand Down
Loading

0 comments on commit 53f1505

Please sign in to comment.