Skip to content

Latest commit

 

History

History
98 lines (71 loc) · 2.85 KB

File metadata and controls

98 lines (71 loc) · 2.85 KB

Pack a Punch logo

🦾🔋 Pack a Punch: NPM Project Template Boilerplate

Pack a punch your project, following standards and specifications, linting and formatting your code, automating Git work flows, and improving your styles with emojis 🦄

✨ Features

  • 🛡 Zod validator
  • 🎨 The best linter and formatter, BiomeJS
  • 🐶 Pre-Commit and Commit Husky hooks (Runs linter and formatter before any commit against staged files only!)
  • 💄 Commit nomenclature rules following Conventional Commit Format and Commitizen CLI (emoji powered)
  • 🚀 Release management policy with commit-and-tag-version, including automagically CHANGELOG.md generation, version bumping and GitTags
  • 🔦 Included npm-check to check for outdated, incorrect, and unused dependencies.
  • 🥷🏻 Included better-npm-audit to check for dependency vulnerabilities

🛠 Getting Started

npm ci                  # Install dependencies
cp .env.example .env    # Generate enviroment variables
npm run dev             # Launch project locally

🎨 Linter & Formatter

npm run biome        # Run Biome

⛩ Git Commit with Commitizen

git add .            # Add files
npm run cz           # Commit with Commitizen CLI

🚀 Release a new version

npm run release             # Bump version and generate CHANGELOG.md
git push --follow-tags      # Push changes and GitTag to origin

🔦 Check vulnerabilities and update outdated dependencies

npm run npm:audit     # Check dependency vulnerabilities
npm run npm:check     # Check outdated dependencies

🏗 Build and launch

npm run build         # Compile project
npm run start         # Launch
npm run package       # Package an artifact

How to migrate this configuration to an existing project

  1. Install dependencies
npm install --save-dev @biomejs/biome @commitlint/cli @commitlint/config-conventional commit-and-tag-version commitizen cz-conventional-changelog devmoji husky lint-staged
  1. Copy the following scripts to your package.json file:
  • biome
  • release
  • package
  • cz
  • npm:check
  • npm:audit
  • prepare
  1. Copy the "config", "commitlint" and "lint-staged" configuration objects to your package.json

  2. Copy the corresponding config files

cp -R {.husky,.vscode,biome.json} <YOUR_DESTINATION_FOLDER>
  1. Prepare husky tools running:
npm run prepare