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

Aberta Para iniciantes
#3,062 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
88/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
react-native, typescript, vscode
Domínio
devtools

Direção de pesquisa

Leia src/extension/commands/setNewArch.ts e confira a ordem da validação da raiz do projeto, da verificação de existência do Podfile e de fs.readFileSync(). Confirme que o caminho de arquivo ausente registra Podfile not found e retorna antes de ler ou modificar o arquivo ou executar pod install; adicione ou atualize testes para esse comportamento se o projeto tiver cobertura relevante.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
TypeScript
Estrelas
2.7k
Forks
303
Merge médio
22h 52min
PRs com merge (30d)
36

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/vscode-react-native

Todas as issues de microsoft/vscode-react-native

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.