Allow configuring npmClient on a project level

未关闭
#5,113 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
cli

调研方向

首先跟踪现有的 ionic config set 对全局设置和项目级 ionic.config.json 的处理,然后了解 ionic build 如何选择其包管理器。确认项目配置与全局配置之间所需的优先级,并验证构建使用项目设置而不会创建错误的 lockfile。

由索引模型根据 Issue 内容生成。

描述

triage

Currently, the npmClient ionic uses can only be set globally, using e.g.:

ionic config set -g npmClient pnpm

In my opinion, it should be possible to override this on a project level, e.g.:

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.

主要语言
TypeScript
星标
2k
派生
681
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/ionic-cli 的其他 Issue

查看 ionic-team/ionic-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。