Skip to content

chore: migrate from npm to pnpm#9

Merged
chenjiahan merged 2 commits intomainfrom
use_pnpm_0313
Mar 14, 2026
Merged

chore: migrate from npm to pnpm#9
chenjiahan merged 2 commits intomainfrom
use_pnpm_0313

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

  • replace npm commands with pnpm in package.json and CI workflows
  • update README with pnpm installation instructions
  • remove package-lock.json and add pnpm-lock.yaml to ignore list
  • specify packageManager in package.json
  • reorder imports in documentation examples

Copilot AI review requested due to automatic review settings March 14, 2026 12:27
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes the migration of the project's package management system from npm to pnpm. The changes encompass updating script commands, documentation, and configuration files to reflect the new package manager, aiming to streamline dependency management and potentially improve performance and disk space usage.

Highlights

  • Package Manager Migration: Migrated the project's package management system from npm to pnpm, updating all relevant scripts and configuration files.
  • Documentation Updates: Updated the README.md to include comprehensive installation instructions for npm, pnpm, yarn, and bun.
  • Code Example Consistency: Adjusted the order of import statements in various JavaScript code examples within README.md for improved consistency and readability.
  • Lockfile Management: Removed package-lock.json and added pnpm-lock.yaml to the .cspell.json ignore list to reflect the new package manager.
  • Project Configuration: Specified pnpm@10.21.0 as the packageManager in package.json to enforce the use of pnpm.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .cspell.json
    • Added "rstackjs" and "sokra" to the list of known words.
    • Included "pnpm-lock.yaml" in the list of ignored paths.
  • README.md
    • Expanded installation instructions to cover npm, pnpm, yarn, and bun.
    • Reordered require statements in several JavaScript code examples for better readability.
  • package.json
    • Replaced npm run commands with pnpm run in various scripts.
    • Removed the security and prebuild scripts.
    • Added the packageManager field, specifying pnpm@10.21.0.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/nodejs.yml
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@chenjiahan chenjiahan merged commit 5f77f49 into main Mar 14, 2026
1 of 15 checks passed
@chenjiahan chenjiahan deleted the use_pnpm_0313 branch March 14, 2026 12:29
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully migrates the project from npm to pnpm. The changes to scripts, configurations, and documentation are mostly well-executed. However, there are a few areas that need attention. The security audit script has been removed, which poses a security risk. The prebuild script for cleaning build artifacts has also been removed, potentially leading to stale builds. Lastly, the specified packageManager version in package.json appears to be invalid, which could cause setup issues for other developers.

Comment thread package.json
],
"scripts": {
"commitlint": "commitlint --from=main",
"security": "npm audit --production",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The security script, which runs npm audit, has been removed. It's important to maintain a script for auditing dependencies for security vulnerabilities. Please add it back using the pnpm equivalent, which is pnpm audit --prod.

Comment thread package.json
"optional": true
}
},
"packageManager": "pnpm@10.21.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The specified pnpm version 10.21.0 does not appear to be a valid, published version. This will likely cause issues for developers using Corepack. Please use a valid and recent version of pnpm that corresponds to lockfile version 9. For example, you could use a recent stable version such as 9.6.0.

  "packageManager": "pnpm@9.6.0"

Comment thread package.json
"fix:prettier": "pnpm run lint:prettier -- --write",
"fix": "npm-run-all -l fix:js fix:prettier",
"clean": "del-cli dist types",
"prebuild": "npm run clean",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The prebuild script, which cleans the build directories before a new build, has been removed. This is a good practice to prevent issues with stale build artifacts. Please consider adding it back as "prebuild": "pnpm run clean".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the repository’s Node.js tooling from npm to pnpm by updating scripts, CI workflows, and documentation, while aligning ancillary tooling (spelling/ignore lists) to the new lockfile.

Changes:

  • Update package.json scripts to use pnpm run, and declare packageManager as pnpm.
  • Switch GitHub Actions workflow installs/caching from npm to pnpm.
  • Update README install instructions and reorder documentation example imports; update cspell ignore paths/words for pnpm lockfile and project terms.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.

File Description
package.json Replaces npm script invocations with pnpm and declares the pnpm package manager version.
README.md Expands install instructions to include pnpm (and others) and reorders import/require lines in examples.
.github/workflows/nodejs.yml Uses pnpm setup, pnpm caching, and pnpm install/run commands in CI jobs.
.cspell.json Adds project words and ignores pnpm-lock.yaml for spellchecking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"fix:js": "pnpm run lint:code -- --fix",
"fix:prettier": "pnpm run lint:prettier -- --write",
"fix": "npm-run-all -l fix:js fix:prettier",
"clean": "del-cli dist types",
Comment thread package.json
"lint:code": "eslint --cache .",
"lint:spelling": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
"lint:types": "tsc --pretty --noEmit",
"lint": "npm-run-all -l -p \"lint:**\"",
Comment on lines +59 to 64
run: if [ -n "$(git status types --porcelain)" ]; then echo "Missing types. Update types by running 'pnpm run build:types'"; exit 1; else echo "All types are valid"; fi

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: pnpm exec commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6ddc0cfd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"test:coverage": "pnpm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
"pretest": "pnpm run lint",
"test": "pnpm run test:coverage",
"prepare": "husky && pnpm run build",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore clean hook before running build in prepare

This commit removed the prebuild clean step, but prepare still runs build, so installs/publish builds now execute build:types and build:code without clearing dist/types first. In that state, deleting or renaming source files can leave stale generated artifacts on disk, and those stale files can be shipped because the package publishes dist and types.

Useful? React with 👍 / 👎.

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.

2 participants