Skip to content

Resolve and install transitive registryDependencies for registry items#3

Merged
rakibulism merged 1 commit intomainfrom
cdx/find-improvement-opportunities-in-repo-zl9r5h
Apr 23, 2026
Merged

Resolve and install transitive registryDependencies for registry items#3
rakibulism merged 1 commit intomainfrom
cdx/find-improvement-opportunities-in-repo-zl9r5h

Conversation

@rakibulism
Copy link
Copy Markdown
Owner

Motivation

  • Components/blocks can declare registryDependencies and the CLI needs to fetch and install those transitive dependencies before installing the requested item.
  • The add flow must remap targets and install dependencies in topological order so projects get all required files without manual steps.
  • The resolver should surface clear errors for missing dependencies and dependency cycles.

Description

  • Added resolveItemWithDependencies to the registry resolver to fetch an item and all transitive registryDependencies in topological order and detect cycles, and kept resolveItem as a thin wrapper around it.
  • Updated runAdd to call resolveItemWithDependencies, remap targets for every resolved item, install each dependency item before the requested item, and return an installed list in the result along with accumulated written files.
  • Exported resolveItemWithDependencies from the registry index and updated imports in the add command to use it instead of resolveItem.
  • Enhanced tests and fixtures: expanded add.test.ts to expect dependency installation and updated registry/resolver.test.ts to test dependency ordering, missing transitive dependency errors, and cycle detection; adjusted mocked fetch and fixture items to simulate registryDependencies.

Testing

  • Ran resolver unit tests in packages/cli/src/registry/resolver.test.ts which exercise listRegistryItems, resolveItem, and the new resolveItemWithDependencies cases for ordering, missing dependency, and cycles, and they passed.
  • Ran integration/unit tests in packages/cli/src/commands/add.test.ts which verify remapped targets, dependency installs, and snippet behavior, and they passed.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f18c14cc7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/registry/resolver.ts
@rakibulism rakibulism merged commit 9384c2e into main Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant