edit-in-v0.ts — ui Source File
Architecture documentation for edit-in-v0.ts, a typescript file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR cd9b6915_a6ba_735e_a2e4_e60f625b4070["edit-in-v0.ts"] ba402b74_8010_c3d3_546a_3ea25557b67a["server"] cd9b6915_a6ba_735e_a2e4_e60f625b4070 --> ba402b74_8010_c3d3_546a_3ea25557b67a ec70b8dd_bad3_0120_b3da_3927651dc74d["change-case"] cd9b6915_a6ba_735e_a2e4_e60f625b4070 --> ec70b8dd_bad3_0120_b3da_3927651dc74d 7a25f51b_551e_131b_bc51_bd5ccc7c308c["registry"] cd9b6915_a6ba_735e_a2e4_e60f625b4070 --> 7a25f51b_551e_131b_bc51_bd5ccc7c308c 9798186b_08af_1d79_2ad7_d662300dc0ba["registry-styles"] cd9b6915_a6ba_735e_a2e4_e60f625b4070 --> 9798186b_08af_1d79_2ad7_d662300dc0ba style cd9b6915_a6ba_735e_a2e4_e60f625b4070 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use server"
import { track } from "@vercel/analytics/server"
import { capitalCase } from "change-case"
import { getRegistryItem } from "@/lib/registry"
import { Style } from "@/registry/registry-styles"
const TAILWIND_CONFIG_BLOCKS = ["dashboard-01"]
export async function editInV0({
name,
style,
url,
}: {
name: string
style?: Style["name"]
url: string
}) {
style = style ?? "new-york"
try {
const registryItem = await getRegistryItem(name, style)
if (!registryItem) {
return { error: "Something went wrong. Please try again later." }
}
await track("edit_in_v0", {
name,
title: registryItem.name,
description: registryItem.description ?? registryItem.name,
style,
url,
})
// Remove v0 prefix from the name
registryItem.name = registryItem.name.replace(/^v0-/, "")
const projectName = capitalCase(name.replace(/\d+/g, ""))
registryItem.description = registryItem.description || projectName
// Replace `@/registry/new-york/` in files.
registryItem.files = registryItem.files?.map((file) => {
if (file.content?.includes("@/registry/new-york/ui")) {
file.content = file.content?.replaceAll(
"@/registry/new-york/ui",
"@/components/ui"
)
}
return file
})
if (TAILWIND_CONFIG_BLOCKS.includes(name)) {
registryItem.files?.push({
path: "tailwind.config.js",
type: "registry:file",
target: "tailwind.config.js",
content: TAILWIND_CONFIG,
})
}
// ... (146 more lines)
Domain
Subdomains
Functions
Dependencies
- change-case
- registry
- registry-styles
- server
Source
Frequently Asked Questions
What does edit-in-v0.ts do?
edit-in-v0.ts is a source file in the ui codebase, written in typescript. It belongs to the ComponentRegistry domain, Styles subdomain.
What functions are defined in edit-in-v0.ts?
edit-in-v0.ts defines 1 function(s): editInV0.
What does edit-in-v0.ts depend on?
edit-in-v0.ts imports 4 module(s): change-case, registry, registry-styles, server.
Where is edit-in-v0.ts in the architecture?
edit-in-v0.ts is located at deprecated/www/actions/edit-in-v0.ts (domain: ComponentRegistry, subdomain: Styles, directory: deprecated/www/actions).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free