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

OpenMRS: OpenMRSOptions is missing in docs #937

Open
josephjclark opened this issue Jan 24, 2025 · 5 comments · May be fixed by #940
Open

OpenMRS: OpenMRSOptions is missing in docs #937

josephjclark opened this issue Jan 24, 2025 · 5 comments · May be fixed by #940
Assignees

Comments

@josephjclark
Copy link
Collaborator

OpenMRS docs currently looks like this for http.request:

Image

But the link to OpenMRSOptions doesn't go anywhere.

For some reason the typedef has not been generated into the docs.

Is this a bug in the docs builder? Do we need to annotate the typedef with @public? (I don't think so, I think we should automatically document all typedefs. Is it because its in the http file?

Also: this type is badly named. It's not OpenMRSOptions, which is generic and meaningless. It's more like RequestOptions.

Tip: In /tools/build/src/commands/docs.ts is the code which parses the jsdocs and generates the markdown. If there's a docs builder bug, you'll see it in there.

Tip: If you run pnpm build docs from inside the openmrs package, it should build documentation into markdown for you. Check in the docs folder and you'll see if. If the OpenMRSOptions interface is defined in there, it'll be available on the docsite. That's how you know this is fixed.

@github-project-automation github-project-automation bot moved this to New Issues in v2 Jan 24, 2025
@josephjclark
Copy link
Collaborator Author

@PiusKariuki here's a real challenge for you. Unrelated to you work, while looking at your PR, I noticed this bug we have in production.

Could you take a couple of hours and have a look, see if you can work out what this is? You'll be digging into an area of code that's not well documented or explained anywhere. Don't worry if it's beyond your expertise, and please track your time whether you think you can fix this or not. But If you could take a look, I'd really appreciate it.

You can ask questions here or over email or we can arrange a call this afternoon if you're totally lost.

@PiusKariuki
Copy link
Collaborator

Yeah I'll look into this @josephjclark. If I run into any roadblocks I'll be sure to let you know.

@PiusKariuki PiusKariuki self-assigned this Jan 25, 2025
@PiusKariuki
Copy link
Collaborator

@josephjclark this works when I annotate the typedef with public

@josephjclark
Copy link
Collaborator Author

@PiusKariuki that's strange - I expect typedefs to be public by default. The only reason to declare a a typedef is to have it appear in the docsite.

In tools/build/src/commands/docs.ts, we have this:

  // Filter items which are not marked as @public
  templateData = templateData.filter(
    data => data.kind === 'typedef' || data.access === 'public'
  );

The intention of that code is to ensure that typedefs have markdown generated. I've just done a super quick search and I can see that that's not happening. Obviously we've got this problem in openMRS but I see it in cht too.

Can you spare a little more time to work out why this code isn't working? If you just run the docs builder for cht you should have a small enough dataset to debug.

If the docs.ts code is impenetrable to you don't worry, and please don't spend more than a couple of hours on this. I'm just hoping that there's some silly fix we can make to docs.ts to restore all the proper typedefs at once.

@PiusKariuki
Copy link
Collaborator

@josephjclark sure, I'll look into this.

@PiusKariuki PiusKariuki linked a pull request Jan 26, 2025 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

Successfully merging a pull request may close this issue.

2 participants