Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Autogenerate JS Core API Docs #4021

Closed
lidel opened this issue Jan 21, 2022 · 6 comments
Closed

Autogenerate JS Core API Docs #4021

lidel opened this issue Jan 21, 2022 · 6 comments
Assignees
Labels
effort/days Estimated to take multiple days, but less than a week kind/maybe-in-helia need/triage Needs initial labeling and prioritization P1 High: Likely tackled by core team if no one steps up topic/docs Documentation

Comments

@lidel
Copy link
Member

lidel commented Jan 21, 2022

Problem

Right now JS Core API docs are maintained by hand as a directory with bunch of Markdown files.

This is unsustainable, docs often get out of date (#4013, #3990, #4014, #3911, etc), wasting everyone's time.

Proposed solution

cc @achingbrain @BigLep + @hugomrdias if there is any prior art for doing this in JS land

@lidel lidel added P1 High: Likely tackled by core team if no one steps up topic/docs Documentation need/triage Needs initial labeling and prioritization effort/days Estimated to take multiple days, but less than a week labels Jan 21, 2022
@hugomrdias
Copy link
Member

The end goal was always to use https://typedoc.org/ to gen the docs, we didnt do it because the output wasn't always the best because of legacy cjs code.
You can check nft.storage client workflow https://github.com/nftstorage/nft.storage/blob/main/.github/workflows/client.yml#L79 and output https://nftstorage.github.io/nft.storage/client

@galargh
Copy link

galargh commented Feb 1, 2022

I think this might be a pretty interesting task for one of our Dev Productivity Launchpad Cadets. According to the schedule, they'll start working on issues after Feb 21. Would that timeline work here?

@laurentsenta
Copy link

laurentsenta commented Mar 2, 2022

👋 I took a quick shot at this issue to try to move it forward, without much success yet,

It's not straightforward to point typedoc to ipfs-core/index.ts and get a "good looking" documentation,
it looks like typedoc doesn't resolve references import, so all we get are empty API types. (also some of our interfaces seemed to break typedoc's parser)

There is a monorepo configuration with typedoc, but I couldn't get it to work. It looks like our setup confuses typedoc: it tries to load our index.js and find its source typescript. Which doesn't exist.

I did manage to generate an equivalent of the current doc by pointing typedoc at the ipfs-core-types folder and marking every ts file as an entry point.

I see a few options:

  • Invest into typedoc to make it work with our codebase and use it /everywhere/,
  • Build our own solution, just the minimum that works with this codebase,
  • Look into other tools such as jsdoc with better-docs plugin.

Notes with all the commands & experiments I ran:

https://gist.github.com/laurentsenta/aa7c70a0b83880abe9b6ad0ffd34d488

@SgtPooki SgtPooki self-assigned this Mar 15, 2022
@SgtPooki
Copy link
Member

@laurentsenta @galargh

Laurent, are you planning on taking this on?

@laurentsenta
Copy link

@SgtPooki Not right now, feel free to take over,

@SgtPooki SgtPooki removed their assignment May 19, 2022
@SgtPooki SgtPooki self-assigned this May 17, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/days Estimated to take multiple days, but less than a week kind/maybe-in-helia need/triage Needs initial labeling and prioritization P1 High: Likely tackled by core team if no one steps up topic/docs Documentation
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants