From 7360b99f7b751cf97bf93bde8a916d8ad2cf4ae3 Mon Sep 17 00:00:00 2001 From: xiaozhenliugg Date: Mon, 24 Feb 2020 16:15:11 -0800 Subject: [PATCH 1/3] export protos in index.ts --- baselines/dlp/src/index.ts.baseline | 1 + baselines/kms/src/index.ts.baseline | 1 + baselines/monitoring/src/index.ts.baseline | 1 + baselines/redis/src/index.ts.baseline | 1 + baselines/showcase/src/index.ts.baseline | 1 + baselines/texttospeech/src/index.ts.baseline | 1 + baselines/translate/src/index.ts.baseline | 1 + templates/typescript_gapic/src/index.ts.njk | 1 + 8 files changed, 8 insertions(+) diff --git a/baselines/dlp/src/index.ts.baseline b/baselines/dlp/src/index.ts.baseline index 56587ec8a..e314dbbe2 100644 --- a/baselines/dlp/src/index.ts.baseline +++ b/baselines/dlp/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v2 from './v2'; const DlpServiceClient = v2.DlpServiceClient; export {v2, DlpServiceClient}; diff --git a/baselines/kms/src/index.ts.baseline b/baselines/kms/src/index.ts.baseline index 6ebde6271..f35c1a2ce 100644 --- a/baselines/kms/src/index.ts.baseline +++ b/baselines/kms/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v1 from './v1'; const KeyManagementServiceClient = v1.KeyManagementServiceClient; export {v1, KeyManagementServiceClient}; diff --git a/baselines/monitoring/src/index.ts.baseline b/baselines/monitoring/src/index.ts.baseline index cf6f9adf2..958380cc6 100644 --- a/baselines/monitoring/src/index.ts.baseline +++ b/baselines/monitoring/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v3 from './v3'; const AlertPolicyServiceClient = v3.AlertPolicyServiceClient; const GroupServiceClient = v3.GroupServiceClient; diff --git a/baselines/redis/src/index.ts.baseline b/baselines/redis/src/index.ts.baseline index 49e1ccaad..977e75de2 100644 --- a/baselines/redis/src/index.ts.baseline +++ b/baselines/redis/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const CloudRedisClient = v1beta1.CloudRedisClient; export {v1beta1, CloudRedisClient}; diff --git a/baselines/showcase/src/index.ts.baseline b/baselines/showcase/src/index.ts.baseline index def228fcd..489c9e235 100644 --- a/baselines/showcase/src/index.ts.baseline +++ b/baselines/showcase/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const EchoClient = v1beta1.EchoClient; const IdentityClient = v1beta1.IdentityClient; diff --git a/baselines/texttospeech/src/index.ts.baseline b/baselines/texttospeech/src/index.ts.baseline index d6084cc33..cd4d47569 100644 --- a/baselines/texttospeech/src/index.ts.baseline +++ b/baselines/texttospeech/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v1 from './v1'; const TextToSpeechClient = v1.TextToSpeechClient; export {v1, TextToSpeechClient}; diff --git a/baselines/translate/src/index.ts.baseline b/baselines/translate/src/index.ts.baseline index 01defa5e5..d4a28d175 100644 --- a/baselines/translate/src/index.ts.baseline +++ b/baselines/translate/src/index.ts.baseline @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export * as protos from '../protos/protos'; import * as v3beta1 from './v3beta1'; const TranslationServiceClient = v3beta1.TranslationServiceClient; export {v3beta1, TranslationServiceClient}; diff --git a/templates/typescript_gapic/src/index.ts.njk b/templates/typescript_gapic/src/index.ts.njk index 78a430ada..2512442b7 100644 --- a/templates/typescript_gapic/src/index.ts.njk +++ b/templates/typescript_gapic/src/index.ts.njk @@ -17,6 +17,7 @@ limitations under the License. -#} {% import "../_license.njk" as license -%} {{license.license()}} +export * as protos from '../protos/protos'; import * as {{ api.naming.version }} from './{{ api.naming.version }}'; {%- for service in api.services %} const {{ service.name.toPascalCase() }}Client = {{ api.naming.version }}.{{ service.name.toPascalCase() }}Client; From f9bc22d9bbcf6b3bcef88a2fa67282b0d5a1bd48 Mon Sep 17 00:00:00 2001 From: xiaozhenliugg Date: Mon, 24 Feb 2020 16:30:42 -0800 Subject: [PATCH 2/3] still on typescropt 3.7.0 --- baselines/dlp/src/index.ts.baseline | 3 ++- baselines/kms/src/index.ts.baseline | 3 ++- baselines/monitoring/src/index.ts.baseline | 3 ++- baselines/redis/src/index.ts.baseline | 3 ++- baselines/showcase/src/index.ts.baseline | 3 ++- baselines/texttospeech/src/index.ts.baseline | 3 ++- baselines/translate/src/index.ts.baseline | 3 ++- templates/typescript_gapic/src/index.ts.njk | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/baselines/dlp/src/index.ts.baseline b/baselines/dlp/src/index.ts.baseline index e314dbbe2..2707b4d8f 100644 --- a/baselines/dlp/src/index.ts.baseline +++ b/baselines/dlp/src/index.ts.baseline @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v2 from './v2'; const DlpServiceClient = v2.DlpServiceClient; export {v2, DlpServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v2, DlpServiceClient}; +export {protos} diff --git a/baselines/kms/src/index.ts.baseline b/baselines/kms/src/index.ts.baseline index f35c1a2ce..b18dc2b76 100644 --- a/baselines/kms/src/index.ts.baseline +++ b/baselines/kms/src/index.ts.baseline @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v1 from './v1'; const KeyManagementServiceClient = v1.KeyManagementServiceClient; export {v1, KeyManagementServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, KeyManagementServiceClient}; +export {protos} diff --git a/baselines/monitoring/src/index.ts.baseline b/baselines/monitoring/src/index.ts.baseline index 958380cc6..60df21b33 100644 --- a/baselines/monitoring/src/index.ts.baseline +++ b/baselines/monitoring/src/index.ts.baseline @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v3 from './v3'; const AlertPolicyServiceClient = v3.AlertPolicyServiceClient; const GroupServiceClient = v3.GroupServiceClient; @@ -28,3 +28,4 @@ export {v3, AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, N // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v3, AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, NotificationChannelServiceClient, ServiceMonitoringServiceClient, UptimeCheckServiceClient}; +export {protos} diff --git a/baselines/redis/src/index.ts.baseline b/baselines/redis/src/index.ts.baseline index 977e75de2..5ef6f959f 100644 --- a/baselines/redis/src/index.ts.baseline +++ b/baselines/redis/src/index.ts.baseline @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const CloudRedisClient = v1beta1.CloudRedisClient; export {v1beta1, CloudRedisClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, CloudRedisClient}; +export {protos} diff --git a/baselines/showcase/src/index.ts.baseline b/baselines/showcase/src/index.ts.baseline index 489c9e235..abe9bb481 100644 --- a/baselines/showcase/src/index.ts.baseline +++ b/baselines/showcase/src/index.ts.baseline @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const EchoClient = v1beta1.EchoClient; const IdentityClient = v1beta1.IdentityClient; @@ -26,3 +26,4 @@ export {v1beta1, EchoClient, IdentityClient, MessagingClient, TestingClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, EchoClient, IdentityClient, MessagingClient, TestingClient}; +export {protos} diff --git a/baselines/texttospeech/src/index.ts.baseline b/baselines/texttospeech/src/index.ts.baseline index cd4d47569..567d75a5e 100644 --- a/baselines/texttospeech/src/index.ts.baseline +++ b/baselines/texttospeech/src/index.ts.baseline @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v1 from './v1'; const TextToSpeechClient = v1.TextToSpeechClient; export {v1, TextToSpeechClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, TextToSpeechClient}; +export {protos} diff --git a/baselines/translate/src/index.ts.baseline b/baselines/translate/src/index.ts.baseline index d4a28d175..6841b2531 100644 --- a/baselines/translate/src/index.ts.baseline +++ b/baselines/translate/src/index.ts.baseline @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as v3beta1 from './v3beta1'; const TranslationServiceClient = v3beta1.TranslationServiceClient; export {v3beta1, TranslationServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v3beta1, TranslationServiceClient}; +export {protos} diff --git a/templates/typescript_gapic/src/index.ts.njk b/templates/typescript_gapic/src/index.ts.njk index 2512442b7..fe68cb8c0 100644 --- a/templates/typescript_gapic/src/index.ts.njk +++ b/templates/typescript_gapic/src/index.ts.njk @@ -17,7 +17,7 @@ limitations under the License. -#} {% import "../_license.njk" as license -%} {{license.license()}} -export * as protos from '../protos/protos'; +import * as protos from '../protos/protos'; import * as {{ api.naming.version }} from './{{ api.naming.version }}'; {%- for service in api.services %} const {{ service.name.toPascalCase() }}Client = {{ api.naming.version }}.{{ service.name.toPascalCase() }}Client; @@ -34,3 +34,4 @@ export default { {{- api.naming.version }} , {{ service.name.toPascalCase() + 'Client' }} {%- endfor -%} }; +export {protos} From 05f0bcd0995a8f74f4dbbabef1b2f986149243c7 Mon Sep 17 00:00:00 2001 From: xiaozhenliugg Date: Wed, 26 Feb 2020 12:31:54 -0800 Subject: [PATCH 3/3] reformat to align with mass PR change --- baselines/dlp/src/index.ts.baseline | 2 +- baselines/kms/src/index.ts.baseline | 2 +- baselines/monitoring/src/index.ts.baseline | 2 +- baselines/redis/src/index.ts.baseline | 2 +- baselines/showcase/src/index.ts.baseline | 2 +- baselines/texttospeech/src/index.ts.baseline | 2 +- baselines/translate/src/index.ts.baseline | 2 +- templates/typescript_gapic/src/index.ts.njk | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/baselines/dlp/src/index.ts.baseline b/baselines/dlp/src/index.ts.baseline index 2707b4d8f..8d2cf4315 100644 --- a/baselines/dlp/src/index.ts.baseline +++ b/baselines/dlp/src/index.ts.baseline @@ -16,11 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v2 from './v2'; const DlpServiceClient = v2.DlpServiceClient; export {v2, DlpServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v2, DlpServiceClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/kms/src/index.ts.baseline b/baselines/kms/src/index.ts.baseline index b18dc2b76..1334aa28a 100644 --- a/baselines/kms/src/index.ts.baseline +++ b/baselines/kms/src/index.ts.baseline @@ -16,11 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v1 from './v1'; const KeyManagementServiceClient = v1.KeyManagementServiceClient; export {v1, KeyManagementServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, KeyManagementServiceClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/monitoring/src/index.ts.baseline b/baselines/monitoring/src/index.ts.baseline index 60df21b33..5a2bb6576 100644 --- a/baselines/monitoring/src/index.ts.baseline +++ b/baselines/monitoring/src/index.ts.baseline @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v3 from './v3'; const AlertPolicyServiceClient = v3.AlertPolicyServiceClient; const GroupServiceClient = v3.GroupServiceClient; @@ -28,4 +27,5 @@ export {v3, AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, N // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v3, AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, NotificationChannelServiceClient, ServiceMonitoringServiceClient, UptimeCheckServiceClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/redis/src/index.ts.baseline b/baselines/redis/src/index.ts.baseline index 5ef6f959f..f3e90759f 100644 --- a/baselines/redis/src/index.ts.baseline +++ b/baselines/redis/src/index.ts.baseline @@ -16,11 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const CloudRedisClient = v1beta1.CloudRedisClient; export {v1beta1, CloudRedisClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, CloudRedisClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/showcase/src/index.ts.baseline b/baselines/showcase/src/index.ts.baseline index abe9bb481..83a51614b 100644 --- a/baselines/showcase/src/index.ts.baseline +++ b/baselines/showcase/src/index.ts.baseline @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v1beta1 from './v1beta1'; const EchoClient = v1beta1.EchoClient; const IdentityClient = v1beta1.IdentityClient; @@ -26,4 +25,5 @@ export {v1beta1, EchoClient, IdentityClient, MessagingClient, TestingClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, EchoClient, IdentityClient, MessagingClient, TestingClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/texttospeech/src/index.ts.baseline b/baselines/texttospeech/src/index.ts.baseline index 567d75a5e..c6c09e274 100644 --- a/baselines/texttospeech/src/index.ts.baseline +++ b/baselines/texttospeech/src/index.ts.baseline @@ -16,11 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v1 from './v1'; const TextToSpeechClient = v1.TextToSpeechClient; export {v1, TextToSpeechClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, TextToSpeechClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/baselines/translate/src/index.ts.baseline b/baselines/translate/src/index.ts.baseline index 6841b2531..95755fe45 100644 --- a/baselines/translate/src/index.ts.baseline +++ b/baselines/translate/src/index.ts.baseline @@ -16,11 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as protos from '../protos/protos'; import * as v3beta1 from './v3beta1'; const TranslationServiceClient = v3beta1.TranslationServiceClient; export {v3beta1, TranslationServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v3beta1, TranslationServiceClient}; +import * as protos from '../protos/protos'; export {protos} diff --git a/templates/typescript_gapic/src/index.ts.njk b/templates/typescript_gapic/src/index.ts.njk index fe68cb8c0..1ce890507 100644 --- a/templates/typescript_gapic/src/index.ts.njk +++ b/templates/typescript_gapic/src/index.ts.njk @@ -17,7 +17,6 @@ limitations under the License. -#} {% import "../_license.njk" as license -%} {{license.license()}} -import * as protos from '../protos/protos'; import * as {{ api.naming.version }} from './{{ api.naming.version }}'; {%- for service in api.services %} const {{ service.name.toPascalCase() }}Client = {{ api.naming.version }}.{{ service.name.toPascalCase() }}Client; @@ -34,4 +33,5 @@ export default { {{- api.naming.version }} , {{ service.name.toPascalCase() + 'Client' }} {%- endfor -%} }; +import * as protos from '../protos/protos'; export {protos}