-
Notifications
You must be signed in to change notification settings - Fork 2
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
Generate type declaration files #118
Conversation
Leaving this PR as a draft for now, as there are a couple of open questions. Everything builds successfully right now, but there are a lot of properties typed as Now that we have type checking, I wonder if it would be worth rethinking some of the patterns in the repo to take advantage of it, specifically the way we're handling options. I think it would be cleaner, and a bit less redundant to define options as types rather than classes, ie this: /**
* @typedef SomeOptions
* @param {boolean} option1 - option 1 description
* @param {boolean} option2 - option 2 description
*/ instead of our current pattern, which looks something like this: class SomeOptions {
/**
* @type {boolean}
*/
option1;
/**
* @type {boolean}
*/
option2;
/**
*
* @param {object} options
* @param {boolean} options.option1
* @param {boolean} options.option2
*/
constructor(options) {
this.option1 = options.option1;
this.option2 = options.option2;
}
}; Not sure if this is something that should be held off for a different PR. @benjaminbojko any thoughts? |
Update: fixed. See comment below. One more hiccup I ran into while working on the plugin API (#114): Right now, the only types that are accessible are those exported in the For instance, I'm defining Some easy but inelegant solutions off the top of my head:
Gonna research some other options to see if there's a 'nicer' way to accomplish this. |
Found a workaround from this blog for the shared types issue above. Types imported directly from lib files works now. |
fc1a4ff
to
221f84f
Compare
Per our conversation, breaking the updated options typings and removal of vague |
Will check this out locally and review asap. |
downgrade back to 2.0.0
Looks like the docs generation is pretty broken with these updates. Seems like the official JSDoc lib doesn't support a lot of typescript syntax (namely using Gonna research to see if there are plugins for JSDoc that could fix this, and check to see if TypeDoc could be a drop-in replacement. |
Thanks! FWIW I think the docs could use a refresh, especially pending our discussion around #116 . So if you find this to be a major hurdle, I'd err on the side of merging this in and creating a new issue to resolve docs generation. |
Yeah it's looking like there's not really a quick fix for this. We can merge into dev but hold on releasing until we have the updated docs? |
Yes, sounds good! Could you merge and create a new issue for revisiting jsdoc generation? |
resolves #117