-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
feat(chore): added types definitions #2822
Conversation
Cool and thanks a lot for doing this 👍🏼 I believe you make many people happy 😃 What should we do with https://github.com/fomantic/DefinitelyTyped/tree/fomantic-ui then? Regarding Fomantic-UI-CSS. We are always creating that out of a new FUI release, so usually dont maintain separate PRs there. Btw https://github.com/fomantic/Fomantic-UI-LESS also has the single js files for the modules, so should we add the types there as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The DefinitelyTyped repo can be deleted, right. For the Fomantic-UI-CSS and Fomantic-UI-LESS repo, yes, we just need to add the |
All JS files should be tested againts the TS interfaces and any missing/extra method/property should fail CI. |
That would be worth another PR as it does not seem to be easy. The whole special "behavior" concept (string as first parameter of module call magically matches existing (nested) javascript method tree) would basically work for each existing method inside the modules, but only the "intended" methods are listed in the docs (and only those were covered by prudho here) A CI, as you suggested, would complain about a lot of unfetched methods as those are not intended to be mentioned. I believe this only works out nicely when recoding each module from scratch with a different code structure concept and modern techniques where types and docs can be created/fetched/generated automatically out of the source without the need to manually touch them. So, I'll merge this PR as it is now and will look for possibly missing new settings in 2.9.3 as this PR "only" covers 2.9.2 which already must have been a hell of work. |
@mvorisek yes, this is something i'd like to implement too. A real testing system for each function/property would be great, but like @lubber-de said, this would be a rather large project to test basically everything. For now, and since we're using an outdated code base, all this work can be done manually, and trust me, there's A LOT of work to do so. |
@prudho As discussed, I just deleted the DefinitelyTyped fomantic fork |
This PR improves #2822, the Typescript is now tested if compiles and linted againts our coding style.
This PR improves fomantic#2822, the Typescript is now tested if compiles and linted againts our coding style.
Long time overdue, sorry about that !
Description
This PR adds type definitions for Fomantic's components, enabling them to be more usable on code editors. Typings are now integrated into the actual repository, rather than in the DefinitelyTyped repository, allowing us a better control over type updates and quick fixes. They've been updated to the actual 2.9.2 release, so they should be pretty accurate.
To use them, there's nothing to do since they're included in the
package.json
. Users should also includejquery types
as well in their package.json:npm install --save-dev @types/jquery
There's maybe some comments to add, but it can be released now.
@fomantic/maintainers should I also create a pull request at https://github.com/fomantic/Fomantic-UI-CSS ?
Screenshot
Closes
#396, #1205, #2742