Home / Function/ migrateCandidate() — tailwindcss Function Reference

migrateCandidate() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8408bbf2_f1a4_0668_26f9_b4cdef678388["migrateCandidate()"]
  75ba60a9_2614_1c57_ad40_3663d4315f3b["migrate.ts"]
  8408bbf2_f1a4_0668_26f9_b4cdef678388 -->|defined in| 75ba60a9_2614_1c57_ad40_3663d4315f3b
  66e0bbad_4b95_c393_4a95_0a694140aecd["migrateAtApply()"]
  66e0bbad_4b95_c393_4a95_0a694140aecd -->|calls| 8408bbf2_f1a4_0668_26f9_b4cdef678388
  404037a5_0bed_880c_5e9a_954d7ffbf6d7["migrateContents()"]
  404037a5_0bed_880c_5e9a_954d7ffbf6d7 -->|calls| 8408bbf2_f1a4_0668_26f9_b4cdef678388
  aa2e93eb_f211_d616_3736_f2a6e60dfa72["isSafeMigration()"]
  8408bbf2_f1a4_0668_26f9_b4cdef678388 -->|calls| aa2e93eb_f211_d616_3736_f2a6e60dfa72
  5bcf4886_1230_a8ff_7302_a26cc5a9a525["get()"]
  8408bbf2_f1a4_0668_26f9_b4cdef678388 -->|calls| 5bcf4886_1230_a8ff_7302_a26cc5a9a525
  style 8408bbf2_f1a4_0668_26f9_b4cdef678388 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)
}

Subdomains

Frequently Asked Questions

What does migrateCandidate() do?
migrateCandidate() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/codemods/template/migrate.ts.
Where is migrateCandidate() defined?
migrateCandidate() is defined in packages/@tailwindcss-upgrade/src/codemods/template/migrate.ts at line 72.
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