Skip to content

Commit d069b6a

Browse files
committed
Support new node versions, including v4 and v5
* Compare strings as lowercase, to permit for v4+ compatibility * Fix bad reference to loc.name * Update README badge and fixture * Remove brfs dependency * Remove traverse * Remove browser transform support
1 parent d470b54 commit d069b6a

20 files changed

+678
-683
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# documentation
22

3-
[![Build Status](https://circleci.com/gh/documentationjs/documentation.svg?style=svg)](https://circleci.com/gh/documentationjs/documentation) [![Coverage Status](https://coveralls.io/repos/documentationjs/documentation/badge.svg?branch=master)](https://coveralls.io/r/documentationjs/documentation?branch=master)
3+
[![Circle CI](https://circleci.com/gh/documentationjs/documentation/tree/master.svg?style=svg)](https://circleci.com/gh/documentationjs/documentation/tree/master)
4+
[![Coverage Status](https://coveralls.io/repos/documentationjs/documentation/badge.svg?branch=master)](https://coveralls.io/r/documentationjs/documentation?branch=master)
45
[![npm version](https://badge.fury.io/js/documentation.svg)](http://badge.fury.io/js/documentation)
56
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/documentationjs/documentation?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
67

circle.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
machine:
2+
node:
3+
version: 0.10.33
4+
5+
dependencies:
6+
override:
7+
- 'nvm install 5 && nvm use 5 && npm update -g npm'
8+
- 'nvm install 0.10 && nvm use 0.10 && npm update -g npm'
9+
10+
test:
11+
override:
12+
- 'nvm use 5 && rm -rf node_modules && npm install && npm test'
13+
- 'nvm use 0.10 && rm -rf node_modules && npm install && npm test'

docs/NODE_API.md

-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ comments, given a root file as a path.
9393
- `options.external` **Array<string>** a string regex / glob match pattern
9494
that defines what external modules will be whitelisted and included in the
9595
generated documentation.
96-
97-
- `options.transform` **Array<string>** source transforms given as strings
98-
passed to [the module-deps transform option](https://github.com/substack/module-deps)
99-
10096
- `options.polyglot` **[boolean]** parse comments with a regex rather than
10197
a proper parser. This enables support of non-JavaScript languages but
10298
reduces documentation's ability to infer structure of code.

index.js

-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ function expandInputs(indexes, options, callback) {
6262
* @param {Array<string>} options.external a string regex / glob match pattern
6363
* that defines what external modules will be whitelisted and included in the
6464
* generated documentation.
65-
* @param {Array<string>} options.transform source transforms given as strings
66-
* passed to [the module-deps transform option](https://github.com/substack/module-deps)
6765
* @param {boolean} [options.polyglot=false] parse comments with a regex rather than
6866
* a proper parser. This enables support of non-JavaScript languages but
6967
* reduces documentation's ability to infer structure of code.
@@ -130,8 +128,6 @@ module.exports = function (indexes, options, callback) {
130128
* @param {Array<string>} options.external a string regex / glob match pattern
131129
* that defines what external modules will be whitelisted and included in the
132130
* generated documentation.
133-
* @param {Array<string>} options.transform source transforms given as strings
134-
* passed to [the module-deps transform option](https://github.com/substack/module-deps)
135131
* @param {boolean} [options.polyglot=false] parse comments with a regex rather than
136132
* a proper parser. This enables support of non-JavaScript languages but
137133
* reduces documentation's ability to infer structure of code.

lib/args.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,14 @@ module.exports = function (args) {
117117
command = argv._[0],
118118
inputs = argv._.slice(1),
119119
name = argv.name,
120-
version = argv['project-version'],
121-
transform;
120+
version = argv['project-version'];
122121

123122
if (inputs.length == 0) {
124123
try {
125124
var p = require(path.resolve('package.json'));
126125
inputs = [p.main || 'index.js'];
127126
name = name || p.name;
128127
version = version || p.version;
129-
if (p.browserify && p.browserify.transform) {
130-
transform = p.browserify.transform;
131-
}
132128
} catch (e) {
133129
yargs.showHelp();
134130
throw new Error('documentation was given no files and was not run in a module directory');
@@ -155,7 +151,6 @@ module.exports = function (args) {
155151
command: command,
156152
options: {
157153
private: argv.private,
158-
transform: transform,
159154
github: argv.github,
160155
polyglot: argv.polyglot,
161156
order: config.order || [],

lib/infer/params.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = function () {
6363
var newParam = {
6464
title: 'param',
6565
name: param.argument.name,
66-
lineNumber: param.loc.start.name,
66+
lineNumber: param.loc.start.line,
6767
type: {
6868
type: 'RestType'
6969
}

lib/sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ module.exports = function sortDocs(order, a, b) {
4545
return 1;
4646
}
4747

48-
return a.localeCompare(b);
48+
return a.toLowerCase().localeCompare(b.toLowerCase());
4949
};

package.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,11 @@
66
"bin": {
77
"documentation": "./bin/documentation.js"
88
},
9-
"browserify": {
10-
"transform": [
11-
"brfs"
12-
]
13-
},
14-
"browser": {
15-
"vinyl-fs": false
16-
},
179
"dependencies": {
1810
"ansi-html": "0.0.5",
1911
"ast-types": "^0.8.12",
2012
"babel-core": "^5.0.0",
2113
"babelify": "^6.3.0",
22-
"brfs": "^1.4.0",
2314
"chokidar": "^1.2.0",
2415
"concat-stream": "^1.5.0",
2516
"debounce": "^1.0.0",
@@ -47,7 +38,6 @@
4738
"stream-array": "^1.1.0",
4839
"strip-json-comments": "^1.0.2",
4940
"tiny-lr": "^0.2.1",
50-
"traverse": "^0.6.6",
5141
"unist-builder": "^1.0.0",
5242
"vfile": "^1.1.2",
5343
"vfile-reporter": "^1.4.1",
@@ -61,7 +51,7 @@
6151
"eslint": "^1.5.1",
6252
"glob": "^5.0.2",
6353
"lodash": "^3.10.1",
64-
"mock-fs": "^3.2.0",
54+
"mock-fs": "^3.5.0",
6555
"tap": "^2.2.0"
6656
},
6757
"keywords": [

test/fixture/es6-import.output.json

+2
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
{
330330
"title": "param",
331331
"name": "someParams",
332+
"lineNumber": 43,
332333
"type": {
333334
"type": "RestType"
334335
}
@@ -375,6 +376,7 @@
375376
{
376377
"title": "param",
377378
"name": "someParams",
379+
"lineNumber": 49,
378380
"type": {
379381
"type": "RestType",
380382
"expression": {

test/fixture/es6.output.json

+2
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
{
330330
"title": "param",
331331
"name": "someParams",
332+
"lineNumber": 43,
332333
"type": {
333334
"type": "RestType"
334335
}
@@ -375,6 +376,7 @@
375376
{
376377
"title": "param",
377378
"name": "someParams",
379+
"lineNumber": 49,
378380
"type": {
379381
"type": "RestType",
380382
"expression": {

test/fixture/flow-types.output.custom.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# addThem
2+
3+
This function returns the number one.
4+
5+
**Parameters**
6+
7+
- `a` **Point**
8+
- `b` **string**
9+
- `c` **[boolean]**
10+
- `d` **Array&lt;number&gt;**
11+
- `e` **Object**
12+
- `f` **Named**
13+
14+
Returns **number**
15+
116
# Point
217

318
A 2D point.
@@ -25,21 +40,6 @@ A type with entirely derived properties
2540
- `x` **number**
2641
- `y` **number**
2742

28-
# addThem
29-
30-
This function returns the number one.
31-
32-
**Parameters**
33-
34-
- `a` **Point**
35-
- `b` **string**
36-
- `c` **[boolean]**
37-
- `d` **Array&lt;number&gt;**
38-
- `e` **Object**
39-
- `f` **Named**
40-
41-
Returns **number**
42-
4343
# veryImportantTransform
4444

4545
Very Important Transform

0 commit comments

Comments
 (0)