renovate icon indicating copy to clipboard operation
renovate copied to clipboard

feat(preset): Add Emotion v10 to v11 Replacement

Open ReDrUm opened this issue 4 years ago • 8 comments

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.

ReDrUm avatar Feb 23 '22 00:02 ReDrUm

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 23 '22 00:02 CLAassistant

What's the next step here? Any decisions needing making?

rarkins avatar Mar 25 '22 10:03 rarkins

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.

astellingwerf avatar Mar 25 '22 10:03 astellingwerf

There are two bugs that were raised during this PR:

  1. We need de-duplication of dependencies after replacement
  2. 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 avatar May 31 '22 15:05 JamieMagee

@JamieMagee can this PR be moved forward/merged?

rarkins avatar Oct 19 '22 04:10 rarkins

Yeah, I'll need to create the issues to followup and merge this one

JamieMagee avatar Oct 19 '22 04:10 JamieMagee

Issues created to track follow-up items:

  • https://github.com/renovatebot/renovate/issues/14386
  • https://github.com/renovatebot/renovate/issues/18919

JamieMagee avatar Nov 15 '22 05:11 JamieMagee

@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
       },
     ],
   },

JamieMagee avatar Nov 15 '22 06:11 JamieMagee