Skip to content

Feature: SDK Reference generation & hosting#78

Merged
ben-fornefeld merged 41 commits intomainfrom
feature-sdk-reference-generation-inside-e2b-devdocs-eng-3413
Feb 16, 2026
Merged

Feature: SDK Reference generation & hosting#78
ben-fornefeld merged 41 commits intomainfrom
feature-sdk-reference-generation-inside-e2b-devdocs-eng-3413

Conversation

@ben-fornefeld
Copy link
Copy Markdown
Member

@ben-fornefeld ben-fornefeld commented Jan 8, 2026

Note

Medium Risk
Introduces a new CI-driven docs generation pipeline that rewrites docs.json navigation and commits generated content, so misconfiguration could break site navigation or publish incomplete SDK reference docs.

Overview
Adds a new sdk-reference-generator/ TypeScript CLI that clones SDK repos by tag, generates reference docs (TypeDoc/Python pydoc/CLI), normalizes output into versioned docs/sdk-reference/<sdk>/<version>/ MDX, and validates results before finishing.

Introduces GitHub Actions workflows to test the generator on PRs and to sync SDK reference docs on demand or via repository_dispatch, including caching and auto-committing updated docs/sdk-reference/ plus an updated docs.json navigation (replacing the existing SDK Reference anchor with generated dropdown/version/page entries).

Adds supporting config (sdks.config.ts, custom TypeDoc theme, Python requirements.txt), extensive unit tests, and repo ignore rules for generated/intermediate files.

Written by Cursor Bugbot for commit 3fef604. This will update automatically on new commits. Configure here.

- Updated the SDK generation workflow to load SDK configurations from `sdks.json`, improving maintainability.
- Removed individual SDK generator scripts for CLI, Code Interpreter (JS and Python), and Desktop SDKs, consolidating functionality into a single generator script.
- Enhanced the `generate-sdk-reference.sh` script to dynamically handle SDK types and versions.
- Cleaned up the workflow YAML file for better readability and consistency in string formatting.
- Updated `.gitignore` to include `sdk_navigation.json` for generated SDK navigation.
- Added new styles for version switcher in `style.css`, improving UI for SDK and version selection.
- Modified `generate-sdk-nav.js` to group SDKs by family, enhancing navigation structure.
- Updated SDK configurations in `sdks.json` to include family and language attributes for better organization.
- Improved CLI and Python documentation generation scripts for consistency and added frontmatter to markdown files.
- Updated `sdk-reference-sync.yml` to allow version generation for "all" versions by default.
- Modified `generate-sdk-reference.sh` to support a new `--limit` option for controlling the number of versions processed.
- Improved `generate-sdk.sh` to filter versions based on a minimum version requirement and to handle version discovery more effectively.
- Updated `sdks.json` to include `minVersion` attributes for SDKs, ensuring only compatible versions are processed.
- Enhanced common library functions for version management and caching during dependency installation.
- Added verification functions to ensure generated documentation meets quality standards, including checks for empty files and missing frontmatter.
- Implemented a logging utility for better output management during the generation process.
- Created a `.mintignore` file to exclude specific directories from version control.
- Enhanced CLI commands for improved user experience and added options for forced regeneration of existing versions.
- Introduced a new `sdks.config.ts` file to define SDK configurations in TypeScript, enhancing type safety and maintainability.
- Removed the outdated `sdks.json` file to streamline the configuration process.
- Updated relevant code to utilize the new configuration structure, including adjustments in the CLI and navigation logic.
- Improved type definitions for SDK configurations to support additional properties and ensure consistency across the codebase.
@ben-fornefeld ben-fornefeld added the feature New feature label Jan 8, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Jan 8, 2026

Comment thread .github/workflows/sdk-reference-sync.yml Outdated
Comment thread sdk-reference-generator/src/lib/files.ts
Comment thread sdk-reference-generator/src/lib/git.ts
Comment thread sdk-reference-generator/src/lib/cache.ts Outdated
- Updated CSS styles for version switcher to enhance UI consistency and usability.
- Modified GitHub Actions workflow to streamline SDK generation input descriptions and improve summary output.
- Refactored context handling in SDK generation functions for better clarity and maintainability.
- Introduced new utility functions for version validation and normalization, enhancing version management.
- Added tests for cache handling and file processing to ensure robustness in SDK reference generation.
Comment thread sdk-reference-generator/src/lib/files.ts Outdated
- Deleted `package.json` and `pnpm-lock.yaml` files to clean up the project structure as they are no longer needed for SDK reference generation.
- Replaced `basePackage` and `fallbackPackages` with `allowedPackages` in SDK configurations for better clarity and usage.
- Refactored the `generateVersion` function to utilize a new `CheckoutManager` for handling repository checkouts and version switching.
- Simplified the `generatePydoc` function to focus on allowed packages, removing the need for fallback and submodule handling.
- Introduced a new `checkout.ts` file to manage SDK checkouts, enhancing code organization and maintainability.
- Removed obsolete cache handling code and related tests to streamline the project structure.
Comment thread .github/workflows/sdk-reference-sync.yml Outdated
Comment thread sdk-reference-generator/src/lib/install.ts
- Enhanced error handling in the CLI to ensure proper exit on validation failures.
- Improved logging for workflow abort scenarios in the generator, ensuring clearer output.
- Introduced a new function to find the CLI output directory, enhancing the generation process and error reporting for missing markdown files.
Comment thread sdk-reference-generator/src/lib/install.ts
Comment thread sdk-reference-generator/src/generator.ts
Comment thread sdk-reference-generator/src/lib/files.ts
Comment thread sdk-reference-generator/src/navigation.ts
Comment thread sdk-reference-generator/src/lib/git.ts Outdated
Comment thread docs.json Outdated
dobrac
dobrac previously requested changes Jan 13, 2026
Comment thread docs.json Outdated
Comment thread docs.json Outdated
"default": true,
"pages": [
"docs/sdk-reference/js-sdk/v2.9.0/errors",
"docs/sdk-reference/js-sdk/v2.9.0/sandbox",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you have any mechanism for checking if all the urls are correct for SEO?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is an edge case, it should be always in sync but these entries are dev artifacts that i forgot to clean up

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we could add another workflow tho that checks on pr's

Comment thread .github/workflows/sdk-reference-generator-test.yml
Comment thread sdk-reference-generator/configs/typedoc-theme.cjs
Comment thread .github/workflows/sdk-reference-sync.yml
Comment thread sdk-reference-generator/README.md Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"src/sandbox/pty.ts",
"src/errors.ts",
],
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Version range gap leaves js-sdk v1.0.x uncovered

Low Severity

The configOverrides for js-sdk uses "1.0.0" as a semver range which only matches version 1.0.0 exactly. Any hypothetical patch versions like 1.0.1 through 1.0.x would fall through to defaultConfig, which includes template entry points (src/template/index.ts, etc.) that don't exist in 1.0.x versions. This would cause TypeDoc generation to fail. Changing the range to ">=1.0.0 <1.1.0" would close this gap.

Fix in Cursor Fix in Web

return b.localeCompare(a);
}
});
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

sortVersionsDescending mutates input array via Array.sort

Low Severity

sortVersionsDescending uses Array.sort() which sorts in place, mutating the caller's array. While current callers happen to pass newly-created arrays (from filter/map chains), this is a fragile contract — any future caller passing a stored array would get unexpected mutation. Creating a copy with [...versions].sort(...) would make this safe by default.

Fix in Cursor Fix in Web

@ben-fornefeld ben-fornefeld merged commit 291102d into main Feb 16, 2026
7 checks passed
@ben-fornefeld ben-fornefeld deleted the feature-sdk-reference-generation-inside-e2b-devdocs-eng-3413 branch February 16, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants