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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure `--default-outline-width` can be used to change the `outline-width` value of the `outline` utility
- Ensure drop shadow utilities don't inherit unexpectedly ([#16471](https://github.com/tailwindlabs/tailwindcss/pull/16471))
- Export backwards compatible config and plugin types from `tailwindcss/plugin` ([#16505](https://github.com/tailwindlabs/tailwindcss/pull/16505))
- Upgrade: Report errors when updating dependencies ([#16504](https://github.com/tailwindlabs/tailwindcss/pull/16504))

## [4.0.6] - 2025-02-10

Expand Down
23 changes: 20 additions & 3 deletions packages/@tailwindcss-upgrade/src/utils/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'
import { dirname, resolve } from 'node:path'
import { promisify } from 'node:util'
import { DefaultMap } from '../../../tailwindcss/src/utils/default-map'
import { warn } from './renderer'
import { error, warn } from './renderer'

const exec = promisify(execCb)

Expand All @@ -20,11 +20,28 @@ export function pkg(base: string) {
if (location === 'devDependencies') {
args.push(SAVE_DEV[packageManager] || SAVE_DEV.default)
}
return exec(`${packageManager} add ${args.join(' ')}`, { cwd: base })

let command = `${packageManager} add ${args.join(' ')}`
try {
return await exec(command, { cwd: base })
} catch (e: any) {
error(`An error occurred while running \`${command}\`\n\n${e.stdout}\n${e.stderr}`, {
prefix: '↳ ',
})
throw e
}
},
async remove(packages: string[]) {
let packageManager = await packageManagerForBase.get(base)
return exec(`${packageManager} remove ${packages.join(' ')}`, { cwd: base })
let command = `${packageManager} remove ${packages.join(' ')}`
try {
return await exec(command, { cwd: base })
} catch (e: any) {
error(`An error occurred while running \`${command}\`\n\n${e.stdout}\n${e.stderr}`, {
prefix: '↳ ',
})
throw e
}
},
}
}
Expand Down