Skip to content

Commit 719b041

Browse files
authored
Grammatical errors - installation.md (#560)
1 parent b5aca02 commit 719b041

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/eden/installation.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ client.
9090
```
9191

9292
## Gotcha
93-
Sometimes Eden may not infer type from Elysia correctly, the following are the most common workaround to fix Eden type inference.
93+
Sometimes, Eden may not infer types from Elysia correctly, the following are the most common workarounds to fix Eden type inference.
9494

9595
### Type Strict
9696
Make sure to enable strict mode in **tsconfig.json**
@@ -103,9 +103,9 @@ Make sure to enable strict mode in **tsconfig.json**
103103
```
104104

105105
### Unmatch Elysia version
106-
Eden depends Elysia class to import Elysia instance and infers type correctly.
106+
Eden depends on Elysia class to import Elysia instance and infer types correctly.
107107

108-
Make sure that both client and server have a matching Elysia version.
108+
Make sure that both client and server have the matching Elysia version.
109109

110110
You can check it with [`npm why`](https://docs.npmjs.com/cli/v10/commands/npm-explain) command:
111111

@@ -135,12 +135,12 @@ node_modules/elysia
135135

136136

137137
### TypeScript version
138-
Elysia uses newer features and syntax of TypeScript to infer types in a the most performant way. Features like Const Generic and Template Literal are heavily used.
138+
Elysia uses newer features and syntax of TypeScript to infer types in the most performant way. Features like Const Generic and Template Literal are heavily used.
139139

140140
Make sure your client has a **minimum TypeScript version if >= 5.0**
141141

142142
### Method Chaining
143-
To make Eden works, Elysia must be using **method chaining**
143+
To make Eden work, Elysia must use **method chaining**
144144

145145
Elysia's type system is complex, methods usually introduce a new type to the instance.
146146

@@ -156,9 +156,9 @@ new Elysia()
156156
.get('/', ({ store: { build } }) => build)
157157
.listen(3000)
158158
```
159-
Using this, **state** now returns a new **ElysiaInstance** type, introducing **build** into store and replace the current one.
159+
Using this, **state** now returns a new **ElysiaInstance** type, introducing **build** into store replacing the current one.
160160

161-
Without using method chaining, Elysia doesn't save the new type when introduced, leading to no type inference.
161+
Without method chaining, Elysia doesn't save the new type when introduced, leading to no type inference.
162162
```typescript twoslash
163163
// @errors: 2339
164164
import { Elysia } from 'elysia'
@@ -173,14 +173,14 @@ app.listen(3000)
173173
```
174174

175175
### Type Definitions
176-
If you are using a Bun specific feature like `Bun.file` or similar API and return it from a handler, you may need to install Bun type definitions to the client as well.
176+
If you are using a Bun specific feature, like `Bun.file` or similar API and return it from a handler, you may need to install Bun type definitions to the client as well.
177177

178178
```bash
179179
bun add -d @types/bun
180180
```
181181

182182
### Path alias (monorepo)
183-
If you are using path alias in your monorepo, make sure that frontend are able to resolve the path as same as backend.
183+
If you are using path alias in your monorepo, make sure that frontend is able to resolve the path as same as backend.
184184

185185
::: tip
186186
Setting up path alias in monorepo is a bit tricky, you can fork our example template: [Kozeki Template](https://github.com/SaltyAom/kozeki-template) and modify it to your needs.
@@ -211,7 +211,7 @@ const app = new Elysia()
211211
export type app = typeof app
212212
```
213213
214-
You **must** make sure that your frontend code is able to resolve the same path alias otherwise type inference will be resolved as any.
214+
You **must** make sure that your frontend code is able to resolve the same path alias. Otherwise, type inference will be resolved as any.
215215
216216
```typescript
217217
import { treaty } from '@elysiajs/eden'
@@ -225,7 +225,7 @@ import { a, b } from '@/controllers'
225225

226226
To fix this, you must make sure that path alias is resolved to the same file in both frontend and backend.
227227

228-
So you must change the path alias in **tsconfig.json** to:
228+
So, you must change the path alias in **tsconfig.json** to:
229229
```json
230230
{
231231
"compilerOptions": {
@@ -244,7 +244,7 @@ import { a, b } from '@/controllers'
244244
```
245245

246246
#### Scope
247-
We recommended to add a **scope** prefix for each modules in your monorepo to avoid any confusion and conflict that may happen.
247+
We recommended adding a **scope** prefix for each module in your monorepo to avoid any confusion and conflict that may happen.
248248

249249
```json
250250
{
@@ -258,12 +258,12 @@ We recommended to add a **scope** prefix for each modules in your monorepo to av
258258
}
259259
```
260260

261-
Then you can import the module like this:
261+
Then, you can import the module like this:
262262
```typescript
263263
// Should work in both frontend and backend and not return `any`
264264
import { a, b } from '@backend/controllers'
265265
```
266266

267-
We recommended creating a **single tsconfig.json** that define a `baseUrl` as the root of your repo, provide a path according to the module location, and create a **tsconfig.json** for each module that inherits the root **tsconfig.json** which has the path alias.
267+
We recommend creating a **single tsconfig.json** that defines a `baseUrl` as the root of your repo, provide a path according to the module location, and create a **tsconfig.json** for each module that inherits the root **tsconfig.json** which has the path alias.
268268

269-
You may find a working example of in this [path alias example repo](https://github.com/SaltyAom/elysia-monorepo-path-alias) or [Kozeki Template](https://github.com/SaltyAom/kozeki-template)
269+
You may find a working example of in this [path alias example repo](https://github.com/SaltyAom/elysia-monorepo-path-alias) or [Kozeki Template](https://github.com/SaltyAom/kozeki-template).

0 commit comments

Comments
 (0)