首页 > 解决方案 > 表情符号没有出现在 git cz 的提交中

问题描述

我有一个带有以下 package.json 的 Angular 项目。我正在使用 commitizen 和 git-cz 以及 husky 进行 git 提交。但无法让表情符号在我的存储库中工作。

{
  "name": "test",
  "version": "0.0.0",
  "scripts": {
    "commit": "cz",
    "prettier-check": "prettier -c .",
    "prettier-format": "prettier -w .",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --configuration production",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lh": "lhci autorun",
    "prepare": "husky install",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "cypress:open": "cypress open",
    "cypress:run": "cypress run",
    "extract-translations": "ngx-translate-extract --input ./src --output ./src/assets/i18n/*.json --sort --format json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.1.0",
    "@angular/common": "~12.1.0",
    "@angular/compiler": "~12.1.0",
    "@angular/core": "~12.1.0",
    "@angular/forms": "~12.1.0",
    "@angular/platform-browser": "~12.1.0",
    "@angular/platform-browser-dynamic": "~12.1.0",
    "@angular/router": "~12.1.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "messageformat": "^2.3.0",
    "ng-zorro-antd": "^12.0.1",
    "ngx-translate-messageformat-compiler": "^4.10.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-builders/jest": "^12.1.0",
    "@angular-devkit/build-angular": "~12.1.0",
    "@angular-eslint/builder": "12.2.0",
    "@semantic-release/changelog": "^5.0.1",
    "@semantic-release/exec": "^5.0.0",
    "@angular-eslint/eslint-plugin": "12.2.0",
    "@angular-eslint/eslint-plugin-template": "12.2.0",
    "@angular-eslint/schematics": "12.2.0",
    "@angular-eslint/template-parser": "12.2.0",
    "@angular/cli": "~12.1.0",
    "@angular/compiler-cli": "~12.1.0",
    "@cypress/schematic": "^1.4.2",
    "@lhci/cli": "^0.8.0",
    "@types/jasmine": "~3.6.0",
    "@types/jest": "^26.0.23",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.23.0",
    "@typescript-eslint/parser": "4.23.0",
    "commitizen": "^4.2.4",
    "cypress": "7.7.0",
    "cz-conventional-changelog": "^3.2.0",
    "eslint": "^7.26.0",
    "git-cz": "^4.7.6",
    "husky": "^6.0.0",
    "jasmine-core": "~3.7.0",
    "jest": "^27.0.6",
    "ng-mocks": "^12.4.0",
    "prettier": "^2.3.2",
    "typescript": "~4.3.2"
  },
  "release": {
    "branches": [
      "master",
      {
        "name": "development",
        "prerelease": "rc"
      }
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/changelog",
      [
        "@semantic-release/exec",
        {
          "verifyReleaseCmd": "echo ${nextRelease.gitTag} > .VERSION"
        }
      ]
    ]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

我正在使用节点版本 14.17.4。我的提交消息中仍然缺少表情符号。

在此处输入图像描述

我希望有像 git-cz 演示页面中所示的提交消息:

在此处输入图像描述

任何帮助将不胜感激

标签: angulargitemojicommitizen

解决方案


推荐阅读