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

Aperta Adatta ai principianti
#3,062 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react-native, typescript, vscode
Ambito
devtools

Direzione di ricerca

Leggi src/extension/commands/setNewArch.ts e verifica l’ordine della convalida della radice del progetto, del controllo dell’esistenza del Podfile e di fs.readFileSync(). Conferma che il percorso relativo al file mancante registra Podfile not found e restituisce il controllo prima di leggere o modificare il file o di eseguire pod install; aggiungi o aggiorna i test per questo comportamento se il progetto dispone di una copertura pertinente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
2.7k
Fork
303
Merge medio
22h 52m
PR unite (30g)
36

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/vscode-react-native

Tutte le issue di microsoft/vscode-react-native

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.