Skip to content

Commit 2aff2f0

Browse files
committed
merge in upstream
2 parents 52cbee0 + 7d6187d commit 2aff2f0

File tree

15 files changed

+84
-49
lines changed

15 files changed

+84
-49
lines changed

.eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"no-eval": 2,
5353
"no-extra-bind": 2,
5454
"no-extend-native": 2,
55-
"no-fallthrough": 2,
55+
"no-fallthrough": 0, // disabled due to ESLint bug
5656
"no-floating-decimal": 2,
5757
"no-implied-eval": 2,
5858
"no-iterator": 2,

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
language: node_js
22

33
node_js:
4-
- "0.10"
5-
- "0.12"
4+
- "6"
5+
- "5"
6+
- "4"
67

78
install: npm install -g gulp; npm install

CHANGES.md

+27
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
This file describes notable changes in each version of JSDoc 3. To download a specific version of JSDoc 3, see [GitHub's tags page](https://github.com/jsdoc3/jsdoc/tags).
44

55

6+
## 3.4.2 (October 2016)
7+
8+
+ Classes exported from an ES2015 module are now documented correctly. (#1137)
9+
+ Fixed an issue that prevented plugins and templates from being loaded correctly. (#1259)
10+
+ Fixed a crash when using the experimental object spread operator in assignments. (#1258)
11+
12+
13+
## 3.4.1 (September 2016)
14+
15+
### Enhancements
16+
+ When installing JSDoc from NPM, all dependencies are now pulled from NPM. (#961)
17+
+ The configuration setting `tags.allowUnknownTags` may now contain an array of tag names that should be allowed. (#1159)
18+
19+
### Bug fixes
20+
+ When an ES2015 module's default export is a class, JSDoc now documents the class correctly. (#1113, #1120)
21+
+ JSDoc no longer crashes when an ES2015 module exports an anonymous class. (#1113)
22+
+ JSDoc no longer crashes when the experimental object spread operator is used. (#1141)
23+
+ In ES2015 methods, JSDoc now autodetects whether a parameter is a default or repeatable parameter. (#1144)
24+
+ The Markdown plugin now works correctly with inline tags that contain special characters, such as `{@link chat."#channel"}`. (#1035)
25+
+ When JSDoc is run in a directory that has a `plugins/` or `templates/` directory, JSDoc can now discover plugins and templates in other directories. (#1081)
26+
27+
### Templates
28+
+ The default template now uses appropriate styles for displaying tables. (#1064)
29+
+ The default template's CSS file no longer uses the same style for both `<h2>` and `<h3>` elements. (#1108)
30+
+ JSDoc now includes a `silent` template that generates no output. This template makes it easier to use JSDoc as a linter to check for syntax errors and unrecognized tags in documentation comments. (#1160)
31+
32+
633
## 3.4.0 (November 2015)
734

835
### Major changes

cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ cli.resolveTutorials = function() {
404404
cli.generateDocs = function() {
405405
var path = require('jsdoc/path');
406406
var resolver = require('jsdoc/tutorial/resolver');
407-
var taffy = require('taffydb-75lb').taffy;
407+
var taffy = require('taffydb').taffy;
408408

409409
var template;
410410

lib/jsdoc/fs.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var fs = require('fs');
88
var path = require('path');
99
var stream = require('stream');
10-
var fse = require('fs-extra');
10+
var mkdirp = require('mkdirp');
1111

1212
var ls = exports.ls = function(dir, recurse, _allFiles, _path) {
1313
var file;
@@ -91,7 +91,7 @@ exports.mkPath = function(_path) {
9191
_path = _path.join('');
9292
}
9393

94-
fse.mkdirsSync(_path);
94+
mkdirp.sync(_path);
9595
};
9696

9797
// adapted from http://procbits.com/2011/11/15/synchronous-file-copy-in-node-js
@@ -106,7 +106,7 @@ exports.copyFileSync = function(inFile, outDir, fileName) {
106106
var outFile = path.join( outDir, fileName || path.basename(inFile) );
107107
var pos = 0;
108108

109-
fse.mkdirsSync(outDir);
109+
mkdirp.sync(outDir);
110110
read = fs.openSync(inFile, 'r');
111111
write = fs.openSync(outFile, 'w');
112112

lib/jsdoc/src/astbuilder.js

+8-27
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,17 @@ var acceptsLeadingComments = (function() {
7575
// exported so we can use them in tests
7676
var parserOptions = exports.parserOptions = {
7777
comment: true,
78-
loc: true,
79-
range: true,
80-
tokens: true,
8178
ecmaFeatures: {
82-
arrowFunctions: true,
83-
binaryLiterals: true,
84-
blockBindings: true,
85-
classes: true,
86-
defaultParams: true,
87-
destructuring: true,
8879
experimentalObjectRestSpread: true,
89-
forOf: true,
90-
generators: true,
9180
globalReturn: true,
92-
jsx: true,
93-
modules: true,
94-
newTarget: true,
95-
objectLiteralComputedProperties: true,
96-
objectLiteralDuplicateProperties: true,
97-
objectLiteralShorthandMethods: true,
98-
objectLiteralShorthandProperties: true,
99-
octalLiterals: true,
100-
regexUFlag: true,
101-
regexYFlag: true,
102-
restParams: true,
103-
spread: true,
104-
superInFunctions: true,
105-
templateStrings: true,
106-
unicodeCodePointEscapes: true
107-
}
81+
impliedStrict: true,
82+
jsx: true
83+
},
84+
ecmaVersion: 7,
85+
loc: true,
86+
range: true,
87+
sourceType: 'module',
88+
tokens: true
10889
};
10990

11091
// TODO: docs

lib/jsdoc/src/astnode.js

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ var nodeToValue = exports.nodeToValue = function(node) {
134134
str = nodeToValue(node.left);
135135
break;
136136

137+
case Syntax.ClassDeclaration:
138+
str = nodeToValue(node.id);
139+
break;
140+
137141
case Syntax.ExportAllDeclaration:
138142
// falls through
139143

lib/jsdoc/src/handlers.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var currentModule = null;
2020
var SCOPE_NAMES = jsdoc.name.SCOPE.NAMES;
2121
var SCOPE_PUNC = jsdoc.name.SCOPE.PUNC;
2222
var Syntax = jsdoc.src.syntax.Syntax;
23-
var unresolvedName = /^((?:module.)?exports|this)(\.|$)/;
2423

2524
function CurrentModule(doclet) {
2625
this.doclet = doclet;

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
"url": "https://github.com/jsdoc2md/jsdoc"
1414
},
1515
"dependencies": {
16-
"async": "~1.5.2",
17-
"bluebird": "~3.3.4",
16+
"bluebird": "~3.4.6",
1817
"catharsis": "~0.8.8",
1918
"escape-string-regexp": "~1.0.5",
20-
"espree": "~2.2.5",
19+
"espree": "~3.1.7",
2120
"js2xmlparser": "~1.0.0",
22-
"marked": "~0.3.5",
21+
"klaw": "~1.3.0",
22+
"marked": "~0.3.6",
23+
"mkdirp": "~0.5.1",
2324
"requizzle": "~0.2.1",
2425
"strip-json-comments": "~2.0.1",
25-
"taffydb-75lb": "^2.6.2",
26-
"underscore": "~1.8.3",
27-
"fs-extra": "~0.26.7"
26+
"taffydb": "2.6.2",
27+
"underscore": "~1.8.3"
2828
},
2929
"devDependencies": {
3030
"gulp": "~3.9.1",
31-
"gulp-eslint": "~2.0.0",
31+
"gulp-eslint": "~3.0.1",
3232
"gulp-json-editor": "~2.2.1",
33-
"istanbul": "~0.4.2",
33+
"istanbul": "~0.4.5",
3434
"tv4": "https://github.com/hegemonic/tv4/tarball/own-properties"
3535
},
3636
"engines": {

templates/default/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template).
1+
The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://underscorejs.org/).
22

33

44
## Generating Typeface Fonts

templates/default/publish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var fs = require('jsdoc/fs');
66
var helper = require('jsdoc/util/templateHelper');
77
var logger = require('jsdoc/util/logger');
88
var path = require('jsdoc/path');
9-
var taffy = require('taffydb-75lb').taffy;
9+
var taffy = require('taffydb').taffy;
1010
var template = require('jsdoc/template');
1111
var util = require('util');
1212

test/fixtures/exportclass.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Foo module
3+
* @module foo
4+
*/
5+
6+
/** Class description */
7+
export class Bar {
8+
}

test/spec-collection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var fs = require('jsdoc/fs');
44
var path = require('jsdoc/path');
55
var runtime = require('jsdoc/util/runtime');
6-
var fse = require('fs-extra');
6+
var klaw = require('klaw');
77

88
var specs = [];
99
var finalSpecs = [];
@@ -81,7 +81,7 @@ exports.load = function(loadpath, matcher, clear, callback) {
8181
}
8282

8383
var wannaBeSpecs = [];
84-
fse.walk(loadpath)
84+
klaw(loadpath)
8585
.on('data', function(spec) {
8686
wannaBeSpecs.push(spec.path);
8787
})
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
describe('export class', function() {
4+
var docSet = jasmine.getDocSetFromFile('test/fixtures/exportclass.js');
5+
var bar = docSet.getByLongname('module:foo.Bar')[0];
6+
7+
it('should name exported classes correctly', function() {
8+
expect(bar).toBeDefined();
9+
expect(bar.name).toBe('Bar');
10+
});
11+
12+
it('should merge the class description with the doclet for the class', function() {
13+
expect(bar.classdesc).toBe('Class description');
14+
});
15+
});

test/specs/jsdoc/util/templateHelper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("jsdoc/util/templateHelper", function() {
1212
var helper = require('jsdoc/util/templateHelper');
1313
var logger = require('jsdoc/util/logger');
1414
var resolver = require('jsdoc/tutorial/resolver');
15-
var taffy = require('taffydb-75lb').taffy;
15+
var taffy = require('taffydb').taffy;
1616

1717
helper.registerLink('test', 'path/to/test.html');
1818

0 commit comments

Comments
 (0)