From 0db5e3689acc2199a3db24a6d89fbfee526fdc14 Mon Sep 17 00:00:00 2001 From: Rebecca Taylor Date: Fri, 23 Mar 2018 14:36:09 -0700 Subject: [PATCH] $ npm run generate-scaffolding --- .github/ISSUE_TEMPLATE.md | 2 +- .gitignore | 4 ++ .jsdoc.js | 2 +- CONTRIBUTORS | 1 + README.md | 9 ++-- package.json | 5 ++- samples/.eslintrc.yml | 3 ++ samples/README.md | 88 +++++++++++++++++++++++++++++++++++++++ system-test/.eslintrc.yml | 6 +++ 9 files changed, 112 insertions(+), 8 deletions(-) create mode 100644 samples/.eslintrc.yml create mode 100644 samples/README.md create mode 100644 system-test/.eslintrc.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 3ccc6312..dbd1f0d6 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -15,7 +15,7 @@ possible: - OS: - Node.js version: - npm version: - - `text-to-speech` version: + - `@google-cloud/text-to-speech` version: #### Steps to reproduce diff --git a/.gitignore b/.gitignore index b7d40760..082cf01e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ .nyc_output docs/ out/ +build/ system-test/secrets.js system-test/*key.json *.lock +.DS_Store +google-cloud-logging-winston-*.tgz +google-cloud-logging-bunyan-*.tgz \ No newline at end of file diff --git a/.jsdoc.js b/.jsdoc.js index fc21f4c4..faaa278c 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -39,7 +39,7 @@ module.exports = { copyright: 'Copyright 2017 Google, Inc.', includeDate: false, sourceFiles: false, - systemName: 'text-to-speech', + systemName: '@google-cloud/text-to-speech', theme: 'lumen' } }; diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7644a907..a21d75c5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -4,3 +4,4 @@ # name # Alexander Fenster +Rebecca Taylor diff --git a/README.md b/README.md index 9788c2ec..39d18d13 100644 --- a/README.md +++ b/README.md @@ -78,15 +78,16 @@ const text = 'Hello, world!'; // Construct the request const request = { - input: { text: text }, + input: {text: text}, // Select the language and SSML Voice Gender (optional) - voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' }, + voice: {languageCode: 'en-US', ssmlGender: 'NEUTRAL'}, // Select the type of audio encoding - audioConfig: { audioEncoding: 'MP3' } + audioConfig: {audioEncoding: 'MP3'}, }; // Performs the Text-to-Speech request -client.synthesizeSpeech(request) +client + .synthesizeSpeech(request) .then(results => { // The binary audio content returned from the API const audioContent = results[0].audioContent; diff --git a/package.json b/package.json index 492a21bb..a3a029d8 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,12 @@ "Cloud Text-to-Speech API" ], "contributors": [ - "Alexander Fenster " + "Alexander Fenster ", + "Rebecca Taylor " ], "scripts": { "test": "repo-tools test run --cmd npm -- run cover", - "generate-scaffolding": "repo-tools generate lib_readme", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "cover": "nyc --reporter=lcov mocha --require intelli-espower-loader test/*.js && nyc report", "test-no-cover": "repo-tools test run --cmd mocha -- test/*.js --no-timeouts", "lint": "repo-tools lint --cmd eslint -- src/ samples/ system-test/ test/ smoke-test/", diff --git a/samples/.eslintrc.yml b/samples/.eslintrc.yml new file mode 100644 index 00000000..282535f5 --- /dev/null +++ b/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/samples/README.md b/samples/README.md new file mode 100644 index 00000000..0e917c3e --- /dev/null +++ b/samples/README.md @@ -0,0 +1,88 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `npm run generate-scaffolding`." +Google Cloud Platform logo + +# Google Cloud Text-To-Speech: Node.js Samples + +[![Open in Cloud Shell][shell_img]][shell_link] + +Cloud Text-to-Speech API + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Synthesize Speech](#synthesize-speech) + * [List supported voices](#list-supported-voices) + +## Before you begin + +Before running the samples, make sure you've followed the steps in the +[Before you begin section](../README.md#before-you-begin) of the client +library's README. + +## Samples + +### Synthesize Speech + +View the [source code][synthesize_speech_0_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-text-to-speech&page=editor&open_in_editor=samples/synthesize.js,samples/README.md) + +__Usage:__ `node synthesize.js --help` + +``` +synthesize.js + +Commands: + synthesize.js text Synthesizes audio file from text + synthesize.js ssml Synthesizes audio file from SSML + synthesize.js text-file Synthesizes audio file from text in a file + synthesize.js ssml-file Synthesizes audio file from SSML in a file + +Options: + --version Show version number [boolean] + --outputFile, -o [string] [default: "output.mp3"] + --help Show help [boolean] + +Examples: + node synthesize.js text "hello" -o hello.mp3 + node synthesize.js ssml " + +Commands: + listVoices.js list-voices List supported voices. + +Options: + --version Show version number [boolean] + --help Show help [boolean] + +Examples: + node listVoices.js list-voices + +For more information, see https://cloud.google.com/text-to-speech/docs +``` + +[list_voices_1_docs]: https://cloud.google.com/text-to-speech/docs +[list_voices_1_code]: listVoices.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-text-to-speech&page=editor&open_in_editor=samples/README.md diff --git a/system-test/.eslintrc.yml b/system-test/.eslintrc.yml new file mode 100644 index 00000000..2e6882e4 --- /dev/null +++ b/system-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off