From cdbc78b6c12e7fc83fde468a6cb0175e967697c2 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sat, 3 Dec 2016 23:50:40 +1100 Subject: [PATCH] feat(build): add git-cz for semantic versioned commits Use commitzen to standardize the commit syntax and to allow easy semantic versioning of electron-forge --- .cz.js | 24 ++++++++++++++++++++++++ package.json | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .cz.js diff --git a/.cz.js b/.cz.js new file mode 100644 index 0000000000..4ba2702175 --- /dev/null +++ b/.cz.js @@ -0,0 +1,24 @@ +module.exports = { + types: [ + {value: 'feat', name: 'feat: A new feature'}, + {value: 'fix', name: 'fix: A bug fix'}, + {value: 'docs', name: 'docs: Documentation only changes'}, + {value: 'style', name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)'}, + {value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature'}, + {value: 'perf', name: 'perf: A code change that improves performance'}, + {value: 'test', name: 'test: Adding missing tests'}, + {value: 'chore', name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation'}, + {value: 'revert', name: 'revert: Revert to a commit'}, + {value: 'WIP', name: 'WIP: Work in progress'}, + ], + scopes: [ + { name: 'maker' }, + { name: 'packager' }, + { name: 'linter' }, + { name: 'starter' }, + { name: 'tests' }, + { name: 'initializer' }, + { name: 'generic' }, + ], + allowCustomScopes: true, +} diff --git a/package.json b/package.json index dae352f0e1..6c3a3261dc 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ }, "scripts": { "build": "gulp build", + "precommit": "npm run lint", + "commit": "git-cz", "lint": "eslint src test", "prepublish": "npm run build", "test": "npm run lint && mocha test --compilers js:babel-register --timeout=300000", @@ -23,6 +25,8 @@ "babel-plugin-transform-runtime": "^6.15.0", "babel-preset-es2015": "^6.16.0", "chai": "^3.5.0", + "commitizen": "^2.8.6", + "cz-customizable": "4.0.0", "eslint": "^3.7.1", "eslint-config-airbnb-base": "^8.0.0", "eslint-plugin-import": "^1.16.0", @@ -63,5 +67,13 @@ "username": "^2.2.2", "yarn-or-npm": "^2.0.2", "zip-folder": "^1.0.0" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-customizable" + }, + "cz-customizable": { + "config": "./.cz.js" + } } }