conventional-changelog-atom
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="0.2.0"></a> | ||
# [0.2.0](https://github.com/stevemao/conventional-changelog-atom/compare/conventional-changelog-atom@0.1.2...conventional-changelog-atom@0.2.0) (2017-12-18) | ||
### Features | ||
* **preset:** add recommended-bump opts into presets ([60815b5](https://github.com/stevemao/conventional-changelog-atom/commit/60815b5)), closes [#241](https://github.com/stevemao/conventional-changelog-atom/issues/241) | ||
<a name="0.1.2"></a> | ||
@@ -8,0 +19,0 @@ ## [0.1.2](https://github.com/stevemao/conventional-changelog-atom/compare/conventional-changelog-atom@0.1.1...conventional-changelog-atom@0.1.2) (2017-11-13) |
64
index.js
'use strict'; | ||
var Q = require('q'); | ||
var readFile = Q.denodeify(require('fs').readFile); | ||
var resolve = require('path').resolve; | ||
function presetOpts(cb) { | ||
var parserOpts = { | ||
headerPattern: /^(:.*?:) (.*)$/, | ||
headerCorrespondence: [ | ||
'emoji', | ||
'shortDesc' | ||
] | ||
}; | ||
const Q = require(`q`); | ||
const conventionalChangelog = require(`./conventional-changelog`); | ||
const parserOpts = require(`./parser-opts`); | ||
const recommendedBumpOpts = require(`./conventional-recommended-bump`); | ||
const writerOpts = require(`./writer-opts`); | ||
var writerOpts = { | ||
transform: function(commit) { | ||
var emojiLength; | ||
module.exports = presetOpts; | ||
if (!commit.emoji || typeof commit.emoji !== 'string') { | ||
return; | ||
} | ||
commit.emoji = commit.emoji.substring(0, 72); | ||
emojiLength = commit.emoji.length; | ||
if (typeof commit.hash === 'string') { | ||
commit.hash = commit.hash.substring(0, 7); | ||
} | ||
if (typeof commit.shortDesc === 'string') { | ||
commit.shortDesc = commit.shortDesc.substring(0, 72 - emojiLength); | ||
} | ||
return commit; | ||
}, | ||
groupBy: 'emoji', | ||
commitGroupsSort: 'title', | ||
commitsSort: ['emoji', 'shortDesc'] | ||
}; | ||
Q.all([ | ||
readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'), | ||
readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8') | ||
]) | ||
.spread(function(template, header, commit) { | ||
writerOpts.mainTemplate = template; | ||
writerOpts.headerPartial = header; | ||
writerOpts.commitPartial = commit; | ||
cb(null, { | ||
parserOpts: parserOpts, | ||
writerOpts: writerOpts | ||
}); | ||
}); | ||
function presetOpts(cb) { | ||
Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) | ||
.spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { | ||
cb(null, {conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts}); | ||
}); | ||
} | ||
module.exports = presetOpts; |
{ | ||
"name": "conventional-changelog-atom", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "conventional-changelog atom preset", | ||
@@ -23,3 +23,7 @@ "main": "index.js", | ||
"files": [ | ||
"conventional-changelog.js", | ||
"conventional-recommended-bump.js", | ||
"index.js", | ||
"parser-opts.js", | ||
"writer-opts.js", | ||
"templates" | ||
@@ -26,0 +30,0 @@ ], |
@@ -5,6 +5,31 @@ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url] | ||
**Issues with the convention itself should be reported on the Atom issue tracker.** | ||
See [convention](convention.md) | ||
## Atom Convention | ||
### Git Commit Messages | ||
* Use the present tense ("Add feature" not "Added feature") | ||
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") | ||
* Limit the first line to 72 characters or less | ||
* Reference issues and pull requests liberally | ||
* Consider starting the commit message with an applicable emoji: | ||
* :art: `:art:` when improving the format/structure of the code | ||
* :racehorse: `:racehorse:` when improving performance | ||
* :non-potable_water: `:non-potable_water:` when plugging memory leaks | ||
* :memo: `:memo:` when writing docs | ||
* :penguin: `:penguin:` when fixing something on Linux | ||
* :apple: `:apple:` when fixing something on Mac OS | ||
* :checkered_flag: `:checkered_flag:` when fixing something on Windows | ||
* :bug: `:bug:` when fixing a bug | ||
* :fire: `:fire:` when removing code or files | ||
* :green_heart: `:green_heart:` when fixing the CI build | ||
* :white_check_mark: `:white_check_mark:` when adding tests | ||
* :lock: `:lock:` when dealing with security | ||
* :arrow_up: `:arrow_up:` when upgrading dependencies | ||
* :arrow_down: `:arrow_down:` when downgrading dependencies | ||
* :shirt: `:shirt:` when removing linter warnings | ||
Based on https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages | ||
[npm-image]: https://badge.fury.io/js/conventional-changelog-atom.svg | ||
@@ -11,0 +36,0 @@ [npm-url]: https://npmjs.org/package/conventional-changelog-atom |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
8656
11
101
42
11
1