Home / Function/ migrateCandidate() — tailwindcss Function Reference

migrateCandidate() — tailwindcss Function Reference

Architecture documentation for the migrateCandidate() function in migrate.ts from the tailwindcss codebase.

Function typescript OxideCore Extractor calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  a8567d3a_b9d2_a553_2828_a5a6b62364da["migrateCandidate()"]
  d42d902c_ed1a_408e_b745_e2810d7e1b4b["migrateAtApply()"]
  d42d902c_ed1a_408e_b745_e2810d7e1b4b -->|calls| a8567d3a_b9d2_a553_2828_a5a6b62364da
  871e666f_c351_cfe2_299d_26df411fa6c5["migrateContents()"]
  871e666f_c351_cfe2_299d_26df411fa6c5 -->|calls| a8567d3a_b9d2_a553_2828_a5a6b62364da
  aca11807_c543_c2c2_e4e5_c0f3adcb5924["isSafeMigration()"]
  a8567d3a_b9d2_a553_2828_a5a6b62364da -->|calls| aca11807_c543_c2c2_e4e5_c0f3adcb5924
  0aa64a1c_efd8_a69d_48ed_649b7a86c854["get()"]
  a8567d3a_b9d2_a553_2828_a5a6b62364da -->|calls| 0aa64a1c_efd8_a69d_48ed_649b7a86c854
  style a8567d3a_b9d2_a553_2828_a5a6b62364da fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/template/migrate.ts lines 72–89

export async function migrateCandidate(
  designSystem: DesignSystem,
  userConfig: Config | null,
  rawCandidate: string,
  // Location is only set when migrating a candidate from a source file
  location?: {
    contents: string
    start: number
    end: number
  },
): Promise<string> {
  // Skip this migration if we think that the migration is unsafe
  if (location && !isSafeMigration(rawCandidate, location, designSystem)) {
    return rawCandidate
  }

  return migrateCached.get(designSystem).get(userConfig).get(rawCandidate)
}

Domain

Subdomains

Frequently Asked Questions

What does migrateCandidate() do?
migrateCandidate() is a function in the tailwindcss codebase.
What does migrateCandidate() call?
migrateCandidate() calls 2 function(s): get, isSafeMigration.
What calls migrateCandidate()?
migrateCandidate() is called by 2 function(s): migrateAtApply, migrateContents.

Analyze Your Own Codebase

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

Try Supermodel Free