Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Harden the host's resolution heuristics: addon detection and Xcode workspace lookup

Ouverte
#421 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
typescript
Domaine
cli

Piste de recherche

Commencez dans packages/host/src/node/path-utils.ts avec isNodeApiModule, PLATFORM_EXTENSIONS et le TODO obsolète, puis examinez findXcodeWorkspace dans packages/host/src/node/cli/xcode-helpers.ts. Confirmez le fonctionnement du fast path et de la recherche descendante actuelle. C’est terminé lorsque la détection des addons exige une extension spécifique à la plateforme, que le TODO obsolète est supprimé et que la recherche du workspace remonte depuis les répertoires imbriqués avant d’échouer.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Host 🏡 Linking 🔗

Two places in the host CLI where a shortcut stands in for a proper check. Both fail quietly or unhelpfully rather than loudly.

isNodeApiModule treats any .node file as an addon

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/host/src/node/path-utils.ts#L64-L78

The HACK short-circuits: if <path>.node exists, it returns true without ever checking that it is one of ours. But PLATFORM_EXTENSIONS is specific — .android.node and .apple.node — and a plain .node file is exactly what a Node.js-targeted addon (or a leftover node-gyp build output in build/Release/) looks like. Accepting it means auto-linking picks up something it cannot load, and the failure surfaces later and further away, at runtime on device.

The accompanying TODO on the doc comment asks for the same thing: check for a specific platform extension. Worth doing together, since the fast path exists to avoid the batch directory scan and any fix needs to preserve that.

While in this file: the TODO: Change to .apple.node above PLATFORMS (line 11) is stale — PLATFORM_EXTENSIONS.apple is already ".apple.node" two lines below. It can just be deleted.

findXcodeWorkspace gives up instead of walking upwards

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/host/src/node/cli/xcode-helpers.ts#L56-L69

The search descends into ios/macos from the starting directory and otherwise throws. Running the command from anywhere below the app root — src/, or a package directory in a monorepo, which is the normal place to be standing — fails with No Xcode workspace found in '<cwd>' even though the workspace is one level up. Walking up to the repository/package root before giving up (bounded, e.g. stopping at a .git or the filesystem root) would match what every other RN tool does.

Langage dominant
TypeScript
Étoiles
191
Forks
10
Merge moyen
2 j 17 h
PR mergées (30 j)
3

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de callstackincubator/react-native-node-api

Toutes les issues de callstackincubator/react-native-node-api

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.