Skip to content

Commit 77ca120

Browse files
authored
feat: cli app creation flow & flags (#69)
1 parent bd05720 commit 77ca120

10 files changed

Lines changed: 1546 additions & 222 deletions

File tree

auth.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ import {
1111
splitLink,
1212
TRPCClientError,
1313
type TRPCLink,
14+
type TRPCUntypedClient,
1415
} from "@trpc/client";
1516
import { observable } from "@trpc/server/observable";
1617
import { Spinner } from "@std/cli/unstable-spinner";
1718
import { error } from "./util.ts";
1819
import { EventSourcePolyfill } from "event-source-polyfill";
1920
import type { GlobalContext } from "./main.ts";
2021

22+
// deno-lint-ignore no-explicit-any
23+
export type TRPCClient = TRPCUntypedClient<any>;
24+
2125
export function createTrpcClient(
2226
context: GlobalContext,
2327
quiet: boolean = false,

config.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createTrpcClient, getAuth } from "./auth.ts";
22
import type { GlobalContext } from "./main.ts";
3-
import { create, error } from "./util.ts";
3+
import { error } from "./util.ts";
44
import {
55
type PromptEntry,
66
promptSelect,
@@ -16,6 +16,8 @@ import {
1616
resolve_config_with_deploy_config,
1717
} from "./lib/rs_lib.js";
1818
import { ValidationError } from "@cliffy/command";
19+
import { createFlow } from "./deploy/create/flow.ts";
20+
import { createApp } from "./deploy/create/mod.ts";
1921

2022
export async function getOrg(
2123
context: GlobalContext,
@@ -128,8 +130,17 @@ export async function getApp(
128130
}
129131

130132
if (selectedApp.value === null) {
131-
const createdOrgAndApp = await create(context, rootPath!, org);
132-
app = createdOrgAndApp.app;
133+
const data = await createFlow(context, rootPath!);
134+
await createApp(
135+
context,
136+
data,
137+
rootPath!,
138+
false,
139+
true,
140+
);
141+
config.org = data.org;
142+
config.app = data.app;
143+
app = data.app;
133144
created = true;
134145
} else {
135146
app = selectedApp.value.slug;

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"jsonc-parser": "npm:jsonc-parser@^3.3.1",
3737
"open": "npm:open@^10.1.0",
3838
"superjson": "npm:superjson@^2.2.2",
39-
"@deno/framework-detect": "jsr:@deno/framework-detect@^0",
39+
"@deno/framework-detect": "jsr:@deno/framework-detect@^0.3",
4040
"temporal-polyfill": "npm:temporal-polyfill@^0.3.0",
4141
"pg-connection-string": "npm:pg-connection-string@^2.9.1",
4242
"dax": "jsr:@david/dax@^0.44.2"

deno.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)