<div dir="ltr">Following up on the previous thread on this subject.<div><br></div><div>So the final steps of the conversion of the module to typescript weren't as straightforward, the biggest gotcha was that apparently the es6 module spec makes it so you can't do `module.exports = X`. and `export default X` actually becomes `exports.default = X` (more on this on a upcoming blog post).</div><div><br></div><div>But currently the high-level worries when moving to TS are:</div><div><br></div><div><ol><li>Since we use the lib/ directory to contain our js files, put TS code in a src/ directory and configure the compiler to output to the lib/ directory (js + d.ts typing files + js.map source maps)</li><li>Delete the original lib/ tree from source control and .gitignore it since it'll be generated by the TS compiler</li><li>Configure npm to include only the needed files via .npmignore or <a href="https://docs.npmjs.com/files/package.json#files">package.json.files</a>. You can check out what would be published to npm via <a href="https://docs.npmjs.com/cli/pack">npm pack</a></li><li>Tests in TS can be run with <a href="https://github.com/TypeStrong/ts-node">ts-node</a> on top of grunt-mocha-test<br></li><li>Make it so the public exports of your module use the special `export = X` TS syntax (if you need module.exports = X)</li><li>You can still use `export default` for internals, but non-es6 consumers will have to use it through `require('my-module').default`</li></ol><div>PR for this is up at <a href="https://github.com/feedhenry-raincatcher/raincatcher-mediator/pull/16">https://github.com/feedhenry-raincatcher/raincatcher-mediator/pull/16</a></div></div></div>