Type-check the TypeScript samples in the docs
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 70/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, node.js, typescript
- 领域
- ci-cd, documentation, testing, tooling
调研方向
Read CONTRIBUTING.md for the pnpm setup and build steps, then inspect the TypeScript blocks in website/src/content/docs/**/*.mdx and the CI workflow. Add a checker that extracts and type-checks the samples against the built packages, supports // docs-check: skip, and reports file and line; add docs:check to CI and fix flagged samples. Done when pnpm docs:check passes on dev, reports checked and skipped counts, and a deliberately broken sample fails with its location.
由索引模型根据 Issue 内容生成。
描述
The docs have 67 typescript code blocks across website/src/content/docs/**/*.mdx, and nothing checks that they still compile against the packages. Past PRs (#52, #135) fixed samples that imported paths that don't exist and called constructors the wrong way; the next API change will break some again without anyone noticing.
What to do
- Add a script, for example
scripts/check-doc-samples.mjs, that pulls every ```typescript block out of the.mdxfiles, writes each to a temporary `.ts` file, and type-checks them with `tsc --noEmit` against the built packages (`@chatcops/core`, `@chatcops/server`, `@chatcops/widget`). - Blocks that are fragments on purpose (a config object on its own, a type signature) can opt out with a
// docs-check: skipfirst line. Keep the opt-outs few, and prefer making a sample complete. - Add a
docs:checkscript and run it in CI after the build. - Fix the samples it flags.
Acceptance criteria
-
pnpm docs:checkruns ondevand passes, with the number of checked and skipped blocks printed - Breaking a sample on purpose (put the diff in the PR description) makes it fail with the file and line
- CI runs it
- No changeset needed (tooling and docs)
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 小时 41 分钟
- 30 天内合并 PR
- 155
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/chatcops 的其他 Issue
-
Document the pre-chat form可能已有人在做 @masyarakatai 于 5 天前认领。 未关闭documentation good first issue hacktoberfest widget
难度 2/5 1-3 小时 新手友好度 88/100
codercops/chatcops#70 · 5 条评论 ·
维护者通常 1 天内回复
-
docs: update the providers page for openai-compatible, registerProvider and provider imports可能已有人在做 @prakashNalla 今天认领。 未关闭documentation good first issue hacktoberfest website
难度 3/5 1-2 天 新手友好度 76/100
codercops/chatcops#291 · 1 条评论 ·
维护者通常 1 天内回复
-
docs: add a protocol reference page for custom clients可能已有人在做 @kachamsiddarth 今天认领。 未关闭documentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)可能已有人在做 @bhushan4work 今天认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 25/100
codercops/chatcops#249 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-sqlite, a store for single-server setups可能已有人在做 @srikar-naidu 今天认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 35/100
codercops/chatcops#247 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
chaitin/MonkeyCode#1437 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
carbon-design-system/carbon-ai-chat#2615 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offline可能已有人在做 @r2jaff 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ComposioHQ/composio#5054 ·
维护者通常 1 天内回复