Skip to content

Commit

Permalink
chore: run prettier on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Nov 30, 2023
1 parent 428f5af commit e3009b9
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 44 deletions.
20 changes: 10 additions & 10 deletions packages/code-gen/src/api-client/react-query.js
Expand Up @@ -268,8 +268,8 @@ export function reactQueryGenerateFunction(
distilledTargetInfo.isAxios
? `AxiosRequestConfig`
: distilledTargetInfo.isFetch
? `RequestInit`
: "unknown"
? `RequestInit`
: "unknown"
}${
route.response && !distilledTargetInfo.skipResponseValidation
? `, skipResponseValidation?: boolean`
Expand Down Expand Up @@ -398,17 +398,17 @@ export function reactQueryGenerateFunction(
const apiInstanceArgument = distilledTargetInfo.useGlobalClients
? ""
: distilledTargetInfo.isAxios
? `axiosInstance: AxiosInstance,`
: distilledTargetInfo.isFetch
? "fetchFn: FetchFn,"
: "";
? `axiosInstance: AxiosInstance,`
: distilledTargetInfo.isFetch
? "fetchFn: FetchFn,"
: "";
const apiInstanceParameter = distilledTargetInfo.useGlobalClients
? ""
: distilledTargetInfo.isAxios
? "axiosInstance,"
: distilledTargetInfo.isFetch
? "fetchFn,"
: "";
? "axiosInstance,"
: distilledTargetInfo.isFetch
? "fetchFn,"
: "";
const queryClientArgument = distilledTargetInfo.useGlobalClients
? ""
: `queryClient: QueryClient,`;
Expand Down
4 changes: 2 additions & 2 deletions packages/code-gen/src/crud/partials/events.js
Expand Up @@ -269,10 +269,10 @@ export const crudPartialInlineRelationInserts = (relations, parentName) =>
relation.isInlineArray
? `${relation.name}[i].map(it => it.${relation.referencedKey} = ${parentName}[i].${relation.parentPrimaryKey});`
: relation.isOptional
? `if (${relation.name}[i]) {
? `if (${relation.name}[i]) {
${relation.name}[i].${relation.referencedKey} = ${parentName}[i].${relation.parentPrimaryKey};
}`
: `${relation.name}[i].${relation.referencedKey} = ${parentName}[i].${relation.parentPrimaryKey};`
: `${relation.name}[i].${relation.referencedKey} = ${parentName}[i].${relation.parentPrimaryKey};`
}
}
Expand Down
5 changes: 2 additions & 3 deletions packages/code-gen/src/crud/query-builder.js
Expand Up @@ -59,9 +59,8 @@ function crudQueryBuilderBuild(crud, options) {
options.includeOwnParam &&
(isNil(relation) || relation?.subType === "oneToMany")
) {
result.where[
primaryKeyName
] = `ctx.validatedParams.${crudInformationGetParamName(crud)}`;
result.where[primaryKeyName] =
`ctx.validatedParams.${crudInformationGetParamName(crud)}`;
}

if (options.traverseParents && crudInformationGetParent(crud)) {
Expand Down
20 changes: 10 additions & 10 deletions packages/code-gen/src/database/js-postgres.js
Expand Up @@ -227,16 +227,16 @@ export function jsPostgresGenerateWhere(
fieldType === "number" && !isFloat
? "int"
: fieldType === "number" && isFloat
? "float"
: fieldType === "string"
? "varchar"
: fieldType === "date" && dateOnly
? "date"
: fieldType === "date" && timeOnly
? "time"
: fieldType === "date"
? "timestamptz"
: "uuid",
? "float"
: fieldType === "string"
? "varchar"
: fieldType === "date" && dateOnly
? "date"
: fieldType === "date" && timeOnly
? "time"
: fieldType === "date"
? "timestamptz"
: "uuid",
matchers: [],
};
}
Expand Down
5 changes: 2 additions & 3 deletions packages/code-gen/src/open-api/generator.js
Expand Up @@ -83,9 +83,8 @@ function openApiBuildFile(generateContext) {
description: "",
}));

openApiSpec[
"x-generator"
] = `Compas (https://compasjs.com) v${compasVersion}`;
openApiSpec["x-generator"] =
`Compas (https://compasjs.com) v${compasVersion}`;

return openApiSpec;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/code-gen/src/processors/route-trie.js
Expand Up @@ -171,8 +171,8 @@ function trieCreateNode(path, route) {
prio: path.includes("*")
? RoutePrio.WILDCARD
: path.includes(":")
? RoutePrio.PARAM
: RoutePrio.STATIC,
? RoutePrio.PARAM
: RoutePrio.STATIC,
path,
route,
};
Expand Down
8 changes: 4 additions & 4 deletions packages/store/src/file-send.js
Expand Up @@ -172,8 +172,8 @@ export async function fileSendTransformedImageResponse(
contentType: acceptsWebp
? "image/webp"
: acceptsAvif
? "image/avif"
: file.contentType,
? "image/avif"
: file.contentType,
},
},
});
Expand Down Expand Up @@ -205,8 +205,8 @@ export async function fileSendTransformedImageResponse(
contentType: acceptsWebp
? "image/webp"
: acceptsAvif
? "image/avif"
: file.contentType,
? "image/avif"
: file.contentType,
},
},
});
Expand Down
4 changes: 2 additions & 2 deletions packages/store/src/generator-helpers.js
Expand Up @@ -468,8 +468,8 @@ export function generatedQueryBuilderHelper(
subEntity !== entity
? subEntity.shortName
: shortName === entity.shortName
? `${shortName}2`
: entity.shortName;
? `${shortName}2`
: entity.shortName;

// We build a JSON object for all columns and it's relations, since sub queries need
// to return a single column result.
Expand Down
6 changes: 3 additions & 3 deletions packages/store/types/advanced-types.d.ts
Expand Up @@ -62,6 +62,6 @@ export type Returning<
> = Selector extends "*"
? Type[]
: Selector extends Array<infer T>
? // @ts-ignore
Pick<Type, T>[]
: undefined;
? // @ts-ignore
Pick<Type, T>[]
: undefined;
9 changes: 4 additions & 5 deletions scripts/citgm.js
Expand Up @@ -132,11 +132,10 @@ async function executor(logger, state) {
]) {
for (const dep of Object.keys(packageJson[key] ?? {})) {
if (dep.includes("compas")) {
packageJson[key][
dep
] = `https://gitpkg.now.sh/compasjs/compas/packages/${dep
.split("/")
.pop()}?main`;
packageJson[key][dep] =
`https://gitpkg.now.sh/compasjs/compas/packages/${dep
.split("/")
.pop()}?main`;
}
}
}
Expand Down

0 comments on commit e3009b9

Please sign in to comment.