Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Add typedoc task #103

Merged
merged 10 commits into from
Feb 22, 2017
Merged

Add typedoc task #103

merged 10 commits into from
Feb 22, 2017

Conversation

jason0x43
Copy link
Member

@jason0x43 jason0x43 commented Feb 10, 2017

This PR adds a typedoc task with support for publishing docs to a repo's gh-pages branch. The PR includes code for mitigating some issues with typedoc <= 0.5.5 that should be unnecessary for 0.5.6+.

Running grunt doc will install necessary types and generate API documentation. Adding a --publish-api option will attempt to publish the API docs to the repo's gh-pages branch.

- Running `grunt doc` will generate API docs for the host project in an
  _apidocs/ directory.
- Use '--publish-api' command line flag to enable publishing
- Publishing is further controlled by a 'shouldPush' function that can
  be specified in publishOptions. If this function returns a falsey
  value, the docs won't be published. The default implementation of this
  function is intended for use in a Travis-CI build.

This task currently relies on typedoc master (0.5.5+).
@jsf-clabot
Copy link

jsf-clabot commented Feb 10, 2017

CLA assistant check
All committers have signed the CLA.

@jason0x43
Copy link
Member Author

Oh, I suppose I should have added some tests...

tasks/typedoc.ts Outdated

// TODO: typedoc <= 0.5.5 breaks TS's automatic type discovery, and also leaves out important
// compiler flags like strictNullChecks. Fake the type discovery, and ignore remaining errors.
const typedocInfo = grunt.file.readJSON(require.resolve('typedoc/package.json'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this section were broken out into a function so we could remove it someday in the future

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree -- I actually already did that while writing the tests. 👍

Copy link
Member

@devpaul devpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and it's well compartmentalized so it's inclusion won't have an affect on any other area.

IIRC, Jason said he'd be adding tests

- Add unit tests
- General cleanup
@codecov-io
Copy link

codecov-io commented Feb 10, 2017

Codecov Report

Merging #103 into master will increase coverage by 0.17%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   92.26%   92.44%   +0.17%     
==========================================
  Files          12       13       +1     
  Lines         388      450      +62     
==========================================
+ Hits          358      416      +58     
- Misses         30       34       +4
Impacted Files Coverage Δ
tasks/typedoc.js 93.54% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e82d3f...63921a8. Read the comment docs.

@dylans dylans added this to the 2017.02 milestone Feb 10, 2017
@@ -0,0 +1,97 @@
import ITask = grunt.task.ITask;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can submit an upstream fix for Grunt to not preface their interfaces with I ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could submit a PR, but this seems to be a pretty common practice in DefinitelyTyped (around 450 packages prefix interface names with I). It might be more worthwhile to submit a discussion issue to DT asking if the no-I style (and possibly other styles in the TS Coding Guidelines) should become a general recommendation.

@agubler agubler merged commit 42a2c0a into dojo:master Feb 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants