Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v3.2.4 (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Jan 25, 2024
1 parent 776decc commit c000380
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 84 deletions.
1 change: 0 additions & 1 deletion .github/workflows/prettier-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/app/_lib/entity/entity-order.converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type EntityQueryOrderMap<T> = {
? EntityQueryOrder
: EntityQueryOrderMap<
NonNullable<T[K] extends Array<infer U> ? U : T[K]>
>;
>;
};

function entityOrder2QueryOrder(value: string): EntityQueryOrder;
Expand Down
18 changes: 9 additions & 9 deletions apps/backend/src/app/_lib/entity/entity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export type EntityRelationKeysDeep<
> extends infer U extends EntityBase
? `${K}.${EntityRelationKeysDeep<U, Depth[D]>}`
: NonNullable<T[K]> extends Collection<
infer U extends EntityBase
>
? `${K}.${EntityRelationKeysDeep<U, Depth[D]>}`
: NonNullable<T[K]> extends Array<
infer U extends EntityBase
>
? `${K}.${EntityRelationKeysDeep<U, Depth[D]>}`
: never;
}[EntityRelationKeys<T>]);
infer U extends EntityBase
>
? `${K}.${EntityRelationKeysDeep<U, Depth[D]>}`
: NonNullable<T[K]> extends Array<
infer U extends EntityBase
>
? `${K}.${EntityRelationKeysDeep<U, Depth[D]>}`
: never;
}[EntityRelationKeys<T>]);
2 changes: 1 addition & 1 deletion apps/backend/src/app/node/node.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class NodeRepository extends EntityRepository<NodeEntity> {
: this.getEntityManager().create(
GraphEntity,
{} as unknown as never
);
);

return super.create(
// @ts-expect-error -- TS2589: Excessive type from the repository base code
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/src/app/node/node.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ export class NodeService
NodeInputEntity,
ioToCreate as NodeInputEntity
)
} satisfies NodeBehaviorParameterInputCreateDto &
} satisfies NodeBehaviorParameterInputCreateDto &
Pick<NodeBehaviorParameterInput, "nodeInput">)
: ({
...behavior,
nodeOutput: em.create(
NodeOutputEntity,
ioToCreate as NodeOutputEntity
)
} satisfies NodeBehaviorParameterOutputCreateDto &
} satisfies NodeBehaviorParameterOutputCreateDto &
Pick<NodeBehaviorParameterOutput, "nodeOutput">);

return {
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/app/auth/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export class AuthInterceptor implements HttpInterceptor {
type === "connected"
? this.translateService.get(
"interceptors.auth.redirect.connected"
)
)
: this.translateService.get(
"interceptors.auth.redirect.unconnected"
)
)
)) as string,
(await lastValueFrom(
this.translateService.get("actions.ok")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class NodeCreateDialog {
"invalid-type": {
type: control.value as never
}
}
}
]
}
),
Expand Down
16 changes: 8 additions & 8 deletions libs/common/src/app/node/io/node-io.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ export type NodeIoValue = NodeIoValueJSON | NodeIoValueVoid | number | string;
export type NodeIoValueFromType<T extends NodeIoType> = T extends NodeIoType.ANY
? NodeIoValue
: T extends NodeIoType.JSON
? NodeIoValueJSON
: T extends NodeIoType.NUMBER
? number
: T extends NodeIoType.STRING
? string
: T extends NodeIoType.VOID
? NodeIoValueVoid
: never;
? NodeIoValueJSON
: T extends NodeIoType.NUMBER
? number
: T extends NodeIoType.STRING
? string
: T extends NodeIoType.VOID
? NodeIoValueVoid
: never;
4 changes: 2 additions & 2 deletions libs/common/src/dtos/entity/entity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export type DtoToEntity<T> = {
>
? Collection<DtoToEntity<U>>
: NonNullable<T[K]> extends EntityDto
? DtoToEntity<NonNullable<T[K]>> | Extract<T[K], null>
: T[K];
? DtoToEntity<NonNullable<T[K]>> | Extract<T[K], null>
: T[K];
};
16 changes: 8 additions & 8 deletions libs/common/src/endpoints/entity-filter.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export type EntityFilterObject<T> = {
[P in keyof T as ExcludeFunctions<T, P>]?: T[P] extends Date
? EntityFilterValue<T[P]> | T[P]
: // Nest array of objects
NonNullable<T[P]> extends ReadonlyArray<infer U>
? EntityFilterObject<U>
: // Compatibility for backend (Mikro-orm Collection)
NonNullable<T[P]> extends Collection<infer U>
? EntityFilterObject<U>
: NonNullable<T[P]> extends object
? EntityFilterObject<T[P]>
: EntityFilterValue<T[P]> | T[P];
NonNullable<T[P]> extends ReadonlyArray<infer U>
? EntityFilterObject<U>
: // Compatibility for backend (Mikro-orm Collection)
NonNullable<T[P]> extends Collection<infer U>
? EntityFilterObject<U>
: NonNullable<T[P]> extends object
? EntityFilterObject<T[P]>
: EntityFilterValue<T[P]> | T[P];
};

/**
Expand Down
11 changes: 6 additions & 5 deletions libs/common/src/endpoints/entity-order.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ export type OrderValueDesc = (typeof OrderValuesDesc)[number];
export type OrderValue = (typeof OrderValues)[number];

// For array and Mikro-orm compatible
export type EntityFlat<T> = T extends ReadonlyArray<infer U>
? U
: T extends Collection<infer U>
? U
: T;
export type EntityFlat<T> =
T extends ReadonlyArray<infer U>
? U
: T extends Collection<infer U>
? U
: T;

export type EntityOrder<T> = {
[K in keyof T as ExcludeFunctions<T, K>]?: T[K] extends Date | Primitive
Expand Down
54 changes: 29 additions & 25 deletions libs/common/src/endpoints/entity-populated.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ export type EntitiesToPopulate<T extends EntityDto> = {
| (Required<T>[K] extends infer U extends EntityDto | null
? EntitiesToPopulate<NonNullable<U>>
: // Mikro-orm Collection
NonNullable<T[K]> extends Collection<infer U extends EntityDto>
? EntitiesToPopulate<U>
: // DTO arrays
NonNullable<T[K]> extends Array<infer U extends EntityDto>
? EntitiesToPopulate<U>
: never);
NonNullable<T[K]> extends Collection<
infer U extends EntityDto
>
? EntitiesToPopulate<U>
: // DTO arrays
NonNullable<T[K]> extends Array<
infer U extends EntityDto
>
? EntitiesToPopulate<U>
: never);
};

/**
Expand All @@ -46,23 +50,23 @@ export type EntityPopulated<
[K in keyof P & keyof T]: P[K] extends true
? Required<T>[K]
: // Nested entities (can still be `null` for nullable relations)
NonNullable<T[K]> extends infer U extends EntityDto
? P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & Required<T[K]>
: U
: // Mikro-orm Collection
NonNullable<T[K]> extends Collection<infer U extends EntityDto>
? Collection<
P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & U
: U
>
: // DTO arrays
NonNullable<T[K]> extends Array<infer U extends EntityDto>
? Array<
P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & U
: U
>
: never;
NonNullable<T[K]> extends infer U extends EntityDto
? P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & Required<T[K]>
: U
: // Mikro-orm Collection
NonNullable<T[K]> extends Collection<infer U extends EntityDto>
? Collection<
P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & U
: U
>
: // DTO arrays
NonNullable<T[K]> extends Array<infer U extends EntityDto>
? Array<
P[K] extends EntitiesToPopulate<U>
? EntityPopulated<U, P[K]> & U
: U
>
: never;
};
32 changes: 16 additions & 16 deletions libs/common/src/http/query/http-query.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,41 @@ export type QueryValue = Date | Primitive | RegExp;
export type QueryDecodedString<T extends string> = T extends QueryEncodedDate
? Date
: T extends QueryEncodedNumber
? number
: T extends QueryEncodedPrimitive
? QueryPrimitiveValue
: T extends QueryEncodedRegExp
? RegExp
: string;
? number
: T extends QueryEncodedPrimitive
? QueryPrimitiveValue
: T extends QueryEncodedRegExp
? RegExp
: string;
/**
* Decoded query to its value.
*/
export type QueryDecoded<T> = T extends string
? QueryDecodedString<T>
: T extends Array<infer U>
? Array<QueryDecoded<U>>
: { [P in keyof T]: QueryDecoded<T[P]> };
? Array<QueryDecoded<U>>
: { [P in keyof T]: QueryDecoded<T[P]> };

/**
* Encoded query string from a query value.
*/
export type QueryEncodedValue<T extends QueryValue> = T extends Date
? QueryEncodedDate
: T extends number
? QueryEncodedNumber
: T extends QueryPrimitiveValue
? QueryEncodedPrimitive
: T extends RegExp
? QueryEncodedRegExp
: string;
? QueryEncodedNumber
: T extends QueryPrimitiveValue
? QueryEncodedPrimitive
: T extends RegExp
? QueryEncodedRegExp
: string;
/**
* Encoded query object from an object.
*/
export type QueryEncoded<T> = T extends QueryValue
? QueryEncodedValue<T>
: T extends Array<infer U>
? Array<QueryEncoded<U>>
: { [P in keyof T]: QueryEncoded<T[P]> };
? Array<QueryEncoded<U>>
: { [P in keyof T]: QueryEncoded<T[P]> };

/**
* An object that is encoded.
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c000380

Please sign in to comment.