Stater kit for modern TypeScript library. Generate JS ready to be published on npm.
MIT License
Starter kit for modern TypeScript libraries. Generates JavaScript ready to be published on npm.
Batteries included. Period.
$ git clone [email protected]: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 [email protected]:{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.com
npm test
: run tests in ./test
directory using tap
npm run test:watch
: watches ./src/
and ./test/
folders and restarts compilation and testsnpm run test:report
: saves test report to out.tap
filenpm run test:reporter
: converts out.tap
file to junitThis 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 precommit lint
hookrimraf
: removes lib
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