Skip to content

Commit ee105d9

Browse files
committed
Improve contributing documentation and integrate release-it.
1 parent 2e620c2 commit ee105d9

File tree

7 files changed

+1951
-77
lines changed

7 files changed

+1951
-77
lines changed

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/benchmarks/
22
/test/
33
.gitattributes
4-
.travis.yml
4+
.release-it.json
5+
.taskcluster.yml

.release-it.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": {
3+
"@release-it/keep-a-changelog": {
4+
"filename": "CHANGELOG.md"
5+
}
6+
},
7+
"github": {
8+
"release": false
9+
}
10+
}

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Changelog
2+
3+
Notable changes to readability will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project attempts to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
For the purposes of Semantic Versioning, the readability output object for a given
9+
input document is not considered a stable API. That is, minor version increments
10+
may change this output. Patch version increments will only do so in ways that are
11+
strict improvements (e.g. from empty strings or exceptions to something more
12+
reasonable).
13+
14+
## [Unreleased]
15+
16+
### Added
17+
18+
- `isProbablyReaderable` can now take an optional options object to configure it,
19+
allowing you to specify the minimum content length, minimum score, and how to
20+
check if nodes are visible.
21+
22+
- Better support for [deeply-nested content](https://github.com/mozilla/readability/pull/611).
23+
24+
- Readability is now more likely to [keep tables of content](https://github.com/mozilla/readability/pull/646).
25+
26+
- Better support for [content in `<code>` tags](https://github.com/mozilla/readability/pull/647).
27+
28+
- Readability (finally) no longer [throws away all `<h1>` tags](https://github.com/mozilla/readability/pull/650).
29+
30+
### Changed
31+
32+
- JSON-LD [support for multiple authors](https://github.com/mozilla/readability/pull/618)
33+
was improved.
34+
35+
- Elements with roles `menu`, `menubar`, `complementary`, `navigation`, `alert`,
36+
`alertdialog`, `dialog` will [all be removed](https://github.com/mozilla/readability/pull/619).
37+
38+
39+
## [0.3.0] - 2020-08-05
40+
41+
The first version that was published on NPM.
42+
43+
Previously, we did not consistently version anything,
44+
nor did we publish to NPM.
45+
46+
At some point, we may wish to expand this changelog into the past.

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing
2+
3+
[![Build Status](https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/readability/master/badge.svg)](https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/readability/master/latest)
4+
5+
For outstanding issues, see the issue list in this repo, as well as this [bug list](https://bugzilla.mozilla.org/buglist.cgi?component=Reader%20Mode&product=Toolkit&bug_status=__open__&limit=0).
6+
7+
Any changes to the main code should be reviewed by an [appropriate Firefox/toolkit peer](https://wiki.mozilla.org/Modules/Firefox), such as [@gijsk](https://github.com/gijsk), since these changes will be merged to mozilla-central and shipped in Firefox.
8+
9+
To test local changes to Readability.js, you can use the [automated tests](#tests).
10+
11+
## Tests
12+
13+
Please run [eslint](http://eslint.org/) as a first check that your changes are valid JS and adhere to our style guidelines:
14+
15+
$ npm run lint
16+
17+
18+
To run the test suite:
19+
20+
$ npm test
21+
22+
To run a specific test page by its name:
23+
24+
$ npm test -- -g 001
25+
26+
To run the test suite in TDD mode:
27+
28+
$ npm test -- -w
29+
30+
Combo time:
31+
32+
$ npm test -- -w -g 001
33+
34+
### Add new tests
35+
36+
There's a [node script](https://github.com/mozilla/readability/blob/master/test/generate-testcase.js) to help you create new tests.
37+
You can run it using:
38+
39+
$ node test/generate-testcase.js slug https://example.com/article
40+
41+
Replacing `slug` with the identifier the test should use, and providing a URL
42+
to an actual article on which the test should be based.
43+
44+
## Benchmarks
45+
46+
Benchmarks for all test pages:
47+
48+
$ npm run perf
49+
50+
Reference benchmark:
51+
52+
$ npm run perf-reference
53+
54+
## Pull Requests
55+
56+
We're always happy to see pull requests to improve readability.
57+
58+
Please ensure you run the linter and [tests](#tests) before submitting a PR.
59+
60+
If you're changing the algorithm to fix a specific page/article, please
61+
[add new tests](#add-new-tests) for the case you're fixing, so we avoid
62+
breaking it in future.
63+
64+
## Steps to release
65+
66+
1. Ensure [CHANGELOG.md](CHANGELOG.md) is up-to-date. ``git log v`npm view . version`...master `` may help with this.
67+
2. Run `npm run release` to create a release, which should:
68+
2a. `npm version [patch | minor | major]`, depending on the nature of the changes according to
69+
[semver](https://semver.org/). This will bump the version in `package.json` and `package-lock.json`
70+
and create a commit and Git tag for the release.
71+
2b. `npm publish` to push the release to the npm registry.
72+
2c. `git push origin head --follow-tags` to push the new commit and tag to GitHub.
73+
74+
## Keeping a changelog
75+
76+
Ensure significant changes are added to `CHANGELOG.md`. Do not add
77+
changes that only affect tests or documentation.
78+

README.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -85,45 +85,7 @@ good sanitizer libraries out there, use them!
8585

8686
## Contributing
8787

88-
[![Build Status](https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/readability/master/badge.svg)](https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/readability/master/latest)
89-
90-
For outstanding issues, see the issue list in this repo, as well as this [bug list](https://bugzilla.mozilla.org/buglist.cgi?component=Reader%20Mode&product=Toolkit&bug_status=__open__&limit=0).
91-
92-
Any changes to Readability.js itself should be reviewed by an [appropriate Firefox/toolkit peer](https://wiki.mozilla.org/Modules/Firefox), such as [@gijsk](https://github.com/gijsk), since these changes will be merged to mozilla-central and shipped in Firefox.
93-
94-
To test local changes to Readability.js, you can use the [automated tests](#tests). There's a [node script](https://github.com/mozilla/readability/blob/master/test/generate-testcase.js) to help you create new ones.
95-
96-
## Tests
97-
98-
Please run [eslint](http://eslint.org/) as a first check that your changes are valid JS and adhere to our style guidelines:
99-
100-
$ npm run lint
101-
102-
To run the test suite:
103-
104-
$ npm test
105-
106-
To run a specific test page by its name:
107-
108-
$ npm test -- -g 001
109-
110-
To run the test suite in TDD mode:
111-
112-
$ npm test -- -w
113-
114-
Combo time:
115-
116-
$ npm test -- -w -g 001
117-
118-
## Benchmarks
119-
120-
Benchmarks for all test pages:
121-
122-
$ npm run perf
123-
124-
Reference benchmark:
125-
126-
$ npm run perf-reference
88+
Please see our [Contributing](CONTRIBUTING.md) document.
12789

12890
## License
12991

0 commit comments

Comments
 (0)