A minimal starter kit designed to build and publish a npm package with ease.
- Typescript for writing our code and keeping it type-safe
- Turborepo for increased performance and faster builds
- @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
- Git for version control
- Fork the repository
- Clone the repository
git clone https://github.com/<your_github_username>/npm-starter-kit.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
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 run ci- runs the CI process for GitHub actionspnpm format- formats the project using biomepnpm format:check- check if all files in the project are formatted correctlypnpm test- test the project usingvitestpnpm dev- test the project usingvitestin watch modepnpm local-release- runchangeset versionand publish the package to npm usingpnpm run releasepnpm release- run thepublish-packagescript using turbopnpm publish-package- publish the package to npm usingchangeset publish
# GitHub
.
├── src
│ ├── functions.ts
│ ├── index.ts
│ └── types.ts
├── .gitignore
├── .npmignore
├── biome.json
├── package.json
├── pnpm-lock.yaml
├── README.md
├── tsconfig.json
├── tsup.config.ts
└── turbo.json
# Npm
.
├── dist
│ ├── index.d.mts
│ ├── index.d.ts
│ ├── index.js
│ └── index.mjs
├── CHANGELOG.md
├── LICENSE
├── README.md
└── package.json
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.