A CLI tool to scaffold a new TypeScript NPM package with a modern setup.
create-az-package helps you kickstart your next TypeScript project by
generating a boilerplate with all the necessary tools and configurations. It
sets up a complete development environment so you can focus on writing code.
The generated package includes:
- pnpm: Fast, disk space-efficient package manager.
- tsup: Simple and fast TypeScript bundler powered by esbuild.
- Vitest: A blazing fast unit-test framework powered by Vite.
- oxlint: A high-performance linter to catch and prevent errors.
- Prettier: An opinionated code formatter for consistent code style.
- Changesets: A tool for managing versioning and changelogs.
To create a new package, run the following command and follow the interactive prompts:
npx create-az-packageYou can also provide options directly via the command line:
npx create-az-package --name my-new-package --description "My awesome package"
Description
Create a new TypeScript NPM package
Usage
$ create-az-package [name] [options]
Options
-n, --name Package name
-d, --description Package description
--dir Directory to create the package in
-v, --version Displays current version
-h, --help Displays this message
To publish packages to NPM, you'll need to create an NPM access token and add it as a secret to your repository.
-
Create an NPM access token: Follow the instructions at https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-access-tokens to create a new token with "Automation" permissions.
-
Add the token to your repository: Add the token as a secret named
NPM_TOKENin your repository's settings. This will allow Changesets to publish packages to NPM on your behalf. -
Allow GitHub Actions to create and approve pull requests: To allow Changesets to create and approve pull requests, go to
https://github.com/YOUR_REPOSITORY/settings/actionsand checkAllow GitHub Actions to create and approve pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.