Home / Function/ updateNextFonts() — ui Function Reference

updateNextFonts() — ui Function Reference

Architecture documentation for the updateNextFonts() function in update-fonts.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  fef00f60_5066_884e_a811_e67807ebd0a0["updateNextFonts()"]
  b169f1bf_76c5_e7c9_f493_15fe0f296591["update-fonts.ts"]
  fef00f60_5066_884e_a811_e67807ebd0a0 -->|defined in| b169f1bf_76c5_e7c9_f493_15fe0f296591
  45970ac3_c363_5014_79ab_2676413c3c46["updateFonts()"]
  45970ac3_c363_5014_79ab_2676413c3c46 -->|calls| fef00f60_5066_884e_a811_e67807ebd0a0
  bd2a3bf4_2986_cc71_7a80_e94ccb460bb0["findLayoutFile()"]
  fef00f60_5066_884e_a811_e67807ebd0a0 -->|calls| bd2a3bf4_2986_cc71_7a80_e94ccb460bb0
  fb488c27_d35b_ddbe_26c7_6bfb5c38105a["transformLayoutFonts()"]
  fef00f60_5066_884e_a811_e67807ebd0a0 -->|calls| fb488c27_d35b_ddbe_26c7_6bfb5c38105a
  style fef00f60_5066_884e_a811_e67807ebd0a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-fonts.ts lines 115–137

async function updateNextFonts(
  fonts: RegistryFontItem[],
  config: Config,
  projectInfo: ProjectInfo
) {
  // Find layout file.
  const layoutPath = await findLayoutFile(config, projectInfo)

  if (!layoutPath) {
    return
  }

  const layoutContent = await fs.readFile(layoutPath, "utf-8")
  const updatedContent = await transformLayoutFonts(
    layoutContent,
    fonts,
    config
  )

  if (updatedContent !== layoutContent) {
    await fs.writeFile(layoutPath, updatedContent, "utf-8")
  }
}

Subdomains

Called By

Frequently Asked Questions

What does updateNextFonts() do?
updateNextFonts() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-fonts.ts.
Where is updateNextFonts() defined?
updateNextFonts() is defined in packages/shadcn/src/utils/updaters/update-fonts.ts at line 115.
What does updateNextFonts() call?
updateNextFonts() calls 2 function(s): findLayoutFile, transformLayoutFonts.
What calls updateNextFonts()?
updateNextFonts() is called by 1 function(s): updateFonts.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free