Closed bbugh closed 5 years ago
Hi @bbugh !
I am still pretty new to TS, so I have no idea what the best practices regarding publishing types are. I hope that having them within the project is sufficient, so that the dedicated @types/rot-js
might not be needed anymore.
Thanks for your contribution! package.json
is automatically re-ordered (alphabetically) by npm every time one makes any npm-based change (such as npm i -S
), so the manual order is really not relevant at all.
Great! I've been using the project types for the last day and so far haven't ran into any issues. Having them published with the project is definitely the preferred way - they're guaranteed to be in sync with the project itself without any extra effort. DefinitelyTyped is great, but often requires extra maintenance and effort to keep it in sync. If a package can publish their own types, it's a big win for everybody.
Having the types
key in package.json
is the TypeScript-recommended way of publishing, which you can see here: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
๐๐ TypeScript, yay! ๐๐
However, the
package.json
doesn't expose the typings, so trying to use them in a project doesn't work.This pull request makes a tiny change to
package.json
to tell TypeScript where the types are, so when you import this library into a new project, it Just Worksยฎ without@types/rot-js
.The
package.json
didn't appear to be in any particular order so it was difficult to guess the best place to put it, so I put it at the bottom.