Skip to content

Fix CLI template issues and remove AI/MCP/MCPClient templates#2904

Open
heyitsaamir wants to merge 2 commits into
mainfrom
heyitsaamir-verbose-enigma
Open

Fix CLI template issues and remove AI/MCP/MCPClient templates#2904
heyitsaamir wants to merge 2 commits into
mainfrom
heyitsaamir-verbose-enigma

Conversation

@heyitsaamir

Copy link
Copy Markdown
Collaborator

Summary

Review of the CLI scaffolding templates surfaced several issues. This PR removes three problematic templates and fixes the rest.

Removed templates

  • typescript/ai — its AGENTS.md linked to a dead URL (microsoft/teams.ts/main/AGENTS_TEMPLATE.md returns 404).
  • typescript/mcp — its package.json.hbs inspect script contained a literal newline, making the generated package.json invalid JSON (every npm command in a scaffolded project would break).
  • typescript/mcpclient — removed alongside the MCP set.

Fixes to remaining templates

  • graph (TS) — declared missing @microsoft/teams.api dependency (imported for MessageActivity).
  • tab (TS) — declared missing @microsoft/teams-js and @microsoft/teams.common dependencies; renamed leftover internal @tests/tab logger names to tab; awaited the reply() call in the echo handler.
  • graph (Python) — fixed a possibly-unbound me (now initialized to None before the if graph: block) so pyright and runtime don't fail when user_graph is None; aligned the dotenv pin with the echo template.
  • Python READMEs — removed reference to a nonexistent apppackage/ directory.
  • menu-loop test — updated the listTemplates mock to ['echo', 'graph', 'tab'].

Template names are discovered dynamically from the filesystem via listTemplates(), so removing the directories is sufficient — no command code references them by name.

Validation

  • All remaining package.json.hbs files are valid JSON; every import is now a declared dependency.
  • npm run build passes.
  • All 206 tests pass.

Remove the ai, mcp, and mcpclient TypeScript templates (the mcp
package.json contained invalid JSON and the ai AGENTS.md linked to a
dead URL).

Fix remaining templates:
- graph (TS): declare missing @microsoft/teams.api dependency
- tab (TS): declare missing @microsoft/teams-js and @microsoft/teams.common
  dependencies; rename leftover @tests/tab loggers; await reply()
- graph (Python): fix possibly-unbound 'me'; align dotenv pin
- python READMEs: drop nonexistent apppackage/ reference
- update listTemplates mock in menu-loop test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 26, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Cleans up CLI scaffolding templates by removing broken TS AI/MCP templates and fixing dependency/runtime/docs issues in the remaining templates so generated projects build/run correctly.

Changes:

  • Remove typescript/ai, typescript/mcp, typescript/mcpclient templates (invalid/buggy scaffold outputs).
  • Fix TS graph/tab templates (missing deps; logger name cleanup; await reply() in tab bot handler).
  • Fix Python graph template (avoid possibly-unbound me; align dotenv pin) and remove stale README references to apppackage/.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cli/tests/menu-loop.test.ts Updates mocked template list to match removed templates.
packages/cli/templates/typescript/tab/src/Tab/App.tsx Renames logger source to non-internal tab.
packages/cli/templates/typescript/tab/src/index.ts Renames logger + awaits reply() for correct async handling.
packages/cli/templates/typescript/tab/package.json.hbs Adds missing runtime deps (@microsoft/teams-js, @microsoft/teams.common).
packages/cli/templates/typescript/graph/package.json.hbs Adds missing @microsoft/teams.api dependency used by template code.
packages/cli/templates/python/graph/src/main.py Initializes me to avoid unbound usage when user_graph is absent.
packages/cli/templates/python/graph/README.md Removes incorrect apppackage/ directory reference.
packages/cli/templates/python/graph/pyproject.toml.hbs Pins dotenv dependency (now consistent with echo template).
packages/cli/templates/python/echo/README.md Removes incorrect apppackage/ directory reference.
packages/cli/templates/typescript/ai/AGENTS.md Deletes removed template content.
packages/cli/templates/typescript/ai/package.json.hbs Deletes removed template content.
packages/cli/templates/typescript/ai/src/index.ts Deletes removed template content.
packages/cli/templates/typescript/ai/tsconfig.json Deletes removed template content.
packages/cli/templates/typescript/ai/tsup.config.js Deletes removed template content.
packages/cli/templates/typescript/mcp/package.json.hbs Deletes removed template content.
packages/cli/templates/typescript/mcp/src/index.ts.hbs Deletes removed template content.
packages/cli/templates/typescript/mcp/tsconfig.json Deletes removed template content.
packages/cli/templates/typescript/mcp/tsup.config.js Deletes removed template content.
packages/cli/templates/typescript/mcpclient/package.json.hbs Deletes removed template content.
packages/cli/templates/typescript/mcpclient/src/index.ts.hbs Deletes removed template content.
packages/cli/templates/typescript/mcpclient/tsconfig.json Deletes removed template content.
packages/cli/templates/typescript/mcpclient/tsup.config.js Deletes removed template content.

Comment on lines 8 to 11
"microsoft-teams-apps",
"microsoft-teams-graph",
"dotenv"
"dotenv>=0.9.9"
]
…emplates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@heyitsaamir heyitsaamir requested a review from nickwalkmsft June 27, 2026 01:12
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