Skip to content

fix(pubsub): import protos from @google-cloud/pubsub-api in index.ts - #9686

Open
feywind wants to merge 2 commits into
googleapis:mainfrom
feywind:fix/pubsub-protos-reexport-devsite
Open

feywind wants to merge 2 commits into
googleapis:mainfrom
feywind:fix/pubsub-protos-reexport-devsite

Conversation

@feywind

@feywind feywind commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

In PR #9621, handwritten/pubsub/protos/protos.d.ts was updated to a star re-export (export * from '@google-cloud/pubsub-api/build/protos/protos').

Because handwritten/pubsub/src/index.ts still imported ../protos/protos via a local namespace import (import * as protos from '../protos/protos'), @microsoft/api-extractor fails during docs-devsite generation with:

ERROR: The protos namespace import includes a start export, which is not supported:
.../handwritten/pubsub/build/src/index.d.ts:99:8

This updates handwritten/pubsub/src/index.ts to import protos directly from @google-cloud/pubsub-api (matching spanner, logging, bigtable, and bigquery-storage), while retaining handwritten/pubsub/protos/protos.{js,d.ts} for direct subpath consumers.

In PR googleapis#9621, `handwritten/pubsub/protos/protos.d.ts` was updated to a star
re-export (`export * from '@google-cloud/pubsub-api/build/protos/protos'`).
Because `handwritten/pubsub/src/index.ts` still imported `../protos/protos` via
a local namespace import (`import * as protos from '../protos/protos'`),
`@microsoft/api-extractor` failed during `docs-devsite` generation with:

`ERROR: The protos namespace import includes a start export, which is not supported`

Import `protos` directly from `@google-cloud/pubsub-api` in `src/index.ts`
(matching `spanner`, `logging`, `bigtable`, and `bigquery-storage`) while
retaining `protos/protos.{js,d.ts}` for direct subpath consumers.
@feywind
feywind requested a review from a team as a code owner October 21, 2026 18:36
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Oct 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the import source of protos in handwritten/pubsub/src/index.ts to use @google-cloud/pubsub-api instead of a local path. Feedback suggests simplifying the import and export statements into a single direct re-export statement to make the code cleaner and more idiomatic.

Comment thread handwritten/pubsub/src/index.ts Outdated
Comment on lines 187 to 188
import {protos} from '@google-cloud/pubsub-api';
export {protos};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of importing protos and then exporting it on the next line, you can simplify this to a single direct re-export statement. This is cleaner and more idiomatic.

Suggested change
import {protos} from '@google-cloud/pubsub-api';
export {protos};
export {protos} from '@google-cloud/pubsub-api';

@github-actions
github-actions Bot requested a review from danieljbruce October 21, 2026 18:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants