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

Type safety - Incremental step 2 #26110

Merged
merged 7 commits into from
May 11, 2024
Merged

Type safety - Incremental step 2 #26110

merged 7 commits into from
May 11, 2024

Conversation

Tcharl
Copy link
Contributor

@Tcharl Tcharl commented May 11, 2024

More type safety on JDL

Related with #26114

Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@Tcharl Tcharl marked this pull request as ready for review May 11, 2024 12:23
relationshipSide?: RelationshipSide;
relationshipName: string;
relationshipType: RelationshipType;
otherEntityName: string;
options?: Record<string, boolean | string | number>;
} & Record<string, any>;

export type Entity = {
export type JSONEntity = {
Copy link
Contributor Author

@Tcharl Tcharl May 11, 2024

Choose a reason for hiding this comment

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

I'm a bit confused with this one: what's the difference with generators/base-application/types/entity.d.ts? is it relevant that these converters/types exists?

Copy link
Member

Choose a reason for hiding this comment

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

generators/base-application/types/entity.d.ts have calculated values and supported annotations.
They are used in generators.
In jdl and json only base data and annotations of type Record<any, any> exists.

@@ -24,12 +24,18 @@ import JDLApplicationConfigurationOption from './jdl-application-configuration-o
import JDLApplicationConfiguration from './jdl-application-configuration.js';
import JDLApplicationEntities from './jdl-application-entities.js';
import JDLOptions from './jdl-options.js';
import AbstractJDLOption from './abstract-jdl-option.js';

export type JDLJSONApplicationConfiguration = {
Copy link
Contributor Author

@Tcharl Tcharl May 11, 2024

Choose a reason for hiding this comment

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

Same confusion about the relevance: shouldn't it be jdl/models/jdl-application.ts. Is it worth splitting the business model and the JDLJson one?

@mshima mshima merged commit c1aec69 into jhipster:main May 11, 2024
52 checks passed
@mraible mraible added this to the 8.5.0 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants