Skip to content

chore: Add clean and build:clean scripts#408

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

chore: Add clean and build:clean scripts#408
JakeSCahill wants to merge 1 commit into
mainfrom
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 09:18
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 7, 2026

Deploy Preview for redpanda-connect ready!

Name Link
🔨 Latest commit f5d94b5
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-connect/deploys/69d4cbef77ea0b0007c3d3fb
😎 Deploy Preview https://deploy-preview-408--redpanda-connect.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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Two new npm scripts are added to package.json. The clean script removes the docs directory and .cache folder using shell commands. The build:clean script chains the clean script execution followed by the build script, enabling sequential cleanup and rebuild operations without manual invocation of separate commands.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: Add clean and build:clean scripts' accurately and concisely describes the main change: adding two new npm scripts to package.json.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the new scripts, usage examples, and the problem they solve (glob-stream stack overflow).
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.

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-9: Consider cross-platform cleanup for consistency with project tooling.

The clean script on line 7 uses rm -rf, which is Unix-only. While the project already includes cross-env and uses cross-env-shell in the start script, the clean script breaks this pattern and fails on Windows shells. For consistency and contributor experience, consider using rimraf:

Recommended refactor
-    "clean": "rm -rf docs .cache",
+    "clean": "npx rimraf docs .cache",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 7 - 9, The clean script currently uses a Unix-only
command ("clean" script) which fails on Windows; replace its use of `rm -rf docs
.cache` with a cross-platform remover (e.g., `rimraf`) and ensure `rimraf` is
added to devDependencies; update the "clean" script to call `rimraf docs .cache`
(so "build:clean" continues to run `npm run clean && npm run build`) and keep
consistent use of cross-platform tooling alongside the existing
`cross-env`/`cross-env-shell` scripts.
🤖 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`:
- Around line 7-9: The clean script currently uses a Unix-only command ("clean"
script) which fails on Windows; replace its use of `rm -rf docs .cache` with a
cross-platform remover (e.g., `rimraf`) and ensure `rimraf` is added to
devDependencies; update the "clean" script to call `rimraf docs .cache` (so
"build:clean" continues to run `npm run clean && npm run build`) and keep
consistent use of cross-platform tooling alongside the existing
`cross-env`/`cross-env-shell` scripts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d408bca-2a2c-48bd-802c-4ea0afae54e7

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0048e and f5d94b5.

📒 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