Skip to content

Make emitter-framework language-specific Alloy peers optional - #12495

Open
Timothee Guerin (timotheeguerin) with Copilot wants to merge 5 commits into
mainfrom
copilot/make-alloy-peer-dependencies-optional
Open

Timothee Guerin (timotheeguerin) with Copilot wants to merge 5 commits into
mainfrom
copilot/make-alloy-peer-dependencies-optional

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

@typespec/emitter-framework requires every Alloy language package, causing single-language emitters to install unused packages or receive missing-peer warnings.

  • Optional language peers: Mark @alloy-js/csharp, @alloy-js/python, and @alloy-js/typescript as optional.
  • Required shared peers: Explicitly retain optional: false for @alloy-js/core and @typespec/compiler.
  • Changelog: Add a fix entry describing the reduced peer requirements.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter-framework Issues for the emitter framework label Nov 4, 2026
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Alloy peer dependencies to be optional Make emitter-framework language-specific Alloy peers optional Nov 4, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Nov 19, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Hi @Copilot. Your PR has had no update for 14 days and it is marked as a stale PR. If it is not updated within 14 additional days, the PR will automatically be closed. The stale label is removed automatically when you update or comment on your PR, or when a maintainer reviews it. You can also remove the label manually.

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/emitter-framework@12495

commit: 8aa28d8

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.

🟡 Changes recommended

Making @alloy-js/typescript optional while root declarations still import its types causes TS2307 for C#- or Python-only consumers checking declarations with skipLibCheck: false.

1 open issue
What changed in this PR

This PR addresses #12476 by making language-specific Alloy peers optional in @typespec/emitter-framework, reducing unnecessary dependencies for single-language emitters.

Changes:

  • Mark the C#, Python, and TypeScript Alloy peers as optional.
  • Explicitly keep Alloy core and the TypeSpec compiler required.
  • Add a fix changelog entry describing the reduced peer requirements.
File Description
packages/​emitter-framework/​package.json Defines optional language peers and required shared peers.
.chronus/​changes/​copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md Documents the peer-dependency change.

Review effort: Balanced

Comment on lines +89 to +90
"@alloy-js/typescript": {
"optional": true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot looks like we might need to reorganize somethings to make this work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved Experimental_CustomTypeToProps to the TypeScript entry point, keeping the root declarations independent of @alloy-js/typescript. Verified with commit 25a0fce7.

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 13:42
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the stale Mark a PR that hasn't been recently updated and will be closed. label Nov 19, 2026

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.

🟢 Approval recommended

No active review issues are reported for the optional language-peer dependencies and relocated TypeScript-specific export.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 14:16

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues

Review effort: Lite

Comment on lines 1 to 5
import { type Children, type ComponentDefinition } from "@alloy-js/core";
import type { ObjectPropertyProps, VarDeclarationProps } from "@alloy-js/typescript";
import type {
Enum,
EnumMember,
Model,
ModelProperty,
Scalar,
Type,
Union,
UnionVariant,
} from "@typespec/compiler";
import type { ModelProperty, Type } from "@typespec/compiler";
import { useTsp } from "../../context/index.js";
import { type Experimental_ComponentOverridesConfig, getOverrideComponent } from "./config.js";
import { type ComponentOverridesContext, OverridesContext, useOverrides } from "./context.js";
Comment on lines +18 to +20
? {}
: TCustomType extends UnionVariant
? {}
Comment on lines +79 to +95
"peerDependenciesMeta": {
"@alloy-js/core": {
"optional": false
},
"@alloy-js/csharp": {
"optional": true
},
"@alloy-js/python": {
"optional": true
},
"@alloy-js/typescript": {
"optional": true
},
"@typespec/compiler": {
"optional": false
}
},
@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/emitter-framework
Show changes

@typespec/emitter-framework - fix ✏️

Make language-specific Alloy peer dependencies optional so emitters only need to install the language packages they use, while keeping Alloy core and the TypeSpec compiler required. The TypeScript-specific Experimental_CustomTypeToProps type is exported from the TypeScript entry point rather than the root entry point.

This branch has not been deployed

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

Labels

emitter-framework Issues for the emitter framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emitter framework: make the language-specific Alloy peer dependencies optional

3 participants