Skip to content

Commit

Permalink
docs: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Lioness100 committed Feb 6, 2023
1 parent dfcb99b commit 59ff4c2
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/fastify-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

If you want to test this example locally, follow the steps below.

### Clone, Install and build main projet
### Clone, Install and build main project

```bash
git clone git@github.com:trpc/trpc.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
postgres:
image: postgres:13
ports:
- '5932:5432' # expose pg on port 5932 to not collide with pg from elswhere
- '5932:5432' # expose pg on port 5932 to not collide with pg from elsewhere
restart: always
volumes:
- db_data:/var/lib/postgresql/data
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/adapters/fastify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ describe('anonymous user with fastify-plugin', () => {
},
body: JSON.stringify(data),
});
// body shoul be string
// body should be string
expect(await req.json()).toMatchInlineSnapshot(`
Object {
"body": "{\\"text\\":\\"life\\",\\"life\\":42}",
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/server/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test('unauthorized()', async () => {
close();
});

test('getMessageFromUnkownError()', () => {
test('getMessageFromUnknownError()', () => {
expect(getMessageFromUnknownError('test', 'nope')).toBe('test');
expect(getMessageFromUnknownError(1, 'test')).toBe('test');
expect(getMessageFromUnknownError({}, 'test')).toBe('test');
Expand Down Expand Up @@ -349,7 +349,7 @@ test('retain stack trace', async () => {
throw new CustomError();
}

return 'toSringValue';
return 'toStringValue';
}),
});

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/inferenceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ type MismatchArgs<B extends boolean, C extends boolean> = Eq<B, C> extends true
? []
: [never];
type Mismatch<T> = (BrandSpecial<T> | T) & {
[secret]: 'Type should be satisified';
[secret]: 'Type should be satisfied';
};

export interface ExpectTypeOf<Actual, B extends boolean> {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/interop/adapters/fastify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('anonymous user with fastify-plugin', () => {
},
body: JSON.stringify(data),
});
// body shoul be string
// body should be string
expect(await req.json()).toMatchInlineSnapshot(`
Object {
"body": "{\\"text\\":\\"life\\",\\"life\\":42}",
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/interop/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test('unauthorized()', async () => {
close();
});

test('getMessageFromUnkownError()', () => {
test('getMessageFromUnknownError()', () => {
expect(getMessageFromUnknownError('test', 'nope')).toBe('test');
expect(getMessageFromUnknownError(1, 'test')).toBe('test');
expect(getMessageFromUnknownError({}, 'test')).toBe('test');
Expand Down
6 changes: 3 additions & 3 deletions packages/tests/server/interop/links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('chainer', async () => {
attempt++;
serverCall();
if (attempt < 3) {
throw new Error('Errr ' + attempt);
throw new Error('Err ' + attempt);
}
return 'world';
},
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('batching', () => {
createContextFn.mockClear();
}
{
// queries should be sent and indivdual requests
// queries should be sent and individual requests
// url length: 2146 > 2083
const res = await Promise.all([
client.query('big-input', '*'.repeat(1024)),
Expand Down Expand Up @@ -302,7 +302,7 @@ test('create client with links', async () => {
attempt++;
serverCall();
if (attempt < 3) {
throw new Error('Errr ' + attempt);
throw new Error('Err ' + attempt);
}
return 'world';
},
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/interop/responseMeta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('set custom headers in beforeEnd', async () => {
server: {
onError,
responseMeta({ ctx, paths, type, errors }) {
// assuming you have all your public routes with the kewyord `public` in them
// assuming you have all your public routes with the keyword `public` in them
const allPublic =
paths && paths.every((path) => path.includes('public'));
// checking that no procedures errored
Expand Down
6 changes: 3 additions & 3 deletions packages/tests/server/links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('chainer', async () => {
attempt++;
serverCall();
if (attempt < 3) {
throw new Error('Errr ' + attempt);
throw new Error('Err ' + attempt);
}
return 'world';
}),
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('batching', () => {
createContextFn.mockClear();
}
{
// queries should be sent and indivdual requests
// queries should be sent and individual requests
// url length: 2146 > 2083
const res = await Promise.all([
proxy['big-input'].query('*'.repeat(1024)),
Expand Down Expand Up @@ -311,7 +311,7 @@ test('create client with links', async () => {
attempt++;
serverCall();
if (attempt < 3) {
throw new Error('Errr ' + attempt);
throw new Error('Err ' + attempt);
}
return 'world';
}),
Expand Down
8 changes: 4 additions & 4 deletions packages/tests/server/react/interopBigCompiled.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ test('react', () => {
try {
const { data } = trpc.useQuery(['oldProc100']);
if (!data) {
throw new Error('Whaever');
throw new Error('Whatever');
}
expectTypeOf(data).toEqualTypeOf<'100'>();
} catch {
// whatev
// whatever
}

try {
const { data } = trpc.proxy.r499.greeting.useQuery({ who: 'KATT' });
if (!data) {
throw new Error('Whaever');
throw new Error('Whatever');
}
expectTypeOf(data).not.toBeAny();
expectTypeOf(data).toMatchTypeOf<string>();
} catch {
// whatev
// whatever
}
console.error = prevConsoleError;
});
2 changes: 1 addition & 1 deletion packages/tests/server/react/useContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ describe('cancel', () => {
});
});

describe('query keys are stored separtely', () => {
describe('query keys are stored separately', () => {
test('getInfiniteData() does not data from useQuery()', async () => {
const { proxy, App } = ctx;

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/responseMeta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('set custom headers in beforeEnd', async () => {
server: {
onError,
responseMeta({ ctx, paths, type, errors }) {
// assuming you have all your public routes with the kewyord `public` in them
// assuming you have all your public routes with the keyword `public` in them
const allPublic =
paths && paths.every((path) => path.includes('public'));
// checking that no procedures errored
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/transformer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Object {
close();
});

describe('required tranformers', () => {
describe('required transformers', () => {
test('works without transformer', () => {
const t = initTRPC.create({});
const router = t.router({});
Expand Down
4 changes: 2 additions & 2 deletions scripts/entrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type PackageJson = {
};
};

// create directories on the way if they dont exist
// create directories on the way if they don't exist
function writeFileSyncRecursive(filePath: string, content: string) {
const dir = path.dirname(filePath);
if (!fs.existsSync(dir)) {
Expand Down Expand Up @@ -57,7 +57,7 @@ export function generateEntrypoints(inputs: string[]) {
const pathWithoutSrc = parts.join('/');

// if filename is index.ts, importPath is path until index.ts,
// otherwise, importPath is the path without the fileextension
// otherwise, importPath is the path without the file extension
const importPath =
parts.at(-1) === 'index.ts'
? parts.slice(0, -1).join('/')
Expand Down
4 changes: 2 additions & 2 deletions www/blog/2022-11-21-announcing-trpc-10.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tRPC v10 embraces your IDE. We want to unify your types - but we've also brought

With v10, you can:

- Use _"Go to Definiton"_ to jump straight from your frontend consumer to your backend procedure
- Use _"Go to Definition"_ to jump straight from your frontend consumer to your backend procedure
- Use _"Rename Symbol"_ to give a new name to an input argument or procedure across your whole application
- [Infer types more easily](https://trpc.io/docs/v10/infer-types) for when you'd like to use your tRPC types in your application manually

Expand Down Expand Up @@ -62,7 +62,7 @@ We've also put in a lot of work to make the migration experience as straightforw

A rich set of sub-libraries is continuing to form around tRPC. Here are a few examples:

- [trpc-openapi](https://github.com/jlalmes/trpc-openapi) to easily create REST-compataible endpoints
- [trpc-openapi](https://github.com/jlalmes/trpc-openapi) to easily create REST-compatible endpoints
- [create-t3-app](https://github.com/t3-oss/create-t3-app) to bootstrap a full-stack Next.js application with tRPC
- [create-t3-turbo](https://github.com/t3-oss/create-t3-turbo) to kickstart your next React Native app with tRPC
- [trpc-chrome](https://github.com/jlalmes/trpc-chrome) for building Chrome extensions using tRPC
Expand Down
2 changes: 1 addition & 1 deletion www/blog/2023-01-14-typescript-performance-lessons.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Today, the TypeScript type checker is prone to becoming slow (although releases

While tRPC was in `v9`, we began seeing reports from developers that their large tRPC routers were starting to have detrimental effects on their type checker. This was a new experience for tRPC as we saw tremendous adoption during the `v9` phase of tRPC's development. With more developers creating larger and larger products with tRPC, some cracks began to show.

Your library may not be slow _now_, but it's important to keep an eye on performance as your library grows and changes. Automated testing can remove an immense burden from your library authoring (and application building!) by _programatically_ testing your library code on each commit.
Your library may not be slow _now_, but it's important to keep an eye on performance as your library grows and changes. Automated testing can remove an immense burden from your library authoring (and application building!) by _programmatically_ testing your library code on each commit.

For tRPC, we do our best to ensure this by [generating](https://github.com/trpc/trpc/blob/9fc2d06a8924da73e10b9d4497f3a1f53de706ed/scripts/generateBigBoi.ts) and [testing](https://github.com/trpc/trpc/blob/9fc2d06a8924da73e10b9d4497f3a1f53de706ed/packages/tests/server/react/bigBoi.test.tsx) a router with 3,500 procedures and 1,000 routers. But this only tests how far we can push the TS compiler before it breaks and not how long type-checking takes. We test all three pieces of the library (server, vanilla client, and the React client) because they all have different code paths. In the past, we have seen regressions that are isolated to one section of the library and rely on our tests to show us when those unexpected behaviors occur. (We still do [want to do more](https://github.com/trpc/trpc/issues/2892) to measure compilation times)

Expand Down
2 changes: 1 addition & 1 deletion www/blog/2023-01-17-tinyrpc-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Most notably here is that our path is `.`-separated instead of `/`. This allows

We also have a `TRPCResponse` type annotation on the `fetch`-request. This determines the JSONRPC-compliant response format that the server responds with. You can read more on that [here](https://trpc.io/docs/rpc). TL;DR, we get back either a `result` or an `error` object, which we can use to determine if the request was successful or not and do appropriate error handling if something went wrong.

And that's it! This is all the code you'll need to call your tRPC procedures on your client as if they were local functions. On the surface, it looks like we're just calling the `publicProcedure.query / mutation`'s resolver function via normal property accesses, but we're actaully crossing a network boundary so we can use server-side libraries such as Prisma without leaking database credentials.
And that's it! This is all the code you'll need to call your tRPC procedures on your client as if they were local functions. On the surface, it looks like we're just calling the `publicProcedure.query / mutation`'s resolver function via normal property accesses, but we're actually crossing a network boundary so we can use server-side libraries such as Prisma without leaking database credentials.

## Trying it out!

Expand Down
4 changes: 2 additions & 2 deletions www/docs/further/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can also have a look at our [Awesome tRPC](awesome-trpc)-collection to find

## Is a monorepo mandatory?

No, a monorepo is not mandatory but you will lose some of the benefits of using tRPC if you don't use it since you will lose gurantees that your client and server works together.
No, a monorepo is not mandatory but you will lose some of the benefits of using tRPC if you don't use it since you will lose guarantees that your client and server works together.

One way you can leverage tRPC is to publish a private npm package with the types of your backend repo and consume them in your frontend repo.

Expand Down Expand Up @@ -70,7 +70,7 @@ For more information, you can read & follow [this issue](https://github.com/trpc
If you encounter a feature in tRPC that is marked as `unstable_` it means that the API is unstable and might change in minor version bumps, but:

- Specifics of the implementation might change in minor changes - its name and options might change
- If it exists in tRPC it's already used it in producation
- If it exists in tRPC it's already used it in production
- We very much encourage you to use it
- If any changes are done to `unstable_features`, they will be included in the release notes (& you'll see type errors)
- Please report any suggestion on the API design or issues on [github.com/trpc/trpc/issues](https://github.com/trpc/trpc/issues)
Expand Down
2 changes: 1 addition & 1 deletion www/docs/further/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ slug: /subscriptions
:::tip

- For a full-stack example have a look at [/examples/next-prisma-starter-websockets](https://github.com/trpc/examples-next-prisma-starter-websockets).
- For a bare-minumum Node.js example see [/examples/standalone-server](https://github.com/trpc/trpc/tree/main/examples/standalone-server).
- For a bare-minimum Node.js example see [/examples/standalone-server](https://github.com/trpc/trpc/tree/main/examples/standalone-server).

:::

Expand Down
2 changes: 1 addition & 1 deletion www/docs/server/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { TRPCError } from '@trpc/server';
// ---cut---
import { getHTTPStatusCodeFromError } from '@trpc/server/http';

// Example error you might get if your input valdidation fails
// Example error you might get if your input validation fails
const error: TRPCError = {
name: 'TRPCError',
code: 'BAD_REQUEST',
Expand Down
2 changes: 1 addition & 1 deletion www/docs/server/infer-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ main();

## Infer React Query options based on your router

When creating custom hooks around tRPC procedures, it's sometimes necesary to have the types of the options inferred from the router. You can do so via the `inferReactQueryProcedureOptions` helper exported from `@trpc/react-query`.
When creating custom hooks around tRPC procedures, it's sometimes necessary to have the types of the options inferred from the router. You can do so via the `inferReactQueryProcedureOptions` helper exported from `@trpc/react-query`.

```ts twoslash filename='trpc.ts'
// @module: esnext
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/TwitterWall/script.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Script to generate a JSON file of tweets from the Twitter API.
* Fetches the tweeets from this timeline: https://twitter.com/alexdotjs/timelines/1441435105910796291
* Fetches the tweets from this timeline: https://twitter.com/alexdotjs/timelines/1441435105910796291
*
* Script has shitty typesafety but hey, it works :)
*/
Expand Down
2 changes: 1 addition & 1 deletion www/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ a {
text-decoration: var(--ifm-link-decoration);
}
/**
* Initialiazing a `footnotes` counter on the wrapper
* Initializing a `footnotes` counter on the wrapper
*/
article {
counter-reset: footnotes;
Expand Down
2 changes: 1 addition & 1 deletion www/versioned_docs/version-9.x/further/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ slug: /subscriptions
:::tip

- For a full-stack example have a look at [/examples/next-prisma-starter-websockets](https://github.com/trpc/examples-next-prisma-starter-websockets).
- For a bare-minumum Node.js example see [/examples/standalone-server](https://github.com/trpc/trpc/tree/main/examples/standalone-server).
- For a bare-minimum Node.js example see [/examples/standalone-server](https://github.com/trpc/trpc/tree/main/examples/standalone-server).

:::

Expand Down
2 changes: 1 addition & 1 deletion www/versioned_docs/version-9.x/main/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For generating a powerful set of React hooks for querying your tRPC API. Powered

`npm install @trpc/next`

A set of utilies for integrating tRPC with [Next.js](https://nextjs.org/).
A set of utilities for integrating tRPC with [Next.js](https://nextjs.org/).

### Installation Snippets

Expand Down
2 changes: 1 addition & 1 deletion www/versioned_docs/version-9.x/server/data-transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const appRouter = trpc.router().transformer(superjson);

## Different transformers for upload and download

If a transformer should only be used for one directon or different transformers should be used for upload and download (e.g. for performance reasons), you can provide individual transformers for upload and download. Make sure you use the same combined transformer everywhere.
If a transformer should only be used for one direction or different transformers should be used for upload and download (e.g. for performance reasons), you can provide individual transformers for upload and download. Make sure you use the same combined transformer everywhere.

### How to

Expand Down
2 changes: 1 addition & 1 deletion www/versioned_docs/version-9.x/server/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default trpcNext.createNextApiHandler({
});
```

The `onError` parameter is an object that contains all information about the error and the context it occures in:
The `onError` parameter is an object that contains all information about the error and the context it occurs in:

```ts
{
Expand Down
2 changes: 1 addition & 1 deletion www/versioned_docs/version-9.x/server/output-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /output-validation

tRPC gives you automatic type-safety of outputs without the need of adding a validator; however, it can be useful at times to strictly define the output type in order to prevent sensitive data of being leaked.

Similarily to `input:`, an `output:` validation to the `query()` and `mutation()` router methods. The output validator is invoked with the payload returned by the `resolve()` function.
Similar to `input:`, an `output:` validation to the `query()` and `mutation()` router methods. The output validator is invoked with the payload returned by the `resolve()` function.

When an `output` validator is defined, its inferred type is expected as the return type of the `resolve()` function.

Expand Down

0 comments on commit 59ff4c2

Please sign in to comment.