Home / File/ migrate-handle-empty-arbitrary-values.test.ts — tailwindcss Source File

migrate-handle-empty-arbitrary-values.test.ts — tailwindcss Source File

Architecture documentation for migrate-handle-empty-arbitrary-values.test.ts, a typescript file in the tailwindcss codebase. 7 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  d51977aa_e57d_6179_0d9a_3c91e11a2a64["migrate-handle-empty-arbitrary-values.test.ts"]
  472e1b98_afcf_f1f2_ad91_916d742bb731["version.ts"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> 472e1b98_afcf_f1f2_ad91_916d742bb731
  ca0b656a_eb12_8775_7c9e_8ec36fc0519a["migrate-handle-empty-arbitrary-values.ts"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> ca0b656a_eb12_8775_7c9e_8ec36fc0519a
  c21053c4_bf58_de9a_aac7_84c86dc78bd3["migrateEmptyArbitraryValues"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> c21053c4_bf58_de9a_aac7_84c86dc78bd3
  e4e5ac2c_0d58_689d_0ad6_7086823787f1["migrate-prefix.ts"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> e4e5ac2c_0d58_689d_0ad6_7086823787f1
  7a457be5_eaef_02ce_7bc4_4e0317ecd8ce["migratePrefix"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> 7a457be5_eaef_02ce_7bc4_4e0317ecd8ce
  08129f89_e6ef_0092_629d_821c60228c89["node"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> 08129f89_e6ef_0092_629d_821c60228c89
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  d51977aa_e57d_6179_0d9a_3c91e11a2a64 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style d51977aa_e57d_6179_0d9a_3c91e11a2a64 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { __unstable__loadDesignSystem } from '@tailwindcss/node'
import { expect, test, vi } from 'vitest'
import * as versions from '../../utils/version'
import { migrateEmptyArbitraryValues } from './migrate-handle-empty-arbitrary-values'
import { migratePrefix } from './migrate-prefix'
vi.spyOn(versions, 'isMajor').mockReturnValue(true)

test.each([
  ['group-[]:flex', 'group-[&]:flex'],
  ['group-[]/name:flex', 'group-[&]/name:flex'],

  ['peer-[]:flex', 'peer-[&]:flex'],
  ['peer-[]/name:flex', 'peer-[&]/name:flex'],
])('%s => %s (%#)', async (candidate, result) => {
  let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss";', {
    base: __dirname,
  })

  expect(migrateEmptyArbitraryValues(designSystem, {}, candidate)).toEqual(result)
})

test.each([
  ['group-[]:tw-flex', 'tw:group-[&]:flex'],
  ['group-[]/name:tw-flex', 'tw:group-[&]/name:flex'],

  ['peer-[]:tw-flex', 'tw:peer-[&]:flex'],
  ['peer-[]/name:tw-flex', 'tw:peer-[&]/name:flex'],
])('%s => %s (%#)', async (candidate, result) => {
  let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss" prefix(tw);', {
    base: __dirname,
  })

  expect(
    [migrateEmptyArbitraryValues, migratePrefix].reduce(
      (acc, step) => step(designSystem, { prefix: 'tw-' }, acc),
      candidate,
    ),
  ).toEqual(result)
})

Frequently Asked Questions

What does migrate-handle-empty-arbitrary-values.test.ts do?
migrate-handle-empty-arbitrary-values.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the CommandLineInterface domain.
What does migrate-handle-empty-arbitrary-values.test.ts depend on?
migrate-handle-empty-arbitrary-values.test.ts imports 7 module(s): migrate-handle-empty-arbitrary-values.ts, migrate-prefix.ts, migrateEmptyArbitraryValues, migratePrefix, node, version.ts, vitest.
Where is migrate-handle-empty-arbitrary-values.test.ts in the architecture?
migrate-handle-empty-arbitrary-values.test.ts is located at packages/@tailwindcss-upgrade/src/codemods/template/migrate-handle-empty-arbitrary-values.test.ts (domain: CommandLineInterface, 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