forked from googleapis/nodejs-datastore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add repo tools config. * Add cloud repo tools dev dep. * Add config to cloud repo tools. * npm run generate-scaffolding * Generate a samples readme. * Add .mailmap and regenerate scaffolding. * New auto-gen layer behind datastore. * Add JSDoc. * Add docs command. * Add lint and prettier commands. * Add ESLint and prettier * npm run prettier * Use GAPIC. (googleapis#1) * Make the linter happy. * Fix jsdocs and regenerate scaffolding. (googleapis#2) * Support TransactionOptions. (googleapis#3) * setting up CI * dummy change to trigger circleci build * prettier, lint * more coverage for unit tests * prettier and lint * sorted new tests in alphabetical order * test changes * add GCLOUD_PROJECT to circleci conf
- Loading branch information
1 parent
6cb2e0c
commit d381556
Showing
110 changed files
with
5,742 additions
and
10,120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: 8 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version | ||
- npm install -g npm # Force using the latest npm to get dedupe during install | ||
- set PATH=%APPDATA%\npm;%PATH% | ||
- npm install --force --ignore-scripts | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm rebuild | ||
- npm test | ||
|
||
build: off | ||
|
||
matrix: | ||
fast_finish: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
--- | ||
# "Include" for unit tests definition. | ||
unit_tests: &unit_tests | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Run unit tests. | ||
command: npm test | ||
- run: | ||
name: Submit coverage data to codecov. | ||
command: node_modules/.bin/codecov | ||
when: always | ||
|
||
version: 2.0 | ||
workflows: | ||
version: 2 | ||
tests: | ||
jobs: | ||
- node4: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node6: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node7: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node8: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- node9: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- lint: | ||
requires: | ||
- node4 | ||
- node6 | ||
- node7 | ||
- node8 | ||
- node9 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- docs: | ||
requires: | ||
- node4 | ||
- node6 | ||
- node7 | ||
- node8 | ||
- node9 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- system_tests: | ||
requires: | ||
- lint | ||
- docs | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
only: /^v[\d.]+$/ | ||
- sample_tests: | ||
requires: | ||
- lint | ||
- docs | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
only: /^v[\d.]+$/ | ||
- publish_npm: | ||
requires: | ||
- system_tests | ||
- sample_tests | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[\d.]+$/ | ||
|
||
jobs: | ||
node4: | ||
docker: | ||
- image: node:4 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install --unsafe-perm | ||
- run: | ||
name: Run unit tests. | ||
command: npm test | ||
- run: | ||
name: Submit coverage data to codecov. | ||
command: node_modules/.bin/codecov | ||
when: always | ||
node6: | ||
docker: | ||
- image: node:6 | ||
<<: *unit_tests | ||
node7: | ||
docker: | ||
- image: node:7 | ||
<<: *unit_tests | ||
node8: | ||
docker: | ||
- image: node:8 | ||
<<: *unit_tests | ||
node9: | ||
docker: | ||
- image: node:9 | ||
<<: *unit_tests | ||
|
||
lint: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: | | ||
npm install | ||
npm link | ||
- run: | ||
name: Link the module being tested to the samples. | ||
command: | | ||
cd samples/ | ||
npm link @google-cloud/datastore | ||
npm install | ||
cd .. | ||
- run: | ||
name: Run linting. | ||
command: npm run lint | ||
|
||
docs: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Build documentation. | ||
command: npm run docs | ||
|
||
sample_tests: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Decrypt credentials. | ||
command: | | ||
openssl aes-256-cbc -d -in .circleci/key.json.enc \ | ||
-out .circleci/key.json \ | ||
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}" | ||
- run: | ||
name: Install and link the module. | ||
command: | | ||
npm install | ||
npm link | ||
- run: | ||
name: Link the module being tested to the samples. | ||
command: | | ||
cd samples/ | ||
npm link @google-cloud/datastore | ||
npm install | ||
cd .. | ||
- run: | ||
name: Run sample tests. | ||
command: npm run samples-test | ||
environment: | ||
GCLOUD_PROJECT: long-door-651 | ||
GOOGLE_APPLICATION_CREDENTIALS: /var/datastore/.circleci/key.json | ||
- run: | ||
name: Remove unencrypted key. | ||
command: rm .circleci/key.json | ||
when: always | ||
working_directory: /var/datastore/ | ||
|
||
system_tests: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Decrypt credentials. | ||
command: | | ||
openssl aes-256-cbc -d -in .circleci/key.json.enc \ | ||
-out .circleci/key.json \ | ||
-k "${SYSTEM_TESTS_ENCRYPTION_KEY}" | ||
- run: | ||
name: Install modules and dependencies. | ||
command: npm install | ||
- run: | ||
name: Run system tests. | ||
command: npm run system-test | ||
environment: | ||
GCLOUD_PROJECT: long-door-651 | ||
GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json | ||
- run: | ||
name: Remove unencrypted key. | ||
command: rm .circleci/key.json | ||
when: always | ||
|
||
publish_npm: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Set NPM authentication. | ||
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | ||
- run: | ||
name: Publish the module to npm. | ||
command: npm publish | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"requiresKeyFile": true, | ||
"requiresProjectId": true, | ||
"product": "datastore", | ||
"client_reference_url": "https://cloud.google.com/nodejs/docs/reference/datastore/latest/", | ||
"release_quality": "ga", | ||
"samples": [ | ||
{ | ||
"id": "tasks", | ||
"name": "Tasks", | ||
"file": "tasks.js", | ||
"docs_link": "https://cloud.google.com/datastore/docs/datastore-api-tutorial", | ||
"usage": "node tasks.js --help" | ||
}, | ||
{ | ||
"id": "concepts", | ||
"name": "Concepts", | ||
"file": "concepts.js", | ||
"docs_link": "https://cloud.google.com/datastore/docs/concepts/entities" | ||
}, | ||
{ | ||
"id": "error", | ||
"name": "Errors and Error Handling", | ||
"file": "error.js", | ||
"docs_link": "https://cloud.google.com/datastore/docs/concepts/errors", | ||
"usage": { | ||
"text": "node error.js" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/* | ||
samples/node_modules/* | ||
src/**/doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
extends: | ||
- 'eslint:recommended' | ||
- 'plugin:node/recommended' | ||
- prettier | ||
plugins: | ||
- node | ||
- prettier | ||
rules: | ||
prettier/prettier: error | ||
block-scoped-var: error | ||
eqeqeq: error | ||
no-warning-comments: warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# How to become a contributor and submit your own code | ||
|
||
**Table of contents** | ||
|
||
* [Contributor License Agreements](#contributor-license-agreements) | ||
* [Contributing a patch](#contributing-a-patch) | ||
* [Running the tests](#running-the-tests) | ||
* [Releasing the library](#releasing-the-library) | ||
|
||
## Contributor License Agreements | ||
|
||
We'd love to accept your sample apps and patches! Before we can take them, we | ||
have to jump a couple of legal hurdles. | ||
|
||
Please fill out either the individual or corporate Contributor License Agreement | ||
(CLA). | ||
|
||
* If you are an individual writing original source code and you're sure you | ||
own the intellectual property, then you'll need to sign an [individual CLA] | ||
(https://developers.google.com/open-source/cla/individual). | ||
* If you work for a company that wants to allow you to contribute your work, | ||
then you'll need to sign a [corporate CLA] | ||
(https://developers.google.com/open-source/cla/corporate). | ||
|
||
Follow either of the two links above to access the appropriate CLA and | ||
instructions for how to sign and return it. Once we receive it, we'll be able to | ||
accept your pull requests. | ||
|
||
## Contributing A Patch | ||
|
||
1. Submit an issue describing your proposed change to the repo in question. | ||
1. The repo owner will respond to your issue promptly. | ||
1. If your proposed change is accepted, and you haven't already done so, sign a | ||
Contributor License Agreement (see details above). | ||
1. Fork the desired repo, develop and test your code changes. | ||
1. Ensure that your code adheres to the existing style in the code to which | ||
you are contributing. | ||
1. Ensure that your code has an appropriate set of tests which all pass. | ||
1. Submit a pull request. | ||
|
||
## Running the tests | ||
|
||
1. [Prepare your environment for Node.js setup][setup]. | ||
|
||
1. Install dependencies: | ||
|
||
npm install | ||
|
||
1. Run the tests: | ||
|
||
npm test | ||
|
||
[setup]: https://cloud.google.com/nodejs/docs/setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Thanks for stopping by to let us know something could be better! | ||
|
||
Please run down the following list and make sure you've tried the usual "quick | ||
fixes": | ||
|
||
- Search the issues already opened: https://github.com/googleapis/nodejs-datastore/issues | ||
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js | ||
- Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting | ||
- Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq | ||
|
||
If you are still having issues, please be sure to include as much information as | ||
possible: | ||
|
||
#### Environment details | ||
|
||
- OS: | ||
- Node.js version: | ||
- npm version: | ||
- @google-cloud/datastore version: | ||
|
||
#### Steps to reproduce | ||
|
||
1. ??? | ||
2. ??? | ||
|
||
Following these steps will guarantee the quickest resolution possible. | ||
|
||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion) | ||
|
||
- [ ] Tests and linter pass | ||
- [ ] Code coverage does not decrease (if any source code was changed) | ||
- [ ] Appropriate docs were updated (if necessary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**/*.log | ||
**/node_modules | ||
.coverage | ||
.nyc_output | ||
docs/ | ||
out/ | ||
system-test/secrets.js | ||
system-test/*key.json | ||
*.lock | ||
*-lock.js* |
Oops, something went wrong.