An opinionated boilerplate to kick off a TypeScript library project.
- Typed JavaScript with TypeScript
- Insanely fast builds with esbuild
- Testing with Jest
- Code formatting with Prettier
- Code linting with ESLint
- API docs with TypeDoc
With npm:
npm install <package>
With yarn:
yarn add <package>
import { hello } from '<package>'
hello('world')
Library development instructions.
When commiting code changes the Conventional Commits specification should be followed. This ensures, for example, that the CHANGELOG can be automatically generated.
Commit Types:
build:
chore:
ci:
docs:
style:
refactor:
perf:
test:
The available yarn/npm scripts.
Builds the library in watch
mode, which will trigger a re-build on changes.
Builds the library for production.
Launches the test runner.
Launches the test runner in the interactive watch mode.
Launches the test runner and generates a coverage report.
Runs Prettier on the source code and fixes formatting.
Runs Prettier on the source code but only checks formatting.
Lints the source code.
Runs TypeScript type checking on the source code, but does not emit types.
Generates API documentation.
Release management is handled via standard-version, which should be installed globally:
yarn global add standard-version
To create a new release run:
yarn release
This will:
- Increment the version in package.json
- Generate the CHANGELOG
- Create a new git release tag
- Commit the changes to the local repo
Next sync your changes with the remote repository.
Then tag the release:
yarn release:tag
You can also run the release
command with the --dry-run
flag to get the simulated output without committing to gut or updating files.