tailwindcss/packages/@tailwindcss-upgrade/src/utils
Philipp Spiess 3e7695fb2c
Include simple config objects when extracting static plugins (#14699)
This PR updates the `extractStaticPlugins` function to also emit options as long as these are objects containing of only `string` and `number` values.

While doing this I also cleaned up the `require('custom-plugin')` detector to use a Tree-Sitter query instead of operating on the AST.

Here are the two cases we considered:

```js
import plugin1 from 'plugin1';

export default {
  plugins: [
    plugin1({
      foo: 'bar',
      num: 19,
    }),
    require('./plugin2')({
      foo: 'bar',
      num: 19,
    }),
  ]
}
```

The test plan also contains a number of scenarios that we do not want to migrate to CSS (because we do not have a CSS API we can use for e.g. nested objects). We do support all types that we also support in the CSS API.
2024-10-18 15:10:21 +02: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 Include simple config objects when extracting static plugins (#14699) 2024-10-18 15:10:21 +02: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
packages.ts Migrate simple PostCSS setup (#14612) 2024-10-10 15:09:14 +02:00
renderer.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
resolve.ts Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
walk.ts Add CSS codemod for missing @layer (#14504) 2024-09-24 16:32:50 +00:00