### Install Husky Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Steps to install the Husky package as a development dependency and initialize it in the project. ```shell npm install husky --save-dev npx husky-init ``` -------------------------------- ### Install Commitlint and Conventional Config Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Installs the Commitlint CLI and the conventional commit configuration package. ```shell npm install --save-dev @commitlint/config-conventional @commitlint/cli ``` -------------------------------- ### Test Commitlint Configuration Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Commands to test the Commitlint configuration by comparing the last two commits or linting from standard input. ```shell npx commitlint --from HEAD~1 --to HEAD --verbose ``` ```shell echo 'foo: bar' | npx commitlint ``` -------------------------------- ### Starting Message Push Service Test Source: https://github.com/baaxl9vh/nest-wechat/blob/main/docs/README.md Command to start the message push service test using ts-node. This is used to verify message handling and integration with WeChat public platform. ```bash npx ts-node -T tests/e2e/wechat-app.main.ts ``` -------------------------------- ### Configure Commitlint Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Sets up the commitlint.config.js file to use the conventional commit configuration and defines custom rules. ```javascript module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'body-max-line-length': [2, 'always', 60], } } ``` -------------------------------- ### Starting Message Push Service Test Source: https://github.com/baaxl9vh/nest-wechat/blob/main/README.md Command to start the message push service test using ts-node. This is used to verify message handling and integration with WeChat public platform. ```bash npx ts-node -T tests/e2e/wechat-app.main.ts ``` -------------------------------- ### Git Commit Commands Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Demonstrates common Git commands for committing changes, including committing specific files or all staged changes. ```shell git commit path/to/file ``` ```shell git commit . ``` -------------------------------- ### Install nest-wechat Source: https://github.com/baaxl9vh/nest-wechat/blob/main/docs/README.md Installs the nest-wechat package using npm. This is the first step to integrate the module into a NestJS application. ```shell npm i --save nest-wechat ``` -------------------------------- ### Install nest-wechat Source: https://github.com/baaxl9vh/nest-wechat/blob/main/README.md Installs the nest-wechat package using npm. This is the first step to integrate the module into a NestJS application. ```shell npm i --save nest-wechat ``` -------------------------------- ### Commit Types Explained Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Lists and explains the different types of commits recognized by the conventional commit standard, such as feat, fix, docs, and chore. ```text + ci: 改变CI配置文件和脚本 + feat: 新增功能特性 + fix: 修复BUG + docs: 添加修改文档 + style: Changes that do not affect the meaning of the code + refactor: 代码重构重写 + perf: 性能优化、体验优化 + test: Adding missing tests or correcting existing tests + build: 改变影响项目build脚本的代码、配置等 + chore: 改变构建流程、添加依懒、添加工具等 + revert: 回滚版本 ``` -------------------------------- ### Add Commit Message Hook Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Configures the commit-msg hook using Husky to run Commitlint for validating commit messages. ```shell npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"' ``` -------------------------------- ### Environment Configuration for Testing Source: https://github.com/baaxl9vh/nest-wechat/blob/main/README.md Example `.env.test.local` file structure for configuring test environments. Includes settings for WeChat AppID, secret, JSSDK URL, token, AES key, and Redis connection details. ```config TEST_APPID=your/test/appid TEST_SECRET=your/test/secret TEST_JSSDK_URL=https://your/website/url TEST_TOKEN=your/token TEST_AESKEY=your/aeskey REDIS_HOST=your/redis/host REDIS_PORT=6379 REDIS_PASSWORD= REDIS_DB=0 REDIS_TTL=600 ``` -------------------------------- ### Environment Configuration for Testing Source: https://github.com/baaxl9vh/nest-wechat/blob/main/docs/README.md Example `.env.test.local` file structure for configuring test environments. Includes settings for WeChat AppID, secret, JSSDK URL, token, AES key, and Redis connection details. ```config TEST_APPID=your/test/appid TEST_SECRET=your/test/secret TEST_JSSDK_URL=https://your/website/url TEST_TOKEN=your/token TEST_AESKEY=your/aeskey REDIS_HOST=your/redis/host REDIS_PORT=6379 REDIS_PASSWORD= REDIS_DB=0 REDIS_TTL=600 ``` -------------------------------- ### Commit Message Structure Source: https://github.com/baaxl9vh/nest-wechat/blob/main/COMMIT_STANDARD.md Defines the standard format for commit messages, including required and optional sections like type, subject, body, and footer. ```text :