tailwindcss/packages/@tailwindcss-upgrade/src/utils
Robin Malfait fe9fc9abba
Use resolveJsId when resolving tailwindcss/package.json (#15041)
This PR uses the `enhanced-resolve` instead of
`createRequire(…).resolve` which improves the usability when running the
upgrade tool locally using Bun.

While testing, we also noticed that it is not possible to use a
`cjs`-only plugin inside of an `esm` project. It was also not possible
to use an `esm`-only plugin inside of a `cjs` project.

# Test plan

We added integration tests in both the CLI (the CLI is an mjs project)
and in the PostCSS (where we can configure a `cjs` and `esm` PostCSS
config) integration tests where we created an `esm` and `cjs` based
project with 4 plugins (`cjs`-only, `esm`-only, and TypeScript based
plugins: `cts`-only and `mts`-only).
2024-11-19 18:39:49 +01:00
..
args.test.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
args.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
extract-static-plugins.test.ts Include simple config objects when extracting static plugins (#14699) 2024-10-18 15:10:21 +02:00
extract-static-plugins.ts Improve robustness when upgrading (#15038) 2024-11-19 14:29:51 +01:00
format-ns.test.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
format-ns.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
git.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
hoist-static-glob-parts.test.ts Fix crash during upgrade when content globs escape root of project (#14896) 2024-11-07 12:22:25 +00:00
hoist-static-glob-parts.ts Fix glob pattern hoisting on Windows (#14904) 2024-11-07 15:31:06 -05:00
package-version.ts Use resolveJsId when resolving tailwindcss/package.json (#15041) 2024-11-19 18:39:49 +01:00
packages.ts Install @tailwindcss/postcss next to tailwindcss (#14830) 2024-10-30 15:32:24 -04:00
renderer.ts Improve robustness when upgrading (#15038) 2024-11-19 14:29:51 +01:00
resolve.ts Use resolveJsId when resolving tailwindcss/package.json (#15041) 2024-11-19 18:39:49 +01:00
walk.ts Sort upgraded CSS (#14866) 2024-11-07 12:04:52 +00:00