conventional-changelog-conventionalcommits 4.4.0 → 4.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.4.0...conventional-changelog-conventionalcommits@4.5.0) (2020-11-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * **conventionalcommits:** allow matching scope ([#669](https://github.com/conventional-changelog/conventional-changelog/issues/669)) ([e01e027](https://github.com/conventional-changelog/conventional-changelog/commit/e01e027af60f5fa3e9146223b96797793930aeb4))
12
+
13
+
14
+
15
+
16
+
6
17
  # [4.4.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.3.1...conventional-changelog-conventionalcommits@4.4.0) (2020-08-12)
7
18
 
8
19
 
@@ -14,6 +25,27 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
14
25
 
15
26
 
16
27
 
28
+ ### [4.6.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits-v4.6.1...conventional-changelog-conventionalcommits-v4.6.2) (2021-12-24)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **docs:** template examples ([#866](https://github.com/conventional-changelog/conventional-changelog/issues/866)) ([5917ad2](https://github.com/conventional-changelog/conventional-changelog/commit/5917ad2bd95a83c2a047b2f5692c8e8e442a23f5))
34
+
35
+ ### [4.6.1](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits-v4.6.0...conventional-changelog-conventionalcommits-v4.6.1) (2021-09-09)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * **conventional-commits-parser:** address CVE-2021-23425 ([#841](https://www.github.com/conventional-changelog/conventional-changelog/issues/841)) ([02b3d53](https://www.github.com/conventional-changelog/conventional-changelog/commit/02b3d53a0c142f0c28ee7d190d210c76a62887c2))
41
+
42
+ ## [4.6.0](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits-vconventional-changelog-conventionalcommits@4.5.0...conventional-changelog-conventionalcommits-v4.6.0) (2021-04-30)
43
+
44
+
45
+ ### Features
46
+
47
+ * **conventionalcommits:** include Release-As commits in CHANGELOG ([#796](https://www.github.com/conventional-changelog/conventional-changelog/issues/796)) ([9a0b9a7](https://www.github.com/conventional-changelog/conventional-changelog/commit/9a0b9a7f7ba5edd68b3476de706672d82e42b9e0))
48
+
17
49
  ## [4.3.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.3.0...conventional-changelog-conventionalcommits@4.3.1) (2020-06-20)
18
50
 
19
51
 
package/README.md CHANGED
@@ -20,7 +20,7 @@ const config = require('conventional-changelog-conventionalcommits')
20
20
 
21
21
  module.exports = config({
22
22
  "issuePrefixes": ["TEST-"],
23
- "issueUrlFormat": "myBugTracker.com/{prefix}{id}"
23
+ "issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}"
24
24
  })
25
25
  ```
26
26
 
@@ -31,7 +31,7 @@ or json config like that:
31
31
  "preset": {
32
32
  "name": "conventionalchangelog",
33
33
  "issuePrefixes": ["TEST-"],
34
- "issueUrlFormat": "myBugTracker.com/{prefix}{id}"
34
+ "issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}"
35
35
  }
36
36
  }
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conventional-changelog-conventionalcommits",
3
- "version": "4.4.0",
3
+ "version": "4.6.2",
4
4
  "description": "conventional-changelog conventionalcommits.org preset",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,11 +32,10 @@
32
32
  "bugs": {
33
33
  "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
34
34
  },
35
- "homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular#readme",
35
+ "homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits#readme",
36
36
  "dependencies": {
37
37
  "compare-func": "^2.0.0",
38
38
  "lodash": "^4.17.15",
39
39
  "q": "^1.5.1"
40
- },
41
- "gitHead": "be1246c68f5dc4e6f28996129951a75bbf1cf307"
40
+ }
42
41
  }
package/writer-opts.js CHANGED
@@ -5,6 +5,7 @@ const compareFunc = require('compare-func')
5
5
  const Q = require('q')
6
6
  const readFile = Q.denodeify(require('fs').readFile)
7
7
  const resolve = require('path').resolve
8
+ const releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i
8
9
 
9
10
  /**
10
11
  * Handlebar partials for various property substitutions based on commit context.
@@ -54,34 +55,50 @@ module.exports = function (config) {
54
55
  })
55
56
  }
56
57
 
58
+ function findTypeEntry (types, commit) {
59
+ const typeKey = (commit.revert ? 'revert' : (commit.type || '')).toLowerCase()
60
+ return types.find((entry) => {
61
+ if (entry.type !== typeKey) {
62
+ return false
63
+ }
64
+ if (entry.scope && entry.scope !== commit.scope) {
65
+ return false
66
+ }
67
+ return true
68
+ })
69
+ }
70
+
57
71
  function getWriterOpts (config) {
58
72
  config = defaultConfig(config)
59
- const typesLookup = {}
60
- config.types.forEach(type => {
61
- typesLookup[type.type] = type
62
- })
63
73
 
64
74
  return {
65
75
  transform: (commit, context) => {
66
76
  let discard = true
67
77
  const issues = []
68
- const typeKey = (commit.revert ? 'revert' : (commit.type || '')).toLowerCase()
78
+ const entry = findTypeEntry(config.types, commit)
69
79
 
70
80
  // adds additional breaking change notes
71
81
  // for the special case, test(system)!: hello world, where there is
72
82
  // a '!' but no 'BREAKING CHANGE' in body:
73
83
  addBangNotes(commit)
74
84
 
85
+ // Add an entry in the CHANGELOG if special Release-As footer
86
+ // is used:
87
+ if ((commit.footer && releaseAsRe.test(commit.footer)) ||
88
+ (commit.body && releaseAsRe.test(commit.body))) {
89
+ discard = false
90
+ }
91
+
75
92
  commit.notes.forEach(note => {
76
93
  note.title = 'BREAKING CHANGES'
77
94
  discard = false
78
95
  })
79
96
 
80
97
  // breaking changes attached to any type are still displayed.
81
- if (discard && (typesLookup[typeKey] === undefined ||
82
- typesLookup[typeKey].hidden)) return
98
+ if (discard && (entry === undefined ||
99
+ entry.hidden)) return
83
100
 
84
- if (typesLookup[typeKey]) commit.type = typesLookup[typeKey].section
101
+ if (entry) commit.type = entry.section
85
102
 
86
103
  if (commit.scope === '*') {
87
104
  commit.scope = ''