diff --git a/templates/typescript_gapic/.jsdoc.js.njk b/templates/typescript_gapic/.jsdoc.js.njk index f209dba2f..05ce4ea5e 100644 --- a/templates/typescript_gapic/.jsdoc.js.njk +++ b/templates/typescript_gapic/.jsdoc.js.njk @@ -25,7 +25,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { include: [ diff --git a/templates/typescript_gapic/package.json.njk b/templates/typescript_gapic/package.json.njk index 846f6d0b0..1214d0786 100644 --- a/templates/typescript_gapic/package.json.njk +++ b/templates/typescript_gapic/package.json.njk @@ -45,21 +45,15 @@ limitations under the License. }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.3", "@types/node": "^12.0.0", - "@types/tmp": "^0.1.0", - "execa": "^3.2.0", "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "mv": "^2.1.1", - "ncp": "^2.0.0", "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", - "tmp": "^0.1.0", "ts-loader": "^6.2.1", "typescript": "^3.7.0", "webpack": "^4.41.2", diff --git a/templates/typescript_gapic/webpack.config.js.njk b/templates/typescript_gapic/webpack.config.js.njk index 084218ca4..c74a2c6d8 100644 --- a/templates/typescript_gapic/webpack.config.js.njk +++ b/templates/typescript_gapic/webpack.config.js.njk @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: '{{ api.naming.name.toCamelCase() }}', - filename: './{{ api.naming.name.toKebabCase() }}.js', + library: '{{ api.mainServiceName }}', + filename: './{{ api.mainServiceName.toKebabCase() }}.js', }, node: { child_process: 'empty', diff --git a/typescript/src/schema/api.ts b/typescript/src/schema/api.ts index ea47be0a9..3782cd3e0 100644 --- a/typescript/src/schema/api.ts +++ b/typescript/src/schema/api.ts @@ -31,6 +31,7 @@ export class API { protos: ProtosMap; hostName?: string; port?: string; + mainServiceName?: string; // oauth_scopes: plugin.google.protobuf.IServiceOptions.prototype[".google.api.oauthScopes"]; // TODO: subpackages @@ -69,6 +70,7 @@ export class API { const arr = defaultHost.split(':'); this.hostName = arr[0] || 'localhost'; this.port = arr.length > 1 ? arr[1] : '443'; + this.mainServiceName = service.name || this.naming.name; } } }); diff --git a/typescript/test/testdata/keymanager/.jsdoc.js.baseline b/typescript/test/testdata/keymanager/.jsdoc.js.baseline index 7b42c1176..f42e03781 100644 --- a/typescript/test/testdata/keymanager/.jsdoc.js.baseline +++ b/typescript/test/testdata/keymanager/.jsdoc.js.baseline @@ -25,7 +25,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { include: [ diff --git a/typescript/test/testdata/keymanager/package.json.baseline b/typescript/test/testdata/keymanager/package.json.baseline index 950fe4610..7cc975ee7 100644 --- a/typescript/test/testdata/keymanager/package.json.baseline +++ b/typescript/test/testdata/keymanager/package.json.baseline @@ -28,21 +28,15 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.3", "@types/node": "^12.0.0", - "@types/tmp": "^0.1.0", - "execa": "^3.2.0", "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "mv": "^2.1.1", - "ncp": "^2.0.0", "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", - "tmp": "^0.1.0", "ts-loader": "^6.2.1", "typescript": "^3.7.0", "webpack": "^4.41.2", diff --git a/typescript/test/testdata/keymanager/webpack.config.js.baseline b/typescript/test/testdata/keymanager/webpack.config.js.baseline index e07e16fe0..1fe16b5c8 100644 --- a/typescript/test/testdata/keymanager/webpack.config.js.baseline +++ b/typescript/test/testdata/keymanager/webpack.config.js.baseline @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'kms', - filename: './kms.js', + library: 'KeyManagementService', + filename: './key-management-service.js', }, node: { child_process: 'empty', diff --git a/typescript/test/testdata/showcase/.jsdoc.js.baseline b/typescript/test/testdata/showcase/.jsdoc.js.baseline index 3f84102f7..8f27315b3 100644 --- a/typescript/test/testdata/showcase/.jsdoc.js.baseline +++ b/typescript/test/testdata/showcase/.jsdoc.js.baseline @@ -25,7 +25,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { include: [ diff --git a/typescript/test/testdata/showcase/package.json.baseline b/typescript/test/testdata/showcase/package.json.baseline index 8c6a5e5c7..1232f169b 100644 --- a/typescript/test/testdata/showcase/package.json.baseline +++ b/typescript/test/testdata/showcase/package.json.baseline @@ -28,21 +28,15 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.3", "@types/node": "^12.0.0", - "@types/tmp": "^0.1.0", - "execa": "^3.2.0", "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "mv": "^2.1.1", - "ncp": "^2.0.0", "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", - "tmp": "^0.1.0", "ts-loader": "^6.2.1", "typescript": "^3.7.0", "webpack": "^4.41.2", diff --git a/typescript/test/testdata/showcase/webpack.config.js.baseline b/typescript/test/testdata/showcase/webpack.config.js.baseline index cea49a3b3..7a3e258a4 100644 --- a/typescript/test/testdata/showcase/webpack.config.js.baseline +++ b/typescript/test/testdata/showcase/webpack.config.js.baseline @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'showcase', - filename: './showcase.js', + library: 'Echo', + filename: './echo.js', }, node: { child_process: 'empty', diff --git a/typescript/test/testdata/texttospeech/.jsdoc.js.baseline b/typescript/test/testdata/texttospeech/.jsdoc.js.baseline index dfd218f7c..a07cde638 100644 --- a/typescript/test/testdata/texttospeech/.jsdoc.js.baseline +++ b/typescript/test/testdata/texttospeech/.jsdoc.js.baseline @@ -25,7 +25,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { include: [ diff --git a/typescript/test/testdata/texttospeech/package.json.baseline b/typescript/test/testdata/texttospeech/package.json.baseline index 8e46fd096..cb4e44bcc 100644 --- a/typescript/test/testdata/texttospeech/package.json.baseline +++ b/typescript/test/testdata/texttospeech/package.json.baseline @@ -28,21 +28,15 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.3", "@types/node": "^12.0.0", - "@types/tmp": "^0.1.0", - "execa": "^3.2.0", "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "mv": "^2.1.1", - "ncp": "^2.0.0", "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", - "tmp": "^0.1.0", "ts-loader": "^6.2.1", "typescript": "^3.7.0", "webpack": "^4.41.2", diff --git a/typescript/test/testdata/texttospeech/webpack.config.js.baseline b/typescript/test/testdata/texttospeech/webpack.config.js.baseline index eb885db73..05026a2d9 100644 --- a/typescript/test/testdata/texttospeech/webpack.config.js.baseline +++ b/typescript/test/testdata/texttospeech/webpack.config.js.baseline @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'texttospeech', - filename: './texttospeech.js', + library: 'TextToSpeech', + filename: './text-to-speech.js', }, node: { child_process: 'empty', diff --git a/typescript/test/testdata/translate/.jsdoc.js.baseline b/typescript/test/testdata/translate/.jsdoc.js.baseline index 32c27002f..0d6b78cca 100644 --- a/typescript/test/testdata/translate/.jsdoc.js.baseline +++ b/typescript/test/testdata/translate/.jsdoc.js.baseline @@ -25,7 +25,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { include: [ diff --git a/typescript/test/testdata/translate/package.json.baseline b/typescript/test/testdata/translate/package.json.baseline index 476ac7610..6718a1713 100644 --- a/typescript/test/testdata/translate/package.json.baseline +++ b/typescript/test/testdata/translate/package.json.baseline @@ -28,21 +28,15 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.3", "@types/node": "^12.0.0", - "@types/tmp": "^0.1.0", - "execa": "^3.2.0", "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "mv": "^2.1.1", - "ncp": "^2.0.0", "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", - "tmp": "^0.1.0", "ts-loader": "^6.2.1", "typescript": "^3.7.0", "webpack": "^4.41.2", diff --git a/typescript/test/testdata/translate/webpack.config.js.baseline b/typescript/test/testdata/translate/webpack.config.js.baseline index 85d02382f..e9d7243bc 100644 --- a/typescript/test/testdata/translate/webpack.config.js.baseline +++ b/typescript/test/testdata/translate/webpack.config.js.baseline @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'translation', - filename: './translation.js', + library: 'TranslationService', + filename: './translation-service.js', }, node: { child_process: 'empty',