Skip to content

Conversation

@kossnocorp
Copy link

Hey! I started adopting deno doc for date-fns documentation generation. Thank you a lot for the outstanding tool!

After running deno doc --json against date-fns and then type checking the resulting JSON, I found that some TypeScript interfaces and properties were missing, so I added them.

I confirmed that the type changes fix all the problems for date-fns by manually updating node_modules/@deno/doc/types.d.ts.


Here's the script I used to generate and type check the docs JSON: buildDocs.sh.

You can see the TypeScript errors I get: logs.txt.

Here's the source code I got as the result: docs.ts (I apologize for a OneDrive link. GitHub Gist was throwing 500 on an attempt to upload ~200K LoC file).

You can also reproduce the problem if you clone the date-fns repo and run:

git submodule update --recursive --init --remote
pnpm install
cd submodules/docs
DATE_FNS_DIR="../.." ./scripts/buildDocs.sh

You will find the docs.json at submodules/docs/tmp/docs.json and the TypeScript code at submodules/docs/tmp/docs.ts.

You can also rerun the tsc (after running the buildDocs.sh first):

cd submodules/docs
pnpm tsc --noEmit --skipLibCheck --module NodeNext --moduleResolution NodeNext tmp/docs.ts

I made missing properties optional to avoid breaking any libraries that depend on it. I also couldn't figure out the proper constructors interface, so I made it unknown[].

Furthermore, I also added the Docs interface to represent the root data structure of the JSON.

@CLAassistant
Copy link

CLAassistant commented Aug 13, 2025

CLA assistant check
All committers have signed the CLA.

kossnocorp and others added 2 commits August 15, 2025 13:24
After running `deno doc --json` against date-fns and then type checking the resulting JSON, I found that some interfaces and properties were missing, so I added them.

I made missing properties optional to avoid breaking any libraries that depend on it. I also couldn't figure out the proper `constructors` interface, so I made it `unknown[]`.

Furthermore, I also added the `Docs` interface to represent the root data structure of the JSON.
Per @crowlKats, it is defined in CLI and doesn't belong here.

Co-authored-by: Leo Kettmeir <64b2b6d@kettmeir.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants