Skip to content

Move internal workspace packages from peer deps to direct deps#474

Open
heyitsaamir wants to merge 1 commit intomainfrom
aamirj/direct-deps
Open

Move internal workspace packages from peer deps to direct deps#474
heyitsaamir wants to merge 1 commit intomainfrom
aamirj/direct-deps

Conversation

@heyitsaamir
Copy link
Collaborator

@heyitsaamir heyitsaamir commented Mar 13, 2026

Why

Internal @microsoft/teams.* packages were declared as peer dependencies of each other, forcing consumers to manually install packages like teams.api, teams.common, teams.graph, and teams.cards even though they had no version choice — all packages are lockstep-versioned and released together. This added DX friction without any architectural benefit.

This was fine when agents were being created from scratch (users would scaffold a project and install everything at once). That's no longer the case — users are integrating the SDK into existing projects, and having to figure out which internal plumbing packages to install is unnecessary. Peer deps are meant for plugin/host relationships and external SDKs where the consumer provides their own version, not for tightly-coupled internal packages.

Summary

  • Converted internal @microsoft/teams.* peer dependencies to real dependencies across all packages. Consumers now only install the packages they consciously choose (teams.apps, teams.dev, teams.ai, etc.) and internal plumbing comes in transitively.
  • Plugin packages (botbuilder, dev, mcp, a2a, mcpclient) correctly peer on their host (teams.apps or teams.ai) while keeping directly-imported internals as real deps. External third-party peers (botbuilder, openai, @microsoft/teams-js, @modelcontextprotocol/sdk, @a2a-js/sdk) remain as peer deps.
  • Cleaned up examples and CLI templates to only declare dependencies they actually import — removed ~16 redundant deps across examples and ~8 across CLI templates.
  • Removed @microsoft/teams.dev dependency from teams.mcp (and associated DevtoolsPlugin code) - This requires a dependency on dev, which is not right. Users should be able to run this plugin without installing dev since dev is an optional plugin.

Dependency principles applied

  1. dependencies = anything your code directly imports
  2. peerDependencies = the host/platform your package is a plugin for, plus external SDKs the consumer provides
  3. Don't declare what you don't import; don't omit what you do

Test plan

  • Full monorepo build passes (33/33 tasks)
  • Verify examples still run locally
  • Verify CLI teams new scaffolds correct deps

skip-test-verification

Internal @microsoft/teams.* packages were declared as peer dependencies,
forcing consumers to manually install internal plumbing. Convert to real
dependencies so consumers only install packages they consciously choose.

Clean up examples and CLI templates to only declare what they import.
Remove teams.dev dependency from teams.mcp (and DevtoolsPlugin code).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

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

lgtm, tentative approval - what's the plan for the teams new scaffolding testing?

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