is-safe-migration.test.ts — tailwindcss Source File
Architecture documentation for is-safe-migration.test.ts, a typescript file in the tailwindcss codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR af634e72_8f21_9695_7ac2_bb89b92a31b2["is-safe-migration.test.ts"] fff09679_e13c_392d_23bb_cebc04ddb008["version.ts"] af634e72_8f21_9695_7ac2_bb89b92a31b2 --> fff09679_e13c_392d_23bb_cebc04ddb008 75ba60a9_2614_1c57_ad40_3663d4315f3b["migrate.ts"] af634e72_8f21_9695_7ac2_bb89b92a31b2 --> 75ba60a9_2614_1c57_ad40_3663d4315f3b 8408bbf2_f1a4_0668_26f9_b4cdef678388["migrateCandidate"] af634e72_8f21_9695_7ac2_bb89b92a31b2 --> 8408bbf2_f1a4_0668_26f9_b4cdef678388 92f2d961_72a4_d195_92d7_2e66972f8894["node"] af634e72_8f21_9695_7ac2_bb89b92a31b2 --> 92f2d961_72a4_d195_92d7_2e66972f8894 696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"] af634e72_8f21_9695_7ac2_bb89b92a31b2 --> 696bd648_5f24_1b59_8e8b_7a97a692869e style af634e72_8f21_9695_7ac2_bb89b92a31b2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { __unstable__loadDesignSystem } from '@tailwindcss/node'
import { describe, expect, test, vi } from 'vitest'
import * as versions from '../../utils/version'
import { migrateCandidate } from './migrate'
vi.spyOn(versions, 'isMajor').mockReturnValue(true)
const css = String.raw
describe('is-safe-migration', async () => {
let designSystem = await __unstable__loadDesignSystem(
css`
@import 'tailwindcss';
/* TODO(perf): Only here to speed up the tests */
@theme {
--*: initial;
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
`,
{ base: __dirname },
)
test.each([
[`let notBorder = !border \n`, '!border'],
[`{ "foo": !border.something + ""}\n`, '!border'],
[`<div v-if="something && !border"></div>\n`, '!border'],
[`<div v-else-if="something && !border"></div>\n`, '!border'],
[`<div v-show="something && !border"></div>\n`, '!border'],
[`<div v-if="!border || !border"></div>\n`, '!border'],
[`<div v-else-if="!border || !border"></div>\n`, '!border'],
[`<div v-show="!border || !border"></div>\n`, '!border'],
[`<div v-if="!border"></div>\n`, '!border'],
[`<div v-else-if="!border"></div>\n`, '!border'],
[`<div v-show="!border"></div>\n`, '!border'],
[`<div x-if="!border"></div>\n`, '!border'],
[`let notShadow = shadow \n`, 'shadow'],
[`{ "foo": shadow.something + ""}\n`, 'shadow'],
[`<div v-if="something && shadow"></div>\n`, 'shadow'],
[`<div v-else-if="something && shadow"></div>\n`, 'shadow'],
[`<div v-show="something && shadow"></div>\n`, 'shadow'],
[`<div v-if="shadow || shadow"></div>\n`, 'shadow'],
[`<div v-else-if="shadow || shadow"></div>\n`, 'shadow'],
[`<div v-show="shadow || shadow"></div>\n`, 'shadow'],
[`<div v-if="shadow"></div>\n`, 'shadow'],
[`<div v-else-if="shadow"></div>\n`, 'shadow'],
[`<div v-show="shadow"></div>\n`, 'shadow'],
[`<div x-if="shadow"></div>\n`, 'shadow'],
[`<div style={{filter: 'drop-shadow(30px 10px 4px #4444dd)'}}/>\n`, 'shadow'],
// Next.js Image placeholder cases
[`<Image placeholder="blur" src="/image.jpg" />`, 'blur'],
[`<Image placeholder={'blur'} src="/image.jpg" />`, 'blur'],
[`<Image placeholder={blur} src="/image.jpg" />`, 'blur'],
// https://github.com/tailwindlabs/tailwindcss/issues/17974
['<div v-if="!duration">', '!duration'],
['<div :active="!duration">', '!duration'],
['<div :active="!visible">', '!visible'],
// ... (91 more lines)
Domain
Dependencies
- migrate.ts
- migrateCandidate
- node
- version.ts
- vitest
Source
Frequently Asked Questions
What does is-safe-migration.test.ts do?
is-safe-migration.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the UpgradeToolkit domain.
What does is-safe-migration.test.ts depend on?
is-safe-migration.test.ts imports 5 module(s): migrate.ts, migrateCandidate, node, version.ts, vitest.
Where is is-safe-migration.test.ts in the architecture?
is-safe-migration.test.ts is located at packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts (domain: UpgradeToolkit, 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