@nhz.io/node-ts-package-template
📚 API Documentation
A template repository for Node.js TypeScript packages with test coverage, git hooks, and development tools.
Click "Use this template" to create a new repository
Configure GitHub Actions permissions:
Wait for the Template Setup workflow to complete (it runs automatically when repository is created)
Configure GitHub Pages:
Clone your repository
Install dependencies:
npm install
Note: After running the template setup workflow:
npm run build
- Build ESM and CJS versionsnpm run build:esm
- Build ESM versionnpm run build:cjs
- Build CJS versionnpm run clean
- Remove build artifactsnpm run dev
- Watch mode developmentnpm run typecheck
- Type checkingnpm run lint
- Lint source filesnpm run lint:fix
- Fix linting issuesnpm run format
- Format filesnpm run format:check
- Check formattingnpm test
- Run testsnpm run test:coverage
- Test with coveragenpm run test:coverage:check
- Check coverage thresholdsnpm run test:coverage:view
- View coverage report in browsernpm run test:coverage:details
- Show detailed coveragenpm run test:coverage:source
- Show source-focused coveragenpm run test:coverage:show
- Show coverage with colored source code in terminalnpm run test:coverage:html
- Generate HTML coverage reportnpm run docs
- Generate documentationnpm run docs:serve
- Serve documentationnpm run release
- Create release (runs patch by default)npm run release:major
- Major version releasenpm run release:minor
- Minor version releasenpm run release:patch
- Patch version releaseThe docs
directory contains API documentation after running npm run docs
.
The release process is automated using conventional commits and GitHub Actions. Here's how to create a new release:
Create a branch for your changes:
git checkout -b feat/new-feature # For features
git checkout -b fix/bug-fix # For bug fixes
Make your changes and commit them using conventional commit messages:
git commit -m "feat: add new feature"
git commit -m "fix: fix the bug"
Create a PR with your changes
After your PR is merged to main:
npm run release # Patch version bump (default)
npm run release:major # Major version bump
npm run release:minor # Minor version bump
npm run release:patch # Patch version bump
Publishing is fully automated through GitHub Actions.
Requirements:
MIT