Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix: don't echo unknown region codes as their name in the by-region table

オープン 初心者向け
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

lib/utils.ts の countryName から始めてください。ここでは Intl.DisplayNames が fallback オプションなしで作成されています。また blocks/charts/region-map.tsx の REGION_ALIASES も確認してください。未知のコード(EL や XX など)が名前を表示しないように fallback: "none" を設定し、テーブルが対応付けられた国を検索できるよう、エイリアスマップを lib/regions.ts に移動してください。EL、XX、UK を宣言したフィクスチャが "greece"、名前なし、"united kingdom" を表示し、pnpm typecheck と pnpm lint が通れば完了です。この issue は #45 に依存しているため、まずその変更がマージ済みかを確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue

Spotted while building the world map (#45).

Problem

The by-region table shows each code's country name next to it, via countryName (lib/utils.ts after #45, before that in blocks/by-region.tsx). Intl.DisplayNames defaults to fallback: "code", so for a code it doesn't know it returns the code itself, which we lowercase:

declared shown
EL EL el
XX XX xx
UK UK united kingdom (Intl knows this one)

EL is the EU's code for Greece, and the map (#45) already draws it on GR through REGION_ALIASES, so the table and the map disagree.

Solution

  1. In countryName, pass fallback: "none" to Intl.DisplayNames. It then returns undefined for an unknown code, so the existing ?? "" shows no name:
    const regionNames = new Intl.DisplayNames(["en"], {
      type: "region",
      fallback: "none",
    })
    
    Checked in Node: EL/XX → undefined, UK/GB → "United Kingdom", GR → "Greece".
  2. Name an aliased code after the country the map draws it on. Move REGION_ALIASES from blocks/charts/region-map.tsx to lib/regions.ts, and have the table look up countryName(REGION_ALIASES[code] ?? code), so EL reads "greece". The code column still shows what was declared.

Out of scope: rewriting declared codes in the indexer (regionCode in worker/src/stats.ts), which would split history between the old and new code.

Verify

pnpm typecheck && pnpm lint, then with a local fixture (see CLAUDE.md) that declares EL, XX and UK, check that the table shows "greece", no name, and "united kingdom".

🤖 Generated with Claude Code

主要言語
TypeScript
スター
2
フォーク
0
平均マージ
9時間 7分
マージ済み PR(30日)
53

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

decdn/stats のほかの issue

decdn/stats の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。