23 Commits

Author SHA1 Message Date
Tom Macwright
355038d03e fix: Infer parameters for classes from constructors
Fixes #689
2017-04-24 19:16:34 -04:00
Tom MacWright
25152edeb9 style(prettier): Use prettier for code formatting (#710)
* style(prettier): Use prettier for code formatting

This saves us style issues. Also adds husky and lint-staged for pre-commit testing

Refs https://github.com/documentationjs/documentation/issues/709
2017-04-10 14:25:45 -04:00
Tom MacWright
84c9215811 fix(inference): Refactor membership inference
- Tags with `@lends` are now filtered out early on, so they never
  generate documentation. Lends tags are structural hints only.
- Uses built-in type checks instead of babel-types where appropriate.
- More internal documentation
- Now reuses code for parsing lends between different forms

Previously broken syntax, now working:

```js
/** parent */
export default function() {
  /** child */
  this.a = 1;
}
```
2017-02-24 15:36:55 -05:00
Tom MacWright
631c6925d4 feat(core): Switch to Promises everywhere. Adopt Node v4 ES6 (#648)
* feat(core): Switch to Promises everywhere. Adopt Node v4 ES6

Big changes:

* Uses template strings where appropriate
* Config and argument parsing is unified and there is no such thing
  as formatterOptions anymore. All user-passed options go through
  mergeConfig.
* The node API surface changed (again): `buildSync` is removed,
  building operations return Promises.
* Now using Flow for internal type annotations.

More changes:

* Remove buildSync command
* feat(inference): Partially implement object shorthand support
* Refs #649
* Use Flow annotations to  enforce types
* Keep flow but switch to comment syntax
* Clarify types
* More flow improvements
* Turn server into class
* LinkerStack becomes class too
* Fix comment description type
* Run flow on lint
* Many more flow fixes
* More intense flow refactoring
* Simplify inference steps
* Update inference tests, flow errors down to 1
* Continue refining types
* Fix more flow issues
* Use 'use strict' everywhere
* Make 'ast' property configurable
* Fix many tests
* Fix more tests
* Fix more tests
* Fix augments
* Test Markdown meta support
* Improve test coverage
* Switch back from for of to for for speed
2017-01-27 16:14:19 -05:00
Patrick Gotthardt
9e6bcefacc Resolve imports without extension (#569)
For `--document-exported` we now use Node.js's `require.resolve`
method to resolve the path for modules referenced by other modules.

This fixes issues where we failed to load imported modules which lead to
a null comment being attached which caused an exception.
2016-10-16 11:10:05 -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
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
Tom MacWright
06412eaad8 Turbo v1 (#497) 2016-08-19 12:22:54 -04:00
Tom MacWright
7f032d6c6a Improve internal documentation 2016-06-02 13:22:06 -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
70fbdedf0c Babel 6 upgrade, round 2 2016-02-14 13:15:54 -05:00
Tom MacWright
ac5b04183f Improve internal documentation, upgrade theme-default. Refs #115 2015-10-30 15:44:46 -04:00
Tom MacWright
8886ac6157 Switch from babylon to babel-core. Fixes #201 2015-10-30 12:37:56 -04:00
Tom MacWright
8ca0e0844f Support ES7 class properties 2015-10-27 11:55:55 -04:00
Tom MacWright
c38b91b4e3 Reparse transformed source 2015-10-05 14:19:48 -04:00
Tom MacWright
c50cb7e430 Specify babylon options 2015-10-05 09:45:52 -04:00
Tom MacWright
7b156d8769 Babel! 🙌
cc @jfirebaugh for the review

This was easier than expected.
2015-10-04 21:55:54 -04:00
Tom MacWright
1e4dd63875 Never attach an AST to a trailing comment 2015-10-04 11:39:55 -04:00
Tom MacWright
0a122b51c2 Walk trailing comments. Fixes #93
cc @jfirebaugh for the review
2015-10-04 11:39:55 -04:00
Tom MacWright
f0954859f6 mdast-powered Markdown output 2015-10-03 16:57:37 -04:00
Tom MacWright
de9ff078a6 Remove straggling mentions of streams 2015-09-28 20:40:44 -04:00
Tom MacWright
c24a9b88a4 Enable jsdoc rule and enforce it.
Also:

* Moves reduction out of parsers so that they don't have awkward
  function signatures
2015-09-28 20:36:07 -04:00
Tom MacWright
11043c300c Move more into lib/ 2015-09-26 16:39:44 -04:00