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

3.6.0 breaks interface exports #1644

Closed
buu700 opened this issue May 5, 2019 · 11 comments
Closed

3.6.0 breaks interface exports #1644

buu700 opened this issue May 5, 2019 · 11 comments
Labels

Comments

@buu700
Copy link

buu700 commented May 5, 2019

3.6.0 seems to have regressed in handling @interface and/or @export.

Using protobufjs with jsdoc@3.5.5 works as expected. After updating to 3.6.0, the pbts command that takes a generated JS file as input and outputs a TypeScript type definition file fails to export required interfaces.

I don't know exactly what protobufjs is doing under-the-hood, but it looks like this is the relevant function that uses jsdoc.

Input code

Protobuf code like this:

/** A class. */
message Balls {
	/** A string. */
	required string test = 1;
}

Would output code that includes this:

/**
 * Properties of a Balls.
 * @exports IBalls
 * @interface IBalls
 * @property {string} test A string.
 */

Expected behavior

The final output should include an interface IBalls (and a class Balls that implements IBalls).

Current behavior

No IBalls.

Your environment

Software Version
JSDoc 3.6.0
Node.js 10.15.3
npm 6.4.1
Operating system Debian 9.9
@hegemonic
Copy link
Contributor

When I save your sample output as a JS file and run JSDoc 3.6.1 on that file, it generates the appropriate docs:

Screen Shot 2019-05-05 at 12 34 24 PM

I'm guessing that your real input file is more complicated. Can you point me to the repo that contains the full input file, or share it with me in a gist (privately if necessary)?

@bcoe
Copy link

bcoe commented May 6, 2019

We are bumping into similar issues in the library:

https://github.com/googleapis/nodejs-resource

When generating jsdoc with 3.5.5, a page is generated correctly for the:

export {Project};

and

export {Resource};

On 3.6.x no Resource.html or Project.html is generated.

@hegemonic
Copy link
Contributor

Thanks for the pointer, @bcoe. I can reproduce the issue with that repo, and this is definitely a bug in JSDoc 3.6.x. I'm continuing to investigate.

The temporary solution is to pin to JSDoc 3.5.5.

@hegemonic
Copy link
Contributor

Looks like the culprit is cc66657. I'll have to think about how to fix this regression without regressing #1129 as well.

Fix coming soon, but "soon" might mean "a few days from now."

@bcoe
Copy link

bcoe commented May 7, 2019

@hegemonic thank you for digging into this 👍

hegemonic added a commit that referenced this issue May 12, 2019
… supposed to. (#1644)

Previously, when we combined doclets, we copied the `undocumented` property if it was set to `true`. That caused the combined doclet to have this property set to `true`, although it shouldn't have. As a result, the template discarded the doclet.

The solution is to simply ignore this property when combining doclets.

Also includes related cleanup for clarity.
hegemonic added a commit that referenced this issue May 12, 2019
… supposed to. (#1644)

Previously, when we combined doclets, we copied the `undocumented` property if it was set to `true`. That caused the combined doclet to have this property set to `true`, although it shouldn't have. As a result, the template discarded the doclet.

The solution is to simply ignore this property when combining doclets.

Also includes related cleanup for clarity.
@hegemonic
Copy link
Contributor

Fixed on master and JSDoc 3.6.2, which I just released. Thanks for your patience!

@bcoe
Copy link

bcoe commented May 13, 2019

@hegemonic thank you 👍, I will start testing it out on some repos tomorrow.

lheberlie added a commit to bsvensson/jsdoc that referenced this issue May 13, 2019
* releases/3.6:
  3.6.2
  Add 3.6.2 changelog.
  Ensure that ES 2015 classes appear in the generated docs when they're supposed to. (jsdoc#1644)

# Conflicts:
#	package.json
@buu700
Copy link
Author

buu700 commented Nov 20, 2019

Hey @hegemonic, I just tested this with both 3.6.2 and 3.6.3 on Node versions 10.17.0 and 12.13.1, and I'm still running into the original issue.

3.5.5 continues to work as expected, aside from #1643 (which I have a temporary workaround for, so not a blocker atm).

@brettz9
Copy link

brettz9 commented Dec 5, 2019

Could this be reopened?

brettz9 added a commit to brettz9/StackBlur that referenced this issue Dec 5, 2019
- npm: Remove `package-lock.json` in favor of `yarn.lock`
- npm: Move from deprecated `opn-cli` to `open-cli`
- npm: Update devDeps (except jsdoc which seems to still have a problem with ESM exports: <jsdoc/jsdoc#1644>)
@SharpDevSa
Copy link

pbts with JSDoc 3.6.3 does not output the correct result for Enums as well.
Enum is missing.
Node version: 12.16.0
protobufjs: 6.8.8
JSDoc was directly updated in protobufjs package,

@buu700
Copy link
Author

buu700 commented May 13, 2021

I can confirm that this is still an issue with jsdoc 3.6.6, protobufjs 6.11.2, and Node 14.17.0. Please reopen, @hegemonic.

buu700 added a commit to buu700/protobuf.js that referenced this issue Jul 19, 2022
buu700 added a commit to buu700/protobuf.js that referenced this issue Jul 19, 2022
this can be reverted after jsdoc is upgraded, which is blocked on jsdoc/jsdoc#1644
buu700 added a commit to buu700/protobuf.js that referenced this issue Jul 19, 2022
buu700 added a commit to buu700/protobuf.js that referenced this issue Jul 19, 2022
this can be reverted after jsdoc is upgraded, which is blocked on jsdoc/jsdoc#1644
buu700 added a commit to buu700/protobuf.js that referenced this issue Aug 4, 2022
this can be reverted after jsdoc is upgraded, which is blocked on jsdoc/jsdoc#1644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants