Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
fix(deps): update dependency @ianvs/prettier-plugin-sort-imports to v4 (
Browse files Browse the repository at this point in the history
trpc#4432)

* fix(deps): update dependency @ianvs/prettier-plugin-sort-imports to v4

* fix(deps): update dependency @ianvs/prettier-plugin-sort-imports to v4

* rm

* run prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: KATT <[email protected]>
  • Loading branch information
renovate[bot] and KATT authored May 29, 2023
1 parent ea70b1c commit ab27bf9
Show file tree
Hide file tree
Showing 141 changed files with 4,608 additions and 12,947 deletions.
1 change: 0 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const config = {
endOfLine: 'auto',
singleQuote: true,
importOrder: ['___', '__', '<THIRD_PARTY_MODULES>', '^[./]'],
importOrderSortSpecifiers: true,
tailwindConfig: './www/tailwind.config.ts',
plugins: [
require.resolve('@ianvs/prettier-plugin-sort-imports'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';

import { z } from 'zod';
import { createAction, publicProcedure } from '~/server/trpc';
import { z } from 'zod';
import { rhfActionSchema } from './ReactHookFormExample.schema';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { zodResolver } from '@hookform/resolvers/zod';
import { useRef } from 'react';
import { FormProvider, UseFormProps, useForm } from 'react-hook-form';
import { FormProvider, useForm, UseFormProps } from 'react-hook-form';
import { useAction } from 'trpc-api';
import { z } from 'zod';
import { rhfAction } from './ReactHookFormExample.action';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

import { zodResolver } from '@hookform/resolvers/zod';
import {
UseTRPCActionResult,
inferActionResultProps,
UseTRPCActionResult,
} from '@trpc/next/app-dir/client';
import { TRPCActionHandler } from '@trpc/next/app-dir/server';
import { ActionHandlerDef } from '@trpc/next/dist/app-dir/shared';
import { AnyProcedure, Simplify } from '@trpc/server';
import { useAction } from '~/trpc/client';
import { useRef } from 'react';
import {
FormProvider,
UseFormProps,
UseFormReturn,
useForm,
useFormContext,
UseFormProps,
UseFormReturn,
useWatch,
} from 'react-hook-form';
import { z } from 'zod';
import { useAction } from '~/trpc/client';

export function createForm<TDef extends ActionHandlerDef>(opts: {
action: TRPCActionHandler<TDef>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';

import { z } from 'zod';
import { createAction, publicProcedure } from '~/server/trpc';
import { z } from 'zod';

/**
* Either inline procedures using trpc's flexible
Expand Down
2 changes: 1 addition & 1 deletion examples/.experimental/next-app-dir/src/trpc/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
experimental_createTRPCNextAppDirClient,
experimental_serverActionLink,
} from '@trpc/next/app-dir/client';
import superjson from 'superjson';
import { AppRouter } from '~/server/routers/_app';
import superjson from 'superjson';
import { getUrl } from './shared';

export const api = experimental_createTRPCNextAppDirClient<AppRouter>({
Expand Down
2 changes: 1 addition & 1 deletion examples/.experimental/next-app-dir/src/trpc/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { httpBatchLink, loggerLink } from '@trpc/client';
import { experimental_createTRPCNextAppDirServer } from '@trpc/next/app-dir/server';
import { AppRouter } from '~/server/routers/_app';
import { headers } from 'next/headers';
import superjson from 'superjson';
import { AppRouter } from '~/server/routers/_app';
import { getUrl } from './shared';

export const api = experimental_createTRPCNextAppDirServer<AppRouter>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import * as trpcNext from '@trpc/server/adapters/next';
import { nodeHTTPFormDataContentTypeHandler } from '@trpc/server/adapters/node-http/content-type/form-data';
import { nodeHTTPJSONContentTypeHandler } from '@trpc/server/adapters/node-http/content-type/json';
import { NextApiRequest, NextApiResponse } from 'next';
import * as undici from 'undici';
import { roomRouter } from '~/server/routers/room';
import { createContext, router } from '~/server/trpc';
import { NextApiRequest, NextApiResponse } from 'next';
import * as undici from 'undici';

const appRouter = router({
room: roomRouter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useRef, useState } from 'react';
import { FormProvider, UseFormProps, useForm } from 'react-hook-form';
import { z } from 'zod';
import { uploadFileSchema } from '~/utils/schemas';
import { trpc } from '~/utils/trpc';
import { useRef, useState } from 'react';
import { FormProvider, useForm, UseFormProps } from 'react-hook-form';
import { z } from 'zod';

/**
* zod-form-data wraps zod in an effect where the original type is a `FormData`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {
experimental_createMemoryUploadHandler,
experimental_parseMultipartFormData,
} from '@trpc/server/adapters/node-http/content-type/form-data';
import { z } from 'zod';
import { uploadFileSchema } from '~/utils/schemas';
import { writeFileToDisk } from '~/utils/writeFileToDisk';
import { z } from 'zod';
import { publicProcedure, router } from '../trpc';

export const viewer = router({
Expand Down
4 changes: 2 additions & 2 deletions examples/express-server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TRPCError, inferAsyncReturnType, initTRPC } from '@trpc/server';
import * as trpcExpress from '@trpc/server/adapters/express';
import { EventEmitter } from 'events';
import { inferAsyncReturnType, initTRPC, TRPCError } from '@trpc/server';
import * as trpcExpress from '@trpc/server/adapters/express';
import express from 'express';
import { z } from 'zod';

Expand Down
2 changes: 1 addition & 1 deletion examples/minimal-react/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PlaywrightTestConfig, devices } from '@playwright/test';
import { devices, PlaywrightTestConfig } from '@playwright/test';

const baseUrl = process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000';
console.log(`ℹ️ Using base URL "${baseUrl}"`);
Expand Down
2 changes: 1 addition & 1 deletion examples/next-edge-runtime/src/pages/api/trpc/[trpc].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* On a bigger app, you will probably want to split this file up into multiple files.
*/
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
import { publicProcedure, router } from '~/server/trpc';
import { NextRequest } from 'next/server';
import { z } from 'zod';
import { publicProcedure, router } from '~/server/trpc';

const appRouter = router({
greeting: publicProcedure
Expand Down
2 changes: 1 addition & 1 deletion examples/next-minimal-starter/src/pages/api/trpc/[trpc].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* On a bigger app, you will probably want to split this file up into multiple files.
*/
import * as trpcNext from '@trpc/server/adapters/next';
import { z } from 'zod';
import { publicProcedure, router } from '~/server/trpc';
import { z } from 'zod';

const appRouter = router({
greeting: publicProcedure
Expand Down
2 changes: 1 addition & 1 deletion examples/next-prisma-todomvc/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PlaywrightTestConfig, devices } from '@playwright/test';
import { devices, PlaywrightTestConfig } from '@playwright/test';

const baseUrl = process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000';
console.log(`ℹ️ Using base URL "${baseUrl}"`);
Expand Down
2 changes: 1 addition & 1 deletion examples/next-prisma-todomvc/src/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link';
import { useLocale } from '~/utils/use-locale';
import Link from 'next/link';

export function InfoFooter(props: { filter: string; locales: string[] }) {
const { t, i18n } = useLocale();
Expand Down
2 changes: 1 addition & 1 deletion examples/next-prisma-todomvc/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { SSRConfig, appWithTranslation } from 'next-i18next';
import { appWithTranslation, SSRConfig } from 'next-i18next';
import { AppProps } from 'next/app';
import { ComponentProps } from 'react';
import { trpc } from '../utils/trpc';
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
createHTTPServer,
} from '@trpc/server/adapters/standalone';
import {
CreateWSSContextFnOptions,
applyWSSHandler,
CreateWSSContextFnOptions,
} from '@trpc/server/adapters/ws';
import { observable } from '@trpc/server/observable';
import { WebSocketServer } from 'ws';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",
"@ianvs/prettier-plugin-sort-imports": "^4.0.0",
"@manypkg/cli": "^0.20.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@swc/core": "1.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/TRPCClientError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
AnyProcedure,
AnyRouter,
DefaultErrorShape,
Maybe,
inferRouterError,
Maybe,
} from '@trpc/server';
import { TRPCErrorResponse, TRPCErrorShape } from '@trpc/server/rpc';

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/createTRPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import type {
} from '@trpc/server';
import { Unsubscribable } from '@trpc/server/observable';
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
import { TRPCClientError } from './TRPCClientError';
import {
CreateTRPCClientOptions,
TRPCRequestOptions,
TRPCSubscriptionObserver,
TRPCUntypedClient,
} from './internals/TRPCUntypedClient';
import { TRPCClientRuntime } from './links';
import { TRPCClientError } from './TRPCClientError';

/**
* @deprecated
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/createTRPCClientProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
inferTransformedProcedureOutput,
inferTransformedSubscriptionOutput,
} from '@trpc/server/shared';
import { TRPCClientError } from './TRPCClientError';
import { TRPCClient } from './createTRPCClient';
import { CreateTRPCClientOptions } from './createTRPCUntypedClient';
import {
TRPCSubscriptionObserver,
TRPCUntypedClient,
UntypedClientProperties,
} from './internals/TRPCUntypedClient';
import { TRPCClientError } from './TRPCClientError';

/** @public */
export type inferRouterProxyClient<TRouter extends AnyRouter> =
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/internals/TRPCUntypedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import {
DefaultDataTransformer,
} from '@trpc/server';
import {
Unsubscribable,
inferObservableValue,
observableToPromise,
share,
Unsubscribable,
} from '@trpc/server/observable';
import { TRPCClientError } from '../TRPCClientError';
import { createChain } from '../links/internals/createChain';
import {
OperationContext,
OperationLink,
TRPCClientRuntime,
TRPCLink,
} from '../links/types';
import { TRPCClientError } from '../TRPCClientError';

type CreateTRPCClientBaseOptions<TRouter extends AnyRouter> =
TRouter['_def']['_config']['transformer'] extends DefaultDataTransformer
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/links/httpBatchLink.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { AnyRouter, ProcedureType } from '@trpc/server';
import { observable } from '@trpc/server/observable';
import { TRPCClientError } from '../TRPCClientError';
import { dataLoader } from '../internals/dataLoader';
import { NonEmptyArray } from '../internals/types';
import { transformResult } from '../shared/transformResult';
import { TRPCClientError } from '../TRPCClientError';
import {
getUrl,
HTTPLinkBaseOptions,
HTTPResult,
getUrl,
jsonHttpRequester,
resolveHTTPLinkOptions,
} from './internals/httpUtils';
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/links/httpFormDataLink.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { httpLinkFactory } from './httpLink';
import { GetBody, Requester, httpRequest } from './internals/httpUtils';
import { GetBody, httpRequest, Requester } from './internals/httpUtils';

const getBody: GetBody = (opts) => {
if (!('input' in opts)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/links/httpLink.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AnyRouter } from '@trpc/server';
import { observable } from '@trpc/server/observable';
import { TRPCClientError } from '../TRPCClientError';
import { transformResult } from '../shared/transformResult';
import { TRPCClientError } from '../TRPCClientError';
import {
HTTPLinkBaseOptions,
Requester,
jsonHttpRequester,
Requester,
resolveHTTPLinkOptions,
} from './internals/httpUtils';
import { HTTPHeaders, Operation, TRPCLink } from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/links/retryLink.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* istanbul ignore file -- @preserve */
// We're not actually exporting this link
import { AnyRouter } from '@trpc/server';
import { Unsubscribable, observable } from '@trpc/server/observable';
import { observable, Unsubscribable } from '@trpc/server/observable';
import { TRPCLink } from './types';

export function retryLink<TRouter extends AnyRouter = AnyRouter>(opts: {
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/links/splitLink.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { observable } from '@trpc/server/observable';
import { splitLink } from '../';
import { OperationLink, TRPCLink } from '../';
import { OperationLink, splitLink, TRPCLink } from '../';
import { AnyRouter } from '../../../server/src';
import { createChain } from '../links/internals/createChain';

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/links/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
} from '@trpc/server';
import { Observable, Observer } from '@trpc/server/observable';
import { TRPCResultMessage, TRPCSuccessResponse } from '@trpc/server/rpc';
import { TRPCClientError } from '../TRPCClientError';
import { ResponseEsque } from '../internals/types';
import { TRPCClientError } from '../TRPCClientError';

/**
* @internal
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/links/wsLink.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { AnyRouter, ProcedureType, inferRouterError } from '@trpc/server';
import { Observer, UnsubscribeFn, observable } from '@trpc/server/observable';
import { AnyRouter, inferRouterError, ProcedureType } from '@trpc/server';
import { observable, Observer, UnsubscribeFn } from '@trpc/server/observable';
import {
TRPCClientIncomingMessage,
TRPCClientIncomingRequest,
TRPCClientOutgoingMessage,
TRPCRequestMessage,
TRPCResponseMessage,
} from '@trpc/server/rpc';
import { TRPCClientError } from '../TRPCClientError';
import { retryDelay } from '../internals/retryDelay';
import { transformResult } from '../shared/transformResult';
import { TRPCClientError } from '../TRPCClientError';
import { Operation, TRPCLink } from './types';

type WSCallbackResult<TRouter extends AnyRouter, TOutput> = TRPCResponseMessage<
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/shared/transformResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type {
TRPCResponseMessage,
TRPCResultMessage,
} from '@trpc/server/rpc';
import { TRPCClientError } from '../TRPCClientError';
import type { TRPCClientRuntime } from '../links';
import { isObject } from '../links/internals/isObject';
import { TRPCClientError } from '../TRPCClientError';

// FIXME:
// - the generics here are probably unnecessary
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/app-dir/client.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import React from 'react';
import superjson from 'superjson';
import { z } from 'zod';
import {
UseTRPCActionResult,
experimental_createActionHook,
experimental_serverActionLink,
UseTRPCActionResult,
} from './create-action-hook';
import { experimental_createServerActionHandler } from './server';

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/app-dir/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
CreateTRPCProxyClient,
clientCallTypeToProcedureType,
CreateTRPCProxyClient,
createTRPCUntypedClient,
} from '@trpc/client';
import { AnyRouter } from '@trpc/server';
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/app-dir/create-action-hook.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {
CreateTRPCClientOptions,
createTRPCUntypedClient,
TRPCClientError,
TRPCLink,
TRPCRequestOptions,
createTRPCUntypedClient,
} from '@trpc/client';
import { transformResult } from '@trpc/client/shared';
import {
AnyProcedure,
AnyRouter,
inferHandlerInput,
MaybePromise,
ProcedureOptions,
Simplify,
inferHandlerInput,
} from '@trpc/server';
import { observable } from '@trpc/server/observable';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
Expand Down
Loading

0 comments on commit ab27bf9

Please sign in to comment.