Skip to content

Commit

Permalink
Add missing type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 15, 2024
1 parent d3bd064 commit 397763a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions packages/cli-utils/src/commands/generate-output/runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as path from 'node:path';
import * as fs from 'node:fs/promises';
import type { GraphQLSPConfig, LoadConfigResult } from '@gql.tada/internal';
import type { IntrospectionQuery } from 'graphql';

Expand All @@ -11,7 +10,7 @@ import {
outputIntrospectionFile,
} from '@gql.tada/internal';

import type { TTY } from '../../term';
import type { TTY, ComposeInput } from '../../term';
import type { WriteTarget } from '../shared';
import { writeOutput } from '../shared';
import * as logger from './logger';
Expand All @@ -22,7 +21,7 @@ interface Options {
tsconfig: string | undefined;
}

export async function* run(tty: TTY, opts: Options) {
export async function* run(tty: TTY, opts: Options): AsyncIterable<ComposeInput> {
let configResult: LoadConfigResult;
let pluginConfig: GraphQLSPConfig;
try {
Expand Down
5 changes: 3 additions & 2 deletions packages/cli-utils/src/commands/generate-persisted/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { GraphQLSPConfig, LoadConfigResult } from '@gql.tada/internal';

import { loadConfig, parseConfig } from '@gql.tada/internal';

import type { TTY } from '../../term';
import type { TTY, ComposeInput } from '../../term';
import type { WriteTarget } from '../shared';
import { writeOutput } from '../shared';
import * as logger from './logger';
Expand All @@ -14,7 +14,7 @@ interface Options {
failOnWarn: boolean;
}

export async function* run(tty: TTY, opts: Options) {
export async function* run(tty: TTY, opts: Options): AsyncIterable<ComposeInput> {
const { runPersisted } = await import('./thread');

let configResult: LoadConfigResult;
Expand Down Expand Up @@ -98,6 +98,7 @@ export async function* run(tty: TTY, opts: Options) {
);
}
}

yield logger.infoSummary(warnings, documentCount);
}
}
5 changes: 2 additions & 3 deletions packages/cli-utils/src/commands/generate-schema/runner.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import { printSchema } from 'graphql';
import type { GraphQLSchema } from 'graphql';
import type { GraphQLSPConfig, LoadConfigResult } from '@gql.tada/internal';
import { load, loadConfig, parseConfig } from '@gql.tada/internal';

import type { TTY } from '../../term';
import type { TTY, ComposeInput } from '../../term';
import type { WriteTarget } from '../shared';
import { writeOutput } from '../shared';
import * as logger from './logger';
Expand All @@ -17,7 +16,7 @@ interface Options {
tsconfig: string | undefined;
}

export async function* run(tty: TTY, opts: Options) {
export async function* run(tty: TTY, opts: Options): AsyncIterable<ComposeInput> {
const origin = opts.headers ? { url: opts.input, headers: opts.headers } : opts.input;
const loader = load({ rootPath: process.cwd(), origin });

Expand Down
4 changes: 2 additions & 2 deletions packages/cli-utils/src/commands/turbo/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { GraphQLSPConfig, LoadConfigResult } from '@gql.tada/internal';

import { loadConfig, parseConfig } from '@gql.tada/internal';

import type { TTY } from '../../term';
import type { TTY, ComposeInput } from '../../term';
import type { WriteTarget } from '../shared';
import { writeOutput } from '../shared';
import * as logger from './logger';
Expand All @@ -16,7 +16,7 @@ interface Options {
output: string | undefined;
}

export async function* run(tty: TTY, opts: Options) {
export async function* run(tty: TTY, opts: Options): AsyncIterable<ComposeInput> {
const { runTurbo } = await import('./thread');

let configResult: LoadConfigResult;
Expand Down

0 comments on commit 397763a

Please sign in to comment.