- 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.
3.2 KiB
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
Option 1: Using Corepack (Recommended)
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 dependenciesstrict-peer-dependencies=false- Allow missing peer dependenciesshamefully-hoist=false- Use strict dependency resolutionpublic-hoist-pattern- Hoist specific packages for compatibility
Benefits for This Project
- Faster installs: pnpm is typically 2-3x faster than npm
- Disk space: Saves significant disk space with shared packages
- Better security: Strict dependency resolution prevents phantom dependencies
- Lock file:
pnpm-lock.yamlensures 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