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

Add a bundle size budget for the widget to CI

已关闭 适合新手
#176 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, typescript

调研方向

从根目录的 package.json 和 .github/workflows/ci.yml 第 35–42 行开始;CONTRIBUTING.md 介绍了 pnpm 的设置和构建顺序。添加 size-limit 和 @size-limit/file,为 packages/widget/dist/chatcops.min.js 和 packages/widget/dist/chatcops.esm.js 配置 gzip 预算,在根目录添加 size 脚本,并在构建后于 CI 中运行。完成标准:pnpm size 报告这两个文件,CI 检查 IIFE 是否符合 14 KB gzip 的限制,并且 CONTRIBUTING.md 提及该预算。

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

描述

enhancement good first issue hacktoberfest testing widget

The widget is about 12 KB gzipped today (packages/widget/dist/chatcops.min.js after pnpm -r build), but nothing stops it from growing. CI only builds, typechecks and tests (.github/workflows/ci.yml, lines 35 to 42).

What to do

  • Add size-limit with @size-limit/file as a root dev dependency.
  • Add a .size-limit.json with a 14 KB gzip limit for packages/widget/dist/chatcops.min.js and a separate entry for packages/widget/dist/chatcops.esm.js.
  • Add a size script to the root package.json and a CI step after the build that runs it.
  • No PR comment bot for now. A failing step is enough.

Acceptance criteria

  • pnpm size prints both files with their gzip size and passes on dev
  • CI fails when the IIFE goes over 14 KB gzip (show it by temporarily lowering the limit in your PR description, not in the committed config)
  • CONTRIBUTING.md mentions the budget in one line
  • No changeset needed (tooling only)

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

主要语言
TypeScript
星标
13
派生
7
平均合并
3 小时 33 分钟
30 天内合并 PR
176

环境准备

从这里开始

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

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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