Skip to content

Commit

Permalink
pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSzx committed Jan 4, 2024
1 parent 0385e59 commit 7eaf6ee
Show file tree
Hide file tree
Showing 28 changed files with 76 additions and 136 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm pretty-quick --staged
pnpx lint-staged
6 changes: 3 additions & 3 deletions examples/express/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversT

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
};

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};

export type MutationResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'],
> = {
uploadFileToBase64?: Resolver<
ResolversTypes['String'],
Expand Down
6 changes: 3 additions & 3 deletions examples/fastify/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversT

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -157,14 +157,14 @@ export type QueryResolvers<

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};

export type MutationResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'],
> = {
uploadFileToBase64?: Resolver<
ResolversTypes['String'],
Expand Down
4 changes: 2 additions & 2 deletions examples/hapi/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversT

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -132,7 +132,7 @@ export type QueryResolvers<

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};
Expand Down
4 changes: 2 additions & 2 deletions examples/http/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversT

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -132,7 +132,7 @@ export type QueryResolvers<

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};
Expand Down
6 changes: 3 additions & 3 deletions examples/koa/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversT

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -152,14 +152,14 @@ export type QueryResolvers<

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};

export type MutationResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'],
> = {
uploadFileToBase64?: Resolver<
ResolversTypes['String'],
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs/complete/src/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ export type ResolversParentTypes = {

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hello2?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
};

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
hello?: SubscriptionResolver<ResolversTypes['String'], 'hello', ParentType, ContextType>;
};
Expand Down
2 changes: 1 addition & 1 deletion internal/website/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TagsList = [
'vercel',
] as const;

export type Tags = typeof TagsList[number];
export type Tags = (typeof TagsList)[number];

declare module '@guild-docs/server/npm' {
interface Package {
Expand Down
2 changes: 1 addition & 1 deletion internal/website/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ExtendComponents({
img: chakra.img,
});

const styles: typeof chakraTheme['styles'] = {
const styles: (typeof chakraTheme)['styles'] = {
global: props => ({
body: {
bg: mode('white', 'gray.850')(props),
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
"husky": "8.0.2",
"jest": "^29.3.1",
"mocha": "^10.2.0",
"prettier": "^2.8.1",
"pretty-quick": "^3.1.3",
"prettier": "^3.1.1",
"ts-jest": "^29.0.3",
"typescript": "^5.3.3"
},
Expand Down Expand Up @@ -110,5 +109,8 @@
"@graphql-ez/*": "*"
}
}
},
"lint-staged": {
"*.{js,css,md}": "prettier --write"
}
}
2 changes: 1 addition & 1 deletion packages/client/main/src/sse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function createSSESubscription(
const subscribe: SubscribeSSE = function subscribe<
TData,
TVariables extends Record<string, unknown> = {},
TExtensions extends Record<string, unknown> = {}
TExtensions extends Record<string, unknown> = {},
>(
document: string | TypedDocumentNode<TData, TVariables>,
{
Expand Down
4 changes: 2 additions & 2 deletions packages/client/main/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type SubscribeOptions<
TResult,
TVariables extends Record<string, unknown>,
TExtensions extends Record<string, unknown> = Record<string, unknown>,
TExtra extends {} = {}
TExtra extends {} = {},
> = {
onData?: (data: ExecutionResult<TResult>) => void;
variables?: TVariables;
Expand All @@ -19,7 +19,7 @@ export interface SubscribeFunction<TExtra extends Record<string, any> = {}> {
TVariables extends Record<string, unknown> = {
[key: string]: any;
},
TExtensions extends Record<string, unknown> = Record<string, unknown>
TExtensions extends Record<string, unknown> = Record<string, unknown>,
>(
query: string | TypedDocumentNode<TResult, TVariables>,
options?: SubscribeOptions<TResult, TVariables, TExtensions, TExtra>
Expand Down
6 changes: 3 additions & 3 deletions packages/core/main/src/types/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export type RequestHandler = (req: IncomingMessage, res: ServerResponse) => Prom
* If it returns an object, it interrupts the default execution returning the given payload.
*/
export interface PreProcessRequest {
(data: Readonly<{ appOptions: AppOptions; requestOptions: PreProcessRequestOptions }>): PromiseOrValue<
ProcessRequestResult<EZContext, unknown> | undefined | null | void
>;
(
data: Readonly<{ appOptions: AppOptions; requestOptions: PreProcessRequestOptions }>
): PromiseOrValue<ProcessRequestResult<EZContext, unknown> | undefined | null | void>;
}
8 changes: 4 additions & 4 deletions packages/core/main/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export type PickRequired<T, TKey extends keyof T> = T & Required<Pick<T, TKey>>;
export type DeepPartial<T> = T extends Function
? T
: T extends Array<infer U>
? DeepPartialArray<U>
: T extends object
? DeepPartialObject<T>
: T | undefined;
? DeepPartialArray<U>
: T extends object
? DeepPartialObject<T>
: T | undefined;

interface DeepPartialArray<T> extends Array<PromiseOrValue<DeepPartial<PromiseOrValue<T>>>> {}
type DeepPartialObject<T> = {
Expand Down
4 changes: 2 additions & 2 deletions packages/helix/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import type {
export type ResultType<T> = T extends AsyncGenerator<infer U>
? ResultType<U>
: T extends PromiseLike<infer U>
? ResultType<U>
: T;
? ResultType<U>
: T;

export interface ExecutionPatchResult<TData = { [key: string]: any }, TExtensions = { [key: string]: any }> {
errors?: ReadonlyArray<GraphQLError>;
Expand Down
4 changes: 2 additions & 2 deletions packages/helix/graphiql/browser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ function prepareGETUrl({
const validUrl = baseUrl.startsWith('http')
? baseUrl
: baseUrl?.startsWith('/')
? `${dummyHostname}${baseUrl}`
: `${dummyHostname}/${baseUrl}`;
? `${dummyHostname}${baseUrl}`
: `${dummyHostname}/${baseUrl}`;
const urlObj = new URL(validUrl);
urlObj.searchParams.set('query', stripIgnoredCharacters(query));
if (variables && Object.keys(variables).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/helix/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"graphql-ez": "workspace:^",
"graphql-language-service-interface": "^2.10.2",
"graphql-ws": "^5.11.2",
"prettier": "^2.8.1",
"prettier": "^3.1.1",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/nextjs/testing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export type AssertedQuery = <TData = any, TVariables = {}>(
) => Promise<TData>;

class GraphQLErrorJSON extends Error {
constructor(message: string, public locations: GraphQLError['locations'], public extensions: GraphQLError['extensions']) {
constructor(
message: string,
public locations: GraphQLError['locations'],
public extensions: GraphQLError['extensions']
) {
super(message);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/automatic-persisted-queries/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type GraphQLErrorParameters = ConstructorParameters<typeof GraphQLError>;
type TupleSplit<T, N extends number, O extends readonly any[] = readonly []> = O['length'] extends N
? [O, T]
: T extends readonly [infer F, ...infer R]
? TupleSplit<readonly [...R], N, readonly [...O, F]>
: [O, T];
? TupleSplit<readonly [...R], N, readonly [...O, F]>
: [O, T];

type SkipFirst<T extends readonly any[], N extends number> = TupleSplit<T, N>[1];

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/automatic-persisted-queries/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const PERSISTED_QUERY_EXTENSION_KEY = 'persistedQuery';

const ALGORITHMS = ['sha256', 'sha512', 'sha1', 'md5'] as const;

export type HashAlgorithm = typeof ALGORITHMS[number];
export type HashAlgorithm = (typeof ALGORITHMS)[number];

export const DEFAULT_HASH_ALGORITHM: HashAlgorithm = 'sha256';

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@graphql-tools/load": "^7.8.8",
"@graphql-tools/utils": "^9.1.3",
"mkdirp": "^1.0.4",
"prettier": "^2.8.1"
"prettier": "^3.1.1"
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/dataloader/test/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export type ResolversParentTypes = {

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
users?: Resolver<Array<ResolversTypes['User']>, ParentType, ContextType>;
Expand All @@ -127,7 +127,7 @@ export type QueryResolvers<

export type UserResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['User'] = ResolversParentTypes['User']
ParentType extends ResolversParentTypes['User'] = ResolversParentTypes['User'],
> = {
id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
idMulti?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
Expand Down
12 changes: 6 additions & 6 deletions packages/plugin/schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export interface RegisterTypeDefs {
*/
export interface RegisterResolvers {
<Resolvers extends EZResolvers>(resolvers: Resolvers): [Resolvers];
<Resolvers extends EZResolvers, Resolvers2 extends EZResolvers>(resolvers: Resolvers, resolvers2: Resolvers2): [
Resolvers,
Resolvers2
];
<Resolvers extends EZResolvers, Resolvers2 extends EZResolvers>(
resolvers: Resolvers,
resolvers2: Resolvers2
): [Resolvers, Resolvers2];
<Resolvers extends EZResolvers, Resolvers2 extends EZResolvers, Resolvers3 extends EZResolvers>(
resolvers: Resolvers,
resolvers2: Resolvers2,
Expand All @@ -74,7 +74,7 @@ export interface RegisterResolvers {
Resolvers2 extends EZResolvers,
Resolvers3 extends EZResolvers,
Resolvers4 extends EZResolvers,
Resolvers5 extends EZResolvers
Resolvers5 extends EZResolvers,
>(
resolvers: Resolvers,
resolvers2: Resolvers2,
Expand Down Expand Up @@ -107,7 +107,7 @@ export interface RegisterSchemas {
Schemas2 extends EZSchema,
Schemas3 extends EZSchema,
Schemas4 extends EZSchema,
Schemas5 extends EZSchema
Schemas5 extends EZSchema,
>(
schemas: Schemas,
schemas2: Schemas2,
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/voyager/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export function renderVoyagerPage(options: RenderVoyagerOptions) {
? typeof headers === 'object'
? JSON.stringify(headers)
: typeof headers === 'string'
? headers
: '{}'
? headers
: '{}'
: '{}';

return `
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/websockets/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type CommonWebSocketsServerTuple =
| readonly [
'both',
(protocol: string | string[] | undefined) => WebSocket.Server,
readonly [WebSocket.Server, WebSocket.Server]
readonly [WebSocket.Server, WebSocket.Server],
]
| readonly ['legacy', WebSocket.Server];

Expand Down
8 changes: 4 additions & 4 deletions packages/plugin/websockets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ export const ezWebSockets = (options: WebSocketOptions = 'adaptive'): EZPlugin =
const enabled: WebSocketsEnabledState | 'none' = enableAll
? 'adaptive'
: enableOldTransport
? 'legacy'
: enableGraphQLWS
? 'new'
: 'none';
? 'legacy'
: enableGraphQLWS
? 'new'
: 'none';

if (enabled === 'none') {
console.warn('No Websockets implementations enabled!');
Expand Down
Loading

0 comments on commit 7eaf6ee

Please sign in to comment.