-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: use @vercel/detect-agent for repo creation #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import { determineAgent } from "@vercel/detect-agent"; | ||
| import * as z from "zod/mini"; | ||
|
|
||
| import { NotFoundRequestError, request } from "../lib/request"; | ||
|
|
@@ -320,14 +321,15 @@ export async function createRepository(config: { | |
| domain: string; | ||
| name?: string; | ||
| framework: string; | ||
| agent: string | undefined; | ||
| token: string | undefined; | ||
| host: string; | ||
| }): Promise<void> { | ||
| const { domain, name, framework, agent, token, host } = config; | ||
| const { domain, name, framework, token, host } = config; | ||
| const url = new URL("app/dashboard/repositories", getDashboardUrl(host)); | ||
| url.searchParams.set("app", "cli"); | ||
| if (agent) url.searchParams.set("agent", agent); | ||
|
|
||
| const { isAgent, agent } = await determineAgent(); | ||
| if (isAgent) url.searchParams.set("agent", agent.name); | ||
|
Comment on lines
+331
to
+332
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 #idea: I prefer keeping the clients as a light layer above the API, essentially just a TypeScript wrapper around the endpoints. It helps keep the mental model simple in each area of the CLI. That being said, I see the benefit of adding it in here. |
||
|
|
||
| const body: Record<string, unknown> = { domain, framework, plan: "personal" }; | ||
| if (name) { | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.