@semantic-release/release-notes-generator 7.3.4 → 9.0.1

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.
Files changed (2) hide show
  1. package/index.js +16 -8
  2. package/package.json +10 -11
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const {URL, format} = require('url');
1
+ const {format} = require('url');
2
2
  const {find, merge} = require('lodash');
3
3
  const getStream = require('get-stream');
4
4
  const intoStream = require('into-stream');
@@ -31,21 +31,30 @@ async function generateNotes(pluginConfig, context) {
31
31
  const repositoryUrl = options.repositoryUrl.replace(/\.git$/i, '');
32
32
  const {parserOpts, writerOpts} = await loadChangelogConfig(pluginConfig, context);
33
33
 
34
- const [match, auth, host, path] = /^(?!.+:\/\/)(?:(.*)@)?(.*?):(.*)$/.exec(repositoryUrl) || [];
34
+ const [match, auth, host, path] = /^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/.exec(repositoryUrl) || [];
35
35
  let {hostname, port, pathname, protocol} = new URL(
36
36
  match ? `ssh://${auth ? `${auth}@` : ''}${host}/${path}` : repositoryUrl
37
37
  );
38
38
  port = protocol.includes('ssh') ? '' : port;
39
39
  protocol = protocol && /http[^s]/.test(protocol) ? 'http' : 'https';
40
- const [, owner, repository] = /^\/([^/]+)?\/?(.+)?$/.exec(pathname);
40
+ const [, owner, repository] = /^\/(?<owner>[^/]+)?\/?(?<repository>.+)?$/.exec(pathname);
41
41
 
42
42
  const {issue, commit, referenceActions, issuePrefixes} =
43
43
  find(HOSTS_CONFIG, conf => conf.hostname === hostname) || HOSTS_CONFIG.default;
44
44
  const parsedCommits = filter(
45
- commits.map(rawCommit => ({
46
- ...rawCommit,
47
- ...parser(rawCommit.message, {referenceActions, issuePrefixes, ...parserOpts}),
48
- }))
45
+ commits
46
+ .filter(({message, hash}) => {
47
+ if (!message.trim()) {
48
+ debug('Skip commit %s with empty message', hash);
49
+ return false;
50
+ }
51
+
52
+ return true;
53
+ })
54
+ .map(rawCommit => ({
55
+ ...rawCommit,
56
+ ...parser(rawCommit.message, {referenceActions, issuePrefixes, ...parserOpts}),
57
+ }))
49
58
  );
50
59
  const previousTag = lastRelease.gitTag || lastRelease.gitHead;
51
60
  const currentTag = nextRelease.gitTag || nextRelease.gitHead;
@@ -73,7 +82,6 @@ async function generateNotes(pluginConfig, context) {
73
82
  debug('previousTag: %o', changelogContext.previousTag);
74
83
  debug('currentTag: %o', changelogContext.currentTag);
75
84
  debug('host: %o', changelogContext.host);
76
- debug('host: %o', changelogContext.host);
77
85
  debug('linkReferences: %o', changelogContext.linkReferences);
78
86
  debug('issue: %o', changelogContext.issue);
79
87
  debug('commit: %o', changelogContext.commit);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semantic-release/release-notes-generator",
3
3
  "description": "semantic-release plugin to generate changelog content with conventional-changelog",
4
- "version": "7.3.4",
4
+ "version": "9.0.1",
5
5
  "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/semantic-release/release-notes-generator/issues"
@@ -23,7 +23,7 @@
23
23
  "read-pkg-up": "^7.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "ava": "^2.0.0",
26
+ "ava": "^3.1.0",
27
27
  "codecov": "^3.0.0",
28
28
  "conventional-changelog-atom": "^2.0.0",
29
29
  "conventional-changelog-conventionalcommits": "^4.1.0",
@@ -33,15 +33,15 @@
33
33
  "conventional-changelog-jshint": "^2.0.0",
34
34
  "escape-string-regexp": "^2.0.0",
35
35
  "fs-extra": "^8.0.1",
36
- "nyc": "^14.0.0",
36
+ "nyc": "^15.0.0",
37
37
  "proxyquire": "^2.1.0",
38
- "semantic-release": "^15.0.0",
39
- "sinon": "^7.3.2",
40
- "tempy": "^0.3.0",
41
- "xo": "^0.25.0"
38
+ "semantic-release": "^17.0.0",
39
+ "sinon": "^9.0.0",
40
+ "tempy": "^0.4.0",
41
+ "xo": "^0.26.0"
42
42
  },
43
43
  "engines": {
44
- "node": ">=8.16"
44
+ "node": ">=10.18"
45
45
  },
46
46
  "files": [
47
47
  "lib",
@@ -73,15 +73,14 @@
73
73
  "all": true
74
74
  },
75
75
  "peerDependencies": {
76
- "semantic-release": ">=15.8.0 <16.0.0 || >=16.0.0-beta <17.0.0"
76
+ "semantic-release": ">=15.8.0 <18.0.0"
77
77
  },
78
78
  "prettier": {
79
79
  "printWidth": 120,
80
80
  "trailingComma": "es5"
81
81
  },
82
82
  "publishConfig": {
83
- "access": "public",
84
- "tag": "next"
83
+ "access": "public"
85
84
  },
86
85
  "repository": {
87
86
  "type": "git",