Skip to content

Conversation

@davidfirst
Copy link
Member

Summary

  • Core aspects (e.g., @teambit/objects, @teambit/workspace, @teambit/remove) were being installed via pnpm in capsules instead of being linked
  • This caused TypeScript compilation errors during bit ci merge due to multiple copies with different peer dependency hashes
  • Now all core aspects are filtered from component dependencies, ensuring they are only linked (not installed) in capsules

Test plan

  • Verified locally that @teambit/objects is now linked to workspace instead of installed via pnpm
  • Verified no duplicate copies in .pnpm folder
  • CI should pass on this branch

Core aspects like @teambit/objects, @teambit/workspace, and @teambit/remove
were being installed via pnpm in capsules instead of being linked. This caused
TypeScript compilation errors due to multiple copies with different peer
dependency hashes.

Now all core aspects are filtered from component dependencies, ensuring they
are only linked (not installed) in capsules.
Copilot AI review requested due to automatic review settings February 2, 2026 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Filters Bit core aspects out of component dependency manifests so they’re linked into capsules (instead of installed by pnpm), avoiding duplicate core packages and resulting TS/peer-hash conflicts during bit ci merge.

Changes:

  • Expand dependency filtering from only @teambit/legacy to all core aspects (by core aspect IDs → package names).
  • Ensure core aspects are excluded from the per-component dependency list before optional dependencyFilterFn runs.

Comment on lines +182 to +185
// Remove core aspects from dep list - they should be linked, not installed
const coreAspectIds = this.aspectLoader.getCoreAspectIds();
const coreAspectPkgNames = new Set(coreAspectIds.map((id) => getCoreAspectPackageName(id)));
coreAspectPkgNames.add('@teambit/legacy');
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

coreAspectIds/coreAspectPkgNames are recomputed for every component iteration. Since core aspects are constant for the workspace, consider computing this Set once (e.g., as a memoized private helper or computed before components.map(...)) and reusing it here and in filterOutCoreAspects() to avoid repeated work/duplication.

Copilot uses AI. Check for mistakes.
@davidfirst
Copy link
Member Author

We ended up with a different approach: #10178

@davidfirst davidfirst closed this Feb 2, 2026
@davidfirst davidfirst deleted the fix/filter-core-aspects-from-capsule-deps branch February 2, 2026 21:03
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