npm-starter-kit
v0.0.6
Published
A starter pack for creating an npm package using typescript, tsup, pnpm and biomejs
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.jsonfile- name
- version
- description
- homepage
- repository
- keywords
- author
- license
- Install dependencies
pnpm install - For more scripts refer to
package.jsonfile
Make sure you have Node.js and pnpm installed in your machine
Scripts and Commands
pnpm build- compiles the typescript code usingtsupwithtsup.config.tsfile as configurationpnpm lint- lints the project usingtscpnpm check-exports- checks if allexportsfrom 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 usingvitestpnpm dev- test the project usingvitestin watch modepnpm prepublishOnly- run theciscript before runninglocal-releasescriptpnpm local-release- runchangeset versionand publish to npm usingchangeset publishpnpm 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.mdSupport & 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.
