Skip to content

Commit 9d65cbe

Browse files
committed
Delete legacy emitter files replaced by component architecture
Removes the old procedural emitter implementation now fully replaced by the Alloy JSX component-based emitter: - graphql-emitter.ts (old emitter implementation) - schema-emitter.ts (old schema-specific emitter) - registry.ts (old type registry) - type-maps.ts (old type mapping logic) - emitter.test.ts (old emitter tests) Replaces emitter.ts with a no-op stub so the package still conforms to the TypeSpec emitter interface. The real component-based emitter is added in the next PR in the chain.
1 parent 7d1bdd7 commit 9d65cbe

6 files changed

Lines changed: 4 additions & 432 deletions

File tree

packages/graphql/src/emitter.ts

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
1-
import type { EmitContext, NewLine } from "@typespec/compiler";
2-
import { resolvePath } from "@typespec/compiler";
3-
import { createGraphQLEmitter } from "./graphql-emitter.js";
1+
import type { EmitContext } from "@typespec/compiler";
42
import type { GraphQLEmitterOptions } from "./lib.js";
53

6-
const defaultOptions = {
7-
"new-line": "lf",
8-
"omit-unreachable-types": false,
9-
strict: false,
10-
} as const;
11-
12-
export async function $onEmit(context: EmitContext<GraphQLEmitterOptions>) {
13-
const options = resolveOptions(context);
14-
const emitter = createGraphQLEmitter(context, options);
15-
await emitter.emitGraphQL();
16-
}
17-
18-
export interface ResolvedGraphQLEmitterOptions {
19-
outputFile: string;
20-
newLine: NewLine;
21-
omitUnreachableTypes: boolean;
22-
strict: boolean;
23-
}
24-
25-
export function resolveOptions(
26-
context: EmitContext<GraphQLEmitterOptions>,
27-
): ResolvedGraphQLEmitterOptions {
28-
const resolvedOptions = { ...defaultOptions, ...context.options };
29-
const outputFile = resolvedOptions["output-file"] ?? "{schema-name}.graphql";
30-
31-
return {
32-
outputFile: resolvePath(context.emitterOutputDir, outputFile),
33-
newLine: resolvedOptions["new-line"],
34-
omitUnreachableTypes: resolvedOptions["omit-unreachable-types"],
35-
strict: resolvedOptions["strict"],
36-
};
37-
}
4+
// Placeholder — the legacy emitter has been removed and the new
5+
// component-based emitter will be added in a follow-up PR.
6+
export async function $onEmit(_context: EmitContext<GraphQLEmitterOptions>) {}

packages/graphql/src/graphql-emitter.ts

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/graphql/src/registry.ts

Lines changed: 0 additions & 115 deletions
This file was deleted.

packages/graphql/src/schema-emitter.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)