Skip to content

Propagate --global to collection package installs - #277

Merged
khaliqgant merged 1 commit into
mainfrom
fix/collection-global-propagation
Oct 6, 2026
Merged

khaliqgant merged 1 commit into
mainfrom
fix/collection-global-propagation

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Summary

  • handleCollectionInstall didn't accept a global option, so prpm install <collection> --global installed each child package into the project instead of globally.
  • It now accepts global and passes it to every child handleInstall. Both collection hand-offs in install.ts (the collections/ prefix and the auto-detected collection path) pass it through.
  • The auto-detected collection path was also dropping eager; it now passes that too.

Tests

  • Added two tests to collections.test.ts: every child gets global: true when the flag is set, and no child gets global when it isn't.
  • The new test fails without the fix. With it, all 36 tests in the suite pass and tsc --noEmit is clean.

🤖 Generated with Claude Code

Review in cubic


CodeAnt-AI Description

Honor global and eager options when installing collections

What Changed

  • --global now installs every package in a collection to user-level locations instead of project-local paths.
  • Automatically detected collection installs now apply the requested eager-loading option to every package.

Impact

✅ Collection packages install globally when requested
✅ Eager loading applies to auto-detected collections

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

handleCollectionInstall never accepted or forwarded the global option, so
`prpm install <collection> --global` installed every child package into
project-local paths. Forward global (and eager on the auto-detected
collection path, which also dropped it) to each child handleInstall, and
add regression tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR ec7db01 Oct 06, 2026 · 23:18 23:21

@codeant-ai

codeant-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@my-senior-dev-pr-review

Copy link
Copy Markdown

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in packages/ (236 edits) • ⚡ 1st PR this month

View your contributor analytics →


📊 3 files reviewed • 3 need attention

⚠️ Needs Attention:

  • packages/cli/src/commands/collections.ts — Changes affect how packages are installed globally, potentially leading to permission and security vulnerabilities.

📚 Relevant Past Discussions:

  • ⚠️ Unresolved discussions on install.ts — 10 unresolved comments on this file from past PRs

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer ⚡ Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate ♿ Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist ✅ Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 6, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@codeant-ai

codeant-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. When a global child install fails, the surrounding catch treats the error as a collection lookup miss and falls through to getPackage, masking the actual installation failure.

Logic error · packages/cli/src/commands/install.ts:546

@codeant-ai

codeant-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; it forwards the global-install option through collection installs.
  • Tests cover propagation when --global is set and omission when it is not.

Assessed commit: ec7db01d5df5

@khaliqgant
khaliqgant merged commit c4b18cd into main Oct 6, 2026
9 of 11 checks passed
@khaliqgant
khaliqgant deleted the fix/collection-global-propagation branch October 6, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant