Skip to content

feat: npm changelog#8

Merged
zkat merged 1 commit into
npm:latestfrom
jefflembeck:changelog
Aug 15, 2018
Merged

feat: npm changelog#8
zkat merged 1 commit into
npm:latestfrom
jefflembeck:changelog

Conversation

@jefflembeck

Copy link
Copy Markdown
Contributor

This is an RFC for npm changelog. This feature would allow a user to
easily see the changelog for a library.

Inspired by #7

This is an RFC for `npm changelog`. This feature would allow a user to
easily see the changelog for a library.
@jefflembeck jefflembeck requested a review from a team May 17, 2018 23:08
@zkat zkat mentioned this pull request May 18, 2018
@sindresorhus

Copy link
Copy Markdown

This also needs to support GitHub Releases. Many packages use that instead of a changelog file.

@sindresorhus

Copy link
Copy Markdown

Would be really useful if it could show a list of commits if there's no changelog.

surface in their application from these changes.

Since npm already supports including a changelog with the package by reserving
three possible document names: `CHANGES`, `CHANGELOG`, and `HISTORY`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"keep a changelog" also suggests NEWS and RELEASES.

@iarna iarna May 31, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filenames listed here are the ones npm already guarantees will be published if they're present in the package directory. Adding new changelog filenames is, I think, out of scope for this RFC.


Any file extension works with `CHANGES` / `CHANGELOG` / `HISTORY`, but npm's
rendering of package files to the website currently only supports markdown. Do
we open this up or convince people to convert to markdown as well? No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about formatting .md files as Markdown and just falling back to text for everything else.

@dantman

dantman commented May 18, 2018

Copy link
Copy Markdown

@sholladay

Copy link
Copy Markdown

@dantman IMO the algorithm should support and prefer GitHub Releases. That would provide the best experience for redux and react-redux. In the case of lodash, I don't think npm should do anything fancy. Just treat it as a changelog and authors will fall in line. Trying to parse the changelog and follow it if it is a link seems like a rabbit hole to me.

@ljharb

ljharb commented May 18, 2018

Copy link
Copy Markdown
Contributor

@sholladay I disagree; I think support for Github Releases should be secondary; there's no need to privilege github more than it already is, and better integration between Releases and changelogs is something Github itself should be solving. I think that if npm can address common changelog patterns, cohering a changelog with Releases is something the ecosytem can address pretty trivially.

@sholladay

sholladay commented May 18, 2018

Copy link
Copy Markdown

@ljharb so I actually agree with all of your points, but stand by my opinion on how the algorithm should be. GitHub gets a lot of preferential treatment in the npm CLI at the moment (perhaps too much, albeit I'm pretty happy with GitHub itself and the marriage it has with npm). That said, I've never had issues with using Bitbucket and npm together, for example, and I don't see any reason to believe this would be different with the changelog feature. npm should leverage GitHub's features while still providing a smooth experience to everyone else. If GitHub improves Releases as you mentioned it should, well I would love that, but I don't see these as being mutually exclusive, nor do I see it as something npm should count on when implementing this feature.

One of the main reasons preferring Releases will help npm's users is that they tend to be higher quality than changelog files, as evidenced by the example links that @dantman posted. I have encountered tons of projects like that. Releases tend to be crafted with more care. I think that when they are available, npm should use them.

@dantman

dantman commented May 18, 2018

Copy link
Copy Markdown

@ljharb I agree.

Usage of GitHub Releases for changelog is very rare. I know of less than a half dozen packages that use GitHub releases to document changes. And a fair portion of them maintain a more detailed CHANGELOG file. And I only remember seeing large regularly updated frameworks use this pattern. i.e. I only see this pattern in projects that would be the easiest to convince to do some manual configuration in package.json.

IMHO among the smaller packages (the larger number of packages, which we should aim to have the best defaults for), changelogs as README sections are something I notice being used more often than GitHub Releases notes.

@iarna

iarna commented May 19, 2018

Copy link
Copy Markdown
Contributor

I have the same uneasiness about privileging Github that @ljharb does.

If we were to support Github releases I'd want to also support the same features in Gitlab and Bitbucket at least (the same way we do with shortcuts, eg, how we have both github:user/project and gitlab:user/project`).

We fill in releases for npm, but that's in addition to the changelog. I'd prefer we pave the changelog-as-file path to start and look at adding more facilities after that's done.

@zkat

zkat commented May 19, 2018

Copy link
Copy Markdown
Contributor

I'm also fairly comfortable decreeing that the CHANGELOG in the package is the One True Way, tbh.

@zkat zkat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've decided to ratify this! We can bikeshed around a lot of small details, but the consensus with the dev team is that basing this off included CHANGELOG files (in their current included forms) is the best way forward. Specific behavior around npm changelog as far as display vs opening vs parsing TBD, but the core here is good.

Thank you Jeff! and thank you @dantman for getting this conversation rolling. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants