Files
smom-dbis-138/orchestration/portal/PNPM_SETUP.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

3.2 KiB

pnpm Setup Guide

Why pnpm?

pnpm is a fast, disk space efficient package manager that:

  • Saves disk space: Uses hard links and symlinks to share packages
  • Faster: Parallel downloads and efficient dependency resolution
  • Strict: Better dependency management and security
  • Monorepo support: Built-in workspace support

Installation

Corepack is included with Node.js 16.9+ and manages package managers:

# Enable corepack
corepack enable

# Prepare and activate pnpm
corepack prepare pnpm@latest --activate

# Verify installation
pnpm --version

Option 2: Using npm

npm install -g pnpm

Option 3: Using Homebrew (macOS)

brew install pnpm

Option 4: Using Standalone Script

curl -fsSL https://get.pnpm.io/install.sh | sh -

Quick Start

# Install dependencies
pnpm install

# Run development server
pnpm dev

# Build for production
pnpm build

# Run production server
pnpm start

Common Commands

Package Management

# Install dependencies
pnpm install

# Add a dependency
pnpm add <package>

# Add a dev dependency
pnpm add -D <package>

# Remove a dependency
pnpm remove <package>

# Update dependencies
pnpm update

Scripts

# Run a script
pnpm <script-name>

# Run with arguments
pnpm <script-name> -- --arg value

Other Useful Commands

# Check for outdated packages
pnpm outdated

# Audit for security vulnerabilities
pnpm audit

# List installed packages
pnpm list

# Clean install (remove node_modules and reinstall)
pnpm install --force

Configuration

The project includes .npmrc with pnpm-specific settings:

  • auto-install-peers=true - Automatically install peer dependencies
  • strict-peer-dependencies=false - Allow missing peer dependencies
  • shamefully-hoist=false - Use strict dependency resolution
  • public-hoist-pattern - Hoist specific packages for compatibility

Benefits for This Project

  1. Faster installs: pnpm is typically 2-3x faster than npm
  2. Disk space: Saves significant disk space with shared packages
  3. Better security: Strict dependency resolution prevents phantom dependencies
  4. Lock file: pnpm-lock.yaml ensures reproducible installs

Migration from npm

If you were using npm before:

# Remove npm lock file
rm package-lock.json

# Remove node_modules
rm -rf node_modules

# Install with pnpm
pnpm install

Troubleshooting

Permission Issues

# Use pnpm's store in a writable location
pnpm config set store-dir ~/.pnpm-store

Clear Cache

pnpm store prune

Reset Everything

rm -rf node_modules pnpm-lock.yaml
pnpm install

CI/CD Integration

GitHub Actions

- uses: pnpm/action-setup@v2
  with:
    version: 8
- uses: actions/setup-node@v3
  with:
    node-version: 18
    cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Docker

FROM node:18-alpine
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

Resources