ts-morph icon indicating copy to clipboard operation
ts-morph copied to clipboard

Documentation: Auto-generate a structures reference?

Open ajvincent opened this issue 2 years ago • 3 comments

I've been rummaging around the ts-morph.com website for months, and I just keep wanting to see a reference directory on the structures ts-morph uses. Say, at docs/references/structures, I would like to see a list of fields on the structures at a glance, with hyperlinks to other structures which each field references.

This might also be a good use case for dogfooding ts-morph: using it to scan its own source code after a build, in packages/ts-morph/src/structures to create Markdown pages.

Usually, what I end up doing is abusing Visual Studio Code with tricks like this:

export type ResolveTypeUnion<T> = Pick<T, keyof T>;
type A = ResolveTypeUnion<ts.ClassDeclarationStructure>;
//   ^?

... and then hovering over "A" to see what happens. It's not very efficient.

ajvincent avatar Mar 25 '23 05:03 ajvincent

I'm doing some experiments on this which may prove fruitful.

ajvincent avatar Mar 25 '23 17:03 ajvincent

https://ajvincent.github.io/ts-morph-structures/reference/structure-types.html

ajvincent avatar Feb 08 '24 06:02 ajvincent

... then I got API Extractor and API Documenter working for my project, and I'm not looking back. Wow, are they nice.

ajvincent avatar Feb 21 '24 14:02 ajvincent