Skip to content

vajahath/generator-ts-np

Repository files navigation

generator-ts-np

Yet another yeoman generator for building npm modules with TypeScript.

TSNP stands for TypeScript Node Package 📦.

Greenkeeper badge

🎁 If you are looking for using this generator, see /generator/README.md.

Why

  • No global dependencies.
  • Written in TypeScript and when publishing, definition(.d.ts) will also ship with this package.
  • Prettier and Eslint.
  • Support for Github Package Registry and NPM
  • Tests uses Jest (tests are also written in TypeScript)
  • Pre-publish hook for build (so you never miss it)
  • Automated build and deployments (using Github Actions) (eg: scope-prefixer package)
  • Lint rules adopted from Google (which means higher coding standard)
  • Publishes only the required files (less bundle size)

Internals briefing

For future maintainability, the entire codebase is split into 3 distinct components.

  • /base-structure: where the actual template reference lives. So if you have to tweak something related to the scaffolding template, raise a PR with altering it in this folder. Also you have to reflect these changes in /base-structure/_meta.
  • /house-keeping: this component bridges /base-structure and the next component, /generator. It converts the keyed template files (that's how the template in /base-structure is defined) to files that support ejs rendering and copy them to generator along with some meta files.
  • /generator: the actual yeoman generator. This is what we are publishing.

Updates are maintained by Greenkeeper and npm run build is ran at this root level to update generator. This means, bare minimum human effort is required to update the generator.

Something missing?

Please feel free to raise an issue.

Licence

MIT © Vajahath Ahmed