equinor / equinor/fusion-framework

context: consider converting context types.ts to Zod schemas for runtime validation

Open
#5,122 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10
Forks
10
Avg merge
19h 40m
Merged PRs (30d)
150

Description

`packages/modules/context/src/types.ts` has an open design note on `ContextItem`/related types:

```ts
/**
* ...
* @todo - convert to Zod schema for validation and type safety.
*/
```

Evaluate converting the plain TypeScript types in this file to Zod schemas (mirroring the pattern used elsewhere in the framework, e.g. `@equinor/fusion-framework-module-telemetry`'s `static.ts`) for runtime validation in addition to compile-time typing.

_Originally flagged as an `@todo` comment while resolving fusion-lint warnings on `fix/sematic-lint`._

Contributor guide

Open the contributing guide

Research direction

Start with packages/modules/context/src/types.ts and inspect the ContextItem and related types, including the open @todo. Compare the intended conversion with the pattern in @equinor/fusion-framework-module-telemetry's static.ts. Done means documenting whether Zod schemas are appropriate here and, if conversion is pursued, defining the required runtime-validation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.