This is a powerful, multi package Typescript project base which has examples for a CLI, Browser and library.
- 📦 Multi-package Monorepo: Uses
pnpmworkspaces to managecorelibrary,cli, andbrowserpackages. - 📚 Core Library Example: Demonstrates a reusable TypeScript library (
packages/core). - 💻 CLI Application Example: Includes a command-line interface built with TypeScript (
packages/cli). - 🌐 Browser Script Example: Shows how to bundle TypeScript for use in a web browser (
packages/browser). - 🧪 Unit Testing: Integrated unit testing setup with examples using Vitest across all packages.
- 💅 Linting & Style: Consistent code style enforced by ESLint & Stylistic.
- 🐳 Docker Support: Dockerfile provided for building the CLI application (
packages/cli/Dockerfile). - 훅 Git Hooks: Pre-commit hooks configured using Husky to ensure code quality before commits.
- ⚙️ Editor Configuration: Includes a
.editorconfigfile for consistent editor settings. - ✨ Automated Versioning & Changelogs: Uses Changesets for streamlined package versioning and changelog generation.
- 🚀 CI/CD: GitHub Actions workflows for automated testing, building, and releasing.
- 🛡️ Vulnerability Scanning: Uses Trivy in CI to scan project dependencies (
pnpm-lock.yaml) and the CLI Docker image for known vulnerabilities. - 📖 Documentation Site: Uses VitePress for generating documentation, deployed via GitHub Actions.
- 🔒 Security Policy: Includes a
SECURITY.mdfile outlining how to report vulnerabilities. - 🤝 Code of Conduct: Includes a
CODE_OF_CONDUCT.mdto foster an inclusive community.
This project uses pnpm to support multiple packages in the same repository.
# Enable Corepack
corepack enable
# Install all packages recursively
pnpm install -rTo build all packages (core, cli, browser):
pnpm buildThis command runs the build script defined in the package.json of each individual package.
There are separate commands for running tests:
-
Run tests for
coreandclipackages:pnpm test -
Run tests specifically for the
browserpackage:pnpm test:browser
To check the code style across all packages:
pnpm lintTo automatically fix linting issues:
pnpm lint:fixThis project uses Changesets to manage versioning and generate changelogs.
-
Add a changeset: When you make a change that should trigger a package release, run:
pnpm changeset
Follow the prompts to specify which packages are affected and the type of change (patch, minor, major).
-
Create a release pull request: The
changeset-bot(if configured in CI) or a manual run ofpnpm changeset versionwill consume the changeset files and update package versions and changelogs. -
Publish packages: After merging the release PR, you can publish the updated packages:
pnpm release
This script typically runs
pnpm buildfirst, then publishes the packages usingpnpm publish -r. Note: The--no-git-checksflag is used here, be mindful of your release workflow.