chore: refine shared build targets and npm scripts across docs and academy repos - #1195
chore: refine shared build targets and npm scripts across docs and academy repos#1195banana-three-join wants to merge 1 commit into
Conversation
Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
📝 WalkthroughWalkthroughThe change updates npm scripts and development dependencies for Hugo builds and Markdown linting. Makefile targets now invoke these scripts, validate Go and dependencies, support link checks, and remove the obsolete formatting target. ChangesDevelopment workflow updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Line 26: Replace the GitHub topic URL in the Makefile comment with the
repository URL for meshery-extensions/meshery-academy, keeping the surrounding
comment unchanged.
In `@package.json`:
- Around line 33-39: Pin markdownlint-cli2 to the exact compatible latest
release, 0.23.2, in package.json and regenerate package-lock.json accordingly.
Update the update:pkg:dep script to pass --save-exact for markdownlint-cli2
while preserving the existing update behavior for the other dependencies.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 81aec1b4-1b19-4472-91f4-51597c06681f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
Makefilepackage.json
| # | ||
| # - https://github.com/layer5io/docs | ||
| # - https://github.com/meshery/meshery/tree/master/docs | ||
| # - https://github.com/topics/meshery-academy |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the Academy repository URL.
Line 26 links a GitHub topic page. It does not identify the repository that must receive the synchronized Makefile change. Use the meshery-extensions/meshery-academy repository URL instead. GitHub identifies that repository as the Meshery Academy project and shows that it contains a Makefile. (github.com)
Proposed fix
-# - https://github.com/topics/meshery-academy
+# - https://github.com/meshery-extensions/meshery-academy📝 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.
| # - https://github.com/topics/meshery-academy | |
| # - https://github.com/meshery-extensions/meshery-academy |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` at line 26, Replace the GitHub topic URL in the Makefile comment
with the repository URL for meshery-extensions/meshery-academy, keeping the
surrounding comment unchanged.
| "update:pkg:dep": "npm install --save-dev autoprefixer@latest postcss@latest postcss-cli@latest markdownlint-cli2@latest", | ||
| "update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest" | ||
| }, | ||
| "devDependencies": { | ||
| "autoprefixer": "^10.4.23", | ||
| "autoprefixer": "^10.5.0", | ||
| "hugo-extended": "0.158.0", | ||
| "markdownlint-cli2": "^0.18.1", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect declared Node.js versions in local tooling and CI configuration.
fd -HI -t f -g '.nvmrc' -g '.node-version' -g '.tool-versions' -g 'package.json' -g '*.yml' -g '*.yaml' . \
| xargs -r rg -n -i 'node-version|setup-node|engines|"node"'
# Inspect the current package metadata and required Node.js version.
curl -fsSL https://registry.npmjs.org/markdownlint-cli2/latest \
| jq '{version, engines}'Repository: layer5io/docs
Length of output: 440
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## files"
git ls-files | rg '(^|/)(package\.json|package-lock\.json|.*\.ya?ml)$|(^|/)(\.nvmrc|\.node-version|\.tool-versions)$' || true
echo
echo "## node-related declarations"
for f in package.json .nvmrc .node-version .tool-versions; do
if [ -e "$f" ]; then cat -n "$f"; fi
done
for f in $(git ls-files '*.yml' '*.yaml'); do
if rg -q -i 'node-version|setup-node|engines|node' "$f"; then
echo "--- $f"
rg -n -i 'node-version|setup-node|engines|node' "$f"
fi
done
echo
echo "## package.json relevant section"
cat -n package.json | sed -n '1,80p'
echo
echo "## markdownlint versions via npm"
npm view markdownlint-cli2 dist-tags --json
npm view markdownlint-cli2@latest version engines --json || true
npm view markdownlint-cli2@latest engines --json || true
echo
echo "## lockfile markdownlint-cli2 section"
rg -n -A 8 -B 2 '"markdownlint-cli2"|"markdownlint-cli2@' package-lock.json || trueRepository: layer5io/docs
Length of output: 50369
Pin the Markdown linter to an exact latest compatible release.
markdownlint-cli2 is declared as ^0.18.1, so dependency resolution can pick any compatible future release. latest is 0.23.2, and its declared engine requirement is node >=22; CI uses Node 22 for the doc/lint workflows and .nvmrc is lts/*. Update package.json, package-lock.json, and make update:pkg:dep use --save-exact for markdownlint-cli2.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` around lines 33 - 39, Pin markdownlint-cli2 to the exact
compatible latest release, 0.23.2, in package.json and regenerate
package-lock.json accordingly. Update the update:pkg:dep script to pass
--save-exact for markdownlint-cli2 while preserving the existing update behavior
for the other dependencies.
Source: Coding guidelines
Propagates the latest round of cleanup and refinement to the shared Makefile and npm script standard.
Adds the
build-preview,check-links,lint, andlint-fixtargets, with linting running a pinnedmarkdownlint-cli2so local and CI runs agree; Prettier has been dropped, since its reachable surface here is a handful of root files and unconfigured it would reformat Go templates and content.--cleanDestinationDirnow applies only to the build scripts, so starting the dev server no longer wipespublic/, and--gclives withbuild:productionrather than the Makefile.build-productionwas passing--baseURLtwice — once from the npm script and once from the Makefile — so the script's copy was removed, leaving the Makefile as the single owner. It also now runscheck-golike the other build targets, since the site resolves Docsy through Hugo Modules.build:previewkeeps itsBASE_URLfallback, which the preview workflow depends on.Also removed the unused
dev:*aliases,check:links:all, andHTMLTEST_ARGS. The Docker section is unchanged. The Makefile header documents the shared contract and which sections are repo-specific.Page counts are unchanged before and after (1610 pages, 467 non-page files, 688 static files, 127 aliases).
Signed commits
Summary by CodeRabbit
Chores
Documentation
Refactor