Skip to content

chore: refine shared build targets and npm scripts across docs and academy repos - #1195

Open
banana-three-join wants to merge 1 commit into
layer5io:masterfrom
banana-three-join:chore/cleanup-scripts
Open

chore: refine shared build targets and npm scripts across docs and academy repos#1195
banana-three-join wants to merge 1 commit into
layer5io:masterfrom
banana-three-join:chore/cleanup-scripts

Conversation

@banana-three-join

@banana-three-join banana-three-join commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Propagates the latest round of cleanup and refinement to the shared Makefile and npm script standard.

Adds the build-preview, check-links, lint, and lint-fix targets, with linting running a pinned markdownlint-cli2 so 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. --cleanDestinationDir now applies only to the build scripts, so starting the dev server no longer wipes public/, and --gc lives with build:production rather than the Makefile.

build-production was passing --baseURL twice — 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 runs check-go like the other build targets, since the site resolves Docsy through Hugo Modules. build:preview keeps its BASE_URL fallback, which the preview workflow depends on.

Also removed the unused dev:* aliases, check:links:all, and HTMLTEST_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

  • Yes, I signed my commits.

Summary by CodeRabbit

  • Chores

    • Improved local development and site build workflows.
    • Added dedicated commands for linting and link validation.
    • Streamlined preview, production, serving, and cleanup tasks.
    • Added automated Go and dependency checks before site-related tasks.
  • Documentation

    • Added shared-template documentation guidance.
  • Refactor

    • Removed obsolete formatting and legacy development workflows.
    • Updated Hugo build and serving behavior for more consistent results.

Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

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

Changes

Development workflow updates

Layer / File(s) Summary
Package scripts and tooling
package.json
Hugo, link-check, and Markdown lint scripts were revised. Prettier packages were removed, and markdownlint-cli2, autoprefixer, and postcss-cli dependencies were updated.
Makefile workflow integration
Makefile
Build and local development targets now use the updated npm scripts and prerequisite checks. Link-check and Markdown lint targets were added, and .PHONY declarations were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: sbragul26

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the shared Makefile and npm script refinements across the docs and academy repositories.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0cdf512 and e339ed1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • Makefile
  • package.json

Comment thread Makefile
#
# - https://github.com/layer5io/docs
# - https://github.com/meshery/meshery/tree/master/docs
# - https://github.com/topics/meshery-academy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Suggested change
# - 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.

Comment thread package.json
Comment on lines +33 to +39
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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 || true

Repository: 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant