Skip to content

feat(libs-data-access): resolve legacy device ids to canonical urls - #265

Merged
gurezo merged 5 commits into
mainfrom
feat/issue-256-device-id-url-compat
Sep 12, 2026
Merged

gurezo merged 5 commits into
mainfrom
feat/issue-256-device-id-url-compat

Conversation

@gurezo

@gurezo gurezo commented Sep 12, 2026

Copy link
Copy Markdown
Owner

PR タイトルは Conventional Commits に準拠してください (例: feat(web): add device list component)。
利用可能な scope は CONTRIBUTING.md と commitlint.config.js を参照してください。

Summary

Certified Devices の id を canonical とし、既存の /devices/:id (例: i2c-ads1015) を解決して canonical URL へ redirect するようにしました。未登録 ID ではリクエスト ID を明示した Not Found UI を表示します。

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Chore (build/test/ci)
  • Breaking change

Related issues

What changed?

  • Certified Devices の id を canonical とし、大小無視・{tag}-{id} legacy・exampleNameAliases / 複合デバイス model を alias として解決する
  • JsonDeviceRepository.get() が alias 解決後のデバイスを返す
  • devices/:id で canonical と異なる ID は replaceUrl 付きで canonical URL へ redirect する
  • 未登録 ID の Not Found UI にリクエスト ID を表示する
  • ID 解決の unit test と /devices/ADS1015 / legacy / 大小違い / unknown / 一覧遷移の E2E を追加する

API / Compatibility

  • Public API changes (export / function signature / behavior)
    • Details: @chirimen-device-dashboard/libs-data-access に buildDeviceIdIndex / parseCertifiedAliases / resolveDeviceId を追加。DeviceRepository.get() は完全一致に加え legacy / alias / 大小違いでもデバイスを返す
  • This change is backward compatible
  • This change introduces a breaking change
    • Migration notes: 一覧から生成される詳細 URL は canonical ID (ADS1015 等) になる。既存の i2c-ads1015 形式 URL は redirect で互換を維持する。generic な other-device* 等、tag 衝突する ID は対象外

How to test

  1. pnpm nx test libs-data-access と pnpm nx test web と pnpm nx test libs-device-detail を実行する
  2. pnpm nx serve web で /devices/ADS1015 を開き、一覧からの遷移・リロードが同じ URL になることを確認する
  3. /devices/i2c-ads1015 と /devices/ads1015 が /devices/ADS1015 へ redirect されること、/devices/not-a-real-device で Not Found になることを確認する
  4. pnpm nx e2e web-e2e -- --project=chromium で device-id-compat.spec.ts が成功することを確認する

Environment (if relevant)

  • Browser: Chromium (Cursor IDE browser / Playwright)
  • OS: macOS
  • Node version: (local nx test / serve)
  • pnpm version: workspace default

Checklist

  • I ran tests locally (if available)
  • I updated docs/README if needed
  • I considered error handling where relevant

Made with Cursor

gurezo and others added 5 commits September 12, 2026 14:44
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gurezo
gurezo merged commit 7944a00 into main Sep 12, 2026
5 checks passed
@gurezo
gurezo deleted the feat/issue-256-device-id-url-compat branch September 12, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Device ID と既存 URL の互換性を整理する

1 participant