Skip to content

Comments

Switch to pnpm#68

Merged
widoz merged 6 commits intomainfrom
switch-to-pnpm
Jun 17, 2025
Merged

Switch to pnpm#68
widoz merged 6 commits intomainfrom
switch-to-pnpm

Conversation

@widoz
Copy link
Member

@widoz widoz commented Jun 17, 2025

This pull request transitions the project from using yarn to pnpm for dependency management and updates related workflows, documentation, and scripts accordingly. Additionally, it introduces new TypeScript type definitions and simplifies the package.json configuration.

Migration from yarn to pnpm:

  • .github/workflows/build-artifacts.yml: Updated the dependency installation step to use pnpm instead of yarn and added a pnpm build command for artifact building.
  • .github/workflows/js-qa.yml: Replaced yarn commands with equivalent pnpm commands for dependency installation, linting, and testing.
  • docs/development.md: Updated all references to yarn commands with pnpm equivalents, including installation, asset building, and environment setup commands. [1] [2]
  • scripts/create-posts.sh and scripts/create-terms.sh: Replaced yarn wp-env commands with pnpm run wp-env commands. [1] [2]

Updates to package.json:

  • Added new TypeScript type definitions for lodash, node, react, and react-dom under devDependencies.
  • Removed yarn from devDependencies and added a pnpm configuration block with overrides for react and react-dom. [1] [2]
  • Modified scripts to replace yarn commands with pnpm equivalents and added a new qa script for combined type checking, linting, and testing.

Summary by CodeRabbit

  • Chores
    • Switched the project’s package manager from Yarn to pnpm across workflows, scripts, and documentation.
    • Updated continuous integration workflows to use pnpm for installing dependencies, caching, linting, and testing.
    • Updated documentation to reflect pnpm usage in all development commands and instructions.
    • Removed Yarn from dependencies and configuration.
    • Added TypeScript type definitions for React and React DOM to development dependencies.
    • Introduced a new script for running quality assurance checks.
    • Relaxed the minimum required version for webpack.

@coderabbitai
Copy link

coderabbitai bot commented Jun 17, 2025

Warning

Rate limit exceeded

@widoz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e6bcfe1 and 735b940.

📒 Files selected for processing (5)
  • .github/workflows/builld-artifacts.yml (1 hunks)
  • .github/workflows/js-qa.yml (1 hunks)
  • package.json (1 hunks)
  • scripts/create-posts.sh (1 hunks)
  • scripts/create-terms.sh (1 hunks)

Walkthrough

The changes update the project's package management system from Yarn to pnpm across workflows, scripts, and documentation. Node.js versions are upgraded, caching strategies adjusted, and commands in CI/CD workflows, shell scripts, and documentation are replaced accordingly. The package.json is modified with dependency moves, new pnpm overrides, script updates, and formatting changes.

Changes

Files/Paths Change Summary
.github/workflows/builld-artifacts.yml,
.github/workflows/js-qa.yml
Updated GitHub Actions workflows to use pnpm instead of Yarn; upgraded Node.js versions; changed caching to pnpm; added pnpm setup steps; updated install and script commands.
docs/development.md Replaced Yarn commands with pnpm equivalents in developer documentation for install, build, and environment start instructions.
package.json Switched dependency management from Yarn to pnpm; moved @types/lodash to devDependencies; added @types/react and @types/react-dom; removed yarn package; added pnpm overrides; relaxed webpack version; updated scripts for pnpm usage; changed indentation to tabs.
scripts/create-posts.sh,
scripts/create-terms.sh
Changed shell scripts to use pnpm for WordPress CLI commands instead of Yarn; no other logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CI Workflow
    participant pnpm
    participant Node.js
    participant WordPress CLI

    Developer->>CI Workflow: Push code / Open PR
    CI Workflow->>pnpm: Install dependencies
    pnpm->>Node.js: Setup environment
    CI Workflow->>pnpm: Run build/lint/test scripts
    CI Workflow->>WordPress CLI: (via pnpm) Run CLI commands
    WordPress CLI-->>CI Workflow: CLI output/results
    CI Workflow-->>Developer: Report results
Loading

Poem

In the garden of code where pnpm hops in,
Yarn takes a bow, let the new flow begin.
Scripts and docs now dance in sync,
CI and CLI with pnpm in the link.
With lighter steps and fresher cheer,
The rabbit says, “Our toolkit’s clear!” 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
.github/workflows/builld-artifacts.yml (1)

17-21: Consider enforcing lockfile integrity in CI
It’s recommended to run pnpm install --frozen-lockfile in the CI pipeline to prevent inadvertent lockfile modifications and ensure reproducible builds.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76a0c22 and fcd8a79.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/builld-artifacts.yml (1 hunks)
  • .github/workflows/js-qa.yml (1 hunks)
  • docs/development.md (2 hunks)
  • package.json (1 hunks)
  • scripts/create-posts.sh (1 hunks)
  • scripts/create-terms.sh (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/development.md

[typographical] ~18-~18: Consider inserting a comma for improved readability.
Context: ...After we have installed the dependencies we need to build the assets: ```bash $ pn...

(INITIAL_ADVP_COMMA)


[typographical] ~24-~24: Consider adding a comma after ‘alternatively’ for more clarity.
Context: ...sets: bash $ pnpm run build or alternatively we can run the dev script to compile th...

(RB_LY_COMMA)

🪛 markdownlint-cli2 (0.17.2)
docs/development.md

15-15: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


21-21: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


27-27: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


37-37: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

🔇 Additional comments (9)
package.json (5)

7-9: Confirm Node engine specification
The engines.node field is set to "22" without a semver operator. Ensure this aligns with your intended Node.js support (e.g., >=22).

Would you like to verify that this matches the versions used in CI and by consumers?


11-14: DevDependency reclassification
Moving @types/lodash, Node, React, and React DOM definitions to devDependencies is correct since they’re only needed at compile time.


36-36: Verify relaxed webpack version
The webpack version constraint was relaxed from ^5.94.0 to ^5.0.0. Confirm that supporting all 5.x releases doesn’t introduce breaking changes.


50-55: Add pnpm overrides
Pinning react and react-dom to 18.2.0 via pnpm.overrides ensures consistency across sub-dependencies. Looks good.


65-66: Introduce QA aggregator script
The new qa script running tsc, lint, and test in sequence simplifies CI steps. Nice addition.

docs/development.md (1)

15-15: Update CLI instructions to pnpm
All yarn commands have been correctly replaced with pnpm equivalents in the documentation.

Also applies to: 21-21, 27-27, 37-37

.github/workflows/js-qa.yml (1)

30-37: Switch QA steps to pnpm
Installation, linting, and test commands have been updated to use pnpm. This aligns with the rest of the migration.

.github/workflows/builld-artifacts.yml (2)

14-14: Upgrade to checkout v4 endorsed
Switching to actions/checkout@v4 brings the latest performance and security improvements.


25-26: Artifact action command correctly specified
Passing command: 'pnpm build' ensures the intended build script executes during artifact generation.

@widoz widoz merged commit 7e4a378 into main Jun 17, 2025
4 checks passed
@widoz widoz deleted the switch-to-pnpm branch June 17, 2025 21:01
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