Skip to content

chore: Add clean and build:clean scripts#1659

Open
JakeSCahill wants to merge 1 commit intomainfrom
add-clean-build-script
Open

chore: Add clean and build:clean scripts#1659
JakeSCahill wants to merge 1 commit intomainfrom
add-clean-build-script

Conversation

@JakeSCahill
Copy link
Copy Markdown
Contributor

Summary

  • Add npm run clean script to remove docs/ and .cache/ directories
  • Add npm run build:clean script that cleans then builds in one command

This prevents the glob-stream stack overflow error that occurs when the docs/ directory accumulates too many files from previous builds.

Usage

When you encounter the stack overflow error during build:

npm run build:clean

Or manually clean first:

npm run clean
npm run build

🤖 Generated with Claude Code

Add npm scripts to clean build artifacts before building. This prevents
the glob-stream stack overflow error that occurs when the docs/ directory
accumulates too many files from previous builds.

- npm run clean: removes docs/ and .cache/ directories
- npm run build:clean: cleans then builds in one command
@JakeSCahill JakeSCahill requested a review from a team as a code owner April 7, 2026 08:41
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Two npm scripts were added to package.json. The clean script removes the docs and .cache directories. The build:clean script sequentially executes the clean script followed by the build script.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. It omits required template sections (Description with JIRA ticket, Page previews, and Checks) that are specified in the repository's description template. Add the missing template sections: include the JIRA ticket link in the Description section, Page previews section, and complete the Checks checkboxes to indicate the type of change (e.g., Small fix).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding clean and build:clean scripts to package.json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-clean-build-script

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.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for redpanda-docs-preview ready!

Name Link
🔨 Latest commit cb5e840
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-docs-preview/deploys/69d4c3543b077a0008fde61f
😎 Deploy Preview https://deploy-preview-1659--redpanda-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
package.json (1)

7-7: Use a cross-platform delete utility in the clean script.

The rm -rf command is POSIX-only and will fail on Windows CMD. The project already uses cross-env for portability, so adding rimraf (a cross-platform alternative) aligns with that pattern.

Proposed update
-    "clean": "rm -rf docs .cache",
+    "clean": "rimraf docs .cache",

Then add rimraf to devDependencies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 7, Update the npm "clean" script in package.json to use
a cross-platform delete tool instead of the POSIX-only "rm -rf": replace the
current "clean" script value ("rm -rf docs .cache") with a rimraf-based command
(e.g., "rimraf docs .cache"), and add "rimraf" to devDependencies so installs
include the tool; ensure the change targets the "clean" script entry and the
package.json devDependencies section.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@package.json`:
- Line 7: Update the npm "clean" script in package.json to use a cross-platform
delete tool instead of the POSIX-only "rm -rf": replace the current "clean"
script value ("rm -rf docs .cache") with a rimraf-based command (e.g., "rimraf
docs .cache"), and add "rimraf" to devDependencies so installs include the tool;
ensure the change targets the "clean" script entry and the package.json
devDependencies section.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6547d890-6744-414c-93f6-be81898b7f02

📥 Commits

Reviewing files that changed from the base of the PR and between 7d06160 and cb5e840.

📒 Files selected for processing (1)
  • package.json

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