0.0.0 • Published 5 months ago

vite-library-starter v0.0.0

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Vite Library Starter

Features

  • Vite
  • Pnpm
  • ESLint
  • Prettier
  • Vitest
  • Husky
  • CommitLint

Installation

If you have node v16 or later then use the below command to install pnpm

corepack enable
corepack prepare pnpm@latest --activate

otherwise see the pnpm install guide

Install dependencies

pnpm install

Developing

Bundler

Vite is used as the bundler. It is a fast bundler that uses esbuild under the hood. It also supports hot module reloading.

Package Manager

pnpm is used as the package manager.

Linting

ESLint is used for linting

pnpm lint

Formatting

Prettier is used for formatting

pnpm format

Testing

Vitest is used for testing. It is syntax compatible with Jest but is faster and has better error messages.

pnpm test

Pre-Commit Hook

Husky is used for pre-commit hook. it ensures that the code is linted and formatted before committing. It also ensures that the commit message is formatted correctly

pnpm prepare

Commit Message Format

CommitLint is used for commit message linting. Commit Convention

<type>(<scope?>): <subject>

Publishing

Set the name of the package in package.json

{
  "name": "my-package"
}

Set the author of the package in package.json

{
  "author": { "name": "John Doe", "url": "https://example.com" }
}

Set the version of the package in package.json

{
  "version": "0.0.1"
}

Set the private field to false in package.json

{
  "private": false
}

Publish the package

pnpm publish

Credits

This project is based on ts-library

0.0.0

5 months ago