Schema: add typed set and map types (ReadonlySet / ReadonlyMap)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 57/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start with ecs/packages/ecs/src/interface/schema/schema.ts, the existing reference implementation mentioned in the issue, then trace this repository’s Schema, schemaTypes, Schema.ToType, toTypeScript, validation, and createCoerceFunction entry points. Add typed set and map support across those areas and pin the inferred types with type tests. Done means values validate and coerce their typed elements, render as ReadonlySet<T> and ReadonlyMap<K, V>, and round-trip through Data.stringify and Data.parse.
索引モデルが issue の本文から書いたものです。
説明
Problem
Data includes ReadonlySet<Data> and ReadonlyMap<Data, Data>, and Data.stringify / Data.parse round-trip both, but Schema has no way to describe either with typed elements.
typeacceptsnumber | integer | string | boolean | null | array | object | typed-buffer | blob | observe | promise | generator | function. There's nosetormap.- The only escape hatch is
typeName:Schema.ToType<{ typeName: 'Set' }>isReadonlySet<any>, which loses the element type.toTypeScriptrenders it as a bareSet.{ typeName: 'ReadonlySet' }resolves toany, becauseReadonlySetisn't a runtime global. uniqueItemson an array doesn't map to a set either.
So a schema-described value that's naturally a set, such as an observable set of ids exposed to an agent, has to be modeled as an array.
Proposal
Port the set and map forms that @adobe/ecs already has (ecs/packages/ecs/src/interface/schema/schema.ts):
{ type: 'set', items: S } // ToType → ReadonlySet<ToType<S>>
{ type: 'map', keys: K, values: V } // ToType → ReadonlyMap<ToType<K>, ToType<V>>
Covering:
Schema/schemaTypes: addsetandmap.Schema.ToType: map them toReadonlySet/ReadonlyMapwith typed elements.toTypeScript: renderReadonlySet<T>/ReadonlyMap<K, V>.- Validation and
createCoerceFunction: check elements againstitems, andkeys/values. - Type-tests pinning
ToTypefor both, plus a round-trip test throughData.stringify/Data.parse.
Motivation
Firefly Platform's agentic surface types (Agentic.State<S> derives its value type from Schema.ToType<S>) need an Observe<ReadonlySet<AppId>> state. Until this lands it uses ReadonlyArray<AppId>.
- 主要言語
- TypeScript
- スター
- 12
- フォーク
- 8
- 平均マージ
- 9時間 2分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/data のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
ecs: let kernels issue commands through helpers (component lists, symbol-keyed values, void helpers)オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
createLazy: wrap nested service groups and accept partial (subset) schemas対応中かも @krisnye が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/langchainjs#12157 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
activescott/home-infra-k8s-flux#511 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
lingdojo/kana-dojo#33753 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
android:player
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
follow-up needs-triage S3: minor
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
manaflow-ai/cmux#38032 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信