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

Replacement badge visually distinguishes between less/more opinioated recommendations

未关闭
#3,062 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
nuxt, typescript
领域
design, frontend

调研方向

从 npmx.dev 仓库开始,在组件中 grep 'replacement' 或 'badge',找出 module-replacements 徽章的渲染位置,以及替换数据是如何从 module-replacements 包中获取的。阅读该包导出的清单文件(dist/main.d.ts 列出了 native/micro-utility/preferred 类别),查看每个替换属于哪个类别,然后将 'preferred' 类别映射到蓝色的信息型徽章变体,同时为 native 和 micro-utility 保留琥珀色。完成标准是包站点对首选替换显示蓝色、其余显示琥珀色,并通过本地构建或现有测试套件验证。

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

描述

e18e front needs discussion
Describe the feature

The module replacements package has three different categorizations for replacements, ranking from less to more opinionated: native, micro utility and preferred. Currently npmx exclusively uses the yellow/amber variant for the badge. From my perspective we could improve the semantics here, and make them map more closely to the semantics of module replacements, by using an informational (blue) variant of the badge for the preferred replacements.

That makes the semantics nicer imo:
amber: “You should really do something different here”
And blue: “Fyi you could also go with something else here”

And it would look something like this (in this particular example there's an added benefit that you can more easily distinguish between a vulnerability warning and a replacement suggestion):

the npmx package site showing a 'preferred' module replacement suggestion, in informational blue, and thereafter a yellow warning about a security vulnerability

The manifests are exposed from the module replacements package https://npmx.dev/package-code/module-replacements/v/3.0.0/dist%2Fmain.d.ts#L7 so it’s possible to get the data. Maybe it could also be contributed upstream to module-replacements (although there’s the other distinction at play around how involved the replacement is too, but worth exploring).

Additional information
  • Would you be willing to help implement this feature?
Final checks
主要语言
TypeScript
星标
3.6k
派生
533
平均合并
4 天 13 小时
30 天内合并 PR
37

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

npmx-dev/npmx.dev 的其他 Issue

查看 npmx-dev/npmx.dev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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