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

use jsdoc to generate typings #3584

Open
Uzlopak opened this issue Sep 11, 2024 · 3 comments
Open

use jsdoc to generate typings #3584

Uzlopak opened this issue Sep 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Sep 11, 2024

This would solve...

Currently typings have to written by hand.

The implementation should look like...

We need to crank up the use of jsdoc and then we can use typescript to generate the typings.

The first thing what we can do is to make it mandatory to write correct jsdoc for new features.
Then we should integrate the typescript typings as jsdoc into our javascript code.
When all typings are migrated to javascript, we could generate the typings directly from the jsdoc and should not break the typings.

It is still necessary to use tsd to ensure that the typings are implemented right.

I have also considered...

N.A.

Additional context

I created a PR #3579 as a possible solution.

If we consider this as good feature, I would look if we can transform iteratively.

Also we should consider to strip the jsdoc and all the comments when we build for node to ensure that we dont bloat the final file.

@Uzlopak Uzlopak added the enhancement New feature or request label Sep 11, 2024
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Sep 12, 2024

The PR #3589 shows how we maybe can adapt jsdoc accordingly for errors.

@Ethan-Arrowood
Copy link
Collaborator

I've experimented with this already for documentation too: #3132 (comment)

And I hit a weird error early on: microsoft/TypeScript#41672 (comment)

I'd love for this change, but it is more work than it seems on the surface.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Sep 16, 2024

I did not hit that error, but we have the problem, that typescript jsdoc can not export types.

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

No branches or pull requests

2 participants