This is an out-of-box TypeScript-based project template with the following features:
- Testing:
- Powered by Vitest with built-in code coverage.
- Code Quality:
- ESLint + Prettier for linting and formatting.
- Husky + Lint-staged for pre-commit checks.
- Auto-organized imports and objects via Perfectionist.
- Commit Standards: Commitlint ensures adherence to Conventional Commits.
- Automated Releases:
- Version bumping, changelog generation via commit-and-tag-version.
- Parses conventional commit messages for versioning and changelog updates.
- Code coverage reported to CodeCov.
Ideal for maintaining high-quality, well-documented, and automated TypeScript projects.
Click the Use this template
button on the top right corner of the repository page.
Just clone your repo and install the dependencies with any package manager you like. This template does not strong bind to any package manager, but the used package manager in GitHub Actions workflow is pnpm
. You may need to modify the workflow file if you use other package managers.
There are a few places you need to modify to fit your project.
First, set the project name in package.json
and README.md
. You can use the following command to replace it and initialize the project:
YOUR_GITHUB_USER="your-user-name"
YOUR_REPO_NAME="your-awesome-repo-name"
sed -i "s/moontaiworks/${YOUR_GITHUB_USER}/g" package.json README.md CONTRIGUTING.md .github/workflows/*
sed -i "s/cli[-_]template/${YOUR_REPO_NAME}/g" package.json README.md CONTRIGUTING.md .github/workflows/*
You can now start coding! Simple right?
You can also checkout the Contributing Guide to learn more.
This template uses CodeCov to archive the code coverage. If you want to use CodeCov, you need to set the
CODECOV_TOKEN
in the repository secrets. If you don't need to use CodeCov, you can remove the CodeCov badge and the related scripts inpackage.json
and.github/workflows/publish.yml
.
Once you done your first version, you can open pull request or directly push your codes to the main
branch.
The actions in this template will auto perform following steps when you push the code to the main
branch:
- Test: Run tests and generate coverage report.
- Build: Generate bundled and minified esm, cjs and iife version, and unminified esm version for node.
- Release: Bump Version & Generate Changelog.
- Publish the package to npm
You can modify the workflow file to fit your needs.
Before start developing, you should remove all desciptions above this line.
npx @moontaiworks/cli-template