V
V
Vitaly2016-11-14 16:17:33
Node.js
Vitaly, 2016-11-14 16:17:33

TypeScript for Node.js - how to set up for collaboration?

Good time. Please help me figure out how to get started with ts on node.
I figured out how to compile ts to js (tsc) and how to set ts headers (tsd).
Now it remains to understand how to enable automatic generation of titles for your modules and how to publish them. Separately, about publishing - I use sinopia on npm, I want to work with a similar utility for ts headers. I will also be grateful for other recommendations about working with TypeScript: for example, about organizing project files and configs.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2016-11-14
@vitali1995

Now it remains to understand how to enable automatic generation of titles for your modules and how to publish them.

1. https://www.typescriptlang.org/docs/handbook/compi... , --declaration.
2. Use SystemJS when generating code or use a bundler.
3. We publish the assembled js-bundle.
With TypeScript 2, no utilities are needed, everything is published to NPM. There are two options - either in your package (IMHO, it is preferable), or in @types. More details: www.typescriptlang.org/docs/handbook/declaration-f... . In fact, if you did not make a bundle, then next to each js there will be .d.ts. If you are making a bundle, then you need to ask tsc to generate .d.ts as a single file for all available modules, and then you specify the entry file and the file with type definitions in package.json using main and types.

D
Dima, 2016-11-15
@v_m_smith

I recommend the free cross -platform Visual Studio Code editor for working with Typescript + Node . It has great support for both:
Description of working with Typescript

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question