Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
},
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.58.0",
"@playwright/test": "^1.59.1",
"@types/node": "catalog:",
"postcss": "8.5.6",
"postcss": "8.5.10",
"postcss-import": "^16.1.1",
"prettier": "catalog:",
"prettier-plugin-embed": "^0.5.1",
"prettier-plugin-organize-imports": "^4.3.0",
"tsup": "^8.5.1",
"turbo": "^2.7.6",
"typescript": "^5.5.4",
"vitest": "^4.0.18"
"turbo": "^2.9.6",
"typescript": "^5.9.3",
"vitest": "^4.1.5"
},
"packageManager": "pnpm@9.6.0",
"pnpm": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@tailwindcss-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"access": "public"
},
"devDependencies": {
"h3": "^1.15.5",
"listhen": "^1.9.0",
"h3": "^1.15.11",
"listhen": "^1.9.1",
"tailwindcss": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/@tailwindcss-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@parcel/watcher": "^2.5.1",
"@tailwindcss/node": "workspace:*",
"@tailwindcss/oxide": "workspace:*",
"enhanced-resolve": "^5.19.0",
"enhanced-resolve": "^5.20.1",
"mri": "^1.2.0",
"picocolors": "^1.1.1",
"tailwindcss": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@jridgewell/remapping": "^2.3.5",
"enhanced-resolve": "^5.19.0",
"enhanced-resolve": "^5.20.1",
"jiti": "^2.6.1",
"lightningcss": "catalog:",
"magic-string": "^0.30.21",
Expand Down
3 changes: 3 additions & 0 deletions packages/@tailwindcss-node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"verbatimModuleSyntax": false,
},
}
4 changes: 2 additions & 2 deletions packages/@tailwindcss-postcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"@alloc/quick-lru": "^5.2.0",
"@tailwindcss/node": "workspace:*",
"@tailwindcss/oxide": "workspace:*",
"postcss": "^8.5.6",
"postcss": "^8.5.10",
"tailwindcss": "workspace:*"
},
"devDependencies": {
"@types/node": "catalog:",
"@types/postcss-import": "14.0.3",
"dedent": "1.7.1",
"dedent": "1.7.2",
"internal-example-plugin": "workspace:*",
"postcss-import": "^16.1.1"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/@tailwindcss-postcss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"verbatimModuleSyntax": false,
},
}
6 changes: 3 additions & 3 deletions packages/@tailwindcss-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/typography": "^0.5.19",
"detect-libc": "1.0.3",
"enhanced-resolve": "^5.19.0",
"enhanced-resolve": "^5.20.1",
"tailwindcss": "workspace:*"
},
"__notes": "These binary packages must be included so Bun can build the CLI for all supported platforms. We also rely on Lightning CSS and Parcel being patched so Bun can statically analyze the executables.",
Expand All @@ -42,8 +42,8 @@
"@parcel/watcher-linux-x64-glibc": "^2.5.6",
"@parcel/watcher-linux-x64-musl": "^2.5.6",
"@parcel/watcher-win32-x64": "^2.5.6",
"@types/bun": "^1.3.9",
"bun": "^1.3.9",
"@types/bun": "^1.3.13",
"bun": "^1.3.13",
"lightningcss-darwin-arm64": "catalog:",
"lightningcss-darwin-x64": "catalog:",
"lightningcss-linux-arm64-gnu": "catalog:",
Expand Down
10 changes: 5 additions & 5 deletions packages/@tailwindcss-upgrade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"dependencies": {
"@tailwindcss/node": "workspace:*",
"@tailwindcss/oxide": "workspace:*",
"dedent": "1.7.1",
"enhanced-resolve": "^5.19.0",
"globby": "^15.0.0",
"jiti": "^2.0.0-beta.3",
"dedent": "1.7.2",
"enhanced-resolve": "^5.20.1",
"globby": "^16.2.0",
"jiti": "^2.6.1",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"mri": "^1.2.0",
"picocolors": "^1.1.1",
"postcss": "^8.5.6",
"postcss": "^8.5.10",
"postcss-import": "^16.1.1",
"postcss-selector-parser": "^7.1.1",
"prettier": "catalog:",
Expand Down
11 changes: 10 additions & 1 deletion packages/@tailwindcss-upgrade/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ async function run() {
}
}

// Prime the compiler/designSystem cache against the pre-migration AST
// so the later template-migration phase sees the same v4 state. After
// this point, `sheet.root` may be mutated by `migrateStylesheet`.
if (!version.isMajor(3) && sheet.isTailwindRoot) {
await Promise.all([sheet.compiler(), sheet.designSystem()])
}

await migrateStylesheet(sheet, {
newPrefix: config?.newPrefix ?? null,
designSystem: config?.designSystem ?? (await sheet.designSystem()),
Expand Down Expand Up @@ -367,7 +374,9 @@ async function run() {
break
}

parent = path.dirname(parent)
let nextParent = path.dirname(parent)
if (nextParent === parent) break
parent = nextParent
} while (parent)

if (ignoredPaths.has(culprit)) continue // Already logged, skip
Expand Down
11 changes: 7 additions & 4 deletions packages/@tailwindcss-upgrade/src/stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,26 @@ export class Stylesheet {
return false
}

#compiler?: Promise<Awaited<ReturnType<typeof compileAst>> | null>
#designSystem?: Promise<Awaited<ReturnType<typeof __unstable__loadDesignSystem>> | null>

async compiler(): Promise<Awaited<ReturnType<typeof compileAst>> | null> {
if (!this.isTailwindRoot) return null
if (!this.file) return null

return compileAst(postCssAstToCssAst(this.root), {
return (this.#compiler ??= compileAst(postCssAstToCssAst(this.root), {
base: path.dirname(this.file),
onDependency() {},
})
}))
}

async designSystem(): Promise<Awaited<ReturnType<typeof __unstable__loadDesignSystem>> | null> {
if (!this.isTailwindRoot) return null
if (!this.file) return null

return __unstable__loadDesignSystem(this.root.toString(), {
return (this.#designSystem ??= __unstable__loadDesignSystem(this.root.toString(), {
base: path.dirname(this.file),
})
}))
}

[util.inspect.custom]() {
Expand Down
3 changes: 3 additions & 0 deletions packages/@tailwindcss-webpack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"verbatimModuleSyntax": false,
},
}
2 changes: 1 addition & 1 deletion packages/tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@jridgewell/remapping": "^2.3.5",
"@tailwindcss/oxide": "workspace:^",
"@types/node": "catalog:",
"dedent": "1.7.1",
"dedent": "1.7.2",
"lightningcss": "catalog:",
"magic-string": "^0.30.21",
"source-map-js": "^1.2.1"
Expand Down
3 changes: 3 additions & 0 deletions packages/tailwindcss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"verbatimModuleSyntax": false,
},
}
Loading
Loading