changelog-light
Advanced tools
Comparing version 1.1.1 to 1.1.2
#!/usr/bin/env node | ||
const { existsSync } = require('fs'); | ||
const { join } = require('path'); | ||
@@ -20,2 +21,3 @@ const yargs = require('yargs'); | ||
'dry-run': isDryRun, | ||
'lock-file': lockFile, | ||
'non-cc': isAllowNonConventionalCommits, | ||
@@ -98,2 +100,9 @@ override: overrideVersion, | ||
}) | ||
.option('lock-file', { | ||
default: ['./package-lock.json', './yarn.lock'], | ||
describe: | ||
'Lock file read and relative path lookup. Defaults to looking for git related updates to "package-lock.json" and "yarn.lock" during release. You can pass your own custom "lock" file if needed. To disable, pass a falsely value.', | ||
type: 'array', | ||
coerce: args => args.flat().filter(value => !/null|undefined|false|0/.test(value) && value !== '') | ||
}) | ||
.option('package', { | ||
@@ -146,2 +155,11 @@ default: './package.json', | ||
linkUrl, | ||
lockFilePath: function () { | ||
let foundLockFile; | ||
if (Array.isArray(lockFile)) { | ||
foundLockFile = lockFile.map(file => join(this.contextPath, file)).find(filePath => existsSync(filePath)); | ||
} | ||
return foundLockFile; | ||
}, | ||
overrideVersion, | ||
@@ -148,0 +166,0 @@ packageFile, |
{ | ||
"name": "changelog-light", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Generate a changelog from commits.", | ||
@@ -17,2 +17,3 @@ "author": "cdcabrera", | ||
"changelog", | ||
"cli", | ||
"commit messages", | ||
@@ -19,0 +20,0 @@ "commits", |
@@ -45,3 +45,3 @@ # Changelog Light | ||
string. Uses system new Date([your date]) | ||
[string] [default: "2024-01-29T07:40:54.615Z"] | ||
[string] [default: "2024-03-21T13:20:45.593Z"] | ||
-n, --non-cc Allow non-conventional commits to apply a semver weight | ||
@@ -69,2 +69,8 @@ and appear in [CHANGELOG.md] under a general type | ||
[string] | ||
--lock-file Lock file read and relative path lookup. Defaults to | ||
looking for git related updates to "package-lock.json" | ||
and "yarn.lock" during release. You can pass your own | ||
custom "lock" file if needed. To disable, pass a | ||
falsely value. | ||
[array] [default: ["./package-lock.json","./yarn.lock"]] | ||
--package package.json read, output and relative path | ||
@@ -71,0 +77,0 @@ [string] [default: "./package.json"] |
@@ -40,10 +40,12 @@ const { execSync } = require('child_process'); | ||
* @param {string} options.packagePath | ||
* @param {string} options.lockFilePath | ||
* @param {string[]|string} options.releaseTypeScope | ||
* @returns {string} | ||
*/ | ||
const commitFiles = (version, { changelogPath, packagePath, releaseTypeScope } = OPTIONS) => { | ||
const commitFiles = (version, { changelogPath, packagePath, lockFilePath, releaseTypeScope } = OPTIONS) => { | ||
const isArray = Array.isArray(releaseTypeScope); | ||
const updatedLockFilePath = (lockFilePath && ` ${lockFilePath}`) || ''; | ||
return runCmd( | ||
`git add ${packagePath} ${changelogPath} && git commit ${packagePath} ${changelogPath} -m "${ | ||
`git add ${packagePath} ${changelogPath}${updatedLockFilePath} && git commit ${packagePath} ${changelogPath}${updatedLockFilePath} -m "${ | ||
(isArray && releaseTypeScope?.[0]) || releaseTypeScope | ||
@@ -50,0 +52,0 @@ }: ${version}"`, |
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
42842
895
174
7