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

refactor: get rid of ReadonlyDeep type #3201

Merged
merged 6 commits into from
Feb 4, 2025
Merged

refactor: get rid of ReadonlyDeep type #3201

merged 6 commits into from
Feb 4, 2025

Conversation

Lodin
Copy link
Contributor

@Lodin Lodin commented Feb 3, 2025

Before, all OpenAPIV3 types were wrapped in ReadonlyDeep wrapper to make them read-only. However, now, when we have TransferTypesPlugin, it looks overburdened and unnecessary. So I decided that it'd be better to just remove this type leaving raw OpenAPIV3 types. It also unwrapped several errors, so this PR contains fixes for them as well.

PR Summary

Dependency Updates:

  • Updated @vaadin/react-components from version 24.7.0-alpha7 to 24.7.0-alpha8 in package.json and packages/ts/react-crud/package.json (🤖).

Type Definition Changes:

  • Removed ReadonlyDeep type from various type definitions in multiple files, including Generator.ts, ReferenceResolver.ts, Schema.ts, EndpointMethodOperationProcessor.ts, EndpointMethodRequestBodyProcessor.ts, EndpointMethodResponseProcessor.ts, EndpointProcessor.ts, index.ts in generator-plugin-backbone, and index.ts in generator-plugin-model.

Code Improvements:

  • Added a check to ensure all items in the oneOf array are ReferenceSchema in SubTypesPlugin.
  • Updated the constructor of SubTypesProcessor to use readonly for the oneOf parameter.

These changes collectively simplify type definitions and improve the robustness of the code.

@Lodin Lodin added the hilla Issues related to Hilla label Feb 3, 2025
@Lodin Lodin requested review from platosha, cromoteca and taefi February 3, 2025 16:08
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.91%. Comparing base (e238c32) to head (4646dab).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/ts/generator-core/src/Generator.ts 0.00% 1 Missing ⚠️
...ackages/ts/generator-core/src/ReferenceResolver.ts 0.00% 1 Missing ⚠️
packages/ts/generator-core/src/Schema.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3201      +/-   ##
==========================================
- Coverage   86.91%   86.91%   -0.01%     
==========================================
  Files         118      118              
  Lines        8194     8191       -3     
  Branches     1256     1256              
==========================================
- Hits         7122     7119       -3     
  Misses       1058     1058              
  Partials       14       14              
Flag Coverage Δ
unittests 86.91% <75.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarqubecloud bot commented Feb 4, 2025

Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Lodin Lodin merged commit d8473d8 into main Feb 4, 2025
13 of 15 checks passed
@Lodin Lodin deleted the refactor/readonly-deep branch February 4, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hilla Issues related to Hilla
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants