Coder Social home page Coder Social logo

dylang / changelog Goto Github PK

View Code? Open in Web Editor NEW
239.0 4.0 59.0 737 KB

Finally see what's changed when you do npm update. Changelog generates a changelog for npm modules and github repos.

Home Page: https://npmjs.org/package/changelog

License: MIT License

JavaScript 98.74% Shell 1.26%

changelog's Introduction

changelog NPM version Build Status

Command line tool (and Node module) that generates a changelog in color output, markdown, or json for modules in npmjs.org's registry as well as any public github.com repo.

changelog

Command-line Usage

Node Modules in NPM

Modules do not need to be installed to generate changelog but they must define their repository url in their package.json.

Example using Express

$ changelog {npm module name} [release] [options]

npm module: The module name, such as express, npm, grunt, etc.

Any Public Github.com Repository

Changelog also works on any public Github repo.

$ changelog {Github.com repo} [options]

Github.com repo url: Urls can be any format, such as https://github.com/dylang/changelog or [email protected]:dylang/changelog.git or even just dylang/changelog.

Help

changelog --help

Usage:
  changelog <npm module name> [versions] [options]
  changelog <github repo url> [versions] [options]

Module name:
   $ changelog npm

Github repo:
   $ changelog github.com/isaacs/npm
   $ changelog isaacs/npm

Versions:
   latest   Default: Show only the latest versions. ex: $ changelog npm latest
   all      Show all versions.                      ex: $ changelog npm all
   number   Show that many recent versions.         ex: $ changelog npm 3
   n.n.n    Show changes for a specific version.    ex: $ changelog npm 1.3.11

Options:
  -c, --color            Output as Color (terminal default)
  -m, --markdown         Output as Github-flavored Markdown (file default)
  -j, --json             Output as JSON
  -d, --debug            Enable debugging
  -h, --help             Display help and usage details

More Examples

Changelog API

Changelog can be easily integrated into other tools.

`changelog.generate(name, versions)

  • name string, required NPM module name from registry.
  • versions integer or semver, optional Number of versions, or the semver version to show.
var changelog = require('changelog');

changelog.generate(NpmPackageName, countOrVersions)
    .then(changelog.markdown);
var changelog = require('changelog');

changelog.generate('grunt')
    .then(showChanges);

function showChanges(data) {

    //With npm each "version" corresponds to all changes for that build pushed on npm
    //With github each "version" is one GMT day of changes
    data.versions.forEach(function(version) {
        console.log(version.version); //currently npm projects only
        console.log(version.date);    //JS Date

        //version.changes is an array of commit messages for that version
        version.changes.forEach(function(change) {
            console.log(' * ' + change);
        });
    });

    //Information about the project
    console.log(data.project);
}

How it works

  • Changelog uses npmjs.org API to get the list of versions and the publish dates.
  • It cross-references the versions in npm with the commit history from the Github's API.

Inspiration

Dylan Greene built this because he was always curious what was changed when doing npm update. This module's name is inspired by listening to TheChangelog Podcast on the way to work.

About the Author

Hello fellow developer! My name is Dylan Greene. When not overwhelmed with my two kids I enjoy contributing to the open source community. I'm a tech lead at Opower. I lead a team using Grunt and Angular to build software that successfully helps people like us use less power. Not too long ago I co-created Doodle or Die, a hilarious web game with millions of doodles that won us Node Knockout for the "most fun" category. I'm dylang on Twitter and other places.

Some of my other Node projects:

Name Description Github Stars Npm Installs
grunt-notify Automatic desktop notifications for Grunt errors and warnings using Growl for OS X or Windows, Mountain Lion and Mavericks Notification Center, and Notify-Send. 798 36,294
grunt-prompt Interactive prompt for your Grunt config using console checkboxes, text input with filtering, password fields. 244 5,804
shortid Amazingly short non-sequential url-friendly unique id generator. 262 8,357
rss RSS feed generator. A really simple API to add RSS feeds to any project. 243 15,147
npm-check Check for outdated, incorrect, and unused dependencies. New! 1,164
xml Fast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples. 56 21,139
logging Super sexy color console logging with cluster support. 24 541
grunt-attention Display attention-grabbing messages in the terminal New! 6,253
observatory Beautiful UI for showing tasks running on the command line. 31 3,516
flowdock-refined Flowdock desktop app custom UI New! 59
anthology Module information and stats for any @npmjs user New! 216
grunt-cat Echo a file to the terminal. Works with text, figlets, ascii art, and full-color ansi. New! 102

This list was generated using anthology.

License

Copyright (c) 2014 undefined, contributors.

Released under the MIT license.

Screenshots are CC BY-SA (Attribution-ShareAlike).


Generated using grunt-readme with grunt-templates-dylang on Monday, October 6, 2014. Bitdeli Badge Google Analytics

changelog's People

Contributors

benlangfeld avatar dylang avatar fgnass avatar gerhobbelt avatar rarkins avatar renovate-bot avatar renovate[bot] avatar rimunroe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

changelog's Issues

Feature Suggestion: Add link to repo

sometimes the command line output isn't the best way to look at the changelog. I find myself wanting to have a quick glance at the repo (or the changelog file in the repo) often enough that I'd want a quick link to the repo from the command line output.

`npm test`: unit tests fail for github&npm

These fail:


  github
    1) should have something come back for changelog
    2) should have something come back for commit messages

  npm
    3) should have something come back for pageHistory

Check commit retrieval logic

Suspicious example:
image

In the above you can see that each release's "chore" of updating package.json is actually being accredited to the subsequent release, which is not ideal and is perhaps just plain wrong.

Dependency deprecation warning: time-grunt (npm)

On registry https://registry.npmjs.org/, the "latest" version (v2.0.0) of dependency time-grunt has the following deprecation notice:

Deprecated because Grunt is practically unmaintained. Move on to something better. This package will continue to work with Grunt v1, but it will not receive any updates.

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about time-grunt's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

RestRequest using github

I am getting this error on request to github.
"Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes."

var client = new RestClient
{
BaseUrl = "https://api.github.com",
Authenticator = new HttpBasicAuthenticator(_username, _password)
};
_restRequest = new RestRequest(Method.POST)
{
Resource = _resource,
RequestFormat = DataFormat.Json
};
_restRequest.AddBody(new { title = form["feedbackmessage"], body = html, labels = new List { _defaultlabel } });
_restRequest.AddHeader("User-Agent", "http://developer.github.com/v3/#" + _username);
var response = client.Execute(_restRequest);

changelog doesn't read repo URL from package.json

I have this in package.json:

  "repository": {
    "type": "git",
    "url": "git+https://github.com/abc/xyz.git"
  },

And yet when I run changelog in the project dir, I get:

changelog The module's owner did not specify the repository url in the package.json for proj. You should let the author know.

If I type out the full URL, it works fine:

$ changelog https://github.com/abc/xyz

Archive/deprecation

I am no longer using his repository as part of @renovatebot and I think @dylang himself is also not in active use either. Unless someone else wants to take over, it might be best to deprecate the npm package and archive this repository.

"Changelog not found" bug for some versions of @material-ui/core

$ changelog @material-ui/core
3.6.2 / 2018-12-09
  * [CHANGELOG] Prepare v3.6.2
  * [core] Upgrade the dev dependencies
    (https://github.com/mui-org/material-ui/issues/13858)
  * [ToggleButton] Change ToggleButtonGroup non-exclusive default
    value to an empty array
    (https://github.com/mui-org/material-ui/issues/13857)
...

$ changelog @material-ui/core 3.6.0
3.6.0 / 2018-11-26
  * [CHANGELOG] Prepare v3.6.0
  * [docs] Notification Cyber Monday
  * [docs] Fix typo in URL
    (https://github.com/mui-org/material-ui/issues/13688)
...
$ changelog @material-ui/core v3.0.0
3.0.0 / 2018-08-27
  * Changelog not found.

But it's right here: https://github.com/mui-org/material-ui/releases/tag/v3.0.0

Surprised the "How it works" section of the README doesn't talk about where it actually looks for changelog information (Github releases? CHANGELOG.md? material-ui has both and they are very thorough and consistent)

Support for private repos?

Great project. I would love to use this for tracking private repos at our startup.

Just to confirm - currently private repos are not supported? AFAICT they are not as the code seems to perform an authless, no-token fetch.

Change Commit url

Hi,

Is it possible to change the commit URL generated by the plugin ?
In fact, into a Stash Repository the commit url is : repos/myrepo/commits/XXXXXX
The plugin generate an url like repos/myrepo/commit/XXXXXX

Thanks.

Support GitLab repos

Example:

debug: Creating branch renovate/semantic-release-gitlab-3.x
debug: package.json exists - updating it
debug: yarn.lock exists - updating it
debug: semverString: >2.5.2 <=3.0.0
verbose: getChangelog error: Unknown Github Repo: git+https://gitlab.com/hyper-expanse/semantic-release-gitlab.git. Not Found
verbose: No changelog for semantic-release-gitlab

Dependency deprecation warning: has-color (npm)

On registry https://registry.npmjs.org/, the "latest" version (v0.2.0) of dependency has-color has the following deprecation notice:

Renamed to supports-color``

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about has-color's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Unknown Github repo error

changelog Unknown Github Repo: git://github.com/ljharb/node-json-file.git.
"Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required).
Check https://developer.github.com for other possible causes."

[feature request] save and auto-load head commit hash for incremental updating of CHANGELOG

Use case + process:

  • you create CHANGELOG via changelog all + hand-editing at time/date T1.
    • changelog has saved to top commit hash in .changelog.json or some such 'hidden' file.
  • some time later (time T2) you rerun changelog to UPDATE/APPEND the CHANGELOG.
    • changelog loads the hash from .changelog.json and uses that as the start of the commit range to request commit log info about and generate changelog entries for, which are appended at the top of the CHANGELOG.

Result:

With the above process you can update the CHANGELOG without worrying about missing entries and/or having to wade through duplicates, also when you do this several times when a new release is not yet scheduled, i.e. during development for the next release.

It also saves you the hassle (and very much potential for human error) of coming up with a manually specified commit range to load in changelog: this way you will be sure that changelog will have processed all your commits to date, over time, while your CHANGELOG slowly grows and stays up to date, also between releases.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency has-color to v0.2.0
  • chore(deps): update dependency chai to v5
  • chore(deps): update dependency mocha to v10
  • chore(deps): update dependency np to v10
  • chore(deps): update dependency time-grunt to v2
  • fix(deps): update dependency chalk to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • chalk 2.3.1
  • cli 1.0.1
  • github-url-from-git ^1.5.0
  • has-color 0.1.7
  • lodash 4.17.5
  • moment 2.20.1
  • q 1.5.1
  • request 2.83.0
  • semver 5.5.0
  • wordwrap 1.0.0
  • chai 3.5.0
  • grunt 1.0.2
  • grunt-contrib-jshint 1.1.0
  • grunt-contrib-watch 1.0.0
  • grunt-mocha-test 0.13.3
  • grunt-notify 0.4.5
  • grunt-readme 0.4.5
  • grunt-templates-dylang 1.0.12
  • load-grunt-tasks 3.5.2
  • mocha 5.0.1
  • np 2.19.0
  • proxyquire 1.8.0
  • time-grunt 1.4.0
  • node >= 0.10.0
travis
.travis.yml
  • node 4
  • node 6

  • Check this box to trigger a request for Renovate to run again on this repository

Support for specific releases

it would be cool to maybe have something like:

$ changelog express 2.4.4

or

$ changelog express latest

something like that or

$ changelog express 3

to show the 3 most recent releases

support for scoped npm packages

Somewhat related to issue #1.

It would be awesome if this worked for scoped (private) npm packages.

Currently if I run the program using my scoped package it recognizes it as a github repository:
changelog Unknown Github Repo: @my_username/my_package. Not Found

TypeError when accessing express' changelog

Here's the error I got:

 ~  changelog express

TypeError: Invalid Version: 1.0.0beta
    at new SemVer (/usr/local/lib/node_modules/changelog/node_modules/semver/semver.js:273:11)
    at compare (/usr/local/lib/node_modules/changelog/node_modules/semver/semver.js:460:10)
    at Function.gt (/usr/local/lib/node_modules/changelog/node_modules/semver/semver.js:489:10)
    at sortVersions (/usr/local/lib/node_modules/changelog/lib/datasrc/npm.js:11:16)
    at Array.sort (native)
    at Request._callback (/usr/local/lib/node_modules/changelog/lib/datasrc/npm.js:85:14)
    at Request.self.callback (/usr/local/lib/node_modules/changelog/node_modules/request/request.js:237:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/changelog/node_modules/request/request.js:1146:14)
    at Request.emit (events.js:117:20)

grunt-readme is deprecated and causes grunt to fail.

Not updated since 2013.

readme says to migrate to Verb but my previous encounters with Verb have left a very nasty taste, so I'm not going there. Hence issue instead of pullreq: this one's left as an exercise for the reader. ๐Ÿ˜‰

add `--after` option

please add --after <version> option. in order to show all change log from some version to current version

for example:

$ changelog redux-saga --after 0.10.2
0.10.4 / 2016-05-12
  * 0.10.4
  * Merge branch 'master' of github.com:yelouafi/redux-saga
  * ...
0.10.3 / 2016-05-12
  * 0.10.3
  * upgraded to 0.10
  * remove isDev util
  * ...
$

Not work for scoped packages

Test case:
changelog @types/react-native
Results:

/usr/local/lib/node_modules/changelog/node_modules/q/q.js:155
                throw e;
                ^

TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
    at Url.parse (url.js:106:11)
    at Object.urlParse [as parse] (url.js:100:13)
    at commitMessages (/usr/local/lib/node_modules/changelog/lib/datasrc/github.js:19:23)
    at _fulfilled (/usr/local/lib/node_modules/changelog/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/changelog/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/changelog/node_modules/q/q.js:796:13)
    at /usr/local/lib/node_modules/changelog/node_modules/q/q.js:604:44
    at runSingle (/usr/local/lib/node_modules/changelog/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/changelog/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:150:11)

Expected results: show changelog

Environment:

  • macOS 10.12.6
  • node 9.3.0
  • changelog 1.4.1

Changelog integration with `npm outdated` of local package.json file

At the moment I'm doing npm outdated, then manually checking each item with changelog, which can also be a pain because I don't know how many version steps there are between my current and the newest version of a package. So it's just randomly choosing a number to put after changelog package-name

I think that if you're in a directory with a package.json file, when you run changelog by itself, it should be able to tell you all the version changes for every out of date package.

I can always have a look into implementing something like this myself into a PR when I get the time, but just wondering if it's a viable idea.

Thanks!

Is This Project Dead?

Hi all,

There are 22 outstanding PRs, some of which resolve security vulnerabilities caused by Changelog's outdated dependencies. None of those have been committed. Some of them have been outstanding for years.

I totally understand the time commitment involved in open-source software; I'm not judging. It's just that if nobody is at the helm on Changelog, I'll need to explore alternatives for my app. I can't keep shipping "high" security vulnerabilities.

lodash - moderate severity vulnerability

npm audit report

  Moderate        Prototype Pollution                                           
                                                                                
  Package         lodash                                                        
                                                                                
  Patched in      >=4.17.11                                                     
                                                                                
  Dependency of   changelog [dev]                                               
                                                                                
  Path            changelog > lodash                                            
                                                                                
  More info       https://nodesecurity.io/advisories/782 

image

Please merge the pull request #77 to resolve the moderate severity vulnerability.

Thank-you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.