ionic-team / ionic-team/ionic-cli

Allow configuring npmClient on a project level

Abierto
#5,113 0 comentarios 1 reacción 0 asignados Ver en GitHub
triage
Lenguaje dominante
TypeScript
Estrellas
2k
Forks
682
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Currently, the npmClient ionic uses can only be set globally, using e.g.:
```sh
ionic config set -g npmClient pnpm
```

In my opinion, it should be possible to override this on a project level, e.g.:
```sh
ionic config set npmClient pnpm
```
This commands "succeeds" and updates the `ionic.config.json`, but ionic doesn't check that file for this parameter (a bit confusing).

The use cases:
- We have some older projects that use npm, and newer once use pnpm. It has happened multiple times that I run `ionic build` when i just switched project and forgot to switch package manager. This then creates a `pnpm-lock` file in an `npm` project. And regularly breaks my dependencies and requires deleting `node-modules` and reinstalling. This wastes time.
- We have pipelines that build iOS projects on local MacMini's. However, if the global ionic package manager changes, and a pipeline doesn't have the setting to change it back, the build breaks. It's not always obvious that the issue is caused by a switch in package manager.

This was previously suggested in https://github.com/ionic-team/ionic-cli/issues/4570, but was not implemented because the lack of use cases.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by tracing the existing `ionic config set` handling for global settings and the project-level `ionic.config.json`, then follow how `ionic build` selects its package manager. Confirm the desired precedence between project and global configuration, and verify that builds use the project setting without creating the wrong lockfile.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
cli
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.