-
Notifications
You must be signed in to change notification settings - Fork 250
Include typings folder in npm publish. #140
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
Comments
Hi there. I'm actually not the one maintaining the types. They are published from https://github.com/DefinitelyTyped/DefinitelyTyped. I have nothing against migrating the code to TS and export types directly from here. Would you be interested in doing the porting? |
@Gpx Why are the typings both in this folder in this repo: https://github.com/testing-library/user-event/blob/master/typings/index.d.ts as well as on DefinitelyTyped? |
@Gpx I agree with @calebeby above. It's totally fine if the types are maintained on DefinitelyTyped! There's also no need to port the entire lib to TS. It's more that folks' tend to either ship types directly with their lib or rely on the types on DefinitelyTyped. In this case, you have the types in source here, but don't ship them along with the lib, and also rely on DefinitelyTyped. It'd be great to have one place where they were located so it was clear to end users where we should expect to get our types. I'm happy to make a PR w/ a sample |
You are right that there is no need, but if @Gpx is ok with this I'm willing to do it |
😆 I actually forgot we added types in here. I would start with exporting the file we currently have and making sure it's up-to-date. Does it make sense? |
I think you changed on this opinion? After noticing the change in the react / dom package? Where are removing it? |
Let's see how the discussion on testing-library/react-testing-library#437 goes |
@Gpx I think this issue can be closed. The typings folder is being published to npm: @parkerziegler you were looking at 4.1.0 which was before the typings were added to this repo. The typings were published in 4.2.0: #134 |
Thanks for a helpful lib! It appears that the typings folder is not actually making it to
npm
, so the TS support isn't working. You can see that thetypings
folder isn't there by checking it out onrunpkg
: https://runpkg.com/?@testing-library/[email protected]/dist/index.js. Compare this to say,@testing-library/react
, whosetypings
folder is published tonpm
: https://runpkg.com/?@testing-library/[email protected]/dist/index.js. Since there's no.npmignore
nor afiles
field in thepackage.json
, I believe everything that's on GitHub is ending up published tonpm
(which is strange thattypings
wouldn't also make it in this case), which even means your tests and source are getting bundled in folks'node_modules
😬 Finally, it appears thepackage.json
version is out of lockstep with thenpm
published version. Happy to make a PR to help with these things if you like! Thanks again for a helpful lib.The text was updated successfully, but these errors were encountered: