Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up to date changelog with fixes #94

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f423e21
shut up eslint
GerHobbelt Oct 2, 2017
70cebf0
added package-lock.json for precise dependency management straight ou…
GerHobbelt Oct 2, 2017
94ba2e8
updated CHANGELOG using `changelog` (and hand-tweaked the output)
GerHobbelt Oct 2, 2017
7479796
TravisCI: test all major Node versions from 4.0 onwards
GerHobbelt Oct 3, 2017
d8f8393
package states we support node as old as 0.10.0, so have TravisCI che…
GerHobbelt Oct 3, 2017
6aea89a
added package-lock.json for precise dependency management straight ou…
GerHobbelt Oct 2, 2017
a853ca8
updated CHANGELOG using `changelog` (and hand-tweaked the output)
GerHobbelt Oct 2, 2017
0644ce2
Merge branch 'patch-3'
GerHobbelt Oct 3, 2017
6ec041e
Merge branch 'patch-4'
GerHobbelt Oct 3, 2017
4e24f1d
fix: npm.org now has a different way to request info about scoped pac…
GerHobbelt Oct 3, 2017
98fb0a6
bumped build revision + making this a scoped package for fast publica…
GerHobbelt Oct 3, 2017
368495e
fix: npm.org now has a different way to request info about scoped pac…
GerHobbelt Oct 3, 2017
9cb73da
Merge branch 'patch-5'
GerHobbelt Oct 3, 2017
68b0843
nuke deprecated (and crashing!) grunt-readme from the task set (and c…
GerHobbelt Oct 3, 2017
b58c1f9
fix: has-color package is now chalk/supports-color
GerHobbelt Oct 3, 2017
7c7afce
sync output/markdown and output/terminal: same conditional logic arou…
GerHobbelt Oct 3, 2017
4ff77c6
Add note about the otherwise obscure solution to get terminal/console…
GerHobbelt Oct 3, 2017
c65475b
bump build revision
GerHobbelt Oct 3, 2017
bd439bf
add "pub" publish task in npm scripts: `npm run pub'
GerHobbelt Oct 4, 2017
f4f9733
Merge remote-tracking branch 'remotes/dylang-original/master'
GerHobbelt Oct 4, 2017
d4920eb
dependency `supports-color` doesn't support antique NodeJS (0.12 and …
GerHobbelt Oct 4, 2017
a34eb77
update TravisCI config to test all major supported Node versions: 4/5…
GerHobbelt Oct 4, 2017
942fa2f
updated mocha + chai NPM packages; this causes #43
GerHobbelt Oct 4, 2017
5a95fd8
chai github and npm tests (#43) don't fail with obscure error report …
GerHobbelt Oct 4, 2017
49e5908
bump build revision. Now all unit tests pass (`npm test` failed for b…
GerHobbelt Oct 4, 2017
d5b3f3d
bump build revision
GerHobbelt Oct 4, 2017
9ab2e50
chai github and npm tests (#43) don't fail with obscure error report …
GerHobbelt Oct 4, 2017
708077f
Merge branch 'patch-6'
GerHobbelt Oct 4, 2017
8d8e899
updated package-lock.json: complete re-install of npm packages via `r…
GerHobbelt Oct 4, 2017
daf87bd
updated NPM packages, including move from deprecated has-color (not u…
GerHobbelt Oct 3, 2017
920adee
Merge branch 'patch-7'
GerHobbelt Oct 30, 2017
1856dde
updated NPM packages; bumped build revision; all tests PASS
GerHobbelt Oct 30, 2017
bc6aceb
bumped build revision
GerHobbelt Oct 30, 2017
6e7ee9c
message typo fix
GerHobbelt Oct 30, 2017
98728b6
allow variable number of args to log.debug & log.error: behave exactl…
GerHobbelt Oct 30, 2017
db27edd
fix releaseRequested value: should never be NaN, just keep it 'undefi…
GerHobbelt Oct 30, 2017
67f8877
enhancement: when you collect the changelog info for the local packag…
GerHobbelt Oct 30, 2017
1fdb12a
whoops, forgot npm dependency in there...
GerHobbelt Oct 30, 2017
204f7cd
turns out today, npm registry requests for scoped packages has appare…
GerHobbelt Oct 30, 2017
5c6dcdd
turns out today, npm registry requests for scoped packages has appare…
GerHobbelt Oct 30, 2017
01e3c10
Merge branch 'patch-5'
GerHobbelt Oct 30, 2017
7ab319c
cleaned up CHANGELOG.md
GerHobbelt Oct 30, 2017
babece0
updated CHANGELOG.md
GerHobbelt Oct 30, 2017
1d47ea1
updated CHANGELOG.md using the correct repo URL (fork) now in package…
GerHobbelt Oct 30, 2017
d6905f6
bumped build revision
GerHobbelt Oct 30, 2017
1ea550b
kill obnoxious chai behaviour: `expects().to.be.an.object` fails, whi…
GerHobbelt Oct 30, 2017
42fa5e6
github should not just deliver commits but also **tags**: often those…
GerHobbelt Oct 30, 2017
05c5af9
SPDX-style license key in package.json: MIT.
GerHobbelt Oct 30, 2017
3e83ad4
bumped build revision
GerHobbelt Oct 30, 2017
055e9dc
add CLI `-a` / `--append` option to write/append to a CHANGELOG.md file:
GerHobbelt Oct 31, 2017
d5b1c10
bumped build revision + improved debug logging, including inspection …
GerHobbelt Oct 31, 2017
f25e1b8
`npm run build` task will execute `grunt` and have it do everything: …
GerHobbelt Oct 31, 2017
c159e35
`npm run changelog` will append the CHANGELOG.md file with everything…
GerHobbelt Oct 31, 2017
e02029e
bump build revision
GerHobbelt Oct 31, 2017
7659a9c
support empty repo urls
Nov 3, 2017
166a502
Merge remote-tracking branch 'remotes/dylang-original/master'
GerHobbelt Nov 11, 2017
535408f
updated npm packages
GerHobbelt Aug 6, 2019
54e92a7
bumped build revision
GerHobbelt Aug 6, 2019
9fb2164
Merge remote-tracking branch 'remotes/fgnass/master'
GerHobbelt Aug 6, 2019
d7e86cc
updated CHANGELOG.md
GerHobbelt Aug 6, 2019
e9cfccd
bump build revision
GerHobbelt Aug 6, 2019
50f3bce
TravisCI: only test on active Node versions (8+); now only support LT…
GerHobbelt Aug 6, 2019
84f2aab
- fix: return failures (Errors ~ thrown as exceptions) through the sa…
GerHobbelt Aug 6, 2019
25e6c21
bump build revision
GerHobbelt Aug 6, 2019
d37eb44
- fix: return failures (Errors ~ thrown as exceptions) through the sa…
GerHobbelt Aug 6, 2019
937faed
Merge branch 'patch-8'
GerHobbelt Jul 23, 2020
51430b8
update npm packages
GerHobbelt Jul 23, 2020
c049d4a
updated npm packages
GerHobbelt Jul 2, 2021
a89d857
change leat supported node version to v12.20 (LTS)
GerHobbelt Jul 2, 2021
41d4287
bumped build revision
GerHobbelt Jul 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions .travis.yml
@@ -1,6 +1,12 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- 8
- 9
- 10
- 11
- 12
- node

before_script:
- npm install -g grunt-cli
141 changes: 109 additions & 32 deletions CHANGELOG.md
@@ -1,3 +1,88 @@
`v1.4.1-10 / 2017-11-06
===================

* support empty repo urls ([#48](https://github.com/GerHobbelt/changelog/issues/48))

Some non-open-source npm packages like
https://www.npmjs.com/package/bitmovin-player contain repository fields
with empty URLs. This commit handles this case which previously would
throw an error.
* for changelog developers: `npm run changelog` will append the CHANGELOG.md file with everything (in case you don't trust the 'single release changelog entries only'-behaviour yet...)
* for changelog developers: `npm run build` task will execute `grunt` and have it do everything: lint, test, etc.

1.4.1-9 / 2017-10-31
====================

* improved debug logging, including inspection of proper OAuth transfer to github
* add CLI `-a` / `--append` option to write/append to a CHANGELOG.md file:
- new generated data is appended to the top of an existing file.
- the tool searches the local directory for any file matching the 'changelog*' glob search crriterion and picks the first one it finds. When no file is found, 'CHANGELOG.md' is assumed as a default destination. This behaviour ensures that various incantations of the name do not cause any trouble in `-a`-updating, while any newly created CHANGELOG will have a github-friendly name: "CHANGELOG.md"

1.4.1-8 / 2017-10-31
====================

* SPDX-style license key in package.json: MIT.

1.4.1-7 / 2017-10-31
====================

* github should not just deliver commits but also **tags**: often those are in sync with npm releases, at least when they have a 'semver' format, so we collect those alongside the ones produced by the npm registry.
This is particularly handy to obtain a complete releases set (CLI: 'all') when a project is worked on via fork + subsequent "scoping" of that package, but that's just one(1) use case; this functionality is also useful for packages which do have releases via git tags, but have not been registered with npm, for example!
* kill obnoxious chai behaviour: `expects().to.be.an.object` fails, while `assert.isObject()` does what it's supposed to do.
* updated CHANGELOG.md using the correct repo URL (fork) now in package.json

1.4.1-6 / 2017-10-31
====================

* turns out today, npm registry requests for scoped packages has apparently reverted to old behaviour. See also commit SHA-1: 368495e38ac989f444b82867c753a7402de51b59 :: fix: npm.org now has a different way to request info about scoped packages: via the `Npm-Scope` header. See also https://docs.npmjs.com/misc/registry
* whoops, forgot npm dependency in there...
* enhancement: when you collect the changelog info for the local package, i.e. load the project name from the local package.json file, also pick up the repository URL from that file as well and apply that as the actual github URL rather than going to the NPM registry and collecting the github repo URL from the data produced by *that* one: the reason we do this is that we MAY VERY PROBABLY have adjusted the package.json file to be a scoped package or otherwise, but have not yet changed the repository URL to point to our fork/clone/derivative: it's one of those fields you only correct when you find out they matter... and now it turns out they matter for the CHANGELOG tool but then, of course, you otherwise would have to push a new NPM release just to correct this, which is ludicrous, so we have the local package.json take priority when we obtain data from it anyway. (Ergo: specifying the npm repo identifier on the command line WILL NOT take the package.json repository URL as explicit specification of the npm registry entry on the command line results in CHANGELOG not accessing any local package.json *at all*!)
* fix releaseRequested value: should never be NaN, just keep it 'undefined' then. Better validation in the code.
* allow variable number of args to log.debug & log.error: behave exactly like console.log and console.error so we can log more complex (debug) messages easily.
* message typo fix

1.4.1-5 / 2017-10-30
====================

* updated NPM packages, including move from deprecated has-color (not updated since 2013) to chalk-supports module (which is linked from rmp website's has-color entry). Added note to README for Windows users who run into issues around console TTY detection failing on several msys/mingw systems: `-c` vs. `--color`.
* updated package-lock.json: complete re-install of npm packages via `rm -rf node_modules; rm -f package-lock.json; npm i`

1.4.1-4 / 2017-10-04
====================

* chai github and npm tests ([#43](https://github.com/GerHobbelt/changelog/issues/43)) don't fail with obscure error report anymore: `expect.an.object` is not the correct use: http://chaijs.com/api/bdd/ --> `expect.an('object')`
* Now all unit tests pass (`npm test` failed for build -2 and before, after having updated to chai 4)
* updated package-lock.json: complete re-install of npm packages via `rm -rf node_modules; rm -f package-lock.json; npm i`
* chai github and npm tests ([#43](https://github.com/GerHobbelt/changelog/issues/43)) don't fail with obscure error report anymore: `expect.an.object` is not the correct use: http://chaijs.com/api/bdd/ --> `expect.an('object')`

1.4.1-3 / 2017-10-04
====================

* Now all unit tests pass (`npm test` failed for build -2 and before, after having updated to chai 4)
* chai github and npm tests ([#43](https://github.com/GerHobbelt/changelog/issues/43)) don't fail with obscure error report anymore: `expect.an.object` is not the correct use: http://chaijs.com/api/bdd/ --> `expect.an('object')`
* updated mocha + chai NPM packages; this causes [#43](https://github.com/GerHobbelt/changelog/issues/43)
* update TravisCI config to test all major supported Node versions: 4/5/6/7/8
* dependency `supports-color` doesn't support antique NodeJS (0.12 and older) due to `const` usage in the code. Discarding antiquated NodeJS support in `changelog` itself now: NodeJS versions 4 and later are supported and CI tested (adjusted TravisCI config accordingly)
* add "pub" publish task in npm scripts: `npm run pub'
* updated CHANGELOG using `changelog` (and hand-tweaked the output) ([#41](https://github.com/GerHobbelt/changelog/issues/41))
* added package-lock.json ([#40](https://github.com/GerHobbelt/changelog/issues/40))
* use strict ([#39](https://github.com/GerHobbelt/changelog/issues/39))

1.4.1-2 / 2017-10-03
====================

* Add note about the otherwise obscure solution to get terminal/console output with `-c` on platforms/terminals which are not recognized as color-supporting. (e.g. Windows+msys bash)
* sync output/markdown and output/terminal: same conditional logic around augmenting github issues with an URL.
* fix: has-color package is now chalk/supports-color
* nuke deprecated (and crashing!) grunt-readme from the task set (and consequently from the dev deps)
* fix: npm.org now has a different way to request info about scoped packages: via the `Npm-Scope` header. See also https://docs.npmjs.com/misc/registry
* bumped build revision + making this a scoped package for fast publication of updates.
* updated CHANGELOG using `changelog` (and hand-tweaked the output)
* added package-lock.json for precise dependency management straight out of the NPM box
* package states we support node as old as 0.10.0, so have TravisCI check 'em all.
* TravisCI: test all major Node versions from 4.0 onwards
* shut up eslint

1.4.0 / 2017-07-08
==================

Expand All @@ -11,18 +96,23 @@
This enhances GitHub URL parsing to support:
- git://
- git+https://
- monropo (e.g. https://github.com/babel/babel/tree/master/packages/babel-runtime)
- monorepo (e.g. https://github.com/babel/babel/tree/master/packages/babel-runtime)

1.3.0 / 2017-06-12
==================

* Add np
* Return sha with commits
* Fix filename for example markdown ([#30](https://github.com/dylang/changelog/issues/30))

1.2.1 / 2017-06-12
==================
1.2.2 / 2017-03-16
===================

* nil

1.2.1 / 2017-01-17
===================

* Fix filename for example markdown ([#30](https://github.com/dylang/changelog/issues/30))
* Revert q to 1.x ([#28](https://github.com/dylang/changelog/issues/28))

Although q has released 2.0.0 - 2.0.3, the author writes on the GitHub repo:
Expand All @@ -34,7 +124,8 @@
1.2.0 / unpublished?
====================

* Upgrade and pin dependencies ([#27](https://github.com/dylang/changelog/issues/27)) & devDependencies ([#26](https://github.com/dylang/changelog/issues/26))
* Upgrade and pin dependencies ([#27](https://github.com/dylang/changelog/issues/27))
& devDependencies ([#26](https://github.com/dylang/changelog/issues/26))
* Closes [#20](https://github.com/dylang/changelog/issues/20)
* Closes [#16](https://github.com/dylang/changelog/issues/16)
* Closes [#13](https://github.com/dylang/changelog/issues/13)
Expand Down Expand Up @@ -68,18 +159,15 @@
* updated examples
* update dependencies
* fix main, update readme
* update changelog

1.0.4 / 2014-01-24
==================

* update dependencies
* Uppercase changelog
* add json example
* bump version
* adding grunt-readme
* Merge pull request [#7](https://github.com/dylang/changelog/issues/7) from rimunroe/master
added User-Agent header to github API request
* added User-Agent header to GitHub API request

1.0.3 / 2013-09-22
Expand All @@ -94,52 +182,49 @@
* renaming readme
* update help
* update readme
* * updated readme

1.0.1 / 2013-09-20
==================

* * fix some bugs in the command line script
* update readme
* update help
* update examples
* fix some bugs in the command line script
* update readme
* update help
* update examples
* show error message when github api rate limiting is enabled

1.0.0 / 2013-09-20
==================

* more refactoring, update tests
* added .travis.yml.
fixed TTL problem that made it not work in modern versions of Node. Fixes [#3](https://github.com/dylang/changelog/issues/3).
updated npm registry api url.
added tests.
updated readme.
changed from using `step` to `q`.
* fixed TTL problem that made it not work in modern versions of Node. Fixes [#3](https://github.com/dylang/changelog/issues/3).
* updated npm registry api url.
* added tests.
* updated readme.
* changed from using `step` to `q`.
* let the author know

0.1.3 / 2011-11-21
==================

* bump version, ignore TTY.getWindowSize if it's not working.
* ignore TTY.getWindowSize if it's not working.
* fix bug when author doesn't include repo. make work in node 0.6.*

0.1.2 / 2011-08-26
==================

* version bump to 0.1.2
* added support for showing specific releases via `latest`, `n`, and `n.n.n` based on Tjholowaychuk's request. Closes [#2](https://github.com/dylang/changelog/issues/2)

0.1.1 / 2011-08-24
==================

* updated examples and version
* updated examples
* fixed regex for replacing github ticket numbers with url to the ticket so it wouldn't blindly match #.

0.1.0 / 2011-08-23
==================

* update changelog
* update version
* show the author's name if the repo url is not in the module's package.json.
* fix exception that happens when a module isn't found
* clean up readme
Expand All @@ -149,44 +234,38 @@
0.0.9 / 2011-08-23
==================

* update version
* update examples
* show full url to to github issue on command line output

0.0.8 / 2011-08-16
==================

* updated version
* updated examples
* don't include ansi color codes when outputting to a file or pipe

0.0.7 / 2011-08-10
==================

* upped version
* added changelog for changelog
* run changelog in the root of a node project with a package.json and it will use it to create the changelog.

0.0.6 / 2011-08-07
==================

* bumped version to 0.0.6
* added lots of examples
* added --color output (new default)
* get debug output via --debug

0.0.5 / 2011-08-05
==================

* up version
* handle better npm's api not being available
wrap text using the screen width via tty
* wrap text using the screen width via tty
* remove node_modules from git project

0.0.4 / 2011-08-04
==================

* update version to 0.0.4
* using issac's semver to compare module version numbers
* update readme

Expand All @@ -195,16 +274,14 @@

* update readme
* support upcoming features that are in github but not yet in npm.
* up to 0.0.3
* --json support
* update description

0.0.2 / 2011-08-04
==================

* version 0.0.2
* use standard out and standard error for output.
don't bubble exceptions or repeat error messages.
* don't bubble exceptions or repeat error messages.

0.0.1 / 2011-08-01
==================
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -83,7 +83,7 @@ module.exports = function (grunt) {
},
readme: {
options: {
readme: 'templates/README.md.tmpl',
readme: 'templates/changelog.md',
contributing: false
}
}
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -72,6 +72,9 @@ Options:
-h, --help Display help and usage details
```

**Note**: on Windows and other platforms, `-c` MAY not detect a color-supporting terminal. Use `--color` instead to force changelog (which uses `chalk`) to output terminal color escape codes. See also https://github.com/chalk/supports-color.


#### More Examples


Expand Down
13 changes: 9 additions & 4 deletions lib/changelog.js
Expand Up @@ -3,6 +3,7 @@
var npm = require('./datasrc/npm');
var github = require('./datasrc/github');
var versionFilter = require('./util/versionFilter');
var q = require('q');
var log = require('./log');

function processNpmAndGithubData(data, versionRequested) {
Expand Down Expand Up @@ -47,10 +48,12 @@ function processNpmAndGithubData(data, versionRequested) {
};
}

function generate(project, versionRequested) {
function generate(project, repoUrlOverride, versionRequested) {

if (!project) {
return new Error('Need help? --help or more help at https://github.com/dylang/changelog');
return q.fcall(function () {
throw new Error('No project specified. Need help? --help or more help at https://github.com/dylang/changelog');
});
}

if (project.match(/github.com/)) {
Expand All @@ -61,7 +64,9 @@ function generate(project, versionRequested) {
return github.changelog(repo, versionRequested);
}

return new Error('Bad repo url: ' + project);
return q.fcall(function () {
throw new Error('Bad repo url: ' + project);
});
}

// Scoped npm packages start with an '@' and include a forward slash
Expand All @@ -71,7 +76,7 @@ function generate(project, versionRequested) {
}

log.debug('using npm module ' + project);
return npm.packageHistory(project)
return npm.packageHistory(project, repoUrlOverride)
.then(github.commitMessages)
.then(function(data) {
return processNpmAndGithubData(data, versionRequested);
Expand Down