Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc fix root @exports for enum & interface #1999

Closed
wants to merge 1 commit into from
Closed

JSDoc fix root @exports for enum & interface #1999

wants to merge 1 commit into from

Conversation

jaovitubr
Copy link

Fix Incomplete Type Definitions for .proto Files Without Package

Problem Description

When a package is not specified in the .proto file and types are generated using pbts, jsdoc does not recognize the @exports of the interfaces. This results in an incomplete type definition file.

Steps to Reproduce

  1. Clone the repository:

    git clone https://github.com/jaovitubr/protobuf.js-poc.git
  2. Navigate to the project directory:

    cd protobuf.js-poc
  3. Install the dependencies:

    npm install
  4. Generate the types:

    npm run gen
  5. Observe the generated files:

    • The sample-root.d.ts file is incomplete and missing the IPerson interface.
    • Compare it with the corrected file sample-root-fixed.d.ts, which includes the complete type definitions.

Solution

To fix this problem, the @exports annotation was removed so that Root enums/interfaces are correctly recognized by jsdoc even when no package is specified in the .proto file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant