Starter kit for modern TypeScript libraries. Generates JavaScript ready to be published on npm.
Batteries included. Period.
- Prettier and ESLlint for formatting and linting
- ts-node for tests execution
- node-tap for testing and code coverage
- tap-mocha-reporter for test reporting
- GitHub Actions configuration file for github actions workflow
$ git clone git@github.com:fox1t/typescript-lib-starter.git {your_project_name}
$ cd {your_project_name}
$ rm -rf .git && git init && npm init
$ npm i
$ git remote add origin git@github.com:{your_repository}.git
$ git add .
$ git commit -m "Initial commit"
$ git push -u origin master
npm run build
: build TypeScript sources to dist directorynpm publish
: builds and publishes lib to npmjs.comnpm test
: run tests in./test
directory using tapnpm run test:watch
: watches./src/
and./test/
folders and restarts compilation and testsnpm run test:report
: saves test report toout.tap
filenpm run test:reporter
: convertsout.tap
file to junit
This starter is already configured to allow you to extend typings of external packages. The logic behind it is based on this official template. To augment a module, just create a folder with the same name as the module you are augmenting and add an index.d.ts in it. Here you can find a real world example.
Includes azure-pipelines.yml
configuration file. You can build, test and publish code coverage on Azure DevOps for free with GitHub integration for OSS projects.
husky
: runs precommitlint
hookrimraf
: removeslib
folder crossplatformchokidar-cli
: file watchertap
: test runnertap-mocha-reporter
: mocha reporter for tapts-node
: runs tests without compilingprettier
eslint
eslint-config-prettier
: makes ESLint work nice with prettiertypescript
If you use this starter, add this badge to your project to help standardising TS library development.
[![built with typescript-lib-starter](https://img.shields.io/badge/built%20with-typescript--lib--starter%20-blue.svg)](https://github.com/fox1t/typescript-lib-starter)
MIT