Skip to content

chore: Generate API docs#1546

Open
emincihangeri wants to merge 13 commits intomainfrom
chore-add-api-reference
Open

chore: Generate API docs#1546
emincihangeri wants to merge 13 commits intomainfrom
chore-add-api-reference

Conversation

@emincihangeri
Copy link
Contributor

Context

Closes SAP/ai-sdk-js-backlog#453.

What this PR does and why it is needed

@hyperspace-insights
Copy link
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Add API Documentation Generation Workflow

🔧 Chore: Automated API Documentation Generation

This PR introduces automated API documentation generation using TypeDoc, enabling automatic publishing of API reference documentation to the SAP/ai-sdk repository.

Changes

Documentation Generation

  • tsconfig.typedoc.json: Created TypeDoc configuration including all SDK packages (ai-api, core, document-grounding, foundation-models, langchain, orchestration, prompt-registry, and rpt) with custom output path and validation settings
  • scripts/generate-docs.ts: Implemented comprehensive documentation generation script with features including:
    • GitHub Pages compatibility adjustments
    • HTML link transformation to remove underscore prefixes
    • Search and navigation data compression/decompression
    • Copyright footer insertion for all generated HTML files
    • Validation of symbol references in JSDoc comments

CI/CD Integration

  • .github/workflows/api-docs.yml: Added dedicated workflow to automatically push generated API documentation to the SAP/ai-sdk repository when changes are detected in knowledge-base/api-reference/ or on version branches
  • .github/workflows/build.yml: Enhanced build workflow with API documentation generation check to ensure docs can be built successfully

Dependencies

  • package.json: Added TypeDoc (^0.28.16) and Execa (^5.0.0) dependencies, plus new doc script for documentation generation
  • pnpm-lock.yaml: Updated lockfile with TypeDoc and Execa package entries

GitHub Issues


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.17.61 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback


💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pp] Mark node imports with node:fs. That makes it easier to differentiate from other imports + it is more secure.
[pp] I would prefer if we could apply the async functions instead of the sync ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the implementation accordingly. Should I also do the similar changes in other script files in this PR?

Copy link
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, I guess this is taken from Cloud SDK right? I have some small questions...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[req] Can't we do something like this:

Suggested change
htmlPaths.map((filePath: string) => removeUnderlinePrefixFromFileName(filePath))
htmlPaths.map((filePath: string) => {
const newPath = removeUnderlinePrefix(filePath);
return rename(filePath, newPath)
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it has a little different functioning here. Because we don't remove the first underscore from the filePath, rather the leading underscores from the fileName. (i.e. path/_fileName -> path/fileName). But I can still reuse the function removeUnderlinePrefix there as you suggested.

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.

2 participants

Comments