ionic-team / ionic-team/ionic-cli

Feature request: Add capability to remove components

Aberta
#2,745 10 comentários 12 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
TypeScript
Estrelas
2k
Forks
682
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Currently the CLI provides us with the capability to generate components using the **generate** command. Assume that we need to generate a page, we use the `ionic generate page games-list`. This will generate a directory which contains a .html, .ts and .scss file for us and add an entry within the _declarations_ and _entryComponents_ array in the app's root module: _app.module.ts_.

Now for some reason if we want to delete the _games-list_ component we will have to manually delete the folder and remove the entries in the _app.module.ts_. In many situations the developer may forget to do the second step i.e. to remove the entries from _app.module.ts_ which results in an error.
PS: I have faced this error many times in the initial stages of development. I keep forgetting to remove the entries.

In order to avoid this error, we can introduce **remove** command which removes the component folder as well the entries from the app's root module.
`ionic remove page games-list`

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by tracing the CLI's existing generate command and how it updates app.module.ts. Define the remove command for a generated page such as games-list, covering both its directory and the declarations and entryComponents entries, then verify the resulting module remains valid.

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

Avaliação

Stack de tecnologia
typescript
Domínio
cli
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

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