catca-vite
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

ts-rollup-npm-vite-boilerplate

codecov

Boilerplate for building a TypeScript + Rollup + Vite module that can be published to NPM.

⭐️ Included Packages

Package Name Version
TypeScript TypeScript Badge
Preact Preact Badge
Htm Htm Badge
Jest Jest Badge
Rollup Rollup Badge
Rollup-plugin-dts Rollup-plugin-dts Badge
Rollup-plugin-typescript2 Rollup-plugin-typescript2 Badge
Rollup-plugin-uglify Rollup-plugin-uglify Badge
@rollup/plugin-node-resolve @rollup-plugin-node-resolve Badge
Vite Vite Badge
Eslint Eslint Badge
Prettier Prettier Badge

🚀 Installation

1. Fork this Repo

After visiting this link, Fork the repository.

2. Clone your Repo

git clone https://github.com/<YOUR_GITHUB_NAME>/ts-rollup-npm-vite-boilerplate
cd ts-rollup-npm-vite-boilerplate

3. Edit the Package name, Version and Description

Edit package.json fields

4. Set CODECOV_TOKEN (Optional)

If you don't need CodeCov CI, you should delete the .github/workflows/ci.yml file.

Step 1: Visite CodeCov CI and get CODECOV_TOKEN for your repository.

Get the CODECOV_TOKEN

Copy the Upload Token text.

Step 2: Enter the token with the name CODECOV_TOKEN in the Secrets of your GitHub repository.

Enter the token

5. Set NPM_TOKEN (Optional)

If you don't need to Deploy with NPM, you should delete the .github/workflows/publish.yml file.

Step 1: Visite NPM and get NPM_TOKEN for your repository.

Get the NPM_TOKEN - 1

Click the Generate New Token Button

Get the NPM_TOKEN - 2

When generating a token, it must be created as an automation token.

Get the NPM_TOKEN - 3

Copy the NPM Token text.

Step 2: Enter the token with the name NPM_TOKEN in the Secrets of your GitHub repository.

Enter the token

Step 3: Edit the NPM account name in the publish.yml file

Edit NPM account name

Don't forget the @.

🛠 Usage

Scripts

pnpm install # or (yarn|npm) install
pnpm test # unit tests
pnpm lint
pnpm build # production build
pnpm build:watch # for debug modules only
pnpm build:sandbox # for debug modules with sandbox (alias `pnpm start`)

CodeCov CI

If you have successfully set up CodeCov, if you push or PR to the main branch, CodeCov Coverage is automatically updated.

CodeCov CI Image

Publish to NPM

First, you need to deploy module with a Tag on GitHub using the npm version patch command.

# Update module version (This command changes `package.json`)
npm version patch

# Push to GitHub
git push origin main
git push origin <VERSION> # <VERSION> = vX.X.X

Then Create and Publish a new release on GitHub.

Publish a new release

After completing the above process, you will see the NPM module deploy to @npm-account-name/<PACKAGE_NAME> like this:

Published NPM Module

Package Sidebar

Install

npm i catca-vite

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

10.2 kB

Total Files

5

Last publish

Collaborators

  • catca