3 ms·
I just wrote and published a library and CLI (for migrating postgres databases) to NPM using Typescript ( https://npmjs.com/package/nomadic https://npmjs.com/pa
by cellis 4y ago
I just wrote and published a library and CLI (for migrating postgres databases) to NPM using Typescript ( https://npmjs.com/package/nomadic https://npmjs.com/package/nomadic ).
The Typescript itself, coupled with jest TDD made development very pleasant. The hardest part for me was figuring out how to publish the types so when a user installs it using yarn install, they get Intellisense. I think I did a poor job of it, as in the end I just published the source code. Even though I prefer when npm libraries do this ( as I can inspect the source in my editor easily ), I know the pros don't do that. If anyone wants to take a look and knows how to solve this type publishing, I'd be very appreciative.
- acemarke 4y agoGlancing at it very quickly via Unpkg, I _think_ you really just need to fix the broken `types` path reference in `package.json`. Right now, your `dist` folder has `dist/index.d.ts` available, but `package.json` points to: "types": "./lib/index.ts" Just change that to: "types": "./dist/index.d.ts"