-
Notifications
You must be signed in to change notification settings - Fork 191
Merge main into stable #3796
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
Merge main into stable #3796
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ import { ensureNoUnknownFlags, isDirectExecution, repoRoot, runCommand } from '. | |
| const allowedFlags = new Set(['--types']); | ||
| const superdocRoot = path.join(repoRoot, 'packages/superdoc'); | ||
| const documentApiRoot = path.join(repoRoot, 'packages/document-api'); | ||
| const sdkWorkspaceRoot = path.join(repoRoot, 'packages/sdk'); | ||
| const nodeSdkRoot = path.join(sdkWorkspaceRoot, 'langs/node'); | ||
| const documentApiProject = path.relative(repoRoot, documentApiRoot); | ||
|
|
||
| /** | ||
|
|
@@ -16,9 +18,25 @@ export function ensureDocumentApiBuild(run = runCommand) { | |
| run('pnpm', ['exec', 'tsc', '-b', documentApiProject], 'Build document-api dist for CLI runtime'); | ||
| } | ||
|
|
||
| /** | ||
| * Ensures the Node SDK package resolves for CLI builds. | ||
| * | ||
| * The CLI imports `@superdoc-dev/sdk` for `doc.preset.*`; Bun resolves that | ||
| * package through its dist export while compiling native binaries. SDK | ||
| * generation exports the CLI contract first, which builds document-api dist | ||
| * for clean checkouts. | ||
| * | ||
| * @returns {void} | ||
| */ | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Building the Node SDK dist here makes Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| /** | ||
| * Ensures the CLI's runtime dependencies are freshly built: | ||
| * - document-api contract/catalog dist consumed by CLI + SDK generation | ||
| * - document-api contract/catalog dist consumed by CLI metadata export | ||
| * - Node SDK dist consumed by `doc.preset.*` | ||
| * - packaged `superdoc` for the v1 runtime path | ||
| * | ||
| * `--types` performs the full published build so package type exports exist. | ||
|
|
@@ -32,7 +50,7 @@ export function ensureSuperdocBuild(options = {}, run = runCommand) { | |
| const scriptName = includeTypes ? 'build:es' : 'build:dev'; | ||
| const label = includeTypes ? 'Build packaged SuperDoc runtime and types' : 'Build packaged SuperDoc runtime'; | ||
|
|
||
| ensureDocumentApiBuild(run); | ||
| ensureNodeSdkBuild(run); | ||
| run('pnpm', ['--prefix', superdocRoot, 'run', scriptName], label); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/*andpackages/sdk/tools/intent_dispatch_generated.py. After a document-api or CLI metadata edit, a developer runningpnpm --prefix apps/cli run buildor 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 👍 / 👎.