migrate-legacy-arbitrary-values.ts — tailwindcss Source File
Architecture documentation for migrate-legacy-arbitrary-values.ts, a typescript file in the tailwindcss codebase. 9 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR a3df83e7_b177_b92b_d91f_ff6ea6bba20c["migrate-legacy-arbitrary-values.ts"] ba6fca27_7720_5839_0f92_bc2abb8db636["candidate.ts"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> ba6fca27_7720_5839_0f92_bc2abb8db636 23c6e5a0_eac4_e9dd_7fcf_1e5c71d28310["cloneCandidate"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> 23c6e5a0_eac4_e9dd_7fcf_1e5c71d28310 7d328a86_10c6_b5c1_6390_36f4fffe9c14["parseCandidate"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> 7d328a86_10c6_b5c1_6390_36f4fffe9c14 da5d1116_ab2a_437a_6b13_c1429fd546fa["plugin-api.ts"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> da5d1116_ab2a_437a_6b13_c1429fd546fa 0255ffc0_a3d5_e883_5143_99660766448f["Config"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> 0255ffc0_a3d5_e883_5143_99660766448f bdedd2f6_da4b_69dc_e990_0814b59fbe6e["design-system.ts"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> bdedd2f6_da4b_69dc_e990_0814b59fbe6e 665aa4ed_d86e_30e5_80d5_cd56b8ca8b62["DesignSystem"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> 665aa4ed_d86e_30e5_80d5_cd56b8ca8b62 bb9924cc_8308_a1f9_0e30_76de45a64970["segment.ts"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> bb9924cc_8308_a1f9_0e30_76de45a64970 c58cbb33_f3cc_0b4f_844a_15bf66a1dc61["segment"] a3df83e7_b177_b92b_d91f_ff6ea6bba20c --> c58cbb33_f3cc_0b4f_844a_15bf66a1dc61 f9f4dd09_af8a_7dca_384d_340331dcd40b["migrate-legacy-arbitrary-values.test.ts"] f9f4dd09_af8a_7dca_384d_340331dcd40b --> a3df83e7_b177_b92b_d91f_ff6ea6bba20c e39bed3f_bfbf_a8c6_90a0_aa2ce3be1ef4["migrate.ts"] e39bed3f_bfbf_a8c6_90a0_aa2ce3be1ef4 --> a3df83e7_b177_b92b_d91f_ff6ea6bba20c style a3df83e7_b177_b92b_d91f_ff6ea6bba20c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { cloneCandidate, parseCandidate } from '../../../../tailwindcss/src/candidate'
import type { Config } from '../../../../tailwindcss/src/compat/plugin-api'
import type { DesignSystem } from '../../../../tailwindcss/src/design-system'
import { segment } from '../../../../tailwindcss/src/utils/segment'
export function migrateLegacyArbitraryValues(
designSystem: DesignSystem,
_userConfig: Config | null,
rawCandidate: string,
): string {
for (let candidate of parseCandidate(rawCandidate, designSystem)) {
let clone = cloneCandidate(candidate)
let changed = false
// Convert commas to spaces. E.g.: [auto,1fr] to [auto_1fr]
if (
clone.kind === 'functional' &&
clone.value?.kind === 'arbitrary' &&
(clone.root === 'grid-cols' || clone.root == 'grid-rows' || clone.root == 'object')
) {
changed = true
clone.value.value = segment(clone.value.value, ',').join(' ')
}
return changed ? designSystem.printCandidate(clone) : rawCandidate
}
return rawCandidate
}
Domain
Subdomains
Functions
Dependencies
Imported By
Source
Frequently Asked Questions
What does migrate-legacy-arbitrary-values.ts do?
migrate-legacy-arbitrary-values.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the CommandLineInterface domain, Codemods subdomain.
What functions are defined in migrate-legacy-arbitrary-values.ts?
migrate-legacy-arbitrary-values.ts defines 1 function(s): migrateLegacyArbitraryValues.
What does migrate-legacy-arbitrary-values.ts depend on?
migrate-legacy-arbitrary-values.ts imports 9 module(s): Config, DesignSystem, candidate.ts, cloneCandidate, design-system.ts, parseCandidate, plugin-api.ts, segment, and 1 more.
What files import migrate-legacy-arbitrary-values.ts?
migrate-legacy-arbitrary-values.ts is imported by 2 file(s): migrate-legacy-arbitrary-values.test.ts, migrate.ts.
Where is migrate-legacy-arbitrary-values.ts in the architecture?
migrate-legacy-arbitrary-values.ts is located at packages/@tailwindcss-upgrade/src/codemods/template/migrate-legacy-arbitrary-values.ts (domain: CommandLineInterface, 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