221 Commits

Author SHA1 Message Date
Erik Arvidsson
384ccbcf5e Fix inferring return type of var function (#545)
I accidentally broke the detection of the return type in:

```js
var f = function(x: number): boolean {}
```
2016-10-10 17:18:07 -04:00
Tom MacWright
df8efa4d3d Update dependencies (#560)
* also deprecated --private option in favor of --access
2016-10-10 17:16:31 -04:00
Tom MacWright
58c6892c22 Fix parameter sorting: avoid nesting errors and keep params together 2016-09-21 11:47:07 -04:00
Erik Arvidsson
16da8bb225 Infer optional record fields in object types (#547)
This is done with Doctrine's OptionalType, which Doctrine is only
using for parameter types as of now.

Towards #512
2016-09-19 12:54:56 -04:00
Erik Arvidsson
71922c7c8a Handle assignments in document exported (#544)
This improves detection of cases where we have:

```js
export const f = function () {};
export const o = { ... };
```

and similarly indirection using default/named.

```js
const f = function () {};
export {f};
```

Fixes #543
2016-09-19 12:53:18 -04:00
Erik Arvidsson
a71bb03681 Fix sort order alpha (#542)
The old code didn't work correctly with regards to making the sort
aware of memberof.
2016-09-12 16:41:28 -07:00
Erik Arvidsson
e11c1ab3b5 Change document-exported to traverse the code (#533)
* Change document-exported to traverse the code

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes #515

* Move parseToAst to its own module

* Skip non export declarations for speed
2016-09-09 11:07:26 -04:00
Erik Arvidsson
7809669751 Update babel dependencies (#536)
This is to pick up bug fix for #523

Fixes #523
2016-09-08 18:06:34 -07:00
Erik Arvidsson
a5ac4a798c Add a --sort-order option (#535)
Valid values for the `--sort-order` flag are `"source"` (default) and
`"alpha"`. When set to `"alpa"` the order of the entries in the docs
are sorted alphabetically.

Fixes #534
2016-09-08 18:26:02 -04:00
Erik Arvidsson
b1f288dab9 Fix invalid ES6 test with multiple default exports (#529)
The test had 2 default exports. Only 1 is allowed!
Move the second default export to its own test fixture.
2016-09-06 11:27:32 -07:00
Erik Arvidsson
895775df7b Cleanup literal types (#522)
This updates Doctrine to 1.3 to pick up its support for literal types
(doctrine still does not support boolean literals types).

Towards #373
2016-09-04 16:43:28 -04:00
Tom MacWright
0a97e0eccc Continue to close the gap with flow (#520)
* Adds test support for flow difference
* New support for FunctionTypeAnnotation
* New support for ObjectTypeAnnotation
* New support for MixedTypeAnnotation
2016-09-01 16:32:47 -04:00
Erik Arvidsson
6b981e0780 Add the type property to typedef comments (#517)
* Add the type property to typedef comments

When using Flow type aliases we didn't add the `type` property
to the JSDoc comment for the inferred `typedef`.

Fixes #516

* Rename files and update test expectations
2016-09-01 10:12:30 -04:00
Erik Arvidsson
128e75f7cd Update test expectations
The test file needed an update after #503
2016-08-24 12:25:33 -07:00
Erik Arvidsson
2e9376cf46 Fix issue where exported declarations did not set the kind (#503)
* Fix issue where exported declarations did not set the kind

For cases like:

```js
/** */ export class C {}
/** */ export function f {}
/** */ export const k = 42;
```

the kind did not get set properly.

Towards #484

* Infer kind for export default too

Towards #484
2016-08-24 11:03:06 -04:00
Tom MacWright
49347c82e7 Arv document exported (#502)
* Add a flag to document all exported bindings

This adds a boolean flag called `document-exported` (defaults to false)
that effectively adds an empty comment to all exported bindings that do
not already have a JSDoc comment. It also does the same for the
members of exported classes and objects.

```js
export class C {
  method() {}
}
```

Both `C` and `C#method` are now part of the generated documentation.

Related to #424

* Fix lint error

* Rebase and use options pragma in test file

* Create extractor type as a generalized comment/export getter

* Document exported extractor
2016-08-24 10:58:15 -04:00
Erik Arvidsson
662c2f96ed Testing: Support defining options for fixture tests (#492)
This reads the fixture file and looks for

```js
// Options: <JSON>
```

which it uses as the options for documentation.build and
documentation.buildSync.
2016-08-22 17:19:02 -04:00
Tom MacWright
06412eaad8 Turbo v1 (#497) 2016-08-19 12:22:54 -04:00
Tom MacWright
f0af5b86ae Add generator comment to Markdown output (#496) 2016-08-19 10:08:06 -04:00
Anand Thakker
51fa35c2bf Infer name for string-literal property keys (#487) 2016-08-18 16:59:56 -04:00
Tom MacWright
bec5d7b4b8 Refs #451. Any -> any (#491) 2016-08-18 08:01:12 -04:00
Fernando Montoya
12b5451d98 Show chevron icon by default on methods name (#478) 2016-07-18 21:51:35 -04:00
Tom MacWright
9e47ec103b Lint all type-containing tags. Fixes #380 (#477) 2016-07-16 20:26:45 -04:00
Tom MacWright
c7726bbb19 Report bad TOC entries. Fixes #442 (#475) 2016-07-16 19:40:17 -04:00
Fernando Montoya
2f59200378 Fix methods description visibility when clicked on its name (#472)
* Fix methods description visibility when clicked on its name

* Updated test fixtures
2016-07-13 18:15:49 -04:00
Tom MacWright
937ac48154 Forgiving links to 404s 2016-07-06 12:43:36 -04:00
Oscar Dub
c04ea4f818 Fix ToC filter in default theme. (#457)
* Fix filter functionality.

* Add missing semicolon.

* Update tests.

* Replace whitespace to appease tests.

* Tweak whitespace.

* Tweak whitespace.
2016-06-12 17:08:51 -04:00
Tom MacWright
3f08c19533 Move documentation-theme-utils into core
Also:

* Fixes many issues in the default theme
* Moves the default theme from default-theme to default_theme
* Creates a new, robust linker infrastructure that will support
  bare links
* Replaces slugg with github-slugger
* Outputs unknown types as Any. Fixes #451
2016-06-08 12:40:05 -04:00
Tom MacWright
9bda56842f Merge pull request #453 from arv/class-property
Infer class properties
2016-06-07 20:49:09 -04:00
Erik Arvidsson
e13e5d7db3 Infer class properties
Flow/TypeScript has a special syntax for class properties. These
should be grouped under the class that they belong to.
2016-06-07 17:20:55 -07:00
Erik Arvidsson
8c14481260 Treat flow nullable types as nullable
Previously they were treated as optional params which is not the
same thing.
2016-06-07 15:10:39 -07:00
Tom MacWright
367078e34d Fix and combine extension testcase 2016-06-03 13:56:34 -04:00
Tom MacWright
30261d3627 Merge branch 'stevoland-extension-fail' into json-require 2016-06-03 13:49:15 -04:00
Tom MacWright
caa1637880 Fix ability to require() JSON and other files without extension.
Fixes #402
2016-06-03 13:47:42 -04:00
Erik Arvidsson
629ea6f3a8 Add support for inferring private based on the name
This adds a command line flag called `--infer-private` which is a
string (defaults to `^_`) which is used as a regexp for inferring
if a name is private or not.

For example:

```js
/** C */
class C {
  /** I'm public */
  m() {}
  /** I'm private */
  _p() {}
}
```

Fixes #436
2016-06-01 14:40:08 -07:00
Tom MacWright
661f5ceac9 Test corrected export naming. Fixes #387 2016-05-27 17:46:26 -04:00
Tom MacWright
432259d9ea Documentation documentation. Fixes #45 2016-05-27 11:17:55 -04:00
Tom MacWright
51dec0ce2f Update params fixtures 2016-05-26 11:03:52 -04:00
Tom MacWright
907a7a89c5 Test for augments formatting. Fixes #418 2016-05-22 20:04:03 -04:00
Tom MacWright
48b8c6b0fe Expose a sync interface: buildSync
Fixes #389
2016-05-22 19:45:32 -04:00
Tom MacWright
a5e697a192 up-port style fixes 2016-05-20 17:31:55 -04:00
Tom MacWright
4dab786a39 Use explicit --access=public. Fixes #213 2016-05-20 16:49:16 -04:00
Tom MacWright
bb41619c73 Restore default values. Fix sort test 2016-05-05 10:00:57 -04:00
Tom MacWright
3da1ff6dd0 Source-sorting by default (#410)
* Source-sorting by default

Many changes

* Uses a new version of module-deps that exposes a sort key
  we use to sort documentation.
* Adds inference for methods in objects
* Groups events into a separate comment property

* Add jsdoc property. Refs https://github.com/documentationjs/documentation/pull/388#issuecomment-215791547

* Namespaces and paths

* More powerful paths: paths now include name, kind, and scope
* comments now include a 'namespace' property with a formatted namespace

* Fix tests

* Re-ignore fonts

* Nix sourceKey from output

* Pin dependency versions

* Fix module-deps-sortable ref

* Update tests for right deps
2016-04-29 18:09:52 -04:00
Tom MacWright
82388941ef Babel nodes are now frozen, lol, 😢 2016-04-26 13:32:46 -04:00
Tom MacWright
7519a5afef Sort documentation in code order. 2016-04-26 13:11:04 -04:00
Stephen Collings
93739c1899 Add failing test for .jsx dependency 2016-04-04 14:05:13 +01:00
John Firebaugh
ade4f3499b More correct parsing for kind shorthand (@class, @constant, etc)
* Set the `kind` property of the comment, not a property named by the kind.
* Set the `type` property as appropriate for these shorthands.
* Parse @callback as shorthand for @typedef {Function}
2016-03-29 13:21:47 -07:00
John Firebaugh
08d6dc21bd Replace markdown strings with parsed ASTs
This eliminates the need for formatInlineTags and jsdoc-inline-lex, and simplifies the implementation of HTML themes.
2016-03-28 13:19:30 -07:00
Tom MacWright
72708a0b03 Fix export without declaration. Fixes #393 2016-03-25 13:56:16 -04:00