@commitlint/read
Advanced tools
Comparing version 7.3.1 to 7.5.0
@@ -6,4 +6,23 @@ # Change Log | ||
<a name="7.5.0"></a> | ||
# [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31) | ||
### Bug Fixes | ||
* all broken website references ([#564](https://github.com/conventional-changelog/commitlint/issues/564)) ([82eeb5a](https://github.com/conventional-changelog/commitlint/commit/82eeb5a)) | ||
* replace all repository references with conventional changelog ([#561](https://github.com/conventional-changelog/commitlint/issues/561)) ([6c3afcd](https://github.com/conventional-changelog/commitlint/commit/6c3afcd)) | ||
* replace all website references with conventional changelog ([#563](https://github.com/conventional-changelog/commitlint/issues/563)) ([6b86fb1](https://github.com/conventional-changelog/commitlint/commit/6b86fb1)) | ||
* resolve path to commit message for git submodules ([83b1a47](https://github.com/conventional-changelog/commitlint/commit/83b1a47)) | ||
### Features | ||
* add support for git submodules ([cc575fa](https://github.com/conventional-changelog/commitlint/commit/cc575fa)) | ||
<a name="7.3.1"></a> | ||
## [7.3.1](https://github.com/marionebl/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11) | ||
## [7.3.1](https://github.com/conventional-changelog/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11) | ||
@@ -16,3 +35,3 @@ | ||
<a name="7.3.0"></a> | ||
# [7.3.0](https://github.com/marionebl/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11) | ||
# [7.3.0](https://github.com/conventional-changelog/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11) | ||
@@ -25,3 +44,3 @@ | ||
<a name="7.1.2"></a> | ||
## [7.1.2](https://github.com/marionebl/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04) | ||
## [7.1.2](https://github.com/conventional-changelog/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04) | ||
@@ -34,3 +53,3 @@ | ||
<a name="6.1.1"></a> | ||
## [6.1.1](https://github.com/marionebl/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22) | ||
## [6.1.1](https://github.com/conventional-changelog/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22) | ||
@@ -37,0 +56,0 @@ |
@@ -64,5 +64,5 @@ 'use strict'; | ||
var top, editFilePath, editFile; | ||
return Promise.resolve((0, _topLevel2.default)(cwd)).then(function ($await_1) { | ||
return Promise.resolve((0, _topLevel2.default)(cwd)).then(function ($await_3) { | ||
try { | ||
top = $await_1; | ||
top = $await_3; | ||
@@ -74,8 +74,14 @@ | ||
editFilePath = typeof edit === 'string' ? _path2.default.resolve(top, edit) : _path2.default.join(top, '.git/COMMIT_EDITMSG'); | ||
return Promise.resolve(sander.readFile(editFilePath)).then(function ($await_2) { | ||
return Promise.resolve(getEditFilePath(top, edit)).then(function ($await_4) { | ||
try { | ||
editFile = $await_2; | ||
editFilePath = $await_4; | ||
return Promise.resolve(sander.readFile(editFilePath)).then(function ($await_5) { | ||
try { | ||
editFile = $await_5; | ||
return $return([`${editFile.toString('utf-8')}\n`]); | ||
return $return([`${editFile.toString('utf-8')}\n`]); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} catch ($boundEx) { | ||
@@ -91,3 +97,45 @@ return $error($boundEx); | ||
} | ||
// Get path to recently edited commit message file | ||
// (top: string, edit: any) => Promise<String> | ||
function getEditFilePath(top, edit) { | ||
return new Promise(function ($return, $error) { | ||
var dotgitPath, dotgitStats, gitFile, relativeGitPath; | ||
let editFilePath; | ||
if (typeof edit === 'string') { | ||
editFilePath = _path2.default.resolve(top, edit); | ||
return $If_1.call(this); | ||
} else { | ||
dotgitPath = _path2.default.join(top, '.git'); | ||
dotgitStats = sander.lstatSync(dotgitPath); | ||
if (dotgitStats.isDirectory()) { | ||
editFilePath = _path2.default.join(top, '.git/COMMIT_EDITMSG'); | ||
return $If_2.call(this); | ||
} else { | ||
return Promise.resolve(sander.readFile(dotgitPath, 'utf8')).then(function ($await_6) { | ||
try { | ||
gitFile = $await_6; | ||
relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', ''); | ||
editFilePath = _path2.default.resolve(top, relativeGitPath, 'COMMIT_EDITMSG'); | ||
return $If_2.call(this); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} | ||
function $If_2() { | ||
return $If_1.call(this); | ||
} | ||
} | ||
function $If_1() { | ||
return $return(editFilePath); | ||
} | ||
}.bind(this)); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@commitlint/read", | ||
"version": "7.3.1", | ||
"version": "7.5.0", | ||
"description": "Read commit messages from a specified range or last edit", | ||
@@ -14,3 +14,2 @@ "main": "lib/index.js", | ||
"pkg": "pkg-check --skip-import", | ||
"lint": "xo", | ||
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"", | ||
@@ -39,3 +38,2 @@ "test": "ava -c 4 --verbose", | ||
}, | ||
"xo": false, | ||
"engines": { | ||
@@ -46,8 +44,8 @@ "node": ">=4" | ||
"type": "git", | ||
"url": "https://github.com/marionebl/commitlint.git" | ||
"url": "https://github.com/conventional-changelog/commitlint.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/marionebl/commitlint/issues" | ||
"url": "https://github.com/conventional-changelog/commitlint/issues" | ||
}, | ||
"homepage": "https://github.com/marionebl/commitlint#readme", | ||
"homepage": "https://github.com/conventional-changelog/commitlint#readme", | ||
"keywords": [ | ||
@@ -65,7 +63,7 @@ "conventional-changelog", | ||
"devDependencies": { | ||
"@commitlint/test": "^7.3.1", | ||
"@commitlint/utils": "^7.3.1", | ||
"@commitlint/test": "^7.5.0", | ||
"@commitlint/utils": "^7.5.0", | ||
"ava": "0.22.0", | ||
"babel-cli": "6.26.0", | ||
"babel-preset-commitlint": "^7.3.1", | ||
"babel-preset-commitlint": "^7.5.0", | ||
"babel-register": "6.26.0", | ||
@@ -75,7 +73,6 @@ "concurrently": "3.5.1", | ||
"execa": "0.9.0", | ||
"rimraf": "2.6.1", | ||
"xo": "0.20.3" | ||
"rimraf": "2.6.1" | ||
}, | ||
"dependencies": { | ||
"@commitlint/top-level": "^7.3.1", | ||
"@commitlint/top-level": "^7.5.0", | ||
"@marionebl/sander": "^0.6.0", | ||
@@ -82,0 +79,0 @@ "babel-runtime": "^6.23.0", |
@@ -27,2 +27,2 @@ > Read commit messages from a specified range or last edit | ||
Consult [docs/api](http://marionebl.github.io/commitlint/#/reference-api) for comprehensive documentation. | ||
Consult [docs/api](https://conventional-changelog.github.io/commitlint/#/reference-api) for comprehensive documentation. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
24957
10
278
0
1
Updated@commitlint/top-level@^7.5.0