feat(preset): Add Emotion v10 to v11 Replacement
Changes
Adds replacement rules to rename the below packages for transitioning from Emotion v10 to v11 per this guide:
https://emotion.sh/docs/emotion-11#package-renaming
The full list of renamed packages:
-
@emotion/core→@emotion/react -
emotion→@emotion/css -
emotion-theming→ moved into@emotion/react -
emotion-server→@emotion/server -
create-emotion→@emotion/css/create-instance(entry-point) -
create-emotion-server→@emotion/server/create-instance(entry-point) -
babel-plugin-emotion→@emotion/babel-plugin -
eslint-plugin-emotion→@emotion/eslint-plugin -
jest-emotion→@emotion/jest)
Documentation (please check one with an [x])
- [ ] I have updated the documentation, or
- [x] No documentation update is required
How I've tested my work (please tick one)
I have verified these changes via:
- [x] Code inspection only, or
- [ ] Newly added/modified unit tests, or
- [ ] No unit tests but ran on a real repository, or
- [ ] Both unit tests + ran on a real repository
Note: I haven't run these against a repo yet. For some reason I'm unable to run replacement rules inside my repo's renovate.json. See here. I'm happy to test these locally with some guidance on how to achieve it.
What's the next step here? Any decisions needing making?
I believe that one of the steps is that we need to implement/decide on deduping logic if multiple replacements resolve into the same dependency.
There are two bugs that were raised during this PR:
- We need de-duplication of dependencies after replacement
- We need to not filter out replacements with the same version #14386
Neither of these are blockers, in my opinion. So long as we have issues tracking both.
@JamieMagee can this PR be moved forward/merged?
Yeah, I'll need to create the issues to followup and merge this one
Issues created to track follow-up items:
- https://github.com/renovatebot/renovate/issues/14386
- https://github.com/renovatebot/renovate/issues/18919
@ReDrUm It doesn't look like I have permissions to push to your branch. Could you apply this patch, or allow maitainer edits to this PR, and we can get this merged.
I verified these versions are the first version after 11.0.0 for each dependency.
diff --git a/lib/config/presets/internal/replacements.ts b/lib/config/presets/internal/replacements.ts
index cd3dd8a3e..703b20868 100644
--- a/lib/config/presets/internal/replacements.ts
+++ b/lib/config/presets/internal/replacements.ts
@@ -119,42 +119,42 @@ export const presets: Record<string, Preset> = {
matchDatasources: ['npm'],
matchPackageNames: ['@emotion/core', 'emotion-theming'],
replacementName: '@emotion/react',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.1.0', // TODO #14386
},
{
matchCurrentVersion: '>=11.0.0',
matchDatasources: ['npm'],
matchPackageNames: ['emotion', 'create-emotion'],
replacementName: '@emotion/css',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.1.3', // TODO #14386
},
{
matchCurrentVersion: '>=11.0.0',
matchDatasources: ['npm'],
matchPackageNames: ['emotion-server', 'create-emotion-server'],
replacementName: '@emotion/server',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.4.0', // TODO #14386
},
{
matchCurrentVersion: '>=11.0.0',
matchDatasources: ['npm'],
matchPackageNames: ['babel-plugin-emotion'],
replacementName: '@emotion/babel-plugin',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.1.2', // TODO #14386
},
{
matchCurrentVersion: '>=11.0.0',
matchDatasources: ['npm'],
matchPackageNames: ['eslint-plugin-emotion'],
replacementName: '@emotion/eslint-plugin',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.2.0', // TODO #14386
},
{
matchCurrentVersion: '>=11.0.0',
matchDatasources: ['npm'],
matchPackageNames: ['jest-emotion'],
replacementName: '@emotion/jest',
- replacementVersion: '11.0.0',
+ replacementVersion: '11.1.0', // TODO #14386
},
],
},