question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document the public API

See original GitHub issue

Right now when writing dangerfiles, I reference the TypeScript interfaces within the codebase. It would be helpful to bring the public API out into the open somehow.

The reason I bring this up is because I’m introducing Danger-js into some codebases at work and want people to get involved, but it becomes a bit more challenging when the API documentation is within the codebase and spans multiple files.

Would it make sense to maintain an index.d.ts file like Redux does that could also be used to generate a simple API documentation website or something like that?

I wanted to get a conversation started on this to see what some plans are down the line and what I can help with in the near future. 👍

Sidenote: how will danger-js be integrated into the Danger website reference when it hits 1.0? Is there a way we can consider documenting this codebase’s API in a way that would more easily integrate into the official website down the road?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
kwonojcommented, Jan 24, 2017

Would it make sense to maintain an index.d.ts file like Redux does that could also be used to generate a simple API documentation website or something like that?

: I’d actually object with that, it isn’t generally recommended idea to have ambient declaration while source code is TypeScript already with shipping its definition. Probably what we need is documentation pipeline like typedoc (http://typedoc.org/) / tsdoc(http://myaut.github.io/tsload/devel/tsdoc.html)

Say we shipped a danger.d.ts file alongside the flow type definition, would that require a user to write a dangerfile in TypeScript (dangerfile.ts)?

: no, type definition is always opt-in. I’m currently having dangerfile written in js. moreover, if user write dangerfile in typescript. as @orta mentioned, VS code has first-class support for typescript so even you’re writing js, it can pull down dependency’s type definition to provide corresponding language services though.

1reaction
ortacommented, Jan 23, 2017

We do ship docs in the form of flow type annotations inside NPM releases -> https://github.com/danger/danger-js/blob/master/scripts/create-flow-typed-export.js

See it in action here: https://twitter.com/orta/status/793861861930401792 This will need porting to TS at some point though.

And yeah, won’t be 1.0ing until there’s a website with real docs, and all docs need to be generated from source.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Documentation Guide and Best Practices - Stoplight
API docs, or API description documents, are the collection of references, tutorials, and examples that help developers use your API. Your API's documentation...
Read more >
Public API - Read the Docs
This section of the documentation details the public API usable to get details of projects, builds, versions and other details from Read the...
Read more >
Public API Documentation | LooksRare Docs
LooksRare API Documentation.
Read more >
REST API for Documents - Oracle Help Center
The REST API for Documents enables you to interact with folders and files stored in Oracle Content Management Cloud and to create sites...
Read more >
How do you document your APIs? - InfoQ
TurnAPI – TurnAPI is a text-to-HTML conversion tool for web writers that is based on markdown standards. Enunciate: Enunciate is an open-source documentation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found