Merge main into stable#3796
Conversation
The CLI native release build now prepares the Node SDK before Bun compiles CLI binaries. `doc.preset.*` imports SDK preset code, so a fresh release checkout needs generated SDK sources and the SDK dist package before `bun build --compile`. - Adds SDK artifact generation and Node SDK build to the CLI runtime prep helper. - Keeps the existing packaged SuperDoc runtime prep in the same release path. - Verified with the focused CLI script test and a host native CLI build. Co-authored-by: Caio Pizzol <caio@superdoc.dev> Source-PR: #3795 Closes #3795 Ported-From-Source-Repo: superdoc/orbit Ported-From-Source-Commit: debcde03b29c91662fc4d8b1bbfb0032ca555c1d Ported-Public-Prefix: superdoc/public
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b39c6e413
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| */ | ||
| export function ensureNodeSdkBuild(run = runCommand) { | ||
| run('pnpm', ['--prefix', sdkWorkspaceRoot, 'run', 'generate'], 'Generate SDK artifacts for CLI runtime'); | ||
| run('pnpm', ['--prefix', nodeSdkRoot, 'run', 'build'], 'Build Node SDK for CLI runtime'); |
There was a problem hiding this comment.
Stage SDK tool assets for packaged CLI builds
Building the Node SDK dist here makes @superdoc-dev/sdk resolvable, but it still does not make the SDK legacy preset's tools/*.json assets available in the bundled/native CLI layout. The CLI exposes doc.preset.* with the SDK default preset still being legacy, and that preset reads the tool catalog from disk relative to the compiled module; apps/cli only copies prompt files, so packaged/native calls such as superdoc preset get-tools --provider openai without --preset core can pass the build and then fail at runtime with missing tool assets. Please copy/embed the SDK tool artifacts as part of this ensure step or switch the packaged default path to an embedded asset source.
Useful? React with 👍 / 👎.
| * @returns {void} | ||
| */ | ||
| export function ensureNodeSdkBuild(run = runCommand) { | ||
| run('pnpm', ['--prefix', sdkWorkspaceRoot, 'run', 'generate'], 'Generate SDK artifacts for CLI runtime'); |
There was a problem hiding this comment.
Avoid full SDK generation in CLI prebuild
This runs the workspace SDK generator from every CLI prebuild/pretest path, but that generator writes more than the Node SDK files needed by the CLI: it also rewrites tracked artifacts such as apps/mcp/src/generated/* and packages/sdk/tools/intent_dispatch_generated.py. After a document-api or CLI metadata edit, a developer running pnpm --prefix apps/cli run build or tests will now silently mutate unrelated generated outputs and can leave CI/release jobs building from uncommitted files. Please use a Node-SDK-only generation path here, or keep unrelated generated outputs in a non-mutating check.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in superdoc-cli v0.21.0 The release is available on GitHub release |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🎉 This PR is included in superdoc-sdk v1.20.0 |
|
🎉 This PR is included in @superdoc-dev/mcp v0.16.0 The release is available on GitHub release |
Summary
merge/main-into-stable-2026-07-05fromstablemaininto the candidate branchstableAuto-created by promote-stable workflow.