chore: Add clean and build:clean scripts#408
Conversation
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
✅ Deploy Preview for redpanda-connect ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughTwo new npm scripts are added to Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package.json (1)
7-9: Consider cross-platform cleanup for consistency with project tooling.The
cleanscript on line 7 usesrm -rf, which is Unix-only. While the project already includescross-envand usescross-env-shellin thestartscript, thecleanscript breaks this pattern and fails on Windows shells. For consistency and contributor experience, consider usingrimraf: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.
Summary
npm run cleanscript to removedocs/and.cache/directoriesnpm run build:cleanscript that cleans then builds in one commandThis 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:
Or manually clean first:
🤖 Generated with Claude Code