TPT

ts-package-template

Getting started

Installation

How to install and set up the ts-package-template

The content in this page may have been generated by AI.

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
  1. Go to ts-package-template on GitHub
  2. Click the "Use this template" button
  3. Choose "Create a new repository"
  4. Fill in your repository details
  5. Clone your new repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name

Install Dependencies

Install all required dependencies using pnpm:

pnpm install

This 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 install

This 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 check

If 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 dev to start the development server with hot reload
  • Customize the configuration files to suit your needs
  • Write tests for your package

On this page