From 8bc542e030d23dfbbbc5e3e510360702813f71ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:03:25 +0000 Subject: [PATCH 1/4] Initial plan From 346825c62f5d93ccf3003b8e9a963d4411942acf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:09:19 +0000 Subject: [PATCH 2/4] fix(emitter-framework): make language-specific Alloy peers optional Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- packages/emitter-framework/package.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/emitter-framework/package.json b/packages/emitter-framework/package.json index 0e0c2bfd25c..9fff92851f9 100644 --- a/packages/emitter-framework/package.json +++ b/packages/emitter-framework/package.json @@ -76,6 +76,23 @@ "@alloy-js/typescript": "catalog:", "@typespec/compiler": "workspace:^" }, + "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 + } + }, "devDependencies": { "@alloy-js/cli": "catalog:", "@alloy-js/core": "catalog:", From 68fca68d4a7920a8cc35cf3b855effdf10806a8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:12:08 +0000 Subject: [PATCH 3/4] docs(emitter-framework): add optional Alloy peers changelog Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- ...e-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md diff --git a/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md b/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md new file mode 100644 index 00000000000..a34c08df59a --- /dev/null +++ b/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/emitter-framework" +--- + +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. \ No newline at end of file From 25a0fce727fae3bcd1dacf97843df7496b9ebe96 Mon Sep 17 00:00:00 2001 From: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:42:09 +0000 Subject: [PATCH 4/4] fix(emitter-framework): isolate TypeScript override prop types Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- ...dependencies-optional-2026-10-4-20-9-29.md | 2 +- .../overrides/component-overrides.tsx | 27 +------------------ .../src/typescript/component-overrides.ts | 23 ++++++++++++++++ .../emitter-framework/src/typescript/index.ts | 1 + 4 files changed, 26 insertions(+), 27 deletions(-) create mode 100644 packages/emitter-framework/src/typescript/component-overrides.ts diff --git a/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md b/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md index a34c08df59a..73179b33da9 100644 --- a/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md +++ b/.chronus/changes/copilot-make-alloy-peer-dependencies-optional-2026-10-4-20-9-29.md @@ -4,4 +4,4 @@ packages: - "@typespec/emitter-framework" --- -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. \ No newline at end of file +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. \ No newline at end of file diff --git a/packages/emitter-framework/src/core/components/overrides/component-overrides.tsx b/packages/emitter-framework/src/core/components/overrides/component-overrides.tsx index 22316b69a8f..6a713cd6a29 100644 --- a/packages/emitter-framework/src/core/components/overrides/component-overrides.tsx +++ b/packages/emitter-framework/src/core/components/overrides/component-overrides.tsx @@ -1,15 +1,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"; @@ -27,21 +17,6 @@ export interface Experimental_OverrideEmitPropsBase { default: Children; } -/** - * Maps TypeSpec shapes to the corresponding TypeScript declaration props. - * This mapping is TypeScript-specific; use an explicit declaration props type for other languages. - */ -export type Experimental_CustomTypeToProps = - TCustomType extends ModelProperty - ? ObjectPropertyProps - : TCustomType extends EnumMember - ? {} - : TCustomType extends UnionVariant - ? {} - : TCustomType extends Model | Scalar | Union | Enum - ? VarDeclarationProps - : VarDeclarationProps | ObjectPropertyProps; - /** Inputs to a reference override, including the property that uses the referenced type when available. */ export interface Experimental_OverrideReferenceProps< TCustomType extends Type, diff --git a/packages/emitter-framework/src/typescript/component-overrides.ts b/packages/emitter-framework/src/typescript/component-overrides.ts new file mode 100644 index 00000000000..87b5801ade9 --- /dev/null +++ b/packages/emitter-framework/src/typescript/component-overrides.ts @@ -0,0 +1,23 @@ +import type { ObjectPropertyProps, VarDeclarationProps } from "@alloy-js/typescript"; +import type { + Enum, + EnumMember, + Model, + ModelProperty, + Scalar, + Type, + Union, + UnionVariant, +} from "@typespec/compiler"; + +/** Maps TypeSpec shapes to the corresponding TypeScript declaration props. */ +export type Experimental_CustomTypeToProps = + TCustomType extends ModelProperty + ? ObjectPropertyProps + : TCustomType extends EnumMember + ? {} + : TCustomType extends UnionVariant + ? {} + : TCustomType extends Model | Scalar | Union | Enum + ? VarDeclarationProps + : VarDeclarationProps | ObjectPropertyProps; diff --git a/packages/emitter-framework/src/typescript/index.ts b/packages/emitter-framework/src/typescript/index.ts index be95a933d22..dd16ac754f1 100644 --- a/packages/emitter-framework/src/typescript/index.ts +++ b/packages/emitter-framework/src/typescript/index.ts @@ -1,2 +1,3 @@ +export * from "./component-overrides.js"; export * from "./components/index.js"; export * from "./utils/index.js";