From 623c4cc196c2b07e4a70671a8f48dcd1c9c5daaa Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sat, 21 Oct 2017 18:04:53 +0200 Subject: [PATCH 01/13] misc(changelog-generator): Generate changelogs --- package.json | 4 +- yarn.lock | 335 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 321 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 7af2cc0065c3..f13fdb2d8e5d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "smokehouse": "node lighthouse-cli/test/smokehouse/smokehouse.js", "deploy-viewer": "cd lighthouse-viewer && gulp deploy", "bundlesize": "bundlesize", - "plots-smoke": "bash plots/test/smoke.sh" + "plots-smoke": "bash plots/test/smoke.sh", + "changelog:generate": "conventional-changelog -p angular -i CHANGELOG.md -s" }, "devDependencies": { "@types/node": "^6.0.45", @@ -54,6 +55,7 @@ "bundlesize": "^0.14.4", "codecov": "^2.2.0", "commitizen": "^2.9.6", + "conventional-changelog-cli": "^1.3.4", "coveralls": "^2.11.9", "cz-customizable": "^5.2.0", "eslint": "^4.8.0", diff --git a/yarn.lock b/yarn.lock index 543879453381..8f59f839a385 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,6 +22,13 @@ version "0.0.28" resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-0.0.28.tgz#5562519bc7963caca8abf7f128cae3b594d41d06" +JSONStream@^1.0.4: + version "1.3.1" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" @@ -54,6 +61,10 @@ acorn@^5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7" +add-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" + ajv-keywords@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.0.tgz#a296e17f7bfae7c1ce4f7e0de53d29cb32162df0" @@ -147,6 +158,10 @@ array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -679,6 +694,13 @@ commitizen@^2.9.6: shelljs "0.7.6" strip-json-comments "2.0.1" +compare-func@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + dependencies: + array-ify "^1.0.0" + dot-prop "^3.0.0" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -717,10 +739,143 @@ content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" +conventional-changelog-angular@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.5.1.tgz#974e73aa1c39c392e4364f2952bd9a62904e9ea3" + dependencies: + compare-func "^1.3.1" + q "^1.4.1" + +conventional-changelog-atom@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.1.1.tgz#d40a9b297961b53c745e5d1718fd1a3379f6a92f" + dependencies: + q "^1.4.1" + +conventional-changelog-cli@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.4.tgz#38f7ff7ac7bca92ea110897ea08b473f2055a27c" + dependencies: + add-stream "^1.0.0" + conventional-changelog "^1.1.6" + lodash "^4.1.0" + meow "^3.7.0" + tempfile "^1.1.1" + +conventional-changelog-codemirror@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.0.tgz#3cc925955f3b14402827b15168049821972d9459" + dependencies: + q "^1.4.1" + +conventional-changelog-core@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.2.tgz#a09b6b959161671ff45b93cc9efb0444e7c845c0" + dependencies: + conventional-changelog-writer "^2.0.1" + conventional-commits-parser "^2.0.0" + dateformat "^1.0.12" + get-pkg-repo "^1.0.0" + git-raw-commits "^1.2.0" + git-remote-origin-url "^2.0.0" + git-semver-tags "^1.2.2" + lodash "^4.0.0" + normalize-package-data "^2.3.5" + q "^1.4.1" + read-pkg "^1.1.0" + read-pkg-up "^1.0.1" + through2 "^2.0.0" + +conventional-changelog-ember@^0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.2.8.tgz#65e686da83d23b67133d1f853908c87f948035c0" + dependencies: + q "^1.4.1" + +conventional-changelog-eslint@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.0.tgz#b4b9b5dc09417844d87c7bcfb16bdcc686c4b1c1" + dependencies: + q "^1.4.1" + +conventional-changelog-express@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.2.0.tgz#8d666ad41b10ebf964a4602062ddd2e00deb518d" + dependencies: + q "^1.4.1" + +conventional-changelog-jquery@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz#0208397162e3846986e71273b6c79c5b5f80f510" + dependencies: + q "^1.4.1" + +conventional-changelog-jscs@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz#0479eb443cc7d72c58bf0bcf0ef1d444a92f0e5c" + dependencies: + q "^1.4.1" + +conventional-changelog-jshint@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.0.tgz#63ad7aec66cd1ae559bafe80348c4657a6eb1872" + dependencies: + compare-func "^1.3.1" + q "^1.4.1" + +conventional-changelog-writer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-2.0.1.tgz#47c10d0faba526b78d194389d1e931d09ee62372" + dependencies: + compare-func "^1.3.1" + conventional-commits-filter "^1.0.0" + dateformat "^1.0.11" + handlebars "^4.0.2" + json-stringify-safe "^5.0.1" + lodash "^4.0.0" + meow "^3.3.0" + semver "^5.0.1" + split "^1.0.0" + through2 "^2.0.0" + +conventional-changelog@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.6.tgz#ebd9b1ab63766c715f903f654626b6b1c0da7762" + dependencies: + conventional-changelog-angular "^1.5.1" + conventional-changelog-atom "^0.1.1" + conventional-changelog-codemirror "^0.2.0" + conventional-changelog-core "^1.9.2" + conventional-changelog-ember "^0.2.8" + conventional-changelog-eslint "^0.2.0" + conventional-changelog-express "^0.2.0" + conventional-changelog-jquery "^0.1.0" + conventional-changelog-jscs "^0.1.0" + conventional-changelog-jshint "^0.2.0" + conventional-commit-types@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946" +conventional-commits-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.0.0.tgz#6fc2a659372bc3f2339cf9ffff7e1b0344b93039" + dependencies: + is-subset "^0.1.1" + modify-values "^1.0.0" + +conventional-commits-parser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz#71d01910cb0a99aeb20c144e50f81f4df3178447" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + convert-source-map@^1.1.0, convert-source-map@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" @@ -820,13 +975,19 @@ cz-customizable@^5.2.0: winston "2.1.0" word-wrap "1.1.0" +dargs@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + dependencies: + number-is-nan "^1.0.0" + dashdash@^1.12.0: version "1.14.0" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.0.tgz#29e486c5418bf0f356034a993d51686a33e84141" dependencies: assert-plus "^1.0.0" -dateformat@^1.0.11: +dateformat@^1.0.11, dateformat@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" dependencies: @@ -931,6 +1092,12 @@ doctrine@^2.0.0: esutils "^2.0.2" isarray "^1.0.0" +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + dependencies: + is-obj "^1.0.0" + dot-prop@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" @@ -1372,6 +1539,16 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" +get-pkg-repo@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" + dependencies: + hosted-git-info "^2.1.4" + meow "^3.3.0" + normalize-package-data "^2.3.0" + parse-github-repo-url "^1.3.0" + through2 "^2.0.0" + get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -1386,6 +1563,36 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-raw-commits@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.2.0.tgz#0f3a8bfd99ae0f2d8b9224d58892975e9a52d03c" + dependencies: + dargs "^4.0.1" + lodash.template "^4.0.2" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + +git-remote-origin-url@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" + dependencies: + gitconfiglocal "^1.0.0" + pify "^2.3.0" + +git-semver-tags@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.2.tgz#a2139be1bf6e337e125f3eb8bb8fc6f5d4d6445f" + dependencies: + meow "^3.3.0" + semver "^5.0.1" + +gitconfiglocal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" + dependencies: + ini "^1.3.2" + github-build@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/github-build/-/github-build-1.2.0.tgz#b0bdb705ae4088218577e863c1a301030211051f" @@ -1688,6 +1895,16 @@ handlebars@^4.0.1: optionalDependencies: uglify-js "^2.6" +handlebars@^4.0.2: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -1792,11 +2009,11 @@ inherits@1: version "1.0.2" resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@^1.3.4, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" @@ -2002,6 +2219,16 @@ is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + +is-text-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + dependencies: + text-extensions "^1.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -2170,7 +2397,7 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@5.0.1, json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -2192,6 +2419,10 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + jsonpointer@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" @@ -2346,7 +2577,7 @@ lodash._reevaluate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" -lodash._reinterpolate@^3.0.0: +lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -2434,6 +2665,13 @@ lodash.template@^3.0.0: lodash.restparam "^3.0.0" lodash.templatesettings "^3.0.0" +lodash.template@^4.0.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + lodash.templatesettings@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" @@ -2441,11 +2679,17 @@ lodash.templatesettings@^3.0.0: lodash._reinterpolate "^3.0.0" lodash.escape "^3.0.0" +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash@4.17.2: version "4.17.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" -lodash@^4.17.4, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.1.0, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2627,6 +2871,10 @@ mocha@^3.2.0: mkdirp "0.5.1" supports-color "3.1.2" +modify-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" + ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" @@ -2667,6 +2915,15 @@ nopt@3.x: dependencies: abbrev "1" +normalize-package-data@^2.3.0, normalize-package-data@^2.3.5: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.3.5" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" @@ -2845,6 +3102,10 @@ parse-filepath@^1.0.1: map-cache "^0.2.0" path-root "^0.1.1" +parse-github-repo-url@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" + parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2982,6 +3243,10 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +q@^1.4.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + qs@~6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.1.tgz#ce03c5ff0935bc1d9d69a9f14cbd18e568d67625" @@ -3030,7 +3295,7 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^2.0.0" -read-pkg@^1.0.0: +read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" dependencies: @@ -3055,7 +3320,7 @@ read-pkg@^2.0.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -3302,7 +3567,7 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" -safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -3324,6 +3589,10 @@ semver@^4.1.0: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" +semver@^5.0.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + sequencify@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" @@ -3435,6 +3704,18 @@ speedline@1.2.0: loud-rejection "^1.3.0" meow "^3.7.0" +split2@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + dependencies: + through2 "^2.0.2" + +split@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -3496,12 +3777,6 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3600,12 +3875,23 @@ temp@0.8.3: os-tmpdir "^1.0.0" rimraf "~2.2.6" +tempfile@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2" + dependencies: + os-tmpdir "^1.0.0" + uuid "^2.0.1" + term-size@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" dependencies: execa "^0.4.0" +text-extensions@^1.0.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" + text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -3635,7 +3921,14 @@ through2@^2.0.0, through2@^2.0.1, through2@~2.0.0: readable-stream "~2.0.0" xtend "~4.0.0" -through@^2.3.6: +through2@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +through@2, "through@>=2.2.7 <3", through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -3689,6 +3982,10 @@ trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +trim-off-newlines@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + tryit@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.2.tgz#c196b0073e6b1c595d93c9c830855b7acc32a453" @@ -3788,6 +4085,10 @@ uuid@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" +uuid@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -4014,7 +4315,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 6b78e85d58adb2a5165b67b6e8a158932111dabb Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 22 Oct 2017 00:59:17 +0200 Subject: [PATCH 02/13] fix formatting for changelog --- conventional-changelog-lighthouse/index.js | 50 +++++++++++++++++++ .../templates/commit.hbs | 5 ++ .../templates/header.hbs | 5 ++ .../templates/template.hbs | 12 +++++ 4 files changed, 72 insertions(+) create mode 100644 conventional-changelog-lighthouse/index.js create mode 100644 conventional-changelog-lighthouse/templates/commit.hbs create mode 100644 conventional-changelog-lighthouse/templates/header.hbs create mode 100644 conventional-changelog-lighthouse/templates/template.hbs diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js new file mode 100644 index 000000000000..150092b534ce --- /dev/null +++ b/conventional-changelog-lighthouse/index.js @@ -0,0 +1,50 @@ +'use strict'; +const readFileSync = require('fs').readFileSync; +const resolve = require('path').resolve; + +const parserOpts = { + headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, + headerCorrespondence: [ + 'type', + 'scope', + 'message', + ], +}; + +const writerOpts = { + transform: commit => { + if (typeof commit.hash === 'string') { + commit.hash = commit.hash.substring(0, 7); + } + + if (commit.type) { + commit.type = commit.type.replace(/_/g, ' '); + commit.type = commit.type.substring(0, 1).toUpperCase() + commit.type.substring(1); + } else { + commit.type = 'Misc'; + } + + return commit; + }, + groupBy: 'type', + commitGroupsSort: (a, b) => { + if (b.title === 'New audit') { + return 1; + } + + return a.title.localeCompare(b.title); + }, + commitsSort: ['type', 'scope', 'message'] +}; + +const template = readFileSync(resolve(__dirname, 'templates/template.hbs')).toString(); +const header = readFileSync(resolve(__dirname, 'templates/header.hbs')).toString(); +const commit = readFileSync(resolve(__dirname, 'templates/commit.hbs')).toString(); +writerOpts.mainTemplate = template; +writerOpts.headerPartial = header; +writerOpts.commitPartial = commit; + +module.exports = { + writerOpts, + parserOpts, +}; diff --git a/conventional-changelog-lighthouse/templates/commit.hbs b/conventional-changelog-lighthouse/templates/commit.hbs new file mode 100644 index 000000000000..abd82a3f3360 --- /dev/null +++ b/conventional-changelog-lighthouse/templates/commit.hbs @@ -0,0 +1,5 @@ +* {{#if message}}{{message}}{{else}}{{header}}{{/if}} + +{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{hash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}} + +{{~!-- commit references --}}{{#if references}}, closes{{~#each references}} {{#if @root.linkReferences}}[{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if this.repository}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}{{else}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}{{/if}}/{{@root.issue}}/{{this.issue}}){{else}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}{{/if}}{{/each}}{{/if}} diff --git a/conventional-changelog-lighthouse/templates/header.hbs b/conventional-changelog-lighthouse/templates/header.hbs new file mode 100644 index 000000000000..857bc55c102c --- /dev/null +++ b/conventional-changelog-lighthouse/templates/header.hbs @@ -0,0 +1,5 @@ + +# {{version}} ({{date}}) +{{#if @root.linkCompare~}} + [Full Changelog]({{~@root.repoUrl}}/compare/{{previousTag}}...{{currentTag}}) +{{~/if}} diff --git a/conventional-changelog-lighthouse/templates/template.hbs b/conventional-changelog-lighthouse/templates/template.hbs new file mode 100644 index 000000000000..a36bd0ec8acc --- /dev/null +++ b/conventional-changelog-lighthouse/templates/template.hbs @@ -0,0 +1,12 @@ +{{> header}} + +{{#each commitGroups}} + + {{#if title}} + ### {{title}} + + {{/if}} + {{#each commits}} + {{> commit root=@root}} + {{/each}} +{{/each}} From 11634e2c14d1ee6d504611c9cc5c6dead86d342d Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 22 Oct 2017 01:03:30 +0200 Subject: [PATCH 03/13] Update changelog script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f13fdb2d8e5d..33d313600851 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "deploy-viewer": "cd lighthouse-viewer && gulp deploy", "bundlesize": "bundlesize", "plots-smoke": "bash plots/test/smoke.sh", - "changelog:generate": "conventional-changelog -p angular -i CHANGELOG.md -s" + "changelog:generate": "conventional-changelog -n ./conventional-changelog-lighthouse/index.js -i CHANGELOG.md -s" }, "devDependencies": { "@types/node": "^6.0.45", From afe3364675f4f36caabfa34f7a34974c02ff3a62 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 22 Oct 2017 12:15:09 +0200 Subject: [PATCH 04/13] Fix eslint --- conventional-changelog-lighthouse/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index 150092b534ce..b0595fc92aa7 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -3,7 +3,7 @@ const readFileSync = require('fs').readFileSync; const resolve = require('path').resolve; const parserOpts = { - headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, + headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/, headerCorrespondence: [ 'type', 'scope', @@ -28,13 +28,14 @@ const writerOpts = { }, groupBy: 'type', commitGroupsSort: (a, b) => { + // put new audit on the top if (b.title === 'New audit') { return 1; } return a.title.localeCompare(b.title); }, - commitsSort: ['type', 'scope', 'message'] + commitsSort: ['type', 'scope', 'message'], }; const template = readFileSync(resolve(__dirname, 'templates/template.hbs')).toString(); From 7b0ac70f34843ddb3ac802eb474e42a56f037ce0 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Tue, 24 Oct 2017 21:13:49 +0200 Subject: [PATCH 05/13] Combine test and tests to one category --- conventional-changelog-lighthouse/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index b0595fc92aa7..8b6af38d9f77 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -17,6 +17,10 @@ const writerOpts = { commit.hash = commit.hash.substring(0, 7); } + if (commit.type === 'test') { + commit.type = 'tests'; + } + if (commit.type) { commit.type = commit.type.replace(/_/g, ' '); commit.type = commit.type.substring(0, 1).toUpperCase() + commit.type.substring(1); From 0d77fa929ff95c27cf53751b7a00c84bd207640e Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Tue, 24 Oct 2017 23:04:52 +0200 Subject: [PATCH 06/13] Fix template --- .../templates/commit.hbs | 49 +++++++++++++++++-- .../templates/template.hbs | 5 +- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/conventional-changelog-lighthouse/templates/commit.hbs b/conventional-changelog-lighthouse/templates/commit.hbs index abd82a3f3360..b554cb6b6b7c 100644 --- a/conventional-changelog-lighthouse/templates/commit.hbs +++ b/conventional-changelog-lighthouse/templates/commit.hbs @@ -1,5 +1,46 @@ -* {{#if message}}{{message}}{{else}}{{header}}{{/if}} +* {{#if message ~}} + {{~message~}} + {{~else~}} + {{~header~}} + {{~/if ~}} +{{~!-- commit hash --}} +{{~#if @root.linkReferences~}} + ([{{hash}}]( + {{~#if @root.host}}{{~@root.host}}/{{/if~}} + {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} + {{~@root.repository}}/{{@root.commit}}/{{hash}})) +{{~else~}} + {{~hash~}} +{{~/if~}} -{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{hash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}} - -{{~!-- commit references --}}{{#if references}}, closes{{~#each references}} {{#if @root.linkReferences}}[{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if this.repository}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}{{else}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}{{/if}}/{{@root.issue}}/{{this.issue}}){{else}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}{{/if}}{{/each}}{{/if}} +{{~!-- commit references --}} +{{~#if references}}, closes + {{~#each references~}} + {{~#if @root.linkReferences~}}[ + {{~#if this.owner~}} + {{~this.owner}}/ + {{~/if~}} + {{~this.repository}}#{{this.issue}}]( + {{~#if @root.host~}} + {{~@root.host}}/ + {{~/if~}} + {{~#if this.repository~}} + {{~#if this.owner~}} + {{~this.owner}}/ + {{~/if~}} + {{~this.repository~}} + {{~else~}} + {{~#if @root.owner~}} + {{~@root.owner}}/ + {{~/if~}} + {{~@root.repository~}} + {{~/if~}} + /{{@root.issue}}/{{this.issue}}) + {{~else~}} + {{~#if this.owner~}} + {{~this.owner}}/ + {{~/if~}} + {{~this.repository}}#{{this.issue~}} + {{~/if~}} + {{~/each~}} +{{~/if}} diff --git a/conventional-changelog-lighthouse/templates/template.hbs b/conventional-changelog-lighthouse/templates/template.hbs index a36bd0ec8acc..41335f205be2 100644 --- a/conventional-changelog-lighthouse/templates/template.hbs +++ b/conventional-changelog-lighthouse/templates/template.hbs @@ -2,11 +2,12 @@ {{#each commitGroups}} - {{#if title}} + {{#if title~}} ### {{title}} {{/if}} {{#each commits}} - {{> commit root=@root}} + {{~> commit root=@root}} + {{/each}} {{/each}} From 8e26dfd5c36749e29256a3fc1669f4ce4adac85d Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Fri, 3 Nov 2017 15:40:24 +0100 Subject: [PATCH 07/13] Add pr links & remove issue references --- conventional-changelog-lighthouse/index.js | 33 +++++++++--- .../templates/commit.hbs | 54 +++++++------------ .../templates/header.hbs | 9 +++- .../templates/template.hbs | 7 +++ package.json | 2 +- 5 files changed, 60 insertions(+), 45 deletions(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index 8b6af38d9f77..28581e427d58 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -1,6 +1,14 @@ +/** + * @license Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ 'use strict'; const readFileSync = require('fs').readFileSync; const resolve = require('path').resolve; +const mainTemplate = readFileSync(resolve(__dirname, 'templates/template.hbs')).toString(); +const headerPartial = readFileSync(resolve(__dirname, 'templates/header.hbs')).toString(); +const commitPartial = readFileSync(resolve(__dirname, 'templates/commit.hbs')).toString(); const parserOpts = { headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/, @@ -12,6 +20,9 @@ const parserOpts = { }; const writerOpts = { + mainTemplate, + headerPartial, + commitPartial, transform: commit => { if (typeof commit.hash === 'string') { commit.hash = commit.hash.substring(0, 7); @@ -28,6 +39,21 @@ const writerOpts = { commit.type = 'Misc'; } + let pullRequestMatch = commit.header.match(/\((#\d+)\)/); + // if header does not provide a PR we try the message + if (!pullRequestMatch && commit.message) { + pullRequestMatch = commit.message.match(/\(#(\d+)\)/); + } + + if (pullRequestMatch) { + commit.header = commit.header.replace(pullRequestMatch[0], ''); + if (commit.message) { + commit.message = commit.message.replace(pullRequestMatch[0], ''); + } + + commit.PR = pullRequestMatch[1]; + } + return commit; }, groupBy: 'type', @@ -42,13 +68,6 @@ const writerOpts = { commitsSort: ['type', 'scope', 'message'], }; -const template = readFileSync(resolve(__dirname, 'templates/template.hbs')).toString(); -const header = readFileSync(resolve(__dirname, 'templates/header.hbs')).toString(); -const commit = readFileSync(resolve(__dirname, 'templates/commit.hbs')).toString(); -writerOpts.mainTemplate = template; -writerOpts.headerPartial = header; -writerOpts.commitPartial = commit; - module.exports = { writerOpts, parserOpts, diff --git a/conventional-changelog-lighthouse/templates/commit.hbs b/conventional-changelog-lighthouse/templates/commit.hbs index b554cb6b6b7c..09eeee405c90 100644 --- a/conventional-changelog-lighthouse/templates/commit.hbs +++ b/conventional-changelog-lighthouse/templates/commit.hbs @@ -1,3 +1,10 @@ +{{!-- +/** + * @license Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ +--}} * {{#if message ~}} {{~message~}} {{~else~}} @@ -5,42 +12,17 @@ {{~/if ~}} {{~!-- commit hash --}} {{~#if @root.linkReferences~}} - ([{{hash}}]( - {{~#if @root.host}}{{~@root.host}}/{{/if~}} - {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} - {{~@root.repository}}/{{@root.commit}}/{{hash}})) + {{~#if PR ~}} + ([#{{PR}}]( + {{~#if @root.host}}{{~@root.host}}/{{/if~}} + {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} + {{~@root.repository}}/pull/{{PR}})) + {{~else~}} + ([{{hash}}]( + {{~#if @root.host}}{{~@root.host}}/{{/if~}} + {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} + {{~@root.repository}}/{{@root.commit}}/{{hash}})) + {{~/if~}} {{~else~}} {{~hash~}} {{~/if~}} - -{{~!-- commit references --}} -{{~#if references}}, closes - {{~#each references~}} - {{~#if @root.linkReferences~}}[ - {{~#if this.owner~}} - {{~this.owner}}/ - {{~/if~}} - {{~this.repository}}#{{this.issue}}]( - {{~#if @root.host~}} - {{~@root.host}}/ - {{~/if~}} - {{~#if this.repository~}} - {{~#if this.owner~}} - {{~this.owner}}/ - {{~/if~}} - {{~this.repository~}} - {{~else~}} - {{~#if @root.owner~}} - {{~@root.owner}}/ - {{~/if~}} - {{~@root.repository~}} - {{~/if~}} - /{{@root.issue}}/{{this.issue}}) - {{~else~}} - {{~#if this.owner~}} - {{~this.owner}}/ - {{~/if~}} - {{~this.repository}}#{{this.issue~}} - {{~/if~}} - {{~/each~}} -{{~/if}} diff --git a/conventional-changelog-lighthouse/templates/header.hbs b/conventional-changelog-lighthouse/templates/header.hbs index 857bc55c102c..5fcf3812497e 100644 --- a/conventional-changelog-lighthouse/templates/header.hbs +++ b/conventional-changelog-lighthouse/templates/header.hbs @@ -1,4 +1,11 @@ - +{{!-- +/** + * @license Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ +--}} + # {{version}} ({{date}}) {{#if @root.linkCompare~}} [Full Changelog]({{~@root.repoUrl}}/compare/{{previousTag}}...{{currentTag}}) diff --git a/conventional-changelog-lighthouse/templates/template.hbs b/conventional-changelog-lighthouse/templates/template.hbs index 41335f205be2..fb0ffc547ea1 100644 --- a/conventional-changelog-lighthouse/templates/template.hbs +++ b/conventional-changelog-lighthouse/templates/template.hbs @@ -1,3 +1,10 @@ +{{!-- +/** + * @license Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + */ +--}} {{> header}} {{#each commitGroups}} diff --git a/package.json b/package.json index 33d313600851..3fb3b410d2fd 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "deploy-viewer": "cd lighthouse-viewer && gulp deploy", "bundlesize": "bundlesize", "plots-smoke": "bash plots/test/smoke.sh", - "changelog:generate": "conventional-changelog -n ./conventional-changelog-lighthouse/index.js -i CHANGELOG.md -s" + "changelog:generate": "conventional-changelog -n ./conventional-changelog-lighthouse/index.js -i changelog.md -s" }, "devDependencies": { "@types/node": "^6.0.45", From 01efa911e49003322f913ac9a824bc541f7ae4a4 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Fri, 3 Nov 2017 15:47:08 +0100 Subject: [PATCH 08/13] Remove # from pr --- conventional-changelog-lighthouse/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index 28581e427d58..9b3409fb35a9 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -39,7 +39,7 @@ const writerOpts = { commit.type = 'Misc'; } - let pullRequestMatch = commit.header.match(/\((#\d+)\)/); + let pullRequestMatch = commit.header.match(/\(#(\d+)\)/); // if header does not provide a PR we try the message if (!pullRequestMatch && commit.message) { pullRequestMatch = commit.message.match(/\(#(\d+)\)/); From 0d916a168b54e5cd0c71927a20a653bdc144244f Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sat, 4 Nov 2017 17:14:44 +0100 Subject: [PATCH 09/13] Change PR regex to only match end of line --- conventional-changelog-lighthouse/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index 9b3409fb35a9..9a7875011a4f 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -10,6 +10,7 @@ const mainTemplate = readFileSync(resolve(__dirname, 'templates/template.hbs')). const headerPartial = readFileSync(resolve(__dirname, 'templates/header.hbs')).toString(); const commitPartial = readFileSync(resolve(__dirname, 'templates/commit.hbs')).toString(); +const pullRequestRegex = /\(#(\d+)\)$/; const parserOpts = { headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/, headerCorrespondence: [ @@ -39,10 +40,10 @@ const writerOpts = { commit.type = 'Misc'; } - let pullRequestMatch = commit.header.match(/\(#(\d+)\)/); + let pullRequestMatch = commit.header.match(pullRequestRegex); // if header does not provide a PR we try the message if (!pullRequestMatch && commit.message) { - pullRequestMatch = commit.message.match(/\(#(\d+)\)/); + pullRequestMatch = commit.message.match(pullRequestRegex); } if (pullRequestMatch) { @@ -59,6 +60,9 @@ const writerOpts = { groupBy: 'type', commitGroupsSort: (a, b) => { // put new audit on the top + if (a.title === 'New audit') { + return 1; + } if (b.title === 'New audit') { return 1; } From 055700b8a7e73757adb7d93cf89b3d67b53c106d Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 5 Nov 2017 09:41:34 +0100 Subject: [PATCH 10/13] Fix new audit sorting --- conventional-changelog-lighthouse/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index 9a7875011a4f..f5fd244146cd 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -61,7 +61,7 @@ const writerOpts = { commitGroupsSort: (a, b) => { // put new audit on the top if (a.title === 'New audit') { - return 1; + return -1; } if (b.title === 'New audit') { return 1; From 259afcf7cac723fb738a34c09b5943285ea5c858 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 5 Nov 2017 09:41:43 +0100 Subject: [PATCH 11/13] Add scope to the message --- conventional-changelog-lighthouse/templates/commit.hbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conventional-changelog-lighthouse/templates/commit.hbs b/conventional-changelog-lighthouse/templates/commit.hbs index 09eeee405c90..831bb8159d5d 100644 --- a/conventional-changelog-lighthouse/templates/commit.hbs +++ b/conventional-changelog-lighthouse/templates/commit.hbs @@ -5,7 +5,8 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ --}} -* {{#if message ~}} +* {{#if scope}}{{scope}}: {{/if~}} + {{#if message ~}} {{~message~}} {{~else~}} {{~header~}} From b124091f0634dafac51070ceb6d17e412231e216 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Sun, 5 Nov 2017 09:42:02 +0100 Subject: [PATCH 12/13] change sorting --- conventional-changelog-lighthouse/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conventional-changelog-lighthouse/index.js b/conventional-changelog-lighthouse/index.js index f5fd244146cd..c0b801e55a6c 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/conventional-changelog-lighthouse/index.js @@ -69,7 +69,7 @@ const writerOpts = { return a.title.localeCompare(b.title); }, - commitsSort: ['type', 'scope', 'message'], + commitsSort: ['type', 'scope'], }; module.exports = { From e7d5ba5f83a93916c4142089ecae1392ea3bcd1c Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 10 Nov 2017 13:30:57 -0800 Subject: [PATCH 13/13] move directory; more formatting fixes --- CONTRIBUTING.md | 3 ++- .../changelog-generator}/index.js | 12 ++++++++++-- .../changelog-generator}/templates/commit.hbs | 8 +++----- .../changelog-generator}/templates/header.hbs | 0 .../changelog-generator}/templates/template.hbs | 0 package.json | 2 +- yarn.lock | 10 ++++++++-- 7 files changed, 24 insertions(+), 11 deletions(-) rename {conventional-changelog-lighthouse => build/changelog-generator}/index.js (93%) rename {conventional-changelog-lighthouse => build/changelog-generator}/templates/commit.hbs (92%) rename {conventional-changelog-lighthouse => build/changelog-generator}/templates/header.hbs (100%) rename {conventional-changelog-lighthouse => build/changelog-generator}/templates/template.hbs (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1cfed84e9a70..26781ff93c36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -146,6 +146,7 @@ echo "Test the lighthouse-viewer build" echo "Branch and commit the version bump." git co -b bumpv240 git c "2.4.0" +yarn changelog git tag -a v2.4.0 -m "v2.4.0" echo "Generate a PR and get it merged." @@ -162,7 +163,7 @@ npm publish yarn deploy-viewer echo "Use the GitHub web interface to tag the release" -echo "Generate the release notes, and update the release page" +echo "Copy changelog to release notes and update the release page" # * Tell the world!!! * echo "Inform various peoples" diff --git a/conventional-changelog-lighthouse/index.js b/build/changelog-generator/index.js similarity index 93% rename from conventional-changelog-lighthouse/index.js rename to build/changelog-generator/index.js index c0b801e55a6c..6ef54fd0f49b 100644 --- a/conventional-changelog-lighthouse/index.js +++ b/build/changelog-generator/index.js @@ -47,9 +47,9 @@ const writerOpts = { } if (pullRequestMatch) { - commit.header = commit.header.replace(pullRequestMatch[0], ''); + commit.header = commit.header.replace(pullRequestMatch[0], '').trim(); if (commit.message) { - commit.message = commit.message.replace(pullRequestMatch[0], ''); + commit.message = commit.message.replace(pullRequestMatch[0], '').trim(); } commit.PR = pullRequestMatch[1]; @@ -67,6 +67,14 @@ const writerOpts = { return 1; } + // put misc on the bottom + if (a.title === 'Misc') { + return 1; + } + if (b.title === 'Misc') { + return -1; + } + return a.title.localeCompare(b.title); }, commitsSort: ['type', 'scope'], diff --git a/conventional-changelog-lighthouse/templates/commit.hbs b/build/changelog-generator/templates/commit.hbs similarity index 92% rename from conventional-changelog-lighthouse/templates/commit.hbs rename to build/changelog-generator/templates/commit.hbs index 831bb8159d5d..d1f25518f8a5 100644 --- a/conventional-changelog-lighthouse/templates/commit.hbs +++ b/build/changelog-generator/templates/commit.hbs @@ -11,15 +11,13 @@ {{~else~}} {{~header~}} {{~/if ~}} -{{~!-- commit hash --}} +{{~!-- PR number/commit hash --}} {{~#if @root.linkReferences~}} - {{~#if PR ~}} - ([#{{PR}}]( + {{~#if PR}} ([#{{PR}}]( {{~#if @root.host}}{{~@root.host}}/{{/if~}} {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} {{~@root.repository}}/pull/{{PR}})) - {{~else~}} - ([{{hash}}]( + {{~else}} ([{{hash}}]( {{~#if @root.host}}{{~@root.host}}/{{/if~}} {{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} {{~@root.repository}}/{{@root.commit}}/{{hash}})) diff --git a/conventional-changelog-lighthouse/templates/header.hbs b/build/changelog-generator/templates/header.hbs similarity index 100% rename from conventional-changelog-lighthouse/templates/header.hbs rename to build/changelog-generator/templates/header.hbs diff --git a/conventional-changelog-lighthouse/templates/template.hbs b/build/changelog-generator/templates/template.hbs similarity index 100% rename from conventional-changelog-lighthouse/templates/template.hbs rename to build/changelog-generator/templates/template.hbs diff --git a/package.json b/package.json index 3fb3b410d2fd..f10e82401086 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "deploy-viewer": "cd lighthouse-viewer && gulp deploy", "bundlesize": "bundlesize", "plots-smoke": "bash plots/test/smoke.sh", - "changelog:generate": "conventional-changelog -n ./conventional-changelog-lighthouse/index.js -i changelog.md -s" + "changelog": "conventional-changelog -n ./build/changelog-generator/index.js -i changelog.md -s" }, "devDependencies": { "@types/node": "^6.0.45", diff --git a/yarn.lock b/yarn.lock index 8f59f839a385..3dcdb2a527da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2009,7 +2009,7 @@ inherits@1: version "1.0.2" resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -3567,7 +3567,7 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" -safe-buffer@^5.0.1: +safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -3777,6 +3777,12 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"