Skip to content

[templates,autolinking] Switch back to node -e for expo-modules-autolinking invocation in Podfile command#41264

Merged
kitten merged 5 commits intomainfrom
@kitten/refactor/switch-back-to-node-autolinking-invocation
Dec 1, 2025
Merged

[templates,autolinking] Switch back to node -e for expo-modules-autolinking invocation in Podfile command#41264
kitten merged 5 commits intomainfrom
@kitten/refactor/switch-back-to-node-autolinking-invocation

Conversation

@kitten
Copy link
Copy Markdown
Member

@kitten kitten commented Nov 26, 2025

Why

Effectively, this reverts #35661 but instead uses expo/bin/autolinking as a target for readability. A comment was added to denote this.

How

Replace the invocation with:

node --no-warnings --eval "require('expo/bin/autolinking')" expo-modules-autolinking

This resolves the target CLI directly without npx causing extra printing to stdout (in some affected v10 versions), and without performing extra installation, prompting, or resolution.

This differs in what we had previously to target expo/bin/autolinking to avoid the double require.resolve invocation.

The added expo-modules-autolinking argument is purely to shift argv and is arbitrary.

The PR was actually not having an effect on Android since the command there has been moved to the Gradle plugin. I've aligned the command there to be the same as for iOS. I've omitted -- since it's error-prone. It's not needed in this position, and can, under some circumstances, cause our flags to be ignored, so it's probably safer to leave out.

Test Plan

  • Manually invoked a local app iOS build with the command altered
  • E2E CI should cover this

Checklist

@github-actions
Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
packages/expo/** @ide, @lukmccall, @brentvatne
packages/expo-modules-autolinking/** @Kudo, @lukmccall

Generated by CodeMention

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Nov 26, 2025
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Nov 26, 2025

The Pull Request introduced fingerprint changes against the base commit: 12b1bbc

Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoConfigPlugins",
        "expoConfigPlugins",
        "rncoreAutolinkingAndroid",
        "rncoreAutolinkingIos"
      ],
      "hash": "14462b0fc3028831eb53da3f4727465bab6f6dd7"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoConfigPlugins",
        "expoConfigPlugins",
        "rncoreAutolinkingAndroid",
        "rncoreAutolinkingIos"
      ],
      "hash": "640dc7bae8600211c170eb4049a8a0010f3097ca"
    }
  },
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "ios",
      "reasons": [
        "bareNativeDir"
      ],
      "hash": "e54eee6f8e64c685ca1a8a55d5443b8a1a78573e"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "ios",
      "reasons": [
        "bareNativeDir"
      ],
      "hash": "ea4bd2a02a4a739ae5dd44f6a60416616dde24c3"
    }
  }
]

Generated by PR labeler 🤖

Copy link
Copy Markdown
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such a smart idea to pass the additional "expo-modules-autolinking" to reduce the -- and process.argv.slice(1) change.

thanks for helping that!

@expo-bot
Copy link
Copy Markdown
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog, e.g.:
- Switch back to node -eforexpo-modules-autolinkinginvocation inPodfile command ([#41264](https://github.com/expo/expo/pull/41264) by [@kitten](https://github.com/kitten))
Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 2f474e2

@kitten
Copy link
Copy Markdown
Member Author

kitten commented Nov 29, 2025

@lukmccall, @Kudo: I found some more scripts where this hasn't been aligned/switched over in scripts while looking at the pnpm migration. There's one script that technically changes behaviour but I don't think we care

Comment on lines -219 to +220
'require(require.resolve(\'expo-modules-autolinking\', { paths: [\'' + __dir__ + '\'] }))(process.argv.slice(1))',
'require(\'expo/bin/autolinking\')',
'expo-modules-autolinking',
Copy link
Copy Markdown
Member Author

@kitten kitten Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes behaviour. Technically, we'd like to just avoid the self-require here, for our monorepo. However, there's little point in this one script resolving from "itself" rather than re-entering expo while the Android side doesn't bother doing this

The self-require specifically fails with pnpm in our own monorepo

Copy link
Copy Markdown
Member

@gabrieldonadel gabrieldonadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kitten kitten merged commit aae90cd into main Dec 1, 2025
31 of 33 checks passed
@kitten kitten deleted the @kitten/refactor/switch-back-to-node-autolinking-invocation branch December 1, 2025 21:07
@vonovak vonovak mentioned this pull request Dec 3, 2025
3 tasks
kitten added a commit that referenced this pull request Dec 3, 2025
…template (#41383)

# Why

> [!NOTE]
> Supersedes #41306.
> This hides the template way in a CLI dev-only dependency, so it's not
as publicly visible, since it's only meant for our own testing and
monorepo.

We're often making changes to local templates, e.g.:
- #41264
- #39418

Since we don't have a concept of local templates, we then have to make
sure to specify a local prebuild template manually. However, this seems
pretty redundant because `expo-template-bare-minimum` is just a package
and in the monorepo.

Failing to apply template changes to prebuild CNG folders often causes
build issues on `main` as we upgrade React Native.

Applying the monorepo template automatically seems like a good idea,
since we then automatically test against any template changes on `main`.

# How

- Add `packages/@expo/cli/local-template ->
templates/expo-template-bare-minimum` symlink
- Exclude `/local-template` symlink explicitly in CLI's `.npmignore`
- Extend `resolveLocalTemplateAsync` to try to load from
`@expo/cli/local-template` locally first

This means in `expo/expo`, we'll now always look at the up-to-date
`templates/expo-template-bare-minimum` contents, instead of
`expo/template.tgz`

# Test Plan

- CI covers this behaviour

# Checklist

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)

---------

Co-authored-by: Kudo Chien <kudo@expo.dev>
aleqsio pushed a commit that referenced this pull request Dec 5, 2025
…template (#41383)

# Why

> [!NOTE]
> Supersedes #41306.
> This hides the template way in a CLI dev-only dependency, so it's not
as publicly visible, since it's only meant for our own testing and
monorepo.

We're often making changes to local templates, e.g.:
- #41264
- #39418

Since we don't have a concept of local templates, we then have to make
sure to specify a local prebuild template manually. However, this seems
pretty redundant because `expo-template-bare-minimum` is just a package
and in the monorepo.

Failing to apply template changes to prebuild CNG folders often causes
build issues on `main` as we upgrade React Native.

Applying the monorepo template automatically seems like a good idea,
since we then automatically test against any template changes on `main`.

# How

- Add `packages/@expo/cli/local-template ->
templates/expo-template-bare-minimum` symlink
- Exclude `/local-template` symlink explicitly in CLI's `.npmignore`
- Extend `resolveLocalTemplateAsync` to try to load from
`@expo/cli/local-template` locally first

This means in `expo/expo`, we'll now always look at the up-to-date
`templates/expo-template-bare-minimum` contents, instead of
`expo/template.tgz`

# Test Plan

- CI covers this behaviour

# Checklist

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)

---------

Co-authored-by: Kudo Chien <kudo@expo.dev>
@Kudo Kudo mentioned this pull request Dec 5, 2025
kitten added a commit that referenced this pull request Jan 6, 2026
…tolinking` invocation in `Podfile` command (#41264)

Effectively, this reverts #35661 but instead uses `expo/bin/autolinking`
as a target for readability. A comment was added to denote this.

Replace the invocation with:

```sh
node --no-warnings --eval "require('expo/bin/autolinking')" expo-modules-autolinking
```

This resolves the target CLI directly without `npx` causing extra
printing to `stdout` (in some affected v10 versions), and without
performing extra installation, prompting, or resolution.

This differs in what we had previously to target `expo/bin/autolinking`
to avoid the double `require.resolve` invocation.

The added `expo-modules-autolinking` argument is purely to shift `argv`
and is arbitrary.

The PR was actually not having an effect on Android since the command
there has been moved to the Gradle plugin. I've aligned the command
there to be the same as for iOS. I've omitted `--` since it's
error-prone. It's not needed in this position, and can, under some
circumstances, cause our flags to be ignored, so it's probably safer to
leave out.

- Manually invoked a local app iOS build with the command altered
- E2E CI should cover this

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
kitten added a commit that referenced this pull request Jan 6, 2026
…es-autolinking invocation in Podfile command (#41953)

Backport of #41264 /
aae90cd

**This is applied as a PR for an additional round of reviews, just to be
safe.**

Resolves #36952
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: fingerprint changed bot: suggestions ExpoBot has some suggestions published Changes from the PR have been published to npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants