Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using on Expo project #7417

Closed
simoneb opened this issue Oct 6, 2020 · 6 comments
Closed

Using on Expo project #7417

simoneb opened this issue Oct 6, 2020 · 6 comments

Comments

@simoneb
Copy link

simoneb commented Oct 6, 2020

Which Renovate are you using?

WhiteSource Renovate App

Which platform are you using?

GitHub.com

What would you like to do?

Renovate doesn't seem to work so well with attempting updates on expo based projects. Is there a way to perhaps ask renovate to run a different command? For instance, expo based projects wrap npm and add some guard rails, so what you use is expo install and expo update instead of the npm counterparts.

@rarkins rarkins transferred this issue from renovatebot/config-help Oct 6, 2020
@rarkins
Copy link
Collaborator

rarkins commented Oct 6, 2020

I think we would need to treat this like a feature request in the main repo so have transferred it. It sounds a little like #3681 (RushJS support) in that you want to use a specialized CLI command instead of npm. It's getting challenging to detect all these variants (including Lerna too) and automatically do the right thing (e.g. without requiring users to explicitly configure Expo or Rush or Lerna or disable npm).

@rarkins rarkins added type:feature Feature (new functionality) new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Oct 6, 2020
@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Jan 12, 2021
@karlhorky
Copy link
Contributor

karlhorky commented Apr 14, 2022

It sounds a little like #3681 (RushJS support) in that you want to use a specialized CLI command instead of npm

Right, here in this case it's to use the expo install command instead of npm install / yarn add:

- npm install @react-native-async-storage/async-storage
+ expo install @react-native-async-storage/async-storage

It's getting challenging to detect all these variants (including Lerna too) and automatically do the right thing

Yeah, I can imagine, keeping up with all the different variants of tooling and where the config lives must be difficult.

In case Renovate still wants to give autodetection a shot, maybe a starting heuristic could be app.json with a "expo" key - which most Expo apps have, such as seen in this managed Expo app:

https://github.com/upleveled/hotline-bling-codealong


Workaround

I've created a GitHub Actions workflow that creates pull requests weekly based on running expo update (example PR). Not as nice as Renovate bot, but it works.

https://github.com/upleveled/hotline-bling-codealong/blob/main/.github/workflows/cron-expo-install-new-versions.yml

@soullivaneuh
Copy link
Contributor

It's getting challenging to detect all these variants (including Lerna too) and automatically do the right thing

@rarkins Why not starting with that ruleset?

{
  "packageRules": [
    {
      "matchSourceUrlPrefixes": ["https://github.com/expo"],
    }
  ]
}

This is not an exhaustive match, but we can at least be sure that package coming from expo itself must be updated using expo install instead of npm install.

For the rest as the other package has to be installed with expo install only if we are using expo, this matching will indeed be harder.

However, we may maintain a package list for that on a :expoProject preset to be manually activated.

Is that making any sense?

@soullivaneuh
Copy link
Contributor

By the way, we already have a somewhat related expo monorepo group preset configured here:

expo: 'https://github.com/expo/expo',

However, it was not very helpful to me because of this discussion subject, and I am not currently using it.

@rarkins rarkins added help wanted Help is needed or welcomed on this issue auto:reproduction A minimal reproduction is necessary to proceed labels May 13, 2023
@github-actions
Copy link
Contributor

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

@jmatsushita
Copy link

e.g. without requiring users to explicitly configure Expo or Rush or Lerna or disable npm

Explicit configuration of the CLI command would be a fantastic start!

Another important aspect of an expo project, is that a given expo version pins a number of versions of other react-native libraries which don't belong to the expo monorepo.

For instance if I run expo install react-native-webview today (with expo@48.0.19), although the latest published version on npm is 12.4.0, I will get react-native-webview@11.26.0 the mapping is here (this is the master branch though, so it's best to refer to the published code on npm:

https://github.com/expo/expo/blob/8010f0ca72ba25eb19e304002df40a68ace93fa4/packages/expo/bundledNativeModules.json#L98

However, renovate doesn't consider this currently, so I have to customise the renovate.json to pin these versions.

This might also be an application of #19645

Here's the relevant part of my renovate.json (grouping isn't necessary, but it's nice for readability):

    {
      "matchPackageNames": ["@expo/vector-icons"],
      "allowedVersions": "^13.0.0",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-crypto"],
      "allowedVersions": "~12.2.1",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-dev-client"],
      "allowedVersions": "~2.2.1",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-font"],
      "allowedVersions": "~11.1.1",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-sensors"],
      "allowedVersions": "~12.1.1",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-splash-screen"],
      "allowedVersions": "~0.18.2",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["expo-status-bar"],
      "allowedVersions": "~1.4.4",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native"],
      "allowedVersions": "0.71.8",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native-web"],
      "allowedVersions": "~0.18.10",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native-webview"],
      "allowedVersions": "11.26.0",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native-reanimated"],
      "allowedVersions": "~2.14.4",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native-safe-area-context"],
      "allowedVersions": "4.5.0",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["react-native-screens"],
      "allowedVersions": "3.20.0",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["sentry-expo"],
      "allowedVersions": "~6.1.0",
      "groupName": "expo-48-0-19"
    },
    {
      "matchPackageNames": ["@sentry/react-native"],
      "allowedVersions": "4.13.0",
      "groupName": "expo-48-0-19"
    }

@rarkins rarkins removed type:feature Feature (new functionality) help wanted Help is needed or welcomed on this issue priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others new package manager New package manager support auto:reproduction A minimal reproduction is necessary to proceed status:requirements Full requirements are not yet known, so implementation should not be started labels Oct 1, 2023
@renovatebot renovatebot locked and limited conversation to collaborators Oct 1, 2023
@rarkins rarkins converted this issue into discussion #24735 Oct 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants