upgrade-errors.test.ts — tailwindcss Source File
Architecture documentation for upgrade-errors.test.ts, a typescript file in the tailwindcss codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e07e8322_e39e_4816_2376_bb4a4b9effbd["upgrade-errors.test.ts"] 9ffd1dda_9675_c514_373d_0f4ab4648249["utils.ts"] e07e8322_e39e_4816_2376_bb4a4b9effbd --> 9ffd1dda_9675_c514_373d_0f4ab4648249 f11e3be9_51f8_140b_68b0_f58ddd082595["test"] e07e8322_e39e_4816_2376_bb4a4b9effbd --> f11e3be9_51f8_140b_68b0_f58ddd082595 041a5d56_b2a1_1fbe_eb9b_b605f45324db["node:util"] e07e8322_e39e_4816_2376_bb4a4b9effbd --> 041a5d56_b2a1_1fbe_eb9b_b605f45324db style e07e8322_e39e_4816_2376_bb4a4b9effbd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { stripVTControlCharacters } from 'node:util'
import { css, html, js, json, test } from '../utils'
test(
'upgrades half-upgraded v3 project to v4 (pnpm)',
{
fs: {
'package.json': json`
{
"dependencies": {
"tailwindcss": "^3",
"@tailwindcss/upgrade": "workspace:^"
},
"devDependencies": {
"@tailwindcss/cli": "workspace:^"
}
}
`,
'tailwind.config.js': js`
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{html,js}'],
}
`,
'src/index.html': html`
<div class="!flex">Hello World</div>
`,
'src/input.css': css`
@tailwind base;
@tailwind components;
@tailwind utilities;
`,
},
},
async ({ exec, expect }) => {
// Ensure we are in a git repo
await exec('git init')
await exec('git add --all')
await exec('git commit -m "before migration"')
// Fully upgrade to v4
await exec('npx @tailwindcss/upgrade')
// Undo all changes to the current repo. This will bring the repo back to a
// v3 state, but the `node_modules` will now have v4 installed.
await exec('git reset --hard HEAD')
// Re-running the upgrade should result in an error
return expect(() => {
return exec('npx @tailwindcss/upgrade', {}, { ignoreStdErr: true }).catch((e) => {
// Replacing the current version with a hardcoded `v4` to make it stable
// when we release new minor/patch versions.
return Promise.reject(
stripVTControlCharacters(e.message.replace(/\d+\.\d+\.\d+/g, '4.0.0')),
)
})
}).rejects.toThrowErrorMatchingInlineSnapshot(`
"Command failed: npx @tailwindcss/upgrade
≈ tailwindcss v4.0.0
// ... (192 more lines)
Domain
Source
Frequently Asked Questions
What does upgrade-errors.test.ts do?
upgrade-errors.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain.
What does upgrade-errors.test.ts depend on?
upgrade-errors.test.ts imports 3 module(s): node:util, test, utils.ts.
Where is upgrade-errors.test.ts in the architecture?
upgrade-errors.test.ts is located at integrations/upgrade/upgrade-errors.test.ts (domain: OxideEngine, directory: integrations/upgrade).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free