Issue: Improve `bootstrap.js` to support both Yarn and NPM with clearer errors

未关闭
#50 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@adimiz1 已经在做这个了。

开始于 2025年9月25日。

  • #1 来自 @SanskritiSharma-13 —— 已合并
  • #51 来自 @itspavant —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

Feature request for Cloudinary React Native SDK

Improve scripts/bootstrap.js to support both Yarn and NPM with clearer error handling.

Explain your use case

When contributing to this repository, new developers typically start with npm install.
However, the current scripts/bootstrap.js assumes Yarn is installed.
If Yarn is missing, the script fails without guidance, making onboarding harder for contributors who default to npm.

Describe the problem you’re trying to solve

Right now:

  • The script hardcodes Yarn and fails if it’s not installed.
  • There is no fallback to npm run bootstrap.
  • If bootstrap is not defined in package.json, the script exits with no explanation.

This creates friction for new contributors and may result in unnecessary issues being opened.

Do you have a proposed solution?

Yes.

  • Detect if Yarn is available; if not, fall back to npm run bootstrap.
  • Allow contributors to explicitly prefer npm (e.g. with a flag like --use-npm).
  • Validate that a bootstrap script exists in package.json before trying to run it.
  • Print clear, contributor-friendly error messages when something fails.

This change would not alter the default behavior for Yarn users, but it would improve reliability, reduce confusion, and make onboarding easier for developers using npm.

主要语言
TypeScript
星标
28
派生
21
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

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

cloudinary/cloudinary-react-native 的其他 Issue

查看 cloudinary/cloudinary-react-native 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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