expectedCache() — tailwindcss Function Reference
Architecture documentation for the expectedCache() function in version.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 3d4d79b5_b80e_3676_20e6_1dd4fe463f47["expectedCache()"] fff09679_e13c_392d_23bb_cebc04ddb008["version.ts"] 3d4d79b5_b80e_3676_20e6_1dd4fe463f47 -->|defined in| fff09679_e13c_392d_23bb_cebc04ddb008 674ec8b4_cdc1_dbd1_ecd7_8b9bd712c1a1["installedTailwindVersion()"] 3d4d79b5_b80e_3676_20e6_1dd4fe463f47 -->|calls| 674ec8b4_cdc1_dbd1_ecd7_8b9bd712c1a1 style 3d4d79b5_b80e_3676_20e6_1dd4fe463f47 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/@tailwindcss-upgrade/src/utils/version.ts lines 34–60
let expectedCache = new DefaultMap((base) => {
try {
// This will report a problem if the package.json/package-lock.json
// mismatches with the installed version in node_modules.
//
// Also tested this with Bun and PNPM, both seem to work fine.
execSync('npm ls tailwindcss --json', { cwd: base, stdio: 'pipe' })
return installedTailwindVersion(base)
} catch (_e) {
try {
let e = _e as { stdout: Buffer }
let data = JSON.parse(e.stdout.toString())
return (
// Could be a sub-dependency issue, but we are only interested in
// the top-level version mismatch.
/"(.*?)" from the root project/.exec(data.dependencies.tailwindcss.invalid)?.[1] ??
// Fallback to the installed version
installedTailwindVersion(base)
)
} catch {
// We don't know how to verify, so let's just return the installed
// version to not block the user.
return installedTailwindVersion(base)
}
}
})
Domain
Subdomains
Source
Frequently Asked Questions
What does expectedCache() do?
expectedCache() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/utils/version.ts.
Where is expectedCache() defined?
expectedCache() is defined in packages/@tailwindcss-upgrade/src/utils/version.ts at line 34.
What does expectedCache() call?
expectedCache() calls 1 function(s): installedTailwindVersion.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free