Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: generate api json for the typings #35

Open
chrisgrieser opened this issue Feb 24, 2024 · 5 comments
Open

FR: generate api json for the typings #35

chrisgrieser opened this issue Feb 24, 2024 · 5 comments

Comments

@chrisgrieser
Copy link
Contributor

The Obsidian team uses API Extractor to create an api.json from their typings: https://github.com/obsidianmd/obsidian-developer-docs/tree/main/config

It would be very useful if your extended typings would also have a json file, as it would allow people like me to build API searches for that.

I tried to use the API extractor to create the api json myself from your extended typings, but for some reason, the output was lacking the actual content. I am not entirely sure what the reason is, since I think I have set up everything correctly – I suspect that some api-extractor-specific doc comments are missing somewhere in your typings. (see this discord message and a few of the messages above.)

@Fevol
Copy link
Owner

Fevol commented Jul 30, 2024

@chrisgrieser I'm really sorry for the delay with this. In truth, I did try in February to get this working, but I wasn't able to make any progress.

After trying the 2.0.0 release today, it finally does spit out a json.

Could you confirm whether this is already somewhat correct? (There are some warnings I'd still have to fix)

obsidian-typings.api.json

@chrisgrieser
Copy link
Contributor Author

Well, since I am not really sure what the output is supposed to look like, I cannot really judge whether it's correct. It does appear to be usable though, I guess?

@chrisgrieser
Copy link
Contributor Author

Before I am able to integrate this in my Alfred workflow, this would need to be available somewhere in the repo though (ideally auto-updated on any changes)

@Fevol
Copy link
Owner

Fevol commented Aug 2, 2024

Before I am able to integrate this in my Alfred workflow, this would need to be available somewhere in the repo though (ideally auto-updated on any changes)

I have added the build set-up, and it should hopefully be added to the assets of the next release. Does fetching from https://github.com/Fevol/obsidian-typings/releases/download/VERSION/obsidian-typings.api.json work for you, or would it have to be in the github repository itself?

@chrisgrieser
Copy link
Contributor Author

chrisgrieser commented Aug 10, 2024

Well, ideally it'd be something like https://github.com/Fevol/obsidian-typings/releases/download/latest/obsidian-typings.api.json, so my workflow does not need to constantly update to accommodate for the typings' updates. (As opposed to linking to releases via latest, downloading assets from a release does not seem to support latest.)

Alternatively, and maybe an even better solution, could be if there was a simple markdown file containing all the changes. Before you started using an index file a few weeks ago, there was simply one big .json file one could open and use cmd+f in. Now, there is no such simple way to search the typings other than installing them via npm I think?

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

No branches or pull requests

2 participants