Home / File/ migrate-legacy-classes.ts — tailwindcss Source File

migrate-legacy-classes.ts — tailwindcss Source File

Architecture documentation for migrate-legacy-classes.ts, a typescript file in the tailwindcss codebase. 12 imports, 2 dependents.

File typescript UpgradeToolkit Codemods 12 imports 2 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  f8237e3b_92f4_a95b_9115_6042ea9c4699["migrate-legacy-classes.ts"]
  669e6a28_c71f_3c5e_9c53_915cede7da78["candidate.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 669e6a28_c71f_3c5e_9c53_915cede7da78
  f29ee016_da0a_a564_1658_fedaaac680b6["cloneCandidate"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> f29ee016_da0a_a564_1658_fedaaac680b6
  af1a6ece_0432_a556_fd63_8cb4a91f12ad["plugin-api.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> af1a6ece_0432_a556_fd63_8cb4a91f12ad
  7fd72d4c_e95c_d849_1002_1e1c9d8aca1a["design-system.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a
  c056448b_f7a2_9149_54e8_f0f8470fe3aa["default-map.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> c056448b_f7a2_9149_54e8_f0f8470fe3aa
  bf2992f6_4a37_8536_70f8_94b13631027d["DefaultMap"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> bf2992f6_4a37_8536_70f8_94b13631027d
  fff09679_e13c_392d_23bb_cebc04ddb008["version.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> fff09679_e13c_392d_23bb_cebc04ddb008
  6818f003_fa74_ca6e_8dd1_99a7154be5c9["candidates.ts"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 6818f003_fa74_ca6e_8dd1_99a7154be5c9
  df17a03b_9c60_27a5_3fcf_5acdd9570ff9["baseCandidate"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> df17a03b_9c60_27a5_3fcf_5acdd9570ff9
  92f2d961_72a4_d195_92d7_2e66972f8894["node"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 92f2d961_72a4_d195_92d7_2e66972f8894
  2a7660a5_3e09_bd74_37f0_e4e54bc64ce5["node:path"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 2a7660a5_3e09_bd74_37f0_e4e54bc64ce5
  83f4eb5c_a623_9c4e_b3f7_d95e77d40d82["node:url"]
  f8237e3b_92f4_a95b_9115_6042ea9c4699 --> 83f4eb5c_a623_9c4e_b3f7_d95e77d40d82
  605bd17e_7d24_228a_fbf8_a68323a3e832["migrate-legacy-classes.test.ts"]
  605bd17e_7d24_228a_fbf8_a68323a3e832 --> f8237e3b_92f4_a95b_9115_6042ea9c4699
  75ba60a9_2614_1c57_ad40_3663d4315f3b["migrate.ts"]
  75ba60a9_2614_1c57_ad40_3663d4315f3b --> f8237e3b_92f4_a95b_9115_6042ea9c4699
  style f8237e3b_92f4_a95b_9115_6042ea9c4699 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { __unstable__loadDesignSystem } from '@tailwindcss/node'
import path from 'node:path'
import url from 'node:url'
import { cloneCandidate, type Candidate } from '../../../../tailwindcss/src/candidate'
import type { Config } from '../../../../tailwindcss/src/compat/plugin-api'
import type { DesignSystem } from '../../../../tailwindcss/src/design-system'
import { DefaultMap } from '../../../../tailwindcss/src/utils/default-map'
import * as version from '../../utils/version'
import { baseCandidate } from './candidates'

const __filename = url.fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const LEGACY_CLASS_MAP = new Map([
  ['shadow', 'shadow-sm'],
  ['shadow-sm', 'shadow-xs'],
  ['shadow-xs', 'shadow-2xs'],

  ['inset-shadow', 'inset-shadow-sm'],
  ['inset-shadow-sm', 'inset-shadow-xs'],
  ['inset-shadow-xs', 'inset-shadow-2xs'],

  ['drop-shadow', 'drop-shadow-sm'],
  ['drop-shadow-sm', 'drop-shadow-xs'],

  ['rounded', 'rounded-sm'],
  ['rounded-sm', 'rounded-xs'],

  ['blur', 'blur-sm'],
  ['blur-sm', 'blur-xs'],

  ['backdrop-blur', 'backdrop-blur-sm'],
  ['backdrop-blur-sm', 'backdrop-blur-xs'],

  ['ring', 'ring-3'],

  ['outline', 'outline-solid'],
])

const THEME_KEYS = new Map([
  ['shadow', '--shadow'],
  ['shadow-sm', '--shadow-sm'],
  ['shadow-xs', '--shadow-xs'],
  ['shadow-2xs', '--shadow-2xs'],

  ['drop-shadow', '--drop-shadow'],
  ['drop-shadow-sm', '--drop-shadow-sm'],
  ['drop-shadow-xs', '--drop-shadow-xs'],

  ['rounded', '--radius'],
  ['rounded-sm', '--radius-sm'],
  ['rounded-xs', '--radius-xs'],

  ['blur', '--blur'],
  ['blur-sm', '--blur-sm'],
  ['blur-xs', '--blur-xs'],

  ['backdrop-blur', '--backdrop-blur'],
  ['backdrop-blur-sm', '--backdrop-blur-sm'],
  ['backdrop-blur-xs', '--backdrop-blur-xs'],
// ... (85 more lines)

Subdomains

Frequently Asked Questions

What does migrate-legacy-classes.ts do?
migrate-legacy-classes.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the UpgradeToolkit domain, Codemods subdomain.
What functions are defined in migrate-legacy-classes.ts?
migrate-legacy-classes.ts defines 2 function(s): DESIGN_SYSTEMS, migrateLegacyClasses.
What does migrate-legacy-classes.ts depend on?
migrate-legacy-classes.ts imports 12 module(s): DefaultMap, baseCandidate, candidate.ts, candidates.ts, cloneCandidate, default-map.ts, design-system.ts, node, and 4 more.
What files import migrate-legacy-classes.ts?
migrate-legacy-classes.ts is imported by 2 file(s): migrate-legacy-classes.test.ts, migrate.ts.
Where is migrate-legacy-classes.ts in the architecture?
migrate-legacy-classes.ts is located at packages/@tailwindcss-upgrade/src/codemods/template/migrate-legacy-classes.ts (domain: UpgradeToolkit, subdomain: Codemods, directory: packages/@tailwindcss-upgrade/src/codemods/template).

Analyze Your Own Codebase

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

Try Supermodel Free