onmax

pnpm

Use when managing Node.js dependencies with pnpm - install packages, configure monorepo workspaces, set up pnpm catalogs, resolve dependency conflicts with overrides, patch third-party packages, and configure CI pipelines for pnpm projects

onmax 701 35 Updated 6mo ago

Resources

1
GitHub

Install

npx skillscat add onmax/nuxt-skills/pnpm

Install via the SkillsCat registry.

About this skill

This skill provides guidance for managing Node.js dependencies using pnpm, covering package installation, monorepo workspace configuration, dependency conflict resolution through overrides, third-party package patching, and CI/CD pipeline setup. It addresses the need for efficient, secure dependency management in JavaScript projects, particularly those using monorepos or requiring strict dependency control. Developers should use it when working with pnpm in any capacity, from basic package installation to advanced workspace and security configurations.

SKILL.md

pnpm

Content-addressable store, strict deps, workspace protocol, catalogs.

When to Use

  • Installing/managing npm packages
  • Monorepo workspace setup with catalogs
  • Overriding transitive dependencies
  • Patching third-party packages
  • CI/CD configuration for pnpm projects
  • Supply chain security hardening

Quick Start

pnpm install                      # Install deps
pnpm add <pkg>                    # Add dep
pnpm add -D <pkg>                 # Dev dep
pnpm -r run build                 # Run in all packages
pnpm --filter @myorg/app build    # Run in specific package

Workspace Setup

# pnpm-workspace.yaml
packages:
  - 'packages/*'
  - 'apps/*'

# Catalogs for centralized version management
catalog:
  react: ^18.2.0
  typescript: ~5.3.0
// package.json - Use workspace protocol and catalogs
{
  "packageManager": "pnpm@10.28.2",
  "dependencies": {
    "@myorg/utils": "workspace:^",
    "react": "catalog:"
  }
}

Reference Files

Task File
Commands, scripts, filtering cli.md
Workspaces, catalogs, config workspaces.md
Overrides, patches, hooks, store features.md
CI/CD, Docker, migration ci.md

Loading Files

Consider loading these reference files based on your task:

DO NOT load all files at once. Load only what's relevant to your current task.

Verify Setup

After configuring a workspace, verify it works:

pnpm install          # Install all deps
pnpm ls --depth 0     # Verify workspace links
pnpm -r run build     # Build all packages

Cross-Skill References

  • TypeScript libs → Use ts-library skill for library patterns
  • Build tooling → Use tsdown or vite skills