question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include typings folder in npm publish.

See original GitHub issue

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 the typings folder isn’t there by checking it out on runpkg: https://runpkg.com/?@testing-library/user-event@4.1.0/dist/index.js. Compare this to say, @testing-library/react, whose typings folder is published to npm: https://runpkg.com/?@testing-library/react@8.0.5/dist/index.js. Since there’s no .npmignore nor a files field in the package.json, I believe everything that’s on GitHub is ending up published to npm (which is strange that typings 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 the package.json version is out of lockstep with the npm published version. Happy to make a PR to help with these things if you like! Thanks again for a helpful lib.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
calebebycommented, May 6, 2020

@Gpx I think this issue can be closed. The typings folder is being published to npm: https://unpkg.com/browse/@testing-library/user-event@4.2.0/typings/index.d.ts

@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: https://github.com/testing-library/user-event/pull/134

0reactions
Gpxcommented, Aug 15, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Publishing - TypeScript
Including declarations in your npm package ... Note that the "typings" field is synonymous with types , and could be used as well....
Read more >
The 30-second guide to publishing a TypeScript package to ...
The 30-second guide to publishing a TypeScript package to NPM · 1. Add "declaration": true to the compilerOptions of your tsconfig.json · 2....
Read more >
npm-publish - npm Docs
Description. Publishes a package to the registry so that it can be installed by name. By default npm will publish to the public...
Read more >
How to npm publish specific folder but as package root
1. When I do npm publish dist it tries to push a package with the name dist instead of using the dist folder....
Read more >
How to make your own npm package with typescript
what files are part of your package (by default, the whole folder with your package.json is published, with the "files" field you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found