Typescript: Best way creating npm library.

Created on 11 Jan 2016  ·  3Comments  ·  Source: microsoft/TypeScript

I have encountered a problem while creating npm library with Typescript. I have created a few react components. Creating declaration files and then combining all of them in one and declaring the module.

Where to put my .d.ts declarations when distributing npm package?

@types Docs

Most helpful comment

We do not have a clear guidance here. we have some documentation https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages, but clearly this is not nearly sufficient.

All 3 comments

For an example of something that is built on TypeScript and is distributed on npm, take a look at RxJS. There are a lot of considerations to distributing your code on npm that are well outside of the scope of just TypeScript. You need to consider if you will distribute your code as CJS, UMD, ES6 (or even AMD) modules and what types of loaders you expect people to use your code with, etc.

We do not have a clear guidance here. we have some documentation https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages, but clearly this is not nearly sufficient.

I think we can close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fwanicka picture fwanicka  ·  3Comments

kyasbal-1994 picture kyasbal-1994  ·  3Comments

bgrieder picture bgrieder  ·  3Comments

manekinekko picture manekinekko  ·  3Comments

seanzer picture seanzer  ·  3Comments