Schema: add typed set and map types (ReadonlySet / ReadonlyMap)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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>.
- Lenguaje dominante
- TypeScript
- Estrellas
- 12
- Forks
- 8
- Merge medio
- 9 h 2 min
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de adobe/data
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
ecs: let kernels issue commands through helpers (component lists, symbol-keyed values, void helpers)Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
createLazy: wrap nested service groups and accept partial (subset) schemasPosiblemente ocupada @krisnye la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
Los mantenedores suelen responder en 1 día
Todos los issues de adobe/data
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/langchainjs#12157 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
activescott/home-infra-k8s-flux#511 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
lingdojo/kana-dojo#33753 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
android:player
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
follow-up needs-triage S3: minor
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
manaflow-ai/cmux#38032 · 1 comentario ·
Los mantenedores suelen responder en 1 día