Skip to content

Commit

Permalink
fix: rename to npm-fetch-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed May 7, 2019
1 parent 3af66aa commit bc8da35
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# what-broke
# npm-fetch-changelog

[![CircleCI](https://circleci.com/gh/jedwards1211/what-broke.svg?style=svg)](https://circleci.com/gh/jedwards1211/what-broke)
[![Coverage Status](https://codecov.io/gh/jedwards1211/what-broke/branch/master/graph/badge.svg)](https://codecov.io/gh/jedwards1211/what-broke)
[![CircleCI](https://circleci.com/gh/jedwards1211/npm-fetch-changelog.svg?style=svg)](https://circleci.com/gh/jedwards1211/npm-fetch-changelog)
[![Coverage Status](https://codecov.io/gh/jedwards1211/npm-fetch-changelog/branch/master/graph/badge.svg)](https://codecov.io/gh/jedwards1211/npm-fetch-changelog)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/what-broke.svg)](https://badge.fury.io/js/what-broke)
[![npm version](https://badge.fury.io/js/npm-fetch-changelog.svg)](https://badge.fury.io/js/npm-fetch-changelog)

list breaking changes in newer major versions of packages
fetch the changelog for an npm package from GitHub

# How it works

Right now only packages hosted on GitHub are supported. `what-broke` will get
Right now only packages hosted on GitHub are supported. `npm-fetch-changelog` will get
the package info and repository URL from `npm`, then try to fetch the GitHub
release for each relevant version tag. If no GitHub release is found it will
fall back to trying to parse the package's `CHANGELOG.md` or `changelog.md`.
Expand All @@ -19,34 +19,34 @@ them!

# Caveats

`what-broke` inevitably fails to find changelog entries for some packages/releases
`npm-fetch-changelog` inevitably fails to find changelog entries for some packages/releases
because many maintainers are not very detail-oriented about it (and don't choose
to use excellent tools that would do the work for them, like
[`semantic-release`](https://github.com/semantic-release/semantic-release)).

However, I've also seen cases where some versions were never published to npm
(for instance, at the time of writing, `superagent` version 5.0.0 was never
published to npm, yet it does have a changelog entry). `what-broke` currently
published to npm, yet it does have a changelog entry). `npm-fetch-changelog` currently
only displays changelog entries for published versions.

# API Tokens

GitHub heavily rate limits public API requests, but allows more throughput for
authenticated requests. If you set the `GH_TOKEN` environment variable to a
personal access token, `what-broke` will use it when requesting GitHub releases.
personal access token, `npm-fetch-changelog` will use it when requesting GitHub releases.

`what-broke` will also use the `NPM_TOKEN` environment variable or try to get
`npm-fetch-changelog` will also use the `NPM_TOKEN` environment variable or try to get
the npm token from your `~/.npmrc`, so that it can get information for private
packages you request.

# CLI

```
npm i -g what-broke
npm i -g npm-fetch-changelog
```

```
what-broke <package name>
npm-fetch-changelog <package name>
```

Prints changelog entries fetched from GitHub for each
Expand All @@ -58,6 +58,10 @@ version released on npm in the given range.

semver version range to get changelog entries for, e.g. `^7.0.0` (defaults to `>` the version installed in the working directory, if it exists)

### `--json`

output JSON instead of Markdown

### `--prereleases`

include prerelease versions
Expand All @@ -75,11 +79,11 @@ exclude patch versions (defaults to `--no-minor`)
(the CLI just uses this under the hood)

```js
import whatBroke from 'what-broke'
import { fetchChangelog } from 'npm-fetch-changelog'
```

```js
async function whatBroke(
async function fetchChangelog(
package: string,
options?: {
include?: ?(((version: string) => boolean) | {
Expand All @@ -89,5 +93,11 @@ async function whatBroke(
patch?: ?boolean,
}),
}
): Promise<Array<{version: string, body: string}>>
): Promise<{[version: string]: {
version: string,
header: string,
body?: string,
date?: Date,
error?: Error,
}}>
```
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "what-broke",
"name": "npm-fetch-changelog",
"version": "0.0.0-development",
"description": "list breaking changes in newer major versions of packages",
"main": "index.js",
"bin": {
"what-broke": "./index.js"
"npm-fetch-changelog": "./index.js"
},
"engines": {
"node": ">=8.0.0"
Expand Down Expand Up @@ -71,7 +71,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/jedwards1211/what-broke.git"
"url": "https://github.com/jedwards1211/npm-fetch-changelog.git"
},
"keywords": [
"breaking-changes",
Expand All @@ -86,9 +86,9 @@
"author": "Andy Edwards",
"license": "MIT",
"bugs": {
"url": "https://github.com/jedwards1211/what-broke/issues"
"url": "https://github.com/jedwards1211/npm-fetch-changelog/issues"
},
"homepage": "https://github.com/jedwards1211/what-broke#readme",
"homepage": "https://github.com/jedwards1211/npm-fetch-changelog#readme",
"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.1.6",
Expand Down

0 comments on commit bc8da35

Please sign in to comment.