Skip to content

docs: use Corepack instead of npm i -g yarn in theme setup#122

Open
snxRCS wants to merge 1 commit intopelican-dev:mainfrom
snxRCS:patch-1
Open

docs: use Corepack instead of npm i -g yarn in theme setup#122
snxRCS wants to merge 1 commit intopelican-dev:mainfrom
snxRCS:patch-1

Conversation

@snxRCS
Copy link
Copy Markdown

@snxRCS snxRCS commented Apr 22, 2026

The theme setup snippet in README.md currently installs Yarn via npm i -g yarn, which requires a global npm write and is the legacy way to get Yarn on Node.

Node.js 22 ships with Corepack, the officially supported mechanism for managing package managers (Yarn, pnpm, ...). Enabling Corepack is a single command, avoids the global npm install, and makes the Yarn version pinned per-project (via the packageManager field in a theme's package.json) rather than whatever happens to be globally installed on the host.

Changes

  • ## Additional setup for themes paragraph mentions Corepack instead of a global Yarn install.
  • Replaces npm i -g yarn with sudo corepack enable.

No other changes; the NodeSource install step is untouched.

Summary by CodeRabbit

  • Documentation
    • Updated theme setup instructions to enable Node.js Corepack instead of manually installing Yarn globally.

Updated instructions for theme setup to include enabling Corepack.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

Updated README instructions for theme setup by replacing explicit global Yarn installation with Node.js Corepack enablement. The change substitutes npm i -g yarn with sudo corepack enable while maintaining overall setup workflow consistency.

Changes

Cohort / File(s) Summary
Documentation Update
README.md
Updated "Additional setup for themes" section to replace global Yarn installation instruction with Corepack enablement (sudo corepack enable).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 With whiskers twitching, I hop with glee,
No global yarn cluttering the tree!
Corepack enabled, clean and light,
Your themes now build with pure delight! ✨

🚥 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 directly and accurately describes the main change: updating README docs to replace global Yarn installation with Corepack enablement in theme setup instructions.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 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)
README.md (1)

21-21: Consider adding context about when sudo is needed.

The corepack enable command is correct. However, the official Node.js documentation does not explicitly mention sudo as required—its necessity depends on how Node.js was installed and file permissions on the binary directory. For clarity, consider adding a note explaining that sudo may be needed for system-wide Node.js installations (such as via NodeSource) but might not be necessary for user-level installations.

📝 Optional: Add context about sudo requirement
-sudo corepack enable
+sudo corepack enable  # May require sudo if Node.js is installed system-wide; not needed for user-level installations
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 21, Add a short clarification next to the "corepack
enable" instruction explaining that using sudo may be necessary only for
system-wide Node.js installations (e.g., installed via NodeSource or when the
global binary directory is owned by root) but is not required for user-level
installs; update the README line with "corepack enable" to include a
parenthetical or one-sentence note indicating this and suggesting to try without
sudo first and use sudo only if permission errors occur.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@README.md`:
- Line 21: Add a short clarification next to the "corepack enable" instruction
explaining that using sudo may be necessary only for system-wide Node.js
installations (e.g., installed via NodeSource or when the global binary
directory is owned by root) but is not required for user-level installs; update
the README line with "corepack enable" to include a parenthetical or
one-sentence note indicating this and suggesting to try without sudo first and
use sudo only if permission errors occur.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: abac13d5-3bc1-408b-af52-4d6fe67a1f9b

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb679c and ef5c4a4.

📒 Files selected for processing (1)
  • README.md
📜 Review details
🔇 Additional comments (1)
README.md (1)

15-15: The documentation statement that Corepack ships with Node.js 22+ is accurate and confirmed by nodejs.org documentation across multiple Node.js 22 versions (22.0.0, 22.1.0, 22.2.0, 22.6.0, 22.11.0). No changes needed.

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