Skip to content

Conversation

@gene9831
Copy link
Collaborator

@gene9831 gene9831 commented Nov 26, 2025

Summary by CodeRabbit

  • Chores
    • Refactored build and deployment workflows to streamline documentation generation and artifact management.
    • Updated build processes to improve consistency and efficiency in how project components and documentation are packaged during releases.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

This pull request refactors the build process by extracting build orchestration logic from GitHub Actions workflows into dedicated Node.js scripts. The workflows are simplified to invoke the new scripts, and package.json is updated to reference them. A --nocomponents flag allows conditional component builds. The package name is changed to "robot-root".

Changes

Cohort / File(s) Change Summary
Workflow simplification
.github/workflows/auto-publish.yml, .github/workflows/dispatch-publish.yml
Removed Build playground and Copy playground steps; replaced direct docs build with pnpm build:docs --nocomponents command; relocated PLAYGROUND_BASE environment variable into the Build VitePress step.
Build script orchestration
scripts/build-docs.js
New Node.js script that orchestrates sequential builds: optionally skips component build if --nocomponents flag is present, then builds playground and docs; includes error handling and progress logging.
Artifact copy script migration
scripts/copy-playground.js
Refactored to accept source and destination paths as CLI arguments instead of hard-coded paths; added argument validation, existence checks, and informational logging; preserves recursive copy behavior.
Build script configuration
package.json
Updated package name from "root" to "robot-root"; changed build:docs script to use node scripts/build-docs.js; changed postbuild:docs script to use node scripts/copy-playground.js packages/playground/dist docs/dist/playground.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant GHA as GitHub Actions
    participant BuildDocs as build-docs.js
    participant Pnpm
    participant CopyPlayground as copy-playground.js

    User->>GHA: Trigger workflow
    GHA->>BuildDocs: Execute build:docs --nocomponents
    
    rect rgb(200, 230, 201)
    Note over BuildDocs: Check --nocomponents flag
    alt Flag not present
        BuildDocs->>Pnpm: pnpm build:components
        Pnpm-->>BuildDocs: ✓ complete
    end
    end
    
    BuildDocs->>Pnpm: pnpm build:playground
    Pnpm-->>BuildDocs: ✓ complete
    
    BuildDocs->>Pnpm: pnpm -F docs build
    Pnpm-->>BuildDocs: ✓ complete
    
    BuildDocs-->>GHA: ✓ success
    
    GHA->>CopyPlayground: Execute copy-playground.js [source] [dest]
    
    rect rgb(220, 240, 255)
    Note over CopyPlayground: Parse & validate arguments
    CopyPlayground->>CopyPlayground: Verify source exists
    CopyPlayground->>CopyPlayground: Verify dest parent exists
    end
    
    CopyPlayground->>CopyPlayground: cpSync(source, dest, recursive)
    CopyPlayground-->>GHA: ✓ success
    
    GHA->>GHA: Verify build output
    GHA->>GHA: Deploy docs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Script argument parsing: The new scripts introduce CLI argument handling and validation logic in copy-playground.js and conditional build logic in build-docs.js; verify correctness of path resolution and error handling
  • Error handling paths: Both new scripts include try-catch and validation checks; ensure all failure modes exit with appropriate codes and messages
  • Workflow transitions: Confirm that the simplified workflows correctly invoke the new scripts with appropriate flags and environment variable placement
  • Package.json changes: Verify the new script invocations and the package name change don't break downstream dependencies or tooling

🐰 Build scripts hop into place so neat,

Workflows grow simpler, oh what a treat!

Components skip when we ask so kindly,

Playground copies go smoothly, brightly! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: updating build scripts and improving the copy-playground script, which aligns with the workflow files, build script refactoring, and script enhancements in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
scripts/copy-playground.js (1)

2-35: CLI handling and validation look good; consider making log messages path-agnostic

The argument parsing, path resolution, and existence checks are solid for this use case. The only minor nit is that the log lines still hard‑code playground dist to docs/dist/playground, even though the script now accepts arbitrary source/dest. If you plan to reuse this script elsewhere, consider logging the actual paths instead, for example:

console.log(`Copying from ${source} to ${dest}...`)
cpSync(source, dest, { recursive: true, force: true })
console.log(`✓ Successfully copied from ${source} to ${dest}`)
scripts/build-docs.js (1)

3-25: Confirm that --nocomponents is actually reaching this script from pnpm build:docs

The sequencing here (components → playground → docs) and the skipComponents flag look good. The workflows invoke this via pnpm build:docs --nocomponents; depending on pnpm’s semantics, flags starting with - may require a -- separator to be passed through to the script.

If pnpm is not forwarding --nocomponents, this script will still run pnpm build:components, meaning components get built twice in CI (once via pnpm build, once here). Please double‑check pnpm’s run argument‑forwarding; if needed, update workflows to:

pnpm build:docs -- --nocomponents
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b775495 and f521458.

📒 Files selected for processing (5)
  • .github/workflows/auto-publish.yml (1 hunks)
  • .github/workflows/dispatch-publish.yml (1 hunks)
  • package.json (1 hunks)
  • scripts/build-docs.js (1 hunks)
  • scripts/copy-playground.js (1 hunks)
🔇 Additional comments (3)
.github/workflows/dispatch-publish.yml (1)

85-91: Docs step depends on --nocomponents being forwarded to scripts/build-docs.js

This workflow now calls pnpm build:docs --nocomponents after having already run pnpm build (components). That’s consistent with the intent of scripts/build-docs.js, which conditionally skips the components build based on --nocomponents.

As noted in the script, please verify that pnpm indeed passes --nocomponents through to the build:docs script; otherwise components will still be rebuilt here. If pnpm requires a separator, this step may need to be:

run: pnpm build:docs -- --nocomponents
package.json (1)

2-11: Docs build/postbuild script wiring looks consistent with the new Node helpers

Renaming the root package to "robot-root" is fine, and the new build:docs / postbuild:docs scripts cleanly delegate to the Node helpers introduced in scripts/build-docs.js and scripts/copy-playground.js. The hard‑coded arguments for postbuild:docs match the current playground/dist layout and the workflow expectations.

No issues from a build orchestration standpoint.

.github/workflows/auto-publish.yml (1)

106-112: Same --nocomponents forwarding concern in Auto Publish workflow

This step correctly reuses pnpm build:docs --nocomponents and sets VITEPRESS_BASE / PLAYGROUND_BASE per dist tag, matching the new build-docs script design. As with dispatch-publish.yml, the effectiveness of --nocomponents hinges on pnpm passing the flag through to scripts/build-docs.js.

Please confirm pnpm’s behavior here and, if necessary, switch to:

run: pnpm build:docs -- --nocomponents

to ensure the flag is seen by the script and components aren’t rebuilt.

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.

1 participant