nodejs / corepack

Zero-runtime-dependency package acting as bridge between Node projects and their package managers
MIT License
2.56k stars 169 forks source link

feat: add cnpm to corepack #333

Open elrrrrrrr opened 11 months ago

elrrrrrrr commented 11 months ago

add cnpm to corepack, closes #331

  1. ✍️ update config.json and add registry information for cnpm.
  2. 🪝 Add a post-install hook to install cnpm-related dependencies.

Fixes: https://github.com/nodejs/corepack/issues/331

aduh95 commented 11 months ago

2. 🪝 Add a post-install hook to install cnpm-related dependencies.

Could it be possible to drop that and download ready-to-be-used code instead?

elrrrrrrr commented 10 months ago

Just a gentle ping 🙏🏻 @aduh95 @arcanis @merceyz If there's anything more needed from my side, please let me know. Eagerly awaiting your feedback

anonrig commented 10 months ago

cc @nodejs/security-wg

joyeecheung commented 10 months ago

Can't review the code per-se myself, but I can also confirm that cnpm is a trust-worthy alternative primarily sponsored by Alibaba to help Node.js developers in China work around the network issues in the public network in China & create private registries within a company.

arcanis commented 10 months ago

I'm not familiar with cnpm, so couple of questions:

elrrrrrrr commented 10 months ago

@arcanis

Thank you for your interest and questions about cnpm. I am pleased to provide you with the following clarifications:

Why does a whole package manager need to be built around

Indeed, we offer a complete read-only mirror service capability. Developers can directly configure the registry address and use yarn, pnpm, or any package manager of their choice. However, we still provide an independent client, mainly to handle the following scenarios:

Does it mean that the cnpm default registry is subject to local CN legislation

Like all websites accessible within China, cnpm aligns with the country's internet and data regulations. For over 10 years, it has been reliably serving users while adhering to Mainland China's regulatory requirements. This compliance ensures that cnpm's default registry undergoes thorough network filing and security scanning, aligning with local policy standards. Our commitment is to provide reliable and compliant services to developers, not just in China but globally, always mindful of the legal nuances in different regions.

Are there other differencies?

cnpm includes npm to ensure maximum compatibility. In the corporate environment, we also offer some extended capabilities. We continue to advance related open-source work, including:

These features, in addition to changes on the registry side, also require client-side adaptation.

Please let me know if you have any further questions or need more information. 🙏🏻

aladdin-add commented 9 months ago

Whether or not to support setting registry to https://registry.npmmirror.com/ when not using cnpm?