Skip to content

feat(libs-data-access): add certified devices json types and adapter - #263

Merged
gurezo merged 5 commits into
mainfrom
feat/issue-254-certified-device-adapter
Sep 12, 2026
Merged

gurezo merged 5 commits into
mainfrom
feat/issue-254-certified-device-adapter

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

chirimen-certified-devices/generated/devices.json を型安全に扱う入力型と、既存 Dashboard UI モデル (DeviceInfo) への Adapter を libs-data-access に追加しました。外部 JSON の構造は UI に漏らさず、後続の Repository 切り替え (#255) から利用できる純関数として公開しています。

Type of change

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

Related issues

What changed?

  • Certified Devices JSON 用の入力型 (CertifiedDevicesJson / CertifiedDevice / CertifiedDeviceMeta / Example / Platform / Alias) と version === 1 の対応方針を追加
  • adaptCertifiedDevicesJson / adaptCertifiedDevice で基本情報・product URL・datasheet / circuit / reference・Example / platform を DeviceInfo へ変換
  • nullable / optional フィールドは例外を出さず既定値またはプロパティ省略で扱い、Adapter の主要ケースを unit test でカバー

API / Compatibility

  • Public API changes (export / function signature / behavior)
    • Details: @chirimen-device-dashboard/libs-data-access に Certified Devices の型、SUPPORTED_CERTIFIED_DEVICES_VERSION、adaptCertifiedDevice / adaptCertifiedDevicesJson を追加。既存の DeviceRepository / JsonDeviceRepository の挙動は変更していません。
  • This change is backward compatible
  • This change introduces a breaking change
    • Migration notes:

How to test

  1. pnpm nx test libs-data-access を実行し、Adapter / repository の unit test がすべて成功することを確認する
  2. Adapter のフィクスチャ (ADS1015) で id / deviceName / product.url / Example の hardware・platform が変換されることを確認する
  3. circuit / datasheet / image / productUrl が null のデバイスでも例外が出ないこと、不正入力では [] が返ることを確認する

Environment (if relevant)

  • Browser:
  • OS: macOS / Windows / Linux
  • Node version:
  • pnpm version:

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:09
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 0228c57 into main Sep 12, 2026
5 checks passed
@gurezo
gurezo deleted the feat/issue-254-certified-device-adapter branch September 12, 2026 05:20
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]: Certified Devices JSON 用の型と Adapter を実装する

1 participant