Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgecoke/pack-a-punch-npm
π¦Ύπ Pack a punch your NPM project, following standards and specifications, linting and formatting your code, automating Git work flows, and improving your styles with emojis π¦
https://github.com/jorgecoke/pack-a-punch-npm
commitizen commitlint cz emoji eslint formatter git hooks husky lint linter npm prettier
Last synced: 25 days ago
JSON representation
π¦Ύπ Pack a punch your NPM project, following standards and specifications, linting and formatting your code, automating Git work flows, and improving your styles with emojis π¦
- Host: GitHub
- URL: https://github.com/jorgecoke/pack-a-punch-npm
- Owner: JorgeCoke
- Created: 2024-03-26T14:53:44.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-20T13:53:26.000Z (8 months ago)
- Last Synced: 2024-04-21T15:05:37.496Z (8 months ago)
- Topics: commitizen, commitlint, cz, emoji, eslint, formatter, git, hooks, husky, lint, linter, npm, prettier
- Language: JavaScript
- Homepage:
- Size: 761 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# π¦Ύπ 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
- π¨ [ESLint](https://www.npmjs.com/package/eslint) & [Prettier](https://www.npmjs.com/package/prettier) as linter and formatter
- πΆ Pre-Commit and Commit [Husky](https://github.com/typicode/husky) hooks (Runs linter and formatter before any commit against staged files only!)
- π Commit nomenclature rules following [Conventional Commit Format](https://commitlint.js.org/) and [Commitizen CLI](https://github.com/commitizen/cz-cli) (emoji [powered](https://github.com/folke/devmoji))
- π Release management policy with [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version), including automagically CHANGELOG.md generation, version bumping and GitTags
- π¦ Included [npm-check](https://www.npmjs.com/package/npm-check) to check for outdated, incorrect, and unused dependencies.
- π₯·π» Included [better-npm-audit](https://www.npmjs.com/package/better-npm-audit) to check for dependency vulnerabilities## π Getting Started
```
npm ci # Install dependencies
npm run dev # Launch project locally
```## π¨ Linter & Formatter
```
npm run lint # Run ESLint
npm run format # Run Prettier
```## β© 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
```---
#### How to migrate this configuration to an existing project
1. Install dependencies
```bash
npm install --save-dev @commitlint/cli @commitlint/config-conventional better-npm-audit commit-and-tag-version commitizen cz-conventional-changelog devmoji husky lint-staged npm-check
```> (Optional) Install **ESLint** and **Prettier** if you don't have them already: `npm install --save-dev prettier eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-sonarjs`
2. Copy the following scripts to your package.json file:
- format:staged
- npm:audit
- npm:check
- release
- cz
- devmoji
- prepare> (Optional) You can also copy `lint` and `format` commands if needed
3. Copy the corresponding config files
```bash
cp -R {.husky,.commitlintrc.cjs,.czrc,.lintstagedrc.cjs}
```> (Optional) Copy **ESLint**, **Prettier** and **VSCode** config files: `cp -R {.vscode,.prettierrc.cjs,.eslintrc.cjs}`
4. Prepare husky tools running:
```bash
npm run prepare
```