migrate-js-config.ts — tailwindcss Source File
Architecture documentation for migrate-js-config.ts, a typescript file in the tailwindcss codebase. 36 imports, 3 dependents.
Entity Profile
Dependency Diagram
graph LR b2ba3368_7330_fe20_4543_9cafa8cfedc0["migrate-js-config.ts"] 69d3ce9e_56db_8f40_5261_64f91b0dee31["compile.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 69d3ce9e_56db_8f40_5261_64f91b0dee31 0dec976b_4cf5_63bb_0d29_f560fe197a3b["loadModule"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 0dec976b_4cf5_63bb_0d29_f560fe197a3b 3537600c_05e8_d2be_061f_2b6f3002fbf6["../../../../tailwindcss/dist/default-theme"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 3537600c_05e8_d2be_061f_2b6f3002fbf6 42640952_ea63_55f1_1ff1_00816e2980ae["ast.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 42640952_ea63_55f1_1ff1_00816e2980ae f9b19679_c1f0_28d6_4d1a_31a10c52e42d["atRule"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> f9b19679_c1f0_28d6_4d1a_31a10c52e42d 2da63033_d079_7b37_5cfb_3877674a70b9["toCss"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 2da63033_d079_7b37_5cfb_3877674a70b9 245c850a_c551_a2cf_854e_bba95b5a1339["apply-config-to-theme.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 245c850a_c551_a2cf_854e_bba95b5a1339 ae20c4fb_29d7_ca79_3c49_ca02c45d5369["keyPathToCssProperty"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> ae20c4fb_29d7_ca79_3c49_ca02c45d5369 f0444c59_74bb_21c0_b8e1_c65ad667fa51["themeableValues"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> f0444c59_74bb_21c0_b8e1_c65ad667fa51 0620c0e4_5f2c_149b_94e3_e0fed99b95d8["apply-keyframes-to-theme.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 0620c0e4_5f2c_149b_94e3_e0fed99b95d8 53bccebe_7dfe_9987_589d_32686d3b1037["keyframesToRules"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 53bccebe_7dfe_9987_589d_32686d3b1037 9b5d2e3d_392e_c654_c350_1352ed70f5e8["resolve-config.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 9b5d2e3d_392e_c654_c350_1352ed70f5e8 0ed24ba5_7c39_3f5a_fdbb_f973a617a172["resolveConfig"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 0ed24ba5_7c39_3f5a_fdbb_f973a617a172 c1272aed_91bb_73df_0746_d55fa9b302fd["types.ts"] b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> c1272aed_91bb_73df_0746_d55fa9b302fd style b2ba3368_7330_fe20_4543_9cafa8cfedc0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { Scanner } from '@tailwindcss/oxide'
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { loadModule } from '../../../../@tailwindcss-node/src/compile'
import defaultTheme from '../../../../tailwindcss/dist/default-theme'
import { atRule, toCss, type AstNode } from '../../../../tailwindcss/src/ast'
import {
keyPathToCssProperty,
themeableValues,
} from '../../../../tailwindcss/src/compat/apply-config-to-theme'
import { keyframesToRules } from '../../../../tailwindcss/src/compat/apply-keyframes-to-theme'
import {
resolveConfig,
type ConfigFile,
} from '../../../../tailwindcss/src/compat/config/resolve-config'
import type { ResolvedConfig, ThemeConfig } from '../../../../tailwindcss/src/compat/config/types'
import { buildCustomContainerUtilityRules } from '../../../../tailwindcss/src/compat/container'
import { darkModePlugin } from '../../../../tailwindcss/src/compat/dark-mode'
import type { Config } from '../../../../tailwindcss/src/compat/plugin-api'
import type { DesignSystem } from '../../../../tailwindcss/src/design-system'
import { escape } from '../../../../tailwindcss/src/utils/escape'
import {
isValidOpacityValue,
isValidSpacingMultiplier,
} from '../../../../tailwindcss/src/utils/infer-data-type'
import * as ValueParser from '../../../../tailwindcss/src/value-parser'
import { findStaticPlugins, type StaticPluginOptions } from '../../utils/extract-static-plugins'
import { highlight, info, relative } from '../../utils/renderer'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export type JSConfigMigration =
// Could not convert the config file, need to inject it as-is in a @config directive
null | {
sources: { base: string; pattern: string }[]
plugins: { base: string; path: string; options: null | StaticPluginOptions }[]
css: string
}
export async function migrateJsConfig(
designSystem: DesignSystem,
fullConfigPath: string,
base: string,
): Promise<JSConfigMigration> {
let [unresolvedConfig, source] = await Promise.all([
loadModule(fullConfigPath, __dirname, () => {}).then((result) => result.module) as Config,
fs.readFile(fullConfigPath, 'utf-8'),
])
if (!canMigrateConfig(unresolvedConfig, source)) {
info(
`The configuration file at ${highlight(relative(fullConfigPath, base))} could not be automatically migrated to the new CSS configuration format, so your CSS has been updated to load your existing configuration file.`,
{ prefix: '↳ ' },
)
return null
}
let sources: { base: string; pattern: string }[] = []
// ... (494 more lines)
Domain
Subdomains
Functions
Types
Dependencies
- ../../../../tailwindcss/dist/default-theme
- apply-config-to-theme.ts
- apply-keyframes-to-theme.ts
- ast.ts
- atRule
- buildCustomContainerUtilityRules
- compile.ts
- container.ts
- dark-mode.ts
- darkModePlugin
- design-system.ts
- escape
- escape.ts
- extract-static-plugins.ts
- findStaticPlugins
- highlight
- infer-data-type.ts
- info
- isValidOpacityValue
- isValidSpacingMultiplier
- keyPathToCssProperty
- keyframesToRules
- loadModule
- node:path
- node:url
- oxide
- plugin-api.ts
- promises
- relative
- renderer.ts
- resolve-config.ts
- resolveConfig
- themeableValues
- toCss
- types.ts
- value-parser.ts
Imported By
Source
Frequently Asked Questions
What does migrate-js-config.ts do?
migrate-js-config.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-js-config.ts?
migrate-js-config.ts defines 12 function(s): autodetectedSourceFiles, canMigrateConfig, createSectionKey, keyframesToCss, migrateContent, migrateDarkMode, migrateJsConfig, migrateTheme, onlyAllowedThemeValues, patternSourceFiles, and 2 more.
What does migrate-js-config.ts depend on?
migrate-js-config.ts imports 36 module(s): ../../../../tailwindcss/dist/default-theme, apply-config-to-theme.ts, apply-keyframes-to-theme.ts, ast.ts, atRule, buildCustomContainerUtilityRules, compile.ts, container.ts, and 28 more.
What files import migrate-js-config.ts?
migrate-js-config.ts is imported by 3 file(s): index.ts, migrate-config.ts, migrate.ts.
Where is migrate-js-config.ts in the architecture?
migrate-js-config.ts is located at packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts (domain: UpgradeToolkit, subdomain: Codemods, directory: packages/@tailwindcss-upgrade/src/codemods/config).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free