Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "Redpanda documentation",
"license": "ISC",
"scripts": {
"clean": "rm -rf docs .cache",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Use a cross-platform solution for the clean script.

The rm -rf command is Unix/Linux/macOS specific and will fail on Windows, blocking Windows developers from using this script.

🔧 Proposed fix using rimraf for cross-platform compatibility

Install rimraf as a dev dependency:

npm install --save-dev rimraf

Then update the script:

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

Alternatively, use del-cli:

npm install --save-dev del-cli
-    "clean": "rm -rf docs .cache",
+    "clean": "del docs .cache",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 7, The clean script in package.json uses the
Unix-specific command "rm -rf" which breaks on Windows; replace it with a
cross-platform tool (e.g., add rimraf or del-cli as a devDependency) and update
the "clean" npm script to call that tool (e.g., use "rimraf docs .cache" or
"del-cli docs .cache") so the "clean" script works on all platforms; ensure you
add the chosen package to devDependencies and update the "clean" entry in
package.json accordingly.

"build": "antora --to-dir docs --fetch local-antora-playbook.yml",
"build:clean": "npm run clean && npm run build",
"serve": "wds --node-resolve --open / --watch --root-dir docs --port 5002",
"start": "cross-env-shell LIVERELOAD=true npx gulp"
Comment on lines +7 to 11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify which directories are created by build vs. start scripts

# Check the playbook configuration
echo "=== Checking playbook configuration ==="
if [ -f "local-antora-playbook.yml" ]; then
  echo "Playbook exists. Checking output.dir configuration:"
  rg -A 2 "^output:" local-antora-playbook.yml || echo "No output.dir configured (defaults to ./build/site for gulp)"
else
  echo "Playbook file not found"
fi

# Check what directories currently exist
echo -e "\n=== Current output directories ==="
ls -la | rg "^d.*(docs|build|\.cache)" || echo "No output directories found"

# Check gulpfile for confirmation
echo -e "\n=== Gulpfile output directory logic ==="
rg -A 1 "outputDir.*=.*playbook" gulpfile.js

Repository: redpanda-data/cloud-docs

Length of output: 480


Major: Inconsistent output directories between build and start workflows.

The clean script removes docs/ and .cache/, which aligns with the build script (Line 8: --to-dir docs). However, the start script (Line 11) uses gulp with the local-antora-playbook.yml configuration. Since the playbook does not set an explicit output.dir, gulp defaults to ./build/site. This means:

  • npm run clean && npm run build ✅ works correctly
  • npm run clean && npm start ❌ leaves stale files in ./build/site

The clean script should be updated to remove both output directories:

Proposed fix
-    "clean": "rm -rf docs .cache",
+    "clean": "rm -rf docs build .cache",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"clean": "rm -rf docs .cache",
"build": "antora --to-dir docs --fetch local-antora-playbook.yml",
"build:clean": "npm run clean && npm run build",
"serve": "wds --node-resolve --open / --watch --root-dir docs --port 5002",
"start": "cross-env-shell LIVERELOAD=true npx gulp"
"clean": "rm -rf docs build .cache",
"build": "antora --to-dir docs --fetch local-antora-playbook.yml",
"build:clean": "npm run clean && npm run build",
"serve": "wds --node-resolve --open / --watch --root-dir docs --port 5002",
"start": "cross-env-shell LIVERELOAD=true npx gulp"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 7 - 11, The clean script currently removes docs
and .cache but not the gulp default output, so update the "clean" npm script to
also remove the gulp output directory (./build/site) to keep build and start
workflows consistent; modify the "clean" value in package.json (referencing the
"clean" script) to delete docs, .cache and build/site so both npm run build and
npm start produce fresh outputs when preceded by npm run clean.

},
Expand Down