0.0.6 ⢠Published 10 months ago
npm-starter-kit v0.0.6
š 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.