Skip to content

JSDoc fix root @exports for enum & interface#1999

Closed
jaovitubr wants to merge 1 commit intoprotobufjs:masterfrom
jaovitubr:master
Closed

JSDoc fix root @exports for enum & interface#1999
jaovitubr wants to merge 1 commit intoprotobufjs:masterfrom
jaovitubr:master

Conversation

@jaovitubr
Copy link
Copy Markdown

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