Comparing version 3.2.0-dev to 3.2.0
103
changes.md
@@ -5,2 +5,63 @@ # JSDoc 3 change history | ||
## 3.2.0 (May 2013) | ||
### Major changes | ||
+ JSDoc can now parse any valid [Google Closure Compiler type expression](https://developers.google.com/closure/compiler/docs/js-for-compiler#types). **Note**: As a result of this change, JSDoc quits if a file contains an invalid type expression. To prevent JSDoc from quitting, run JSDoc with the `--lenient` (`-l`) command-line option. (Multiple issues) | ||
+ You can now use the new `@listens` tag to indicate that a symbol listens for an event. (#273) | ||
### Enhancements | ||
+ The parser now fires a `parseBegin` event before it starts parsing files, as well as a `parseComplete` event after all files have been parsed. Plugins can define event handlers for these events, and `parseBegin` handlers can modify the list of files to parse. (#299) | ||
+ Event handlers for `jsdocCommentFount` events can now modify the JSDoc comment. (#228) | ||
+ You can now exclude tags from Markdown processing using the new option `markdown.excludeTags` in the configuration file. (#337) | ||
+ You can now use the [marked](https://github.com/chjj/marked) Markdown parser by setting the configuration property `markdown.parser` to `marked`. In addition, if `markdown.parser` is set to `gfm`, JSDoc will now use the "marked" parser instead. (#385) | ||
+ The `@typedef` tag no longer requires a name when used with a Closure Compiler-style type definition. For example, the following type definition will automatically get the name `Foo.Bar`: | ||
```javascript | ||
/** @typedef {string} */ | ||
Foo.Bar; | ||
``` | ||
(#391) | ||
+ You can now use an inline `{@type}` tag in a parameter's description. If this tag is present, JSDoc will assume that the parameter uses the type specified in the inline `{@type}` tag. For example, the following `@param` tag would cause `myParam`'s type to be documented as `Foo`: | ||
``` | ||
@param {(boolean|string)} myParam - My special parameter. {@type Foo} | ||
``` | ||
(#152) | ||
+ The `console.log` function now behaves the same way as on Node.js. In addition, the functions `console.info`, `console.error`, `console.warn`, and `console.trace` have been implemented. (#298) | ||
+ You can now use npm to install JSDoc globally by running `npm install -g`. **Note**: JSDoc will still run under Mozilla Rhino, not Node.js. (#374) | ||
+ The `jsVersion` configuration property has been removed. (#390) | ||
### Bug fixes | ||
+ JSDoc now quits if the configuration file cannot be loaded. (#407) | ||
+ JSDoc's `--explain` (`-X`) option now runs much more quickly, and it outputs valid JSON to the console. (#298) | ||
+ JSDoc's `--lenient` (`-l`) option now prints warnings on STDERR rather than STDOUT. (#298) | ||
+ The parser now assigns the correct scope to object properties whose names include single quotes. (#386) | ||
+ The parser now recognizes CommonJS modules that export a single function rather than an object. (#384) | ||
+ The inline `{@link}` tag now works correctly when `@link` is followed by a tab. (#359) | ||
+ On POSIX systems, quoted command-line arguments are no longer split on spaces. (#397) | ||
### Plugins | ||
+ The new `overloadHelper` plugin makes it easier to link to overloaded methods. (#179) | ||
+ The `markdown` plugin now converts Markdown links in the `@see` tag. (#297) | ||
### Default template enhancements | ||
+ You can now use the configuration property `templates.default.staticFiles` to copy additional static files to the output directory. (#393) | ||
+ All output files now use human-readable filenames. (#339) | ||
+ The documentation for events now lists the symbols that listen to that event. (#273) | ||
+ Links to source files now allow you to jump to the line where a symbol is defined. (#316) | ||
+ The output files now link to individual types within a Closure Compiler type expression. (Multiple issues) | ||
+ CommonJS modules that export a single function, rather than an object, are now documented more clearly. (#384) | ||
+ Functions that can throw multiple types of errors are now documented more clearly. (#389) | ||
+ If a `@property` tag does not identify the property's name, the template no longer throws an error. (#373) | ||
+ The type of each `@typedef` is now displayed. (#391) | ||
+ If a `@see` tag contains a URL (for example, `@see http://example.com` or `@see <http://example.com>`), the tag text is now converted to a link. (#371) | ||
+ Repeatable parameters are now identified. (#381) | ||
+ The "Classes" header is no longer repeated in the navigation bar. (#361) | ||
+ When the only documented symbols in global scope are type definitions, you can now click the "Global" header to view their documentation. (#261) | ||
## 3.1.1 (February 2013) | ||
@@ -25,25 +86,25 @@ | ||
```javascript | ||
/** | ||
* @class | ||
*/ | ||
function MyClass() {} | ||
```javascript | ||
/** | ||
* @class | ||
*/ | ||
function MyClass() {} | ||
/** | ||
* Send a request. | ||
* | ||
* @param {MyClass~responseCb} cb - Called after a response is received. | ||
*/ | ||
MyClass.prototype.sendRequest = function(cb) { | ||
// code | ||
}; | ||
/** | ||
* Send a request. | ||
* | ||
* @param {MyClass~responseCb} cb - Called after a response is received. | ||
*/ | ||
MyClass.prototype.sendRequest = function(cb) { | ||
// code | ||
}; | ||
/** | ||
* Callback for sending a request. | ||
* | ||
* @callback MyClass~responseCb | ||
* @param {?string} error - Information about the error. | ||
* @param {?string} response - Body of the response. | ||
*/ | ||
``` | ||
/** | ||
* Callback for sending a request. | ||
* | ||
* @callback MyClass~responseCb | ||
* @param {?string} error - Information about the error. | ||
* @param {?string} response - Body of the response. | ||
*/ | ||
``` | ||
+ The inline link tag, `{@link}`, has been improved: | ||
@@ -50,0 +111,0 @@ + You can now use a space as the delimiter between the link target and link text. |
@@ -18,3 +18,3 @@ /*global desc: true, fail: true, Mustache: true, task: true */ | ||
appname : 'jsdoc', | ||
appversion : '3.2.0-dev', | ||
appversion : '3.2.0', | ||
timestamp : '' + new Date().getTime() | ||
@@ -21,0 +21,0 @@ }; |
@@ -173,3 +173,3 @@ /*global app: true, args: true, env: true, publish: true */ | ||
confPath = env.opts.configure || path.join(__dirname, 'conf.json'); | ||
if ( !fs.statSync(confPath).isFile() ) { | ||
if ( !fs.statSync(confPath).isFile() && !env.opts.configure ) { | ||
confPath = path.join(__dirname, 'conf.json.EXAMPLE'); | ||
@@ -176,0 +176,0 @@ } |
{ | ||
"name": "jsdoc", | ||
"version": "3.2.0-dev", | ||
"revision": "1366409063892", | ||
"version": "3.2.0", | ||
"revision": "1372032656133", | ||
"description": "An API documentation generator for JavaScript.", | ||
@@ -6,0 +6,0 @@ "keywords": [ "documentation", "javascript" ], |
@@ -383,6 +383,6 @@ /*global env: true */ | ||
// copy static files to outdir | ||
var fromDir = path.join(templatePath, 'static'), | ||
staticFiles = fs.ls(fromDir, 3); | ||
// copy the template's static files to outdir | ||
var fromDir = path.join(templatePath, 'static'); | ||
var staticFiles = fs.ls(fromDir, 3); | ||
staticFiles.forEach(function(fileName) { | ||
@@ -393,2 +393,24 @@ var toDir = fs.toDir( fileName.replace(fromDir, outdir) ); | ||
}); | ||
// copy user-specified static files to outdir | ||
var staticFilePaths; | ||
var staticFileFilter; | ||
var staticFileScanner; | ||
if (conf['default'].staticFiles) { | ||
staticFilePaths = conf['default'].staticFiles.paths || []; | ||
staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf['default'].staticFiles); | ||
staticFileScanner = new (require('jsdoc/src/scanner')).Scanner(); | ||
staticFilePaths.forEach(function(filePath) { | ||
var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter); | ||
extraStaticFiles.forEach(function(fileName) { | ||
var sourcePath = fs.statSync(filePath).isDirectory() ? filePath : | ||
path.dirname(filePath); | ||
var toDir = fs.toDir( fileName.replace(sourcePath, outdir) ); | ||
fs.mkPath(toDir); | ||
fs.copyFileSync(fileName, toDir); | ||
}); | ||
}); | ||
} | ||
@@ -395,0 +417,0 @@ if (sourceFilePaths.length) { |
describe("jsdoc/src/filter", function() { | ||
var filter = new (require('jsdoc/src/filter').Filter)({ | ||
includePattern: new RegExp(".+\\.js(doc)?$"), | ||
excludePattern: new RegExp("(^|\\/)_"), | ||
excludePattern: new RegExp("(^|\\/|\\\\)_"), | ||
exclude: ['.ignore', 'scratch/conf.js'] | ||
@@ -19,2 +19,2 @@ }); | ||
}); | ||
}); | ||
}); |
@@ -5,4 +5,4 @@ describe("@example tag", function() { | ||
doc2 = docSet.getByLongname('y')[0], | ||
txt = 'console.log("foo");\nconsole.log("bar");', | ||
txt2 = '<caption>Example 2</caption>\n1 + 2;'; | ||
txtRegExp = new RegExp('console\\.log\\("foo"\\);[\\r\\n]{1,2}console\\.log\\("bar"\\);'), | ||
txt2RegExp = new RegExp('<caption>Example 2</caption>[\\r\\n]{1,2}1 \\+ 2;'); | ||
@@ -13,3 +13,3 @@ it("creates an 'examples' property on the doclet with the example", function() { | ||
expect(doc.examples.length).toBe(1); | ||
expect(doc.examples).toContain(txt); | ||
expect(doc.examples).toMatch(txtRegExp); | ||
}); | ||
@@ -21,5 +21,5 @@ | ||
expect(doc2.examples.length).toBe(2); | ||
expect(doc2.examples).toContain(txt); | ||
expect(doc2.examples).toContain(txt2); | ||
expect(doc2.examples).toMatch(txtRegExp); | ||
expect(doc2.examples).toMatch(txt2RegExp); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1936648
18067
1
4