[Feature] Set New Architecture reads Podfile before checking whether it exists

Ouverte Adaptée aux débutants
#3,062 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
88/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
react-native, typescript, vscode
Domaine
devtools

Piste de recherche

Lis src/extension/commands/setNewArch.ts et vérifie l’ordre de validation de la racine du projet, de vérification de l’existence du Podfile et de fs.readFileSync(). Confirme que le chemin correspondant au fichier manquant consigne Podfile not found et retourne avant de lire ou de modifier le fichier, ou d’exécuter pod install ; ajoute ou mets à jour des tests pour ce comportement si le projet dispose d’une couverture pertinente.

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

Description

enhancement

Description

The Set React Native New Architecture command reads the iOS Podfile before checking whether the file exists.

When the Podfile is missing, fs.readFileSync() throws an ENOENT error before the command can reach its existing "Podfile not found" warning and early return.

Expected behavior

The command checks whether the Podfile exists before reading it.

If the file is missing, it reports "Podfile not found" and stops without attempting to read or modify the file or run pod install.

Actual behavior

The command attempts to read the missing Podfile first, causing an ENOENT exception. The existing missing-file warning is never reached.

Relevant code

In src/extension/commands/setNewArch.ts, the current order is:

const podfilePath = path.join(projectRoot, "ios", "Podfile");
let podfileContent = fs.readFileSync(podfilePath, "utf-8");

// ...

if (!projectRoot || !fs.existsSync(podfilePath)) {
    logger.warning("Podfile not found");
    return;
}

Suggested fix

  • Validate the project root and check whether the Podfile exists before reading it.
  • Preserve the existing warning and early-return behavior.
Langage dominant
TypeScript
Étoiles
2.7k
Forks
303
Merge moyen
22 h 52 min
PR mergées (30 j)
36

Préparer son environnement

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 microsoft/vscode-react-native

Toutes les issues de microsoft/vscode-react-native

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.