Skip to content

Commit f2ac45a

Browse files
committed
fixes
1 parent 7134068 commit f2ac45a

4 files changed

Lines changed: 38 additions & 36 deletions

File tree

auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import {
99
httpSubscriptionLink,
1010
retryLink,
1111
splitLink,
12-
type TRPCClient as OriginalTRPCClient,
1312
TRPCClientError,
1413
type TRPCLink,
14+
type TRPCUntypedClient,
1515
} from "@trpc/client";
1616
import { observable } from "@trpc/server/observable";
1717
import { Spinner } from "@std/cli/unstable-spinner";
@@ -20,7 +20,7 @@ import { EventSourcePolyfill } from "event-source-polyfill";
2020
import type { GlobalContext } from "./main.ts";
2121

2222
// deno-lint-ignore no-explicit-any
23-
export type TRPCClient = OriginalTRPCClient<any>;
23+
export type TRPCClient = TRPCUntypedClient<any>;
2424

2525
export function createTrpcClient(
2626
context: GlobalContext,

deploy/create/flow.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ export async function createFlow(
6565
const trpcClient = createTrpcClient(context);
6666

6767
let org;
68-
const orgs: Array<{
68+
const orgs = await trpcClient.query("orgs.list") as Array<{
6969
name: string;
7070
slug: string;
7171
id: string;
72-
// deno-lint-ignore no-explicit-any
73-
}> = await (trpcClient.orgs as any).list.query();
72+
}>;
7473

7574
if (orgs.length === 1) {
7675
org = orgs[0].slug;
@@ -451,11 +450,10 @@ async function github(
451450
context: GlobalContext,
452451
trpcClient: TRPCClient,
453452
) {
454-
const owners: Array<{
453+
const owners = await trpcClient.query("github.listOrgsForUser") as Array<{
455454
id: number;
456455
login: string;
457-
// deno-lint-ignore no-explicit-any
458-
}> = await (trpcClient.github as any).listOrgsForUser.query();
456+
}>;
459457

460458
const selectedOwner = promptSelect(
461459
"Select a github owner:",
@@ -470,13 +468,15 @@ async function github(
470468
}
471469
logTitle(TITLES.githubOwner, selectedOwner.value.login);
472470

473-
const repos: Array<{
471+
const repos = await trpcClient.query(
472+
"github.listReposInInstallationForUser",
473+
{
474+
installation_id: selectedOwner.value.id,
475+
},
476+
) as Array<{
474477
id: number;
475478
name: string;
476-
// deno-lint-ignore no-explicit-any
477-
}> = await (trpcClient.github as any).listReposInInstallationForUser.query({
478-
installation_id: selectedOwner.value.id,
479-
});
479+
}>;
480480

481481
const selectedRepo = promptSelect(
482482
"Select a github repo:",
@@ -491,12 +491,13 @@ async function github(
491491
}
492492
logTitle(TITLES.githubRepo, selectedRepo.value.name);
493493

494-
const appDirectories: WorkspaceDetectionResult =
495-
// deno-lint-ignore no-explicit-any
496-
await (trpcClient.github as any).detectWorkspaceForRepo.query({
494+
const appDirectories = await trpcClient.query(
495+
"github.detectWorkspaceForRepo",
496+
{
497497
owner: selectedOwner.value.login,
498498
repo: selectedRepo.value.name,
499-
});
499+
},
500+
) as WorkspaceDetectionResult;
500501

501502
return {
502503
appDirectories,

deploy/create/mod.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@ export const createCommand = new Command<GlobalContext>()
213213
};
214214

215215
const trpcClient = createTrpcClient(options);
216-
// deno-lint-ignore no-explicit-any
217-
appDirectories = await (trpcClient.github as any).detectWorkspaceForRepo
218-
.query(repo);
216+
appDirectories = await trpcClient.query(
217+
"github.detectWorkspaceForRepo",
218+
repo,
219+
) as WorkspaceDetectionResult;
219220
} else {
220221
appDirectories = await detectWorkspace(
221222
new FrameworkFileSystemReader(rootPath),
@@ -245,7 +246,9 @@ export const createCommand = new Command<GlobalContext>()
245246
if (member?.buildConfig) {
246247
buildConfig = member?.buildConfig;
247248
} else {
248-
console.warn(`No build configuration was detected in '${buildDirectory}'.`);
249+
console.warn(
250+
`No build configuration was detected in '${buildDirectory}'.`,
251+
);
249252
}
250253
}
251254

@@ -402,8 +405,7 @@ export async function createApp(
402405
deviceCreation = id;
403406
}
404407

405-
// deno-lint-ignore no-explicit-any
406-
await (trpcClient.apps as any).create.mutate({
408+
await trpcClient.mutation("apps.create", {
407409
org: data.org,
408410
slug: data.app,
409411
repo: data.repo,
@@ -428,14 +430,12 @@ export async function createApp(
428430
wait ?? false,
429431
);
430432
} else {
431-
// deno-lint-ignore no-explicit-any
432-
const revisionId = await (trpcClient.apps as any).triggerGitHubBuild.mutate(
433-
{
434-
org: data.org,
435-
app: data.app,
436-
branch: null,
437-
},
438-
);
433+
const revisionId = await trpcClient.mutation("apps.triggerGitHubBuild", {
434+
org: data.org,
435+
app: data.app,
436+
branch: null,
437+
}) as string;
438+
439439
console.log(
440440
`You can view the revision here:\n ${context.endpoint}/${data.org}/${data.app}/builds/${revisionId}\n`,
441441
);

deploy/publish.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export async function publish(
175175
existingFilesSpinner.start();
176176

177177
let revision: Revision | undefined = undefined;
178-
const sub = await trpcClient.subscription(
178+
const sub = trpcClient.subscription(
179179
"revisions.watchUntilReady",
180180
{
181181
org,
@@ -355,14 +355,14 @@ export async function waitForRevision(
355355

356356
const completionPromise = Promise.withResolvers<void>();
357357

358-
// deno-lint-ignore no-explicit-any
359-
const completionSub = await trpcClient.subscription(
358+
const completionSub = trpcClient.subscription(
360359
"revisions.watchUntilReady",
361360
{
362361
org,
363362
app,
364363
revision: revisionId,
365-
}, {
364+
},
365+
{
366366
onData: (data: unknown) => {
367367
const newRevision = data as Revision;
368368
revision = newRevision;
@@ -383,7 +383,8 @@ export async function waitForRevision(
383383
onStopped: () => {
384384
completionSub.unsubscribe();
385385
},
386-
});
386+
},
387+
);
387388

388389
await completionPromise.promise;
389390

0 commit comments

Comments
 (0)