Skip to content

Ability to define peer and dev deps for auto-imported packages - #345

Open
bterlson wants to merge 2 commits into
alloy-framework:mainfrom
bterlson:peer-deps
Open

Ability to define peer and dev deps for auto-imported packages#345
bterlson wants to merge 2 commits into
alloy-framework:mainfrom
bterlson:peer-deps

Conversation

@bterlson

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @alloy-js/typescript
Show changes

@alloy-js/typescript - feature ✏️

The PackageDirectory component can now specify what kind of dependency to create for package dependencies added by reference using the packageDependencyKinds prop.

@alloy-js/typescript - feature ✏️

The PackageDirectory component can now specify what version of a dependency to create for package dependencies added by reference using the packageVersions prop.

@pkg-pr-new

pkg-pr-new Bot commented Dec 11, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/alloy-framework/alloy/@alloy-js/typescript@345

commit: a335a49

@jongio jongio 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.

This PR appears to be superseded by #347 ("Adding package versions + kind configuration support for PackageDirectory") which was merged the same day these commits were pushed. The PR currently has merge conflicts and failing CI builds, which aligns with this observation.

If this PR is still intended to land (perhaps it takes a different approach or covers additional cases), a few items to address:

  • Merge conflicts with main need resolution
  • CI build failures need investigation
  • The TypeDeclaration.tsx change (adding kind="type") seems unrelated to the peer/dev deps feature and could be split into its own commit or removed if #347 already covers it
  • Second commit message "changes" is non-descriptive

* Retrieve the package scope associated with an external package created via
* createPackage.
*/
export function getPackageScope(pgk: ExternalPackage) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo: pgk should be pkg.

const versionSpecifier =
pkgMeta?.versionSpecifiers.get(dependency) ?? dependency.version;

kinds[kind] ??= {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Potential mutation: kinds[kind] holds a direct reference to props.dependencies (or devDependencies/peerDependencies). Assigning kinds[kind][dependency.name] = versionSpecifier mutates the original props object if it was passed by reference. Consider spreading: kinds[kind] = { ...(kinds[kind] ?? {}), [dependency.name]: versionSpecifier } or building a fresh object to avoid side effects inside the memo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants