Installation
How to install and set up the ts-package-template
Prerequisites
Before you begin, ensure you have the following installed on your system:
- Node.js (version 18 LTS or higher recommended)
- pnpm (recommended package manager)
- Git for version control
While pnpm is recommended, you can also use npm or yarn if you prefer.
Quick Start
Get the Template
You have two options to get started with the template:
Clone the repository directly:
git clone https://github.com/LuanRoger/ts-package-template.git
cd ts-package-template- Go to ts-package-template on GitHub
- Click the "Use this template" button
- Choose "Create a new repository"
- Fill in your repository details
- Clone your new repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-nameInstall Dependencies
Install all required dependencies using pnpm:
pnpm installThis will install all the tools including:
- TypeScript
- Rolldown and tsdown
- Biome
- Vitest
- git-cliff
- np
- lefthook
- ultracite
Customize Package Information
Update the package.json file with your package information:
{
"name": "@your-scope/your-package-name",
"version": "0.0.0",
"description": "Your package description",
"author": "Your Name <your.email@example.com> (https://github.com/your-username)",
"license": "MIT",
"homepage": "https://github.com/your-username/your-repo-name",
"repository": {
"type": "git",
"url": "https://github.com/your-username/your-repo-name.git"
}
}Make sure to update the package name, version, description, author, and repository URL to match your project.
Initialize Git (if not using template)
If you cloned the repository directly, initialize git hooks:
pnpm installThis will automatically set up the lefthook git hooks.
Verify Installation
To ensure everything is working correctly, run the following commands:
# Check if all dependencies are installed
pnpm list
# Run the build process
pnpm run build
# Run tests
pnpm run test
# Check code quality
pnpm run checkIf all commands execute successfully, your template is ready to use!
Next Steps
After installation, you can:
- Start developing your package by modifying files in the
src/directory - Run
pnpm run devto start the development server with hot reload - Customize the configuration files to suit your needs
- Write tests for your package