Add a test that every copy key in code exists in both locales
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 83/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react-native, typescript
調査の方向性
Read apps/mobile/src/a11y-scan.ts and its test for the scanner shape, then packages/copy/src/index.ts for KEY_PATTERN. Add tests in apps/mobile/src/copy-keys.test.ts and cover .ts and .tsx sources under the specified directories, following apps/mobile/src/skill-names.test.ts for package traversal. Run pnpm --filter @hermit/mobile test; done when missing keys are reported with their file names and both locale files are checked.
索引モデルが issue の本文から書いたものです。
説明
Why
Every string a person sees is a key in packages/copy (AGENTS.md rule 9), and the translator throws on a missing key, so a misspelled key breaks its screen at run time. Nothing checks that the keys the code names exist (VISION.md, principle 5: Spanish and English, first-class).
What to do
Today the copy tests check that both locale files have the same keys and placeholders, and a scan finds about 1,700 literal key references in apps/mobile/src and packages/*/src, all of which resolve. This test guards against the next typo.
- Test first. Create
apps/mobile/src/copy-keys.tswith a pure function that takes a source file's text and returns the copy keys written in it as whole string literals (in double quotes, single quotes, or backticks with no${). UseKEY_PATTERNfrom@hermit/copy(packages/copy/src/index.ts). Follow the shape ofapps/mobile/src/a11y-scan.tsand its test. - In
apps/mobile/src/copy-keys.test.ts, test the function on made-up source text: a literal key is found; a key built at run time from a template is skipped; a string that isn't a key is skipped. Watch it fail before the function exists. - Add a test that reads every
.tsand.tsxfile underapps/mobile/src(skipping*.test.ts) and underpackages/*/src, collects the keys, and checks that each one is in bothpackages/copy/locales/en.jsonandes-419.json. Name the file and the key for each one missing.apps/mobile/src/skill-names.test.tsshows how to walkpackages/*/src. - Check that it can fail: misspell one key in a screen on your machine, run the test, see it name the file and the key, then undo the change.
Done when
pnpm --filter @hermit/mobile testruns the new tests and they pass.- A misspelled key in any screen or package makes the test fail and name the file and the key.
How to check
pnpm --filter @hermit/mobile test
(cd apps/mobile && node --test --experimental-strip-types src/copy-keys.test.ts)
Keep in mind
- Keys built at run time, like the Device lab's
HM-SET-10.failed.followed by a reason, are out of scope. Don't guess them. apps/sitehas its own locale files. Leave it out.- No change to the locale files or the screens, unless the test finds a key that is really missing. Then add it to both locales, with no em or en dashes.
- 主要言語
- TypeScript
- スター
- 11
- フォーク
- 0
- 平均マージ
- 10分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DojoCodingLabs/hermit のほかの issue
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
DojoCodingLabs/hermit#73 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DojoCodingLabs/hermit#45 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DojoCodingLabs/hermit#44 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DojoCodingLabs/hermit#43 ·
メンテナーはふだん 1 日以内に返信
-
agent-friendly docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
DojoCodingLabs/hermit#39 ·
メンテナーはふだん 1 日以内に返信
DojoCodingLabs/hermit の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
superlinked/sie#1033 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
remix-run/react-router#15838 ·
メンテナーはふだん 1 日以内に返信
-
area/ci bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melgarafael/DeskcommCRM#5290 ·
メンテナーはふだん 1 日以内に返信