Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Corepack Support

未关闭
#531 68 条评论 248 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

@SayakMukhopadhyay 已经在做这个了。

开始于 2022年12月26日。

  • #546 来自 @beeequeue —— 已关闭,未合并
  • #651 来自 @SayakMukhopadhyay —— 未关闭
  • #901 来自 @JP250552 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
领域
ci-cd, devops, tooling

调研方向

首先查看此 issue 中描述的 setup-node 缓存和 package-manager 引导流程,然后检查根目录 package.json 中的 packageManager 字段如何驱动行为。比较提议的 corepack: true、cache: 'auto' 和自动检测方案,包括启用 Corepack、恢复其 root,以及运行 corepack prepare --active;当所选行为能够在不要求预先安装 package manager 的情况下与 pnpm 或 Yarn 缓存配合工作时,即视为完成。

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

描述

feature request needs eyes

Description:
Support using https://github.com/nodejs/corepack to manage non-NPM package managers.

Ideally in between installing node and bootstrapping the package manager cache, this action:

  • enables corepack (could be a no-op depending on the node version)
  • caches/restores the corepack root
  • runs corepack prepare --active

(after some research, that last one may not necessary but instead makes an implicit step explicit)

This behavior could either be trigged by the presence of the packageManager field in the root package.json (might be suprising), cache: 'auto' as possibly envisioned in #306, or corepack: true

Justification:
Both pnpm and yarn support corepack, and yarn recommendeds corepack for package manager versioning. Currently using corepack with this action will break when using the cache key as this action assumes the appropriate version manager has already been installed. However, you don't necessarily want to bootstrap with corepack until the appropriate node version has been installed and configured.

Related: #530 #182

Are you willing to submit a PR?
Yes

主要语言
TypeScript
星标
5k
派生
1.7k
平均合并
4 天 22 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

actions/setup-node 的其他 Issue

查看 actions/setup-node 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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