Skip to content

Commit 8becc1f

Browse files
authored
Merge branch 'master' into feature-support-shallow-for-lint
2 parents 99134f6 + 37a91b2 commit 8becc1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1931
-1277
lines changed

.circleci/config.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1+
workflows:
2+
version: 2
3+
node-multi-build:
4+
jobs:
5+
- node-v6
6+
- node-v8
7+
- node-latest
8+
19
version: 2
210
jobs:
3-
build:
11+
node-base: &node-base
412
docker:
5-
- image: circleci/node:8.9.1
13+
- image: node
614
steps:
715
- checkout
816
- run:
9-
name: install
17+
name: Install dependencies
1018
command: yarn --frozen-lockfile
1119
- run:
12-
name: test
20+
name: Test
1321
command: yarn test-ci
1422
- run:
1523
name: coverage
1624
command: ./node_modules/.bin/coveralls < coverage/lcov.info
25+
node-v6:
26+
<<: *node-base
27+
docker:
28+
- image: node:6
29+
node-v8:
30+
<<: *node-base
31+
docker:
32+
- image: node:8
33+
node-latest:
34+
<<: *node-base
35+
docker:
36+
- image: node:latest

.eslintrc

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"flowtype"
99
],
1010
"rules": {
11+
"no-var": 2,
12+
"prefer-const": 2,
1113
"no-use-before-define": [2, "nofunc"],
1214
"camelcase": 2,
1315
"no-lonely-if": 2,

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
.nyc_output
77
circle.yml
88
coverage
9-
test
9+
__tests__

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="5.4.0"></a>
6+
# [5.4.0](https://github.com/documentationjs/documentation/compare/v5.3.5...v5.4.0) (2018-02-10)
7+
8+
9+
### Bug Fixes
10+
11+
* **package:** update remark-toc to version 5.0.0 ([0bb3d0d](https://github.com/documentationjs/documentation/commit/0bb3d0d))
12+
13+
14+
### Features
15+
16+
* add support for class param declarations at the constructor ([#1013](https://github.com/documentationjs/documentation/issues/1013)) ([05c5279](https://github.com/documentationjs/documentation/commit/05c5279))
17+
18+
19+
520
<a name="5.3.5"></a>
621
## [5.3.5](https://github.com/documentationjs/documentation/compare/v5.3.4...v5.3.5) (2017-12-12)
722

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ npm install -g documentation
4747

4848
This installs a command called `documentation` in your path, that you can
4949
point at [JSDoc](http://usejsdoc.org/)-annotated source code to generate
50-
human-readable documentation. First run `documentation` with the `--help`
50+
human-readable documentation. First, run `documentation` with the `--help`
5151
option for help:
5252

5353
```sh
@@ -62,10 +62,10 @@ bin/documentation.js build src/** -f html -o docs
6262
# document index.js, ignoring any files it requires or imports
6363
bin/documentation.js build index.js -f md --shallow
6464

65-
# build and serve html docs for app.js
65+
# build and serve HTML docs for app.js
6666
bin/documentation.js serve app.js
6767

68-
# build, serve, and live-update html docs for app.js
68+
# build, serve, and live-update HTML docs for app.js
6969
bin/documentation.js serve --watch app.js
7070

7171
# validate JSDoc syntax in util.js

__tests__/__snapshots__/bin.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`--config 1`] = `
55
<html>
66
<head>
77
<meta charset='utf-8' />
8-
<title>documentation 5.3.5 | Documentation</title>
8+
<title>documentation 5.4.0 | Documentation</title>
99
<meta name='viewport' content='width=device-width,initial-scale=1'>
1010
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
1111
<link href='assets/style.css' type='text/css' rel='stylesheet' />
@@ -17,7 +17,7 @@ exports[`--config 1`] = `
1717
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1818
<div class='py1 px2'>
1919
<h3 class='mb0 no-anchor'>documentation</h3>
20-
<div class='mb1'><code>5.3.5</code></div>
20+
<div class='mb1'><code>5.4.0</code></div>
2121
<input
2222
placeholder='Filter'
2323
id='filter-input'

__tests__/__snapshots__/test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ exports[`html nested.input.js 1`] = `
808808
<html>
809809
<head>
810810
<meta charset='utf-8' />
811-
<title>documentation 5.3.5 | Documentation</title>
811+
<title>documentation 5.4.0 | Documentation</title>
812812
<meta name='viewport' content='width=device-width,initial-scale=1'>
813813
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
814814
<link href='assets/style.css' type='text/css' rel='stylesheet' />
@@ -820,7 +820,7 @@ exports[`html nested.input.js 1`] = `
820820
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
821821
<div class='py1 px2'>
822822
<h3 class='mb0 no-anchor'>documentation</h3>
823-
<div class='mb1'><code>5.3.5</code></div>
823+
<div class='mb1'><code>5.4.0</code></div>
824824
<input
825825
placeholder='Filter'
826826
id='filter-input'

__tests__/bin-readme.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
var path = require('path'),
2-
os = require('os'),
3-
exec = require('child_process').exec,
4-
tmp = require('tmp'),
5-
fs = require('fs-extra');
1+
const path = require('path');
2+
const os = require('os');
3+
const exec = require('child_process').exec;
4+
const tmp = require('tmp');
5+
const fs = require('fs-extra');
66

77
function documentation(args, options, parseJSON) {
88
return new Promise((resolve, reject) => {
@@ -23,13 +23,13 @@ function documentation(args, options, parseJSON) {
2323
}
2424

2525
describe('readme command', function() {
26-
var fixtures = path.join(__dirname, 'fixture/readme');
27-
var sourceFile = path.join(fixtures, 'index.js');
28-
var d;
29-
var removeCallback;
26+
const fixtures = path.join(__dirname, 'fixture/readme');
27+
const sourceFile = path.join(fixtures, 'index.js');
28+
let d;
29+
let removeCallback;
3030

3131
beforeEach(() => {
32-
var dirEntry = tmp.dirSync({ unsafeCleanup: true });
32+
const dirEntry = tmp.dirSync({ unsafeCleanup: true });
3333
d = dirEntry.name;
3434
fs.copySync(
3535
path.join(fixtures, 'README.input.md'),
@@ -41,13 +41,13 @@ describe('readme command', function() {
4141
// run tests after setting up temp dir
4242

4343
test('--diff-only: changes needed', async function() {
44-
var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
44+
const before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
4545
try {
4646
await documentation(['readme index.js --diff-only -s API'], {
4747
cwd: d
4848
});
4949
} catch (err) {
50-
var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
50+
const after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
5151
expect(err).toBeTruthy();
5252
expect(err.code).not.toBe(0);
5353
expect(after).toEqual(before);
@@ -56,7 +56,7 @@ describe('readme command', function() {
5656

5757
test('updates README.md', async function() {
5858
await documentation(['readme index.js -s API'], { cwd: d });
59-
var outputPath = path.join(d, 'README.md');
59+
const outputPath = path.join(d, 'README.md');
6060
expect(fs.readFileSync(outputPath, 'utf-8')).toMatchSnapshot();
6161
});
6262

@@ -68,7 +68,7 @@ describe('readme command', function() {
6868
await documentation(['readme index.js -s API --readme-file other.md'], {
6969
cwd: d
7070
});
71-
var actual = fs.readFileSync(path.join(d, 'other.md'), 'utf8');
71+
const actual = fs.readFileSync(path.join(d, 'other.md'), 'utf8');
7272
expect(actual).toMatchSnapshot();
7373
});
7474

@@ -110,7 +110,7 @@ describe('readme command', function() {
110110
}
111111
});
112112

113-
var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input');
113+
const badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input');
114114
test('errors on invalid syntax', async function() {
115115
try {
116116
await documentation(

__tests__/bin-watch-serve.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
var path = require('path');
2-
var os = require('os');
3-
var get = require('./utils').get;
4-
var spawn = require('child_process').spawn;
5-
var fs = require('fs');
6-
var pEvent = require('p-event');
1+
const path = require('path');
2+
const os = require('os');
3+
const get = require('./utils').get;
4+
const spawn = require('child_process').spawn;
5+
const fs = require('fs');
6+
const pEvent = require('p-event');
77

88
function documentation(args, options) {
99
if (!options) {
@@ -29,17 +29,17 @@ function normalize(result) {
2929
const timeout = 20000;
3030

3131
test('harness', function() {
32-
var docProcess = documentation(['serve', 'fixture/simple.input.js']);
32+
const docProcess = documentation(['serve', 'fixture/simple.input.js']);
3333
expect(docProcess).toBeTruthy();
3434
docProcess.kill();
3535
});
3636

3737
test(
3838
'provides index.html',
3939
function() {
40-
var docProcess = documentation(['serve', 'fixture/simple.input.js']);
40+
const docProcess = documentation(['serve', 'fixture/simple.input.js']);
4141
return pEvent(docProcess.stdout, 'data').then(function(data) {
42-
var portNumber = data
42+
const portNumber = data
4343
.toString()
4444
.match(/documentation.js serving on port (\d+)/);
4545
expect(portNumber).toBeTruthy();
@@ -55,13 +55,13 @@ test(
5555
test(
5656
'accepts port argument',
5757
function() {
58-
var docProcess = documentation([
58+
const docProcess = documentation([
5959
'serve',
6060
'fixture/simple.input.js',
6161
'--port=4004'
6262
]);
6363
return pEvent(docProcess.stdout, 'data').then(function(data) {
64-
var portNumber = data
64+
const portNumber = data
6565
.toString()
6666
.match(/documentation.js serving on port (\d+)/);
6767
expect(portNumber).toBeTruthy();
@@ -77,11 +77,11 @@ test(
7777
test(
7878
'--watch',
7979
function(done) {
80-
var tmpFile = path.join(os.tmpdir(), '/simple.js');
80+
const tmpFile = path.join(os.tmpdir(), '/simple.js');
8181
fs.writeFileSync(tmpFile, '/** a function */function apples() {}');
82-
var docProcess = documentation(['serve', tmpFile, '--watch']);
82+
const docProcess = documentation(['serve', tmpFile, '--watch']);
8383
pEvent(docProcess.stdout, 'data').then(function(data) {
84-
var portNumber = data
84+
const portNumber = data
8585
.toString()
8686
.match(/documentation.js serving on port (\d+)/);
8787
expect(portNumber).toBeTruthy();
@@ -108,14 +108,14 @@ test(
108108
test(
109109
'--watch',
110110
function(done) {
111-
var tmpDir = os.tmpdir();
112-
var a = path.join(tmpDir, '/simple.js');
113-
var b = path.join(tmpDir, '/required.js');
111+
const tmpDir = os.tmpdir();
112+
const a = path.join(tmpDir, '/simple.js');
113+
const b = path.join(tmpDir, '/required.js');
114114
fs.writeFileSync(a, 'require("./required")');
115115
fs.writeFileSync(b, '/** soup */function soup() {}');
116-
var docProcess = documentation(['serve', a, '--watch']);
116+
const docProcess = documentation(['serve', a, '--watch']);
117117
docProcess.stdout.once('data', function(data) {
118-
var portNumber = data
118+
const portNumber = data
119119
.toString()
120120
.match(/documentation.js serving on port (\d+)/);
121121
expect(portNumber).toBeTruthy();
@@ -142,12 +142,12 @@ test(
142142
test(
143143
'error page',
144144
function() {
145-
var tmpDir = os.tmpdir();
146-
var a = path.join(tmpDir, '/simple.js');
145+
const tmpDir = os.tmpdir();
146+
const a = path.join(tmpDir, '/simple.js');
147147
fs.writeFileSync(a, '**');
148-
var docProcess = documentation(['serve', a, '--watch']);
148+
const docProcess = documentation(['serve', a, '--watch']);
149149
return pEvent(docProcess.stdout, 'data').then(function(data) {
150-
var portNumber = data
150+
const portNumber = data
151151
.toString()
152152
.match(/documentation.js serving on port (\d+)/);
153153
expect(portNumber).toBeTruthy();

0 commit comments

Comments
 (0)