Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Changelog generator based on GitHub Pull Requests
The main features:
CHANGELOG.md
from merged GitHub pull requests since the last tag (as long as --stdout is not provided). This works by
CHANGELOG.md
existed, it will create the file else it will write prepending to itpr-log --help
Error: version-number not specified
Error: Local git main branch is 0 commits ahead and 2 commits behind of origin/main
Error: Local copy is not clean
Simply run this to install pr-log
:
npm install pr-log
You have to follow these steps to use pr-log
without problems.
The following categories are defined by default:
GitHub label | Human friendly name | Description |
---|---|---|
breaking | Breaking Changes | Backwards-incompatible changes |
bug | Bug Fixes | Changes that only fix a bug |
feature | Features | New features |
enhancement | Enhancements | Non-breaking improvements of existing features |
documentation | Documentation | Changes to documentation and/or README |
upgrade | Dependency Upgrades | Any kind of dependency updates |
refactor | Code Refactoring | Changes that don’t affect the behavior but improve the code quality |
build | Build-Related | Changes related to the build process and/or CI/CD pipeline |
However, you can also create a custom mapping by adding a pr-log.validLabels
section to your package.json
.
validLabels
must be specified as an array of key, value pairs. The same order will be used to format the changelog sections.
For example:
{
"pr-log": {
"validLabels": [
["core", "Core features"],
["addon", "Addons"]
]
}
}
To use pr-log
your GitHub project needs some small configuration:
Issues -> Labels -> New Label
)2.4.7
)As pr-log
reads repository information from your project you have to add the repository
information in your package.json
{
"repository": {
"type": "git",
"url": "https://github.com/<your username>/<your repository name>.git"
}
}
If you want to use a custom date format you can configure pr-log.dateFormat
in your package.json
. For example:
{
"pr-log": { "dateFormat": "dd.MM.yyyy" }
}
Please refer to the dates-fn
documentation for details about the format expressions.
To create or update your changelog run
pr-log [options] <version-number>
where version-number
is the name of this release
Example:
Given the following setup:
2.0.0
exists that is behind main
breaking
documentation
pr-log 2.0.0
creates a changelog with the following example content:
## 2.0.0 (January 20, 2015)
### Breaking Changes
- Use new (backwards incompatible) version of module XYZ (#13)
### Documentation
- Fix some spelling mistakes in documentation. (#22)
The --sloppy
option defaults to false. When set, it allows pr-log
to generate a changelog even when you are not on the default branch. This should not be used in production!
When enabled this option outputs the stacktrace of an error additionally to the error message to stderr
.
This option disables writing the changelog into the file CHANGELOG.md
. Instead it prints the changelog to stdout
.
If you want your changelog to be complete and clean you have to follow these rules:
main
- if you do, your changes will not be covered in the changelog (this might be ok but you should know this implication)breaking
(which will later result in this feature being listed under the Breaking Changes
point in your changelog)If you need to authenticate pr-log
, e.g. to access a private repo, you can set the GH_TOKEN
environment variable. Generate a token value in your Github settings.
GH_TOKEN=xxxxxxxxx pr-log [options] <version-number>
Many projects have problems with their changelogs. Most of them try one of the following ways
Other challenges for good changelogs:
CHANGELOG.md
After working for some time with the tool and having e.g. two releases, the file content could look like this:
## 2.0.0 (January 20, 2015)
### Breaking Changes
- Use new (backwards incompatible) version of module XYZ (#13)
### Features
- Add fancy feature (#2)
-
### Documentation
- Fix some spelling mistakes in documentation. (#22)
## 1.1.0 (November 3, 2014)
6.1.1 (March 6, 2024)
FAQs
Changelog generator based on GitHub Pull Requests
The npm package pr-log receives a total of 392 weekly downloads. As such, pr-log popularity was classified as not popular.
We found that pr-log demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.