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 小時 39 分鐘
- 30 天內合併 PR
- 275
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
codercops/chatcops 的其他 Issue
-
Widget: fetch signed-in visitor tokens when a session is requested可能已有人在做 @piyusshhjangid 今天認領。 未關閉enhancement
難度 3/5 1-2 天 新手友好度 63/100
codercops/chatcops#461 · 2 則留言 ·
維護者通常 1 天內回覆
-
Widget: support CSP nonces for injected styles可能已有人在做 @piyusshhjangid 今天認領。 未關閉enhancement
難度 4/5 3-5 天 新手友好度 55/100
codercops/chatcops#460 · 2 則留言 ·
維護者通常 1 天內回覆
-
Server: validate `rateLimit.windowMs` before creating the limiter可能已有人在做 @ashutoshpalhare 今天認領。 未關閉
codercops/chatcops#452 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Widget: a "New reply" button when the visitor has scrolled up可能已有人在做 @srujankaleru2007 於 1 天前認領。 未關閉enhancement hacktoberfest widget
codercops/chatcops#420 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
chatcops test: --url to test a deployed server可能已有人在做 @srujankaleru2007 於 1 天前認領。 未關閉enhancement hacktoberfest testing
codercops/chatcops#419 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
better-auth/better-auth#12132 · 1 個 reaction ·
維護者通常 1 天內回覆
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
hurttlocker/o8#5112 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
難度 1/5 1-3 小時 新手友好度 92/100
agent-of-empires/agent-of-empires#5098 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆