Repository navigation
Make emitter-framework language-specific Alloy peers optional - #12495
Timothee Guerin (timotheeguerin) with Copilot wants to merge 5 commits into
Conversation
|
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>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
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 |
commit: |
There was a problem hiding this comment.
🟡 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
| "@alloy-js/typescript": { | ||
| "optional": true |
There was a problem hiding this comment.
Copilot looks like we might need to reorganize somethings to make this work
There was a problem hiding this comment.
Moved Experimental_CustomTypeToProps to the TypeScript entry point, keeping the root declarations independent of @alloy-js/typescript. Verified with commit 25a0fce7.
|
You can try these changes here
|
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
RemovingExperimental_CustomTypeToPropsfrom this core module (and re-exporting it only from the… · New Using{}for theEnumMember/UnionVariantbranches is overly permissive in TypeScript ({}… · New Optional peer dependency still leaks into root TypeScript declarationspeerDependenciesMetaentries are only meaningful for packages that also exist in… · New
Review effort: Lite
| 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"; |
| ? {} | ||
| : TCustomType extends UnionVariant | ||
| ? {} |
| "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 | ||
| } | ||
| }, |
|
All changed packages have been documented.
Show changes
|


@typespec/emitter-frameworkrequires every Alloy language package, causing single-language emitters to install unused packages or receive missing-peer warnings.@alloy-js/csharp,@alloy-js/python, and@alloy-js/typescriptas optional.optional: falsefor@alloy-js/coreand@typespec/compiler.