Skip to content

Commit

Permalink
adjust some types
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Jan 7, 2025
1 parent 51e6608 commit a03027f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion generators/base-application/support/relationship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const loadEntitiesOtherSide = (entities: Entity[], { application }: { app
relationship.otherEntity = otherEntity;
const otherRelationship = findOtherRelationshipInRelationships(entity.name, relationship, otherEntity.relationships ?? []);
if (otherRelationship) {
relationship.otherRelationship = otherRelationship as Relationship;
relationship.otherRelationship = otherRelationship;
otherRelationship.otherEntityRelationshipName = otherRelationship.otherEntityRelationshipName ?? relationship.relationshipName;
relationship.otherEntityRelationshipName = relationship.otherEntityRelationshipName ?? otherRelationship.relationshipName;
if (
Expand Down
3 changes: 1 addition & 2 deletions generators/bootstrap-application-client/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export default class BootStrapApplicationClient extends BaseApplicationGenerator
loadDerivedConfig(clientCommand.configs, { application });
loadDerivedClientConfig({ application });
},
prepareForTemplates({ application: app }) {
const application: any = app;
prepareForTemplates({ application }) {
application.frontendAppName = getFrontendAppName({ baseName: application.baseName });
},
});
Expand Down
1 change: 1 addition & 0 deletions generators/client/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type FrontendApplication = ApplicationClientProperties &
clientWebappDir?: string;
webappEnumerationsDir?: string;
clientFrameworkBuiltIn?: boolean;
frontendAppName?: string;
};

/**
Expand Down
3 changes: 2 additions & 1 deletion generators/server/support/prepare-relationship.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Relationship } from '../../../lib/types/application/relationship.js';
import { mutateData } from '../../../lib/utils/object.js';
import { formatDocAsApiDescription, formatDocAsJavaDoc } from '../../java/support/doc.js';
import type { Entity } from '../../../lib/types/application/index.js';

export function prepareRelationship({ relationship }: { relationship: Relationship; entity: any }) {
export function prepareRelationship({ relationship }: { relationship: Relationship; entity: Entity }) {
if (relationship.documentation) {
mutateData(relationship, {
__override__: false,
Expand Down
4 changes: 2 additions & 2 deletions lib/types/application/entity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export interface Entity<F extends BaseField = Field, R extends BaseRelationship
changelogDateForRecent: any;
/** @experimental */
auditableEntity?: boolean;
relationships: (IsNever<R> extends true ? Relationship<Omit<Entity, 'relationships'>> : R)[];
otherRelationships: (IsNever<R> extends true ? Relationship<Omit<Entity, 'relationships'>> : R)[];
relationships: (IsNever<R> extends true ? Relationship : R)[];
otherRelationships: (IsNever<R> extends true ? Relationship : R)[];

primaryKey?: PrimaryKey<F>;

Expand Down

0 comments on commit a03027f

Please sign in to comment.