Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark version as required on ModDefinition.metadata #9259

Closed
twschiller opened this issue Oct 9, 2024 · 1 comment
Closed

Mark version as required on ModDefinition.metadata #9259

twschiller opened this issue Oct 9, 2024 · 1 comment
Assignees

Comments

@twschiller
Copy link
Contributor

Context

  • In practice, ModDefinition.metadata.version always exists for mods
  • It's currently marked as optional, so there are places where it must be defaulted or asserted to be non-null
  • Tricky to set as required directly on Metadata type because JS-defined bricks inherit from Metadata, but get their version from the Chrome runtime (based on browser extension version)

Implementation Sketch

  • Defined VersionedMetadata = SetRequired<Metadata, "version">
  • Modify ModDefinition type to require it
  • Fix type errors
@twschiller
Copy link
Contributor Author

Closed in: #9264

@twschiller twschiller self-assigned this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant