Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enforce require.resolve for the default preset #465

Merged
merged 2 commits into from Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults.js
Expand Up @@ -12,7 +12,7 @@ const defaults = {
skip: {},
dryRun: false,
gitTagFallback: true,
preset: 'conventionalcommits'
preset: require.resolve('conventional-changelog-conventionalcommits')
}

/**
Expand Down
7 changes: 4 additions & 3 deletions lib/preset-loader.js
Expand Up @@ -3,10 +3,11 @@
const spec = require('conventional-changelog-config-spec')

module.exports = (args) => {
let preset = args.preset || 'conventionalcommits'
if (preset === 'conventionalcommits') {
const defaultPreset = require.resolve('conventional-changelog-conventionalcommits')
let preset = args.preset || defaultPreset
if (preset === defaultPreset) {
preset = {
name: preset
name: defaultPreset
}
Object.keys(spec.properties).forEach(key => {
if (args[key] !== undefined) preset[key] = args[key]
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -41,6 +41,7 @@
"chalk": "2.4.2",
"conventional-changelog": "3.1.15",
"conventional-changelog-config-spec": "2.1.0",
"conventional-changelog-conventionalcommits": "4.2.1",
"conventional-recommended-bump": "6.0.5",
"detect-indent": "6.0.0",
"detect-newline": "3.0.0",
Expand Down