@commitlint/prompt
Advanced tools
Comparing version 8.3.5 to 9.0.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [9.0.0](https://github.com/conventional-changelog/commitlint/compare/v8.3.5...v9.0.0) (2020-05-21) | ||
### Bug Fixes | ||
* [#840](https://github.com/conventional-changelog/commitlint/issues/840) add caret to lodash versions ([#843](https://github.com/conventional-changelog/commitlint/issues/843)) ([ffc0bac](https://github.com/conventional-changelog/commitlint/commit/ffc0bac26993acb2ab6a8fa51065f93c92b0d644)) | ||
* incorrect use of when in getForcedCaseFn ([#993](https://github.com/conventional-changelog/commitlint/issues/993)) ([34c11b8](https://github.com/conventional-changelog/commitlint/commit/34c11b8f3f233eca51866274a10d35231e8eb3d4)) | ||
## [8.3.5](https://github.com/conventional-changelog/commitlint/compare/v8.3.4...v8.3.5) (2020-01-15) | ||
@@ -8,0 +20,0 @@ |
@@ -1,18 +0,14 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.prompter = undefined; | ||
exports.prompter = void 0; | ||
var _vorpal = require('vorpal'); | ||
var _vorpal = _interopRequireDefault(require("vorpal")); | ||
var _vorpal2 = _interopRequireDefault(_vorpal); | ||
var _input = _interopRequireDefault(require("./input")); | ||
var _input = require('./input'); | ||
var _input2 = _interopRequireDefault(_input); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -24,9 +20,7 @@ * Entry point for commitizen | ||
*/ | ||
/* eslint-disable import/no-unassigned-import, import/prefer-default-export */ | ||
const prompter = exports.prompter = (_, commit) => new Promise(function ($return, $error) { | ||
var message; | ||
return Promise.resolve((0, _input2.default)(_vorpal2.default)).then(function ($await_1) { | ||
const prompter = (_, commit) => new Promise(function ($return, $error) { | ||
let message; | ||
return Promise.resolve((0, _input.default)(_vorpal.default)).then(function ($await_1) { | ||
try { | ||
message = $await_1; | ||
commit(message); | ||
@@ -37,4 +31,6 @@ return $return(); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
}, $error); | ||
}); | ||
exports.prompter = prompter; | ||
//# sourceMappingURL=index.js.map |
182
lib/input.js
@@ -1,40 +0,25 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _load = _interopRequireDefault(require("@commitlint/load")); | ||
var _load = require('@commitlint/load'); | ||
var _throat = _interopRequireDefault(require("throat")); | ||
var _load2 = _interopRequireDefault(_load); | ||
var _format = _interopRequireDefault(require("./library/format")); | ||
var _throat = require('throat'); | ||
var _getHasName = _interopRequireDefault(require("./library/get-has-name")); | ||
var _throat2 = _interopRequireDefault(_throat); | ||
var _getPrompt = _interopRequireDefault(require("./library/get-prompt")); | ||
var _format = require('./library/format'); | ||
var _settings = _interopRequireDefault(require("./settings")); | ||
var _format2 = _interopRequireDefault(_format); | ||
var _getHasName = require('./library/get-has-name'); | ||
var _getHasName2 = _interopRequireDefault(_getHasName); | ||
var _getPrompt = require('./library/get-prompt'); | ||
var _getPrompt2 = _interopRequireDefault(_getPrompt); | ||
var _settings = require('./settings'); | ||
var _settings2 = _interopRequireDefault(_settings); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = input; | ||
/* eslint-disable valid-jsdoc */ | ||
var _default = input; | ||
/** | ||
@@ -47,70 +32,67 @@ * Get user input by interactive prompt based on | ||
exports.default = _default; | ||
function input(prompter) { | ||
return new Promise(function ($return, $error) { | ||
var results, _ref, rules; | ||
return new Promise(function ($return, $error) { | ||
let results, _ref, rules; | ||
results = { | ||
type: null, | ||
scope: null, | ||
subject: null, | ||
body: null, | ||
footer: null | ||
}; | ||
return Promise.resolve((0, _load2.default)()).then(function ($await_1) { | ||
try { | ||
_ref = $await_1; | ||
rules = _ref.rules; | ||
return Promise.resolve(Promise.all(['type', 'scope', 'subject', 'body', 'footer'].map((0, _throat2.default)(1, input => new Promise(function ($return, $error) { | ||
var inputRules, inputSettings, isHeader, headerLengthRule, _headerLengthRule, _headerLengthRule$, severity, applicable, length; | ||
results = { | ||
type: null, | ||
scope: null, | ||
subject: null, | ||
body: null, | ||
footer: null | ||
}; | ||
return Promise.resolve((0, _load.default)()).then(function ($await_1) { | ||
try { | ||
_ref = $await_1, rules = _ref.rules; | ||
return Promise.resolve(Promise.all(['type', 'scope', 'subject', 'body', 'footer'].map((0, _throat.default)(1, input => new Promise(function ($return, $error) { | ||
let inputRules, inputSettings, isHeader, headerLengthRule; | ||
inputRules = getRules(input, rules); | ||
inputSettings = _settings.default[input]; | ||
isHeader = ['type', 'scope', 'subject'].indexOf(input) > -1; | ||
headerLengthRule = getRules('header', rules).filter((0, _getHasName.default)('max-length'))[0]; | ||
inputRules = getRules(input, rules); | ||
inputSettings = _settings2.default[input]; | ||
isHeader = ['type', 'scope', 'subject'].indexOf(input) > -1; | ||
headerLengthRule = getRules('header', rules).filter((0, _getHasName2.default)('max-length'))[0]; | ||
if (isHeader && headerLengthRule) { | ||
let _headerLengthRule, _headerLengthRule$, severity, applicable, length; | ||
_headerLengthRule = (0, _slicedToArray2.default)(headerLengthRule, 2), _headerLengthRule$ = (0, _slicedToArray2.default)(_headerLengthRule[1], 3), severity = _headerLengthRule$[0], applicable = _headerLengthRule$[1], length = _headerLengthRule$[2]; | ||
if (isHeader && headerLengthRule) { | ||
_headerLengthRule = (0, _slicedToArray3.default)(headerLengthRule, 2), _headerLengthRule$ = (0, _slicedToArray3.default)(_headerLengthRule[1], 3); | ||
severity = _headerLengthRule$[0], applicable = _headerLengthRule$[1], length = _headerLengthRule$[2]; | ||
if (severity > 0 && applicable === 'always') { | ||
inputSettings.header = { | ||
length | ||
}; | ||
} | ||
} | ||
if (severity > 0 && applicable === 'always') { | ||
inputSettings.header = { | ||
length | ||
}; | ||
} | ||
} | ||
return Promise.resolve((0, _getPrompt2.default)(input, { | ||
// eslint-disable-line no-await-in-loop | ||
rules: inputRules, | ||
settings: inputSettings, | ||
results, | ||
prompter | ||
})).then(function ($await_2) { | ||
try { | ||
results[input] = $await_2; | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this))))).catch(err => { | ||
console.error(err); | ||
return ''; | ||
})).then(function ($await_3) { | ||
try { | ||
// Return the results | ||
return $return((0, _format2.default)(results)); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
return Promise.resolve((0, _getPrompt.default)(input, { | ||
rules: inputRules, | ||
settings: inputSettings, | ||
results, | ||
prompter | ||
})).then(function ($await_2) { | ||
try { | ||
results[input] = $await_2; | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}, $error); | ||
})))).catch(err => { | ||
console.error(err); | ||
return ''; | ||
})).then(function ($await_3) { | ||
try { | ||
// Return the results | ||
return $return((0, _format.default)(results)); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}, $error); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}, $error); | ||
}); | ||
} | ||
/** | ||
@@ -121,12 +103,12 @@ * Get prefix for a given rule id | ||
*/ | ||
function getRulePrefix(id) { | ||
const fragments = id.split('-'); | ||
const fragments = id.split('-'); | ||
var _fragments = (0, _slicedToArray3.default)(fragments, 1); | ||
const _fragments = (0, _slicedToArray2.default)(fragments, 1), | ||
prefix = _fragments[0]; | ||
const prefix = _fragments[0]; | ||
return fragments.length > 1 ? prefix : null; | ||
return fragments.length > 1 ? prefix : null; | ||
} | ||
/** | ||
@@ -137,6 +119,7 @@ * Get a predecate matching rule definitions with a given prefix | ||
*/ | ||
function getHasPrefix(name) { | ||
return rule => getRulePrefix(rule[0]) === name; | ||
return rule => getRulePrefix(rule[0]) === name; | ||
} | ||
/** | ||
@@ -148,6 +131,7 @@ * Get rules for a given prefix | ||
*/ | ||
function getRules(prefix, rules) { | ||
return Object.entries(rules).filter(getHasPrefix(prefix)); | ||
return Object.entries(rules).filter(getHasPrefix(prefix)); | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=input.js.map |
@@ -1,23 +0,16 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
exports.default = enumRuleIsActive; | ||
var _ruleIsApplicable = require('./rule-is-applicable'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _ruleIsApplicable2 = _interopRequireDefault(_ruleIsApplicable); | ||
var _ruleIsApplicable = _interopRequireDefault(require("./rule-is-applicable")); | ||
var _ruleIsActive = require('./rule-is-active'); | ||
var _ruleIsActive = _interopRequireDefault(require("./rule-is-active")); | ||
var _ruleIsActive2 = _interopRequireDefault(_ruleIsActive); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -29,10 +22,8 @@ * [enumRuleIsActive description] | ||
function enumRuleIsActive(rule) { | ||
var _rule = (0, _slicedToArray3.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray3.default)(_rule[1], 3); | ||
const _rule = (0, _slicedToArray2.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray2.default)(_rule[1], 3), | ||
value = _rule$[2]; | ||
const value = _rule$[2]; | ||
return (0, _ruleIsActive2.default)(rule) && (0, _ruleIsApplicable2.default)(rule) && value.length > 0; | ||
return (0, _ruleIsActive.default)(rule) && (0, _ruleIsApplicable.default)(rule) && value.length > 0; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=enum-rule-is-active.js.map |
@@ -1,21 +0,15 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _chalk = _interopRequireDefault(require("chalk")); | ||
var _chalk = require('chalk'); | ||
var _chalk2 = _interopRequireDefault(_chalk); | ||
var _lodash = require('lodash'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = format; | ||
var _default = format; | ||
/** | ||
@@ -28,23 +22,21 @@ * Get formatted commit message | ||
exports.default = _default; | ||
function format(input, debug = false) { | ||
const results = debug ? (0, _lodash.toPairs)(input).reduce((registry, item) => { | ||
var _item = (0, _slicedToArray3.default)(item, 2); | ||
const results = debug ? Object.entries(input || {}).reduce((registry, item) => { | ||
const _item = (0, _slicedToArray2.default)(item, 2), | ||
name = _item[0], | ||
value = _item[1]; | ||
const name = _item[0], | ||
value = _item[1]; | ||
registry[name] = value === null ? _chalk.default.grey(`<${name}>`) : _chalk.default.bold(value); | ||
return registry; | ||
}, {}) : input; // Return formatted string | ||
registry[name] = value === null ? _chalk2.default.grey(`<${name}>`) : _chalk2.default.bold(value); | ||
return registry; | ||
}, {}) : input; | ||
// Return formatted string | ||
const type = results.type, | ||
scope = results.scope, | ||
subject = results.subject, | ||
body = results.body, | ||
footer = results.footer; | ||
return [`${type}${scope ? '(' : ''}${scope}${scope ? ')' : ''}${type || scope ? ':' : ''} ${subject}`, body, footer].filter(Boolean).join('\n'); | ||
const type = results.type, | ||
scope = results.scope, | ||
subject = results.subject, | ||
body = results.body, | ||
footer = results.footer; | ||
return [`${type}${scope ? '(' : ''}${scope}${scope ? ')' : ''}${type || scope ? ':' : ''} ${subject}`, body, footer].filter(Boolean).join('\n'); | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=format.js.map |
@@ -1,21 +0,22 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = getForcedCaseFn; | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _camelCase = _interopRequireDefault(require("lodash/camelCase")); | ||
exports.default = getForcedCaseFn; | ||
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase")); | ||
var _lodash = require('lodash'); | ||
var _snakeCase = _interopRequireDefault(require("lodash/snakeCase")); | ||
var _ = _interopRequireWildcard(_lodash); | ||
var _upperFirst = _interopRequireDefault(require("lodash/upperFirst")); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
var _startCase = _interopRequireDefault(require("lodash/startCase")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -27,71 +28,70 @@ * Get forced case for rule | ||
function getForcedCaseFn(rule) { | ||
const noop = input => input; | ||
const noop = input => input; | ||
if (!rule) { | ||
return noop; | ||
} | ||
if (!rule) { | ||
return noop; | ||
} | ||
var _rule = (0, _slicedToArray3.default)(rule, 1); | ||
const _rule = (0, _slicedToArray2.default)(rule, 1), | ||
config = _rule[0]; | ||
const config = _rule[0]; | ||
if (!Array.isArray(config)) { | ||
return noop; | ||
} | ||
const _config = (0, _slicedToArray2.default)(config, 1), | ||
level = _config[0]; | ||
if (!Array.isArray(config)) { | ||
return noop; | ||
} | ||
if (level === 0) { | ||
return; | ||
} | ||
var _config = (0, _slicedToArray3.default)(config, 1); | ||
const _config2 = (0, _slicedToArray2.default)(config, 2), | ||
when = _config2[1]; | ||
const level = _config[0]; | ||
if (when === 'never') { | ||
return; | ||
} | ||
const _config3 = (0, _slicedToArray2.default)(config, 3), | ||
target = _config3[2]; | ||
if (level === 0) { | ||
return; | ||
} | ||
if (Array.isArray(target)) { | ||
return noop; | ||
} | ||
var _config2 = (0, _slicedToArray3.default)(config, 2); | ||
switch (target) { | ||
case 'camel-case': | ||
return input => (0, _camelCase.default)(input); | ||
const when = _config2[1]; | ||
case 'kebab-case': | ||
return input => (0, _kebabCase.default)(input); | ||
case 'snake-case': | ||
return input => (0, _snakeCase.default)(input); | ||
if (when === 'neve') { | ||
return; | ||
} | ||
case 'pascal-case': | ||
return input => (0, _upperFirst.default)((0, _camelCase.default)(input)); | ||
var _config3 = (0, _slicedToArray3.default)(config, 3); | ||
case 'start-case': | ||
return input => (0, _startCase.default)(input); | ||
const target = _config3[2]; | ||
case 'upper-case': | ||
case 'uppercase': | ||
return input => input.toUpperCase(); | ||
case 'sentence-case': | ||
case 'sentencecase': | ||
return input => `${input.charAt(0).toUpperCase()}${input.substring(1).toLowerCase()}`; | ||
if (Array.isArray(target)) { | ||
return noop; | ||
} | ||
case 'lower-case': | ||
case 'lowercase': | ||
case 'lowerCase': | ||
// Backwards compat config-angular v4 | ||
return input => input.toLowerCase() === input; | ||
switch (target) { | ||
case 'camel-case': | ||
return input => _.camelCase(input); | ||
case 'kebab-case': | ||
return input => _.kebabCase(input); | ||
case 'snake-case': | ||
return input => _.snakeCase(input); | ||
case 'pascal-case': | ||
return input => _.upperFirst(_.camelCase(input)); | ||
case 'start-case': | ||
return input => _.startCase(input); | ||
case 'upper-case': | ||
case 'uppercase': | ||
return input => input.toUpperCase(); | ||
case 'sentence-case': | ||
case 'sentencecase': | ||
return input => `${input.charAt(0).toUpperCase()}${input.substring(1).toLowerCase()}`; | ||
case 'lower-case': | ||
case 'lowercase': | ||
case 'lowerCase': | ||
// Backwards compat config-angular v4 | ||
return input => input.toLowerCase() === input; | ||
default: | ||
throw new TypeError(`Unknown target case "${rule[2]}"`); | ||
} | ||
default: | ||
throw new TypeError(`Unknown target case "${rule[2]}"`); | ||
} | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=get-forced-case-fn.js.map |
@@ -1,14 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
exports.default = getForcedLeadingFn; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -21,25 +18,26 @@ /** | ||
function getForcedLeadingFn(rule) { | ||
const noop = input => input; | ||
const remove = input => { | ||
const fragments = input.split('\n'); | ||
return fragments[0] === '' ? fragments.slice(1).join('\n') : input; | ||
}; | ||
const lead = input => { | ||
const fragments = input.split('\n'); | ||
return fragments[0] === '' ? input : ['', ...fragments].join('\n'); | ||
}; | ||
const noop = input => input; | ||
if (!rule) { | ||
return noop; | ||
} | ||
const remove = input => { | ||
const fragments = input.split('\n'); | ||
return fragments[0] === '' ? fragments.slice(1).join('\n') : input; | ||
}; | ||
const leading = getForcedLeading(rule); | ||
const lead = input => { | ||
const fragments = input.split('\n'); | ||
return fragments[0] === '' ? input : ['', ...fragments].join('\n'); | ||
}; | ||
if (leading === null) { | ||
return noop; | ||
} | ||
if (!rule) { | ||
return noop; | ||
} | ||
return leading ? lead : remove; | ||
const leading = getForcedLeading(rule); | ||
if (leading === null) { | ||
return noop; | ||
} | ||
return leading ? lead : remove; | ||
} | ||
/** | ||
@@ -50,22 +48,22 @@ * Get forced leading for rule | ||
*/ | ||
function getForcedLeading(rule) { | ||
if (!rule) { | ||
return null; | ||
} | ||
if (!rule) { | ||
return null; | ||
} | ||
var _rule = (0, _slicedToArray3.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray3.default)(_rule[1], 2); | ||
const _rule = (0, _slicedToArray2.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray2.default)(_rule[1], 2), | ||
severity = _rule$[0], | ||
applicable = _rule$[1]; | ||
const severity = _rule$[0], | ||
applicable = _rule$[1]; | ||
const negated = applicable === 'never'; | ||
const negated = applicable === 'never'; | ||
if (severity === 0) { | ||
return null; | ||
} | ||
if (severity === 0) { | ||
return null; | ||
} | ||
return !negated; | ||
return !negated; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=get-forced-leading-fn.js.map |
@@ -1,3 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,8 +10,4 @@ value: true | ||
var _getRuleName = require('./get-rule-name'); | ||
var _getRuleName = _interopRequireDefault(require("./get-rule-name")); | ||
var _getRuleName2 = _interopRequireDefault(_getRuleName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -21,5 +19,4 @@ * Get a predecate matching rule definitions with a given name | ||
function getHasName(name) { | ||
return rule => (0, _getRuleName2.default)(rule[0]) === name; | ||
return rule => (0, _getRuleName.default)(rule[0]) === name; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=get-has-name.js.map |
@@ -1,43 +0,27 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _chalk = _interopRequireDefault(require("chalk")); | ||
var _chalk = require('chalk'); | ||
var _enumRuleIsActive = _interopRequireDefault(require("./enum-rule-is-active")); | ||
var _chalk2 = _interopRequireDefault(_chalk); | ||
var _format = _interopRequireDefault(require("./format")); | ||
var _enumRuleIsActive = require('./enum-rule-is-active'); | ||
var _getForcedCaseFn = _interopRequireDefault(require("./get-forced-case-fn")); | ||
var _enumRuleIsActive2 = _interopRequireDefault(_enumRuleIsActive); | ||
var _getForcedLeadingFn = _interopRequireDefault(require("./get-forced-leading-fn")); | ||
var _format = require('./format'); | ||
var _getHasName = _interopRequireDefault(require("./get-has-name")); | ||
var _format2 = _interopRequireDefault(_format); | ||
var _meta = _interopRequireDefault(require("./meta")); | ||
var _getForcedCaseFn = require('./get-forced-case-fn'); | ||
var _getForcedCaseFn2 = _interopRequireDefault(_getForcedCaseFn); | ||
var _getForcedLeadingFn = require('./get-forced-leading-fn'); | ||
var _getForcedLeadingFn2 = _interopRequireDefault(_getForcedLeadingFn); | ||
var _getHasName = require('./get-has-name'); | ||
var _getHasName2 = _interopRequireDefault(_getHasName); | ||
var _meta = require('./meta'); | ||
var _meta2 = _interopRequireDefault(_meta); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = getPrompt; | ||
var _default = getPrompt; | ||
/** | ||
@@ -50,200 +34,178 @@ * Get a cli prompt based on rule configuration | ||
exports.default = _default; | ||
function getPrompt(type, context = {}) { | ||
var _context$rules = context.rules; | ||
const rules = _context$rules === undefined ? [] : _context$rules; | ||
var _context$settings = context.settings; | ||
const settings = _context$settings === undefined ? {} : _context$settings; | ||
var _context$results = context.results; | ||
const results = _context$results === undefined ? {} : _context$results, | ||
prompter = context.prompter; | ||
const _context$rules = context.rules, | ||
rules = _context$rules === void 0 ? [] : _context$rules, | ||
_context$settings = context.settings, | ||
settings = _context$settings === void 0 ? {} : _context$settings, | ||
_context$results = context.results, | ||
results = _context$results === void 0 ? {} : _context$results, | ||
prompter = context.prompter; | ||
if (typeof prompter !== 'function') { | ||
throw new TypeError('Missing prompter function in getPrompt context'); | ||
} | ||
if (typeof prompter !== 'function') { | ||
throw new TypeError('Missing prompter function in getPrompt context'); | ||
} | ||
const prompt = prompter(); | ||
const prompt = prompter(); | ||
if (typeof prompt.removeAllListeners !== 'function') { | ||
throw new TypeError('getPrompt: prompt.removeAllListeners is not a function'); | ||
} | ||
if (typeof prompt.removeAllListeners !== 'function') { | ||
throw new TypeError('getPrompt: prompt.removeAllListeners is not a function'); | ||
} | ||
if (typeof prompt.command !== 'function') { | ||
throw new TypeError('getPrompt: prompt.command is not a function'); | ||
} | ||
if (typeof prompt.command !== 'function') { | ||
throw new TypeError('getPrompt: prompt.command is not a function'); | ||
} | ||
if (typeof prompt.catch !== 'function') { | ||
throw new TypeError('getPrompt: prompt.catch is not a function'); | ||
} | ||
if (typeof prompt.catch !== 'function') { | ||
throw new TypeError('getPrompt: prompt.catch is not a function'); | ||
} | ||
if (typeof prompt.addListener !== 'function') { | ||
throw new TypeError('getPrompt: prompt.addListener is not a function'); | ||
} | ||
if (typeof prompt.addListener !== 'function') { | ||
throw new TypeError('getPrompt: prompt.addListener is not a function'); | ||
} | ||
if (typeof prompt.log !== 'function') { | ||
throw new TypeError('getPrompt: prompt.log is not a function'); | ||
} | ||
if (typeof prompt.log !== 'function') { | ||
throw new TypeError('getPrompt: prompt.log is not a function'); | ||
} | ||
if (typeof prompt.delimiter !== 'function') { | ||
throw new TypeError('getPrompt: prompt.delimiter is not a function'); | ||
} | ||
if (typeof prompt.delimiter !== 'function') { | ||
throw new TypeError('getPrompt: prompt.delimiter is not a function'); | ||
} | ||
if (typeof prompt.show !== 'function') { | ||
throw new TypeError('getPrompt: prompt.show is not a function'); | ||
} | ||
if (typeof prompt.show !== 'function') { | ||
throw new TypeError('getPrompt: prompt.show is not a function'); | ||
} | ||
const enumRule = rules.filter((0, _getHasName.default)('enum')).filter(_enumRuleIsActive.default)[0]; | ||
const emptyRule = rules.filter((0, _getHasName.default)('empty'))[0]; | ||
const mustBeEmpty = emptyRule ? emptyRule[1][0] > 0 && emptyRule[1][1] === 'always' : false; | ||
const mayNotBeEmpty = emptyRule ? emptyRule[1][0] > 0 && emptyRule[1][1] === 'never' : false; | ||
const mayBeEmpty = !mayNotBeEmpty; | ||
const enumRule = rules.filter((0, _getHasName2.default)('enum')).filter(_enumRuleIsActive2.default)[0]; | ||
if (mustBeEmpty) { | ||
prompt.removeAllListeners('keypress'); | ||
prompt.removeAllListeners('client_prompt_submit'); | ||
prompt.ui.redraw.done(); | ||
return Promise.resolve(); | ||
} | ||
const emptyRule = rules.filter((0, _getHasName2.default)('empty'))[0]; | ||
const caseRule = rules.filter((0, _getHasName.default)('case'))[0]; | ||
const forceCaseFn = (0, _getForcedCaseFn.default)(caseRule); | ||
const leadingBlankRule = rules.filter((0, _getHasName.default)('leading-blank'))[0]; | ||
const forceLeadingBlankFn = (0, _getForcedLeadingFn.default)(leadingBlankRule); | ||
const maxLenghtRule = rules.filter((0, _getHasName.default)('max-length'))[0]; | ||
const hasMaxLength = maxLenghtRule && maxLenghtRule[1][0] > 0; | ||
const inputMaxLength = hasMaxLength ? maxLenghtRule[1][1] : Infinity; | ||
const headerLength = settings.header ? settings.header.length : Infinity; | ||
const remainingHeaderLength = headerLength ? headerLength - [results.type, results.scope, results.scope ? '()' : '', results.type && results.scope ? ':' : '', results.subject].join('').length : Infinity; | ||
const maxLength = Math.min(inputMaxLength, remainingHeaderLength); | ||
return new Promise(resolve => { | ||
// Add the defined enums as sub commands if applicable | ||
if (enumRule) { | ||
const _enumRule = (0, _slicedToArray2.default)(enumRule, 2), | ||
_enumRule$ = (0, _slicedToArray2.default)(_enumRule[1], 3), | ||
enums = _enumRule$[2]; | ||
const mustBeEmpty = emptyRule ? emptyRule[1][0] > 0 && emptyRule[1][1] === 'always' : false; | ||
enums.forEach(enumerable => { | ||
const enumSettings = (settings.enumerables || {})[enumerable] || {}; | ||
prompt.command(enumerable).description(enumSettings.description || '').action(() => { | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
return resolve(forceLeadingBlankFn(forceCaseFn(enumerable))); | ||
}); | ||
}); | ||
} else { | ||
prompt.catch('[text...]').action(parameters => { | ||
const _parameters$text = parameters.text, | ||
text = _parameters$text === void 0 ? '' : _parameters$text; | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
return resolve(forceLeadingBlankFn(forceCaseFn(text.join(' ')))); | ||
}); | ||
} | ||
const mayNotBeEmpty = emptyRule ? emptyRule[1][0] > 0 && emptyRule[1][1] === 'never' : false; | ||
if (mayBeEmpty) { | ||
// Add an easy exit command | ||
prompt.command(':skip').description('Skip the input if possible.').action(() => { | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
resolve(''); | ||
}); | ||
} // Handle empty input | ||
const mayBeEmpty = !mayNotBeEmpty; | ||
if (mustBeEmpty) { | ||
prompt.removeAllListeners('keypress'); | ||
prompt.removeAllListeners('client_prompt_submit'); | ||
prompt.ui.redraw.done(); | ||
return Promise.resolve(); | ||
} | ||
const onSubmit = input => { | ||
if (input.length > 0) { | ||
return; | ||
} // Show help if enum is defined and input may not be empty | ||
const caseRule = rules.filter((0, _getHasName2.default)('case'))[0]; | ||
const forceCaseFn = (0, _getForcedCaseFn2.default)(caseRule); | ||
if (mayNotBeEmpty) { | ||
prompt.ui.log(_chalk.default.yellow(`⚠ ${_chalk.default.bold(type)} may not be empty.`)); | ||
} | ||
const leadingBlankRule = rules.filter((0, _getHasName2.default)('leading-blank'))[0]; | ||
if (mayBeEmpty) { | ||
prompt.ui.log(_chalk.default.blue(`ℹ Enter ${_chalk.default.bold(':skip')} to omit ${_chalk.default.bold(type)}.`)); | ||
} | ||
const forceLeadingBlankFn = (0, _getForcedLeadingFn2.default)(leadingBlankRule); | ||
if (enumRule) { | ||
prompt.exec('help'); | ||
} | ||
}; | ||
const maxLenghtRule = rules.filter((0, _getHasName2.default)('max-length'))[0]; | ||
const drawRemaining = length => { | ||
if (length < Infinity) { | ||
const colors = [{ | ||
threshold: 5, | ||
color: 'red' | ||
}, { | ||
threshold: 10, | ||
color: 'yellow' | ||
}, { | ||
threshold: Infinity, | ||
color: 'grey' | ||
}]; | ||
const color = colors.filter(item => { | ||
return item.threshold >= length; | ||
}).map(item => item.color)[0]; | ||
prompt.ui.redraw(_chalk.default[color](`${length} characters left`)); | ||
} | ||
}; | ||
const hasMaxLength = maxLenghtRule && maxLenghtRule[1][0] > 0; | ||
const onKey = event => { | ||
const sanitized = forceCaseFn(event.value); | ||
const cropped = sanitized.slice(0, maxLength); // We **could** do live editing, but there are some quirks to solve | ||
const inputMaxLength = hasMaxLength ? maxLenghtRule[1][1] : Infinity; | ||
/* const live = merge({}, results, { | ||
[type]: cropped | ||
}); | ||
prompt.ui.redraw(`\n\n${format(live, true)}\n\n`); */ | ||
const headerLength = settings.header ? settings.header.length : Infinity; | ||
if (maxLength) { | ||
drawRemaining(maxLength - cropped.length); | ||
} | ||
const remainingHeaderLength = headerLength ? headerLength - [results.type, results.scope, results.scope ? '()' : '', results.type && results.scope ? ':' : '', results.subject].join('').length : Infinity; | ||
prompt.ui.input(cropped); | ||
}; | ||
const maxLength = Math.min(inputMaxLength, remainingHeaderLength); | ||
prompt.addListener('keypress', onKey); | ||
prompt.addListener('client_prompt_submit', onSubmit); | ||
prompt.log(`\n\nPlease enter a ${_chalk.default.bold(type)}: ${(0, _meta.default)({ | ||
optional: !mayNotBeEmpty, | ||
required: mayNotBeEmpty, | ||
'tab-completion': typeof enumRule !== 'undefined', | ||
header: typeof settings.header !== 'undefined', | ||
'multi-line': settings.multiline | ||
})}`); | ||
return new Promise(resolve => { | ||
// Add the defined enums as sub commands if applicable | ||
if (enumRule) { | ||
var _enumRule = (0, _slicedToArray3.default)(enumRule, 2), | ||
_enumRule$ = (0, _slicedToArray3.default)(_enumRule[1], 3); | ||
if (settings.description) { | ||
prompt.log(_chalk.default.grey(`${settings.description}\n`)); | ||
} | ||
const enums = _enumRule$[2]; | ||
enums.forEach(enumerable => { | ||
const enumSettings = (settings.enumerables || {})[enumerable] || {}; | ||
prompt.command(enumerable).description(enumSettings.description || '').action(() => { | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
return resolve(forceLeadingBlankFn(forceCaseFn(enumerable))); | ||
}); | ||
}); | ||
} else { | ||
prompt.catch('[text...]').action(parameters => { | ||
var _parameters$text = parameters.text; | ||
const text = _parameters$text === undefined ? '' : _parameters$text; | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
return resolve(forceLeadingBlankFn(forceCaseFn(text.join(' ')))); | ||
}); | ||
} | ||
if (mayBeEmpty) { | ||
// Add an easy exit command | ||
prompt.command(':skip').description('Skip the input if possible.').action(() => { | ||
prompt.removeAllListeners(); | ||
prompt.ui.redraw.done(); | ||
resolve(''); | ||
}); | ||
} | ||
// Handle empty input | ||
const onSubmit = input => { | ||
if (input.length > 0) { | ||
return; | ||
} | ||
// Show help if enum is defined and input may not be empty | ||
if (mayNotBeEmpty) { | ||
prompt.ui.log(_chalk2.default.yellow(`⚠ ${_chalk2.default.bold(type)} may not be empty.`)); | ||
} | ||
if (mayBeEmpty) { | ||
prompt.ui.log(_chalk2.default.blue(`ℹ Enter ${_chalk2.default.bold(':skip')} to omit ${_chalk2.default.bold(type)}.`)); | ||
} | ||
if (enumRule) { | ||
prompt.exec('help'); | ||
} | ||
}; | ||
const drawRemaining = length => { | ||
if (length < Infinity) { | ||
const colors = [{ | ||
threshold: 5, | ||
color: 'red' | ||
}, { | ||
threshold: 10, | ||
color: 'yellow' | ||
}, { | ||
threshold: Infinity, | ||
color: 'grey' | ||
}]; | ||
const color = colors.filter(item => { | ||
return item.threshold >= length; | ||
}).map(item => item.color)[0]; | ||
prompt.ui.redraw(_chalk2.default[color](`${length} characters left`)); | ||
} | ||
}; | ||
const onKey = event => { | ||
const sanitized = forceCaseFn(event.value); | ||
const cropped = sanitized.slice(0, maxLength); | ||
// We **could** do live editing, but there are some quirks to solve | ||
/* const live = merge({}, results, { | ||
[type]: cropped | ||
}); | ||
prompt.ui.redraw(`\n\n${format(live, true)}\n\n`); */ | ||
if (maxLength) { | ||
drawRemaining(maxLength - cropped.length); | ||
} | ||
prompt.ui.input(cropped); | ||
}; | ||
prompt.addListener('keypress', onKey); | ||
prompt.addListener('client_prompt_submit', onSubmit); | ||
prompt.log(`\n\nPlease enter a ${_chalk2.default.bold(type)}: ${(0, _meta2.default)({ | ||
optional: !mayNotBeEmpty, | ||
required: mayNotBeEmpty, | ||
'tab-completion': typeof enumRule !== 'undefined', | ||
header: typeof settings.header !== 'undefined', | ||
'multi-line': settings.multiline | ||
})}`); | ||
if (settings.description) { | ||
prompt.log(_chalk2.default.grey(`${settings.description}\n`)); | ||
} | ||
prompt.log(`\n\n${(0, _format2.default)(results, true)}\n\n`); | ||
drawRemaining(maxLength); | ||
prompt.delimiter(`❯ ${type}:`).show(); | ||
}); | ||
prompt.log(`\n\n${(0, _format.default)(results, true)}\n\n`); | ||
drawRemaining(maxLength); | ||
prompt.delimiter(`❯ ${type}:`).show(); | ||
}); | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=get-prompt.js.map |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,2 +7,3 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.default = getRuleName; | ||
/** | ||
@@ -17,3 +18,2 @@ * Get name for a given rule id | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=get-rule-name.js.map |
@@ -1,21 +0,14 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
exports.default = meta; | ||
var _chalk = require('chalk'); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _chalk2 = _interopRequireDefault(_chalk); | ||
var _chalk = _interopRequireDefault(require("chalk")); | ||
var _lodash = require('lodash'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -27,12 +20,10 @@ * Get formatted meta hints for configuration | ||
function meta(settings) { | ||
return _chalk2.default.grey((0, _lodash.toPairs)(settings).filter(item => item[1]).map(item => { | ||
var _item = (0, _slicedToArray3.default)(item, 2); | ||
return _chalk.default.grey(Object.entries(settings || {}).filter(item => item[1]).map(item => { | ||
const _item = (0, _slicedToArray2.default)(item, 2), | ||
name = _item[0], | ||
value = _item[1]; | ||
const name = _item[0], | ||
value = _item[1]; | ||
return typeof value === 'boolean' ? `[${name}]` : `[${name}=${value}]`; | ||
}).join(' ')); | ||
return typeof value === 'boolean' ? `[${name}]` : `[${name}=${value}]`; | ||
}).join(' ')); | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=meta.js.map |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray2 = require("babel-runtime/helpers/slicedToArray"); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
exports.default = ruleIsActive; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -21,10 +18,8 @@ /** | ||
function ruleIsActive(rule) { | ||
var _rule = (0, _slicedToArray3.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray3.default)(_rule[1], 1); | ||
const _rule = (0, _slicedToArray2.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray2.default)(_rule[1], 1), | ||
severity = _rule$[0]; | ||
const severity = _rule$[0]; | ||
return severity > 0; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=rule-is-active.js.map |
@@ -1,14 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
exports.default = ruleIsApplicable; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -21,10 +18,8 @@ /** | ||
function ruleIsApplicable(rule) { | ||
var _rule = (0, _slicedToArray3.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray3.default)(_rule[1], 2); | ||
const _rule = (0, _slicedToArray2.default)(rule, 2), | ||
_rule$ = (0, _slicedToArray2.default)(_rule[1], 2), | ||
applicable = _rule$[1]; | ||
const applicable = _rule$[1]; | ||
return applicable === 'always'; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=rule-is-applicable.js.map |
@@ -1,61 +0,62 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = { | ||
type: { | ||
description: '<type> holds information about the goal of a change.', | ||
enumerables: { | ||
feat: { | ||
description: 'Adds a new feature.' | ||
}, | ||
fix: { | ||
description: 'Solves a bug.' | ||
}, | ||
chore: { | ||
description: "Other changes that don't modify src or test files" | ||
}, | ||
docs: { | ||
description: 'Adds or alters documentation.' | ||
}, | ||
style: { | ||
description: 'Improves formatting, white-space.' | ||
}, | ||
refactor: { | ||
description: 'Rewrites code without feature, performance or bug changes.' | ||
}, | ||
perf: { | ||
description: 'Improves performance.' | ||
}, | ||
test: { | ||
description: 'Adds or modifies tests.' | ||
}, | ||
build: { | ||
description: 'Affects the build system or external dependencies.' | ||
}, | ||
ci: { | ||
description: 'Changes CI configuration files and scripts.' | ||
}, | ||
revert: { | ||
description: 'Reverts a previous commit.' | ||
} | ||
} | ||
}, | ||
scope: { | ||
description: '<scope> marks which sub-component of the project is affected' | ||
}, | ||
subject: { | ||
description: '<subject> is a short, high-level description of the change' | ||
}, | ||
body: { | ||
description: '<body> holds additional information about the change', | ||
multline: true | ||
}, | ||
footer: { | ||
description: '<footer> holds further meta data, such as breaking changes and issue ids', | ||
multiline: true | ||
} | ||
exports.default = void 0; | ||
var _default = { | ||
type: { | ||
description: '<type> holds information about the goal of a change.', | ||
enumerables: { | ||
feat: { | ||
description: 'Adds a new feature.' | ||
}, | ||
fix: { | ||
description: 'Solves a bug.' | ||
}, | ||
chore: { | ||
description: "Other changes that don't modify src or test files" | ||
}, | ||
docs: { | ||
description: 'Adds or alters documentation.' | ||
}, | ||
style: { | ||
description: 'Improves formatting, white-space.' | ||
}, | ||
refactor: { | ||
description: 'Rewrites code without feature, performance or bug changes.' | ||
}, | ||
perf: { | ||
description: 'Improves performance.' | ||
}, | ||
test: { | ||
description: 'Adds or modifies tests.' | ||
}, | ||
build: { | ||
description: 'Affects the build system or external dependencies.' | ||
}, | ||
ci: { | ||
description: 'Changes CI configuration files and scripts.' | ||
}, | ||
revert: { | ||
description: 'Reverts a previous commit.' | ||
} | ||
} | ||
}, | ||
scope: { | ||
description: '<scope> marks which sub-component of the project is affected' | ||
}, | ||
subject: { | ||
description: '<subject> is a short, high-level description of the change' | ||
}, | ||
body: { | ||
description: '<body> holds additional information about the change', | ||
multline: true | ||
}, | ||
footer: { | ||
description: '<footer> holds further meta data, such as breaking changes and issue ids', | ||
multiline: true | ||
} | ||
}; | ||
module.exports = exports.default; | ||
exports.default = _default; | ||
//# sourceMappingURL=settings.js.map |
{ | ||
"name": "@commitlint/prompt", | ||
"version": "8.3.5", | ||
"version": "9.0.0", | ||
"description": "commitizen prompt using commitlint.config.js", | ||
@@ -14,21 +14,11 @@ "main": "./lib/index.js", | ||
"pkg": "pkg-check --skip-import", | ||
"start": "concurrently \"ava --watch --verbose\" \"yarn run watch\"", | ||
"test": "ava --verbose", | ||
"start": "yarn run watch", | ||
"watch": "babel src --out-dir lib --watch --source-maps" | ||
}, | ||
"ava": { | ||
"babel": "inherit", | ||
"require": [ | ||
"babel-register" | ||
], | ||
"files": [ | ||
"src/**/*.test.js" | ||
], | ||
"sources": [ | ||
"src/**/*.js" | ||
] | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"commitlint" | ||
], | ||
"ignore": [ | ||
"**/*.test.js" | ||
] | ||
@@ -43,3 +33,3 @@ }, | ||
"type": "git", | ||
"url": "git+https://github.com/conventional-changelog/commitlint.git" | ||
"url": "https://github.com/conventional-changelog/commitlint.git" | ||
}, | ||
@@ -59,21 +49,21 @@ "keywords": [ | ||
"homepage": "https://github.com/conventional-changelog/commitlint#readme", | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/utils": "^8.3.4", | ||
"ava": "0.20.0", | ||
"babel-cli": "6.26.0", | ||
"babel-preset-commitlint": "^8.2.0", | ||
"babel-register": "6.26.0", | ||
"@babel/cli": "^7.7.7", | ||
"@babel/core": "^7.7.7", | ||
"@commitlint/utils": "^9.0.0", | ||
"babel-preset-commitlint": "^9.0.0", | ||
"commitizen": "3.1.2", | ||
"concurrently": "3.6.1", | ||
"cross-env": "6.0.3" | ||
"cross-env": "7.0.0" | ||
}, | ||
"dependencies": { | ||
"@commitlint/load": "^8.3.5", | ||
"babel-runtime": "^6.23.0", | ||
"chalk": "^2.0.0", | ||
"lodash": "4.17.15", | ||
"@commitlint/load": "^9.0.0", | ||
"chalk": "^3.0.0", | ||
"lodash": "^4.17.15", | ||
"throat": "^5.0.0", | ||
"vorpal": "^1.12.0" | ||
}, | ||
"gitHead": "b39e1ade668e1560cdebc94c4fe18a6dba5e5dda" | ||
"gitHead": "71f0194f33943954a8dac1c458be47e5049717cd" | ||
} |
@@ -17,2 +17,3 @@ > commitizen adapter using commitlint.config.js | ||
In package.json | ||
``` | ||
@@ -19,0 +20,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
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
5
6
35
132
2
2
1
18
71406
98249
30
617
1
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@commitlint/execute-rule@9.1.2(transitive)
+ Added@commitlint/load@9.1.2(transitive)
+ Added@commitlint/resolve-extends@9.1.2(transitive)
+ Added@commitlint/types@9.1.2(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.04.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcosmiconfig@6.0.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedyaml@1.10.2(transitive)
- Removedbabel-runtime@^6.23.0
- Removed@commitlint/execute-rule@8.3.6(transitive)
- Removed@commitlint/load@8.3.6(transitive)
- Removed@commitlint/resolve-extends@8.3.6(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedcaller-callsite@2.0.0(transitive)
- Removedcaller-path@2.0.0(transitive)
- Removedcallsites@2.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcosmiconfig@5.2.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedimport-fresh@2.0.0(transitive)
- Removedis-directory@0.3.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedlodash@4.17.15(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedresolve-from@3.0.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@commitlint/load@^9.0.0
Updatedchalk@^3.0.0
Updatedlodash@^4.17.15