From cf98949e717fa8cb50a462d6886889067c01a767 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 1 Apr 2019 20:41:33 -0700 Subject: [PATCH] docs: add .readme-metadata.json and generate new README.md (#595) --- .cloud-repo-tools.json | 9 ----- .gitignore | 1 + .readme-partials.yaml | 10 ++++++ .repo-metadata.json | 13 +++++++ README.md | 79 +++++++++++++++++++++++++++++------------- package.json | 2 -- samples/README.md | 53 ++++++++++++++++++++++++++++ 7 files changed, 131 insertions(+), 36 deletions(-) delete mode 100644 .cloud-repo-tools.json create mode 100644 .readme-partials.yaml create mode 100644 .repo-metadata.json create mode 100644 samples/README.md diff --git a/.cloud-repo-tools.json b/.cloud-repo-tools.json deleted file mode 100644 index c6d830a04..000000000 --- a/.cloud-repo-tools.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "requiresKeyFile": true, - "requiresProjectId": true, - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/firestore/latest/", - "release_quality": "ga", - "suppress_billing": true, - "samples": [], - "product": "firestore" -} diff --git a/.gitignore b/.gitignore index 13048b6db..549ef6081 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ build/ package-lock.json .vscode .DS_Store +__pycache__ diff --git a/.readme-partials.yaml b/.readme-partials.yaml new file mode 100644 index 000000000..bebbd9745 --- /dev/null +++ b/.readme-partials.yaml @@ -0,0 +1,10 @@ +introduction: |- + This is the Node.js Server SDK for [Google Cloud Firestore](https://firebase.google.com/docs/firestore/). Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. + + This Cloud Firestore Server SDK uses Google’s Cloud Identity and Access Management for authentication and should only be used in trusted environments. Your Cloud Identity credentials allow you bypass all access restrictions and provide read and write access to all data in your Cloud Firestore project. + + The Cloud Firestore Server SDKs are designed to manage the full set of data in your Cloud Firestore project and work best with reliable network connectivity. Data operations performed via these SDKs directly access the Cloud Firestore backend and all document reads and writes are optimized for high throughput. + + Applications that use Google's Server SDKs should not be used in end-user environments, such as on phones or on publicly hosted websites. If you are developing a Web or Node.js application that accesses Cloud Firestore on behalf of end users, use the firebase Client SDK. + + **Note:** This Cloud Firestore Server SDK does not support Firestore databases created in [Datastore mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode). To access these databases, use the [Datastore SDK](https://www.npmjs.com/package/@google-cloud/datastore). diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 000000000..a2471e940 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "firestore", + "name_pretty": "Cloud Firestore", + "product_documentation": "https://cloud.google.com/firestore", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/firestore/latest/", + "issue_tracker":"https://issuetracker.google.com/savedsearches/5337669", + "release_level": "ga", + "language": "nodejs", + "repo": "googleapis/nodejs-firestore", + "distribution_name": "@google-cloud/firestore", + "api_id": "firestore.googleapis.com", + "requires_billing ": false +} diff --git a/README.md b/README.md index 565e0a6f4..73a15b83a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `npm run generate-scaffolding`." +[//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Firestore: Node.js Server SDK](https://github.com/googleapis/nodejs-firestore) +# [Cloud Firestore: Node.js Client](https://github.com/googleapis/nodejs-firestore) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/firestore.svg)](https://www.npmjs.org/package/@google-cloud/firestore) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-firestore/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-firestore) + + + This is the Node.js Server SDK for [Google Cloud Firestore](https://firebase.google.com/docs/firestore/). Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. This Cloud Firestore Server SDK uses Google’s Cloud Identity and Access Management for authentication and should only be used in trusted environments. Your Cloud Identity credentials allow you bypass all access restrictions and provide read and write access to all data in your Cloud Firestore project. @@ -19,25 +22,44 @@ Applications that use Google's Server SDKs should not be used in end-user e **Note:** This Cloud Firestore Server SDK does not support Firestore databases created in [Datastore mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode). To access these databases, use the [Datastore SDK](https://www.npmjs.com/package/@google-cloud/datastore). -* [Using the client library](#using-the-client-library) +* [Cloud Firestore Node.js Client API Reference][client-docs] +* [Cloud Firestore Documentation][product-docs] +* [github.com/googleapis/nodejs-firestore](https://github.com/googleapis/nodejs-firestore) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) -## Using the client library - -1. [Select or create a Cloud Platform project][projects]. +## Quickstart -1. [Enable the Google Cloud Firestore API][enable_api]. +### Before you begin +1. [Select or create a Cloud Platform project][projects]. +1. [Enable the Cloud Firestore API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. -1. Install the client library: +### Installing the client library + +```bash +npm install @google-cloud/firestore +``` - npm install --save @google-cloud/firestore -1. Try an example: +### Using the client library ```javascript const Firestore = require('@google-cloud/firestore'); @@ -71,22 +93,40 @@ async function main() { }; main().catch(console.error); + ``` -The [Cloud Firestore Node.js Server SDK API Reference][client-docs] documentation + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-firestore/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-firestore/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Cloud Firestore Node.js Client API Reference][client-docs] documentation also contains samples. ## Versioning This library follows [Semantic Versioning](http://semver.org/). + This library is considered to be **General Availability (GA)**. This means it is stable; the code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against **GA** libraries are addressed with the highest priority. + + + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages @@ -101,21 +141,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-firestore/blob/master/LICENSE) -## What's Next - -* [Cloud Firestore Documentation][product-docs] -* [Cloud Firestore Node.js Server SDK API Reference][client-docs] -* [github.com/googleapis/nodejs-firestore](https://github.com/googleapis/nodejs-firestore) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - [client-docs]: https://cloud.google.com/nodejs/docs/reference/firestore/latest/ -[product-docs]: https://firebase.google.com/docs/firestore/ +[product-docs]: https://cloud.google.com/firestore [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=firestore.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/package.json b/package.json index b731a21bd..699020a83 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "codecov": "nyc report --reporter=json && codecov -f .coverage/*.json", "predocs": "npm run compile", "docs": "jsdoc -c .jsdoc.js", - "generate-scaffolding": "repo-tools generate all", "system-test": "mocha build/system-test --timeout 600000", "samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../", "conformance": "mocha build/conformance", @@ -55,7 +54,6 @@ "through2": "^3.0.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", "@types/assert": "^1.4.0", "@types/chai": "^4.1.7", "@types/chai-as-promised": "^7.1.0", diff --git a/samples/README.md b/samples/README.md new file mode 100644 index 000000000..1b665b9ef --- /dev/null +++ b/samples/README.md @@ -0,0 +1,53 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Firestore: Node.js Samples](https://github.com/googleapis/nodejs-firestore) + +[![Open in Cloud Shell][shell_img]][shell_link] + +This is the Node.js Server SDK for [Google Cloud Firestore](https://firebase.google.com/docs/firestore/). Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. + +This Cloud Firestore Server SDK uses Google’s Cloud Identity and Access Management for authentication and should only be used in trusted environments. Your Cloud Identity credentials allow you bypass all access restrictions and provide read and write access to all data in your Cloud Firestore project. + +The Cloud Firestore Server SDKs are designed to manage the full set of data in your Cloud Firestore project and work best with reliable network connectivity. Data operations performed via these SDKs directly access the Cloud Firestore backend and all document reads and writes are optimized for high throughput. + +Applications that use Google's Server SDKs should not be used in end-user environments, such as on phones or on publicly hosted websites. If you are developing a Web or Node.js application that accesses Cloud Firestore on behalf of end users, use the firebase Client SDK. + +**Note:** This Cloud Firestore Server SDK does not support Firestore databases created in [Datastore mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode). To access these databases, use the [Datastore SDK](https://www.npmjs.com/package/@google-cloud/datastore). + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps in the +[Using the client library](https://github.com/googleapis/nodejs-firestore#using-the-client-library) of the client +library's README. + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-firestore/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-firestore&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/firestore \ No newline at end of file