-
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate from yarn to pnpm package manager #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from yarn to pnpm package manager #14
Conversation
…x TypeScript types Co-authored-by: warengonzaga <[email protected]>
Co-authored-by: warengonzaga <[email protected]>
Co-authored-by: warengonzaga <[email protected]>
Co-authored-by: warengonzaga <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the project from yarn to pnpm package manager to improve installation speed, disk space efficiency, and dependency management while maintaining full backward compatibility.
- Migrated package manager configuration from yarn to pnpm across all files
- Added TypeScript type annotation fix for Redis client type inference
- Updated Docker configuration to use pnpm with proper caching strategies
Reviewed Changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated engines and preinstall script to enforce pnpm usage |
| src/config/redis.ts | Added explicit TypeScript type annotation for Redis client |
| Dockerfile | Migrated from yarn to pnpm with corepack installation and cache optimization |
| README.md | Updated documentation commands from yarn to pnpm |
| CONTRIBUTING.md | Updated development setup and guidelines to use pnpm |
| .github/workflows/validate.yml | Added pnpm setup action and updated CI commands |
| .yarnrc | Removed yarn configuration file |
| .npmrc | Added pnpm configuration for dependency hoisting and peer dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
warengonzaga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, passed. Ready for merge!
|
@copilot resolve the issue with the action: https://github.com/wgtechlabs/unthread-webhook-server/actions/runs/18206320914/job/51838442679?pr=14 |
…ching Co-authored-by: warengonzaga <[email protected]>
Fixed in commit fa3c2a0. The issue was that pnpm needs to be set up before Node.js when using cache. The workflow now follows the correct order:
This ensures proper caching of pnpm dependencies in GitHub Actions. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
✅ Migration from Yarn to pnpm - COMPLETE
Phase 1: Package Manager Setup ✅
Phase 2: Docker Configuration ✅
Phase 3: CI/CD Workflows ✅
Phase 4: Documentation Updates ✅
Phase 5: Testing & Validation ✅
📊 Migration Summary
Files Changed (11 files)
Key Changes
Package Manager Configuration:
package.jsonengines:pnpm: ">=8.0.0"(replaced yarn)npx only-allow pnpm[email protected].npmrcwith pnpm-specific configuration for compatibility.gitignoreto ignore npm and yarn lock filesCode Quality Improvement:
src/config/redis.tsRedisClientTypeannotation to improve type safetyDocker Optimization:
pnpm-lock.yamland.npmrcCI/CD Pipeline:
pnpm/action-setup@v4to validate workflowDocumentation:
yarntopnpm✨ Benefits Achieved
🧪 Testing Results
All pnpm commands tested and verified:
pnpm install --frozen-lockfile- Dependencies install correctlypnpm type-check- TypeScript type checking passespnpm build- Production build succeedspnpm clean- Cleanup works properlypnpm dev- Would start development server (requires Redis)🔒 Security & Compatibility
.npmrcconfigured for maximum compatibility with existing code.gitignoreupdated to prevent accidental commits of npm/yarn lock files📝 Migration Notes
The migration required one code change to
src/config/redis.tsto add an explicit type annotation. This improves type safety and is a best practice that was needed due to pnpm's stricter dependency hoisting. This change does not affect runtime behavior and makes the code more maintainable.The GitHub Actions workflow was updated to set up pnpm before Node.js, which is required for proper dependency caching with the
cache: 'pnpm'option.✅ All Success Criteria Met
The migration is complete and ready for review! 🎉
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.