npm-starter-kit
v0.0.6
Published
A starter pack for creating an npm package using typescript, tsup, pnpm and biomejs
Downloads
457
Maintainers
Readme
🚀 Npm Package Stack
A minimal starter kit designed to build and publish a npm package with ease.
The Stack includes
- Git for version control
- Typescript for writing our code and keeping it type-safe
- @arethetypeswrong/cli for checking our exports
- tsup for compiling our TypeScript code into CJS and ESM
- Vitest for running our tests
- GitHub Actions for running our CI process
- Changesets for versioning and publishing our package
- Biome for formatting
- pnpm as fast, efficient package-manager
Installation
- Fork the repository
- Clone the repository
git clone https://github.com/<your_github_username>/npm-package-stack.git
- Navigate to the directory
cd npm-package-stack
- Make sure you edit the below properties in the
package.json
file- name
- version
- description
- homepage
- repository
- keywords
- author
- license
- Install dependencies
pnpm install
- For more scripts refer to
package.json
file
Make sure you have Node.js and pnpm installed in your machine
Scripts and Commands
pnpm build
- compiles the typescript code usingtsup
withtsup.config.ts
file as configurationpnpm lint
- lints the project usingtsc
pnpm check-exports
- checks if allexports
from the package are correctpnpm format
- formats the project using biomepnpm check-format
- check if all files in the project are formatted correctlypnpm test
- test the project usingvitest
pnpm dev
- test the project usingvitest
in watch modepnpm prepublishOnly
- run theci
script before runninglocal-release
scriptpnpm local-release
- runchangeset version
and publish to npm usingchangeset publish
pnpm ci
- runs the CI process for GitHub actions
Project Structure
# GitHub
.
├── src
│ ├── functions.ts
│ ├── index.ts
│ └── types.ts
├── .gitignore
├── .npmignore
├── biome.json
├── package.json
├── pnpm-lock.yaml
├── README.md
├── tsconfig.json
└── tsup.config.ts
# Npm
.
├── dist
│ ├── index.d.mts
│ ├── index.d.ts
│ ├── index.js
│ └── index.mjs
├── package.json
└── README.md
Support & Contribute
If you found this project helpful or enjoyed using it, please consider giving it a ⭐️ on GitHub! It helps others find the project and motivates us to keep improving.