Skip to content

Commit 5d5119e

Browse files
committed
Merge remote-tracking branch 'origin/sync'
2 parents e0ae9a9 + f8fad2f commit 5d5119e

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

docs/getting-started/deno.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ Hono を使用して TypeScript でコードを書き、 `deno` コマンドで
88
## 1. Deno のインストール
99

1010
まず `deno` コマンドをインストールします。
11-
[公式ドキュメント](https://docs.deno.com/runtime/manual/getting_started/installation) を参照してください。
11+
[公式ドキュメント](https://docs.deno.com/runtime/getting_started/installation/) を参照してください。
1212

1313
## 2. セットアップ
1414

1515
Deno でもスターターを使用できます。
16-
"create-hono" コマンドでプロジェクトを作成してください。
16+
[`deno init`](https://docs.deno.com/runtime/reference/cli/init/) コマンドでプロジェクトを作成してください。
1717

1818
```sh
19-
deno init --npm hono my-app
19+
deno init --npm hono my-app --template=deno
2020
```
2121

22-
Select `deno` template for this example.
23-
2422
`my-app` に移動しますが、 Deno では Hono を明示的にインストールする必要はありません。
2523

2624
```sh
@@ -29,9 +27,9 @@ cd my-app
2927

3028
## 3. Hello World
3129

32-
最初のアプリケーションを書いていきましょう。
30+
`main.ts` を変更します:
3331

34-
```ts
32+
```ts [main.ts]
3533
import { Hono } from 'hono'
3634

3735
const app = new Hono()
@@ -43,7 +41,7 @@ Deno.serve(app.fetch)
4341

4442
## 4. Run
4543

46-
このコマンドだけです:
44+
ローカルで開発サーバーを実行します。次に、 Web ブラウザで `http://localhost:8000` にアクセスします。
4745

4846
```sh
4947
deno task start
@@ -60,7 +58,7 @@ Deno.serve({ port: 8787 }, app.fetch) // [!code ++]
6058

6159
## 静的ファイルの提供
6260

63-
静的ファイルを提供するには `hono/middleware.ts` から `serveStatic` をインポートして使用します。
61+
静的ファイルを提供するには `hono/deno` から `serveStatic` をインポートして使用します。
6462

6563
```ts
6664
import { Hono } from 'hono'
@@ -168,8 +166,8 @@ app.get(
168166

169167
## Deno Deploy
170168

171-
Deno Deploy は Deno のためのエッジランタイムプラットフォームです。
172-
Deno Deploy でワールドワイドにアプリケーションを公開できます。
169+
Deno Deploy is a serverless platform for running JavaScript and TypeScript applications in the cloud.
170+
It provides a management plane for deploying and running applications through integrations like GitHub deployment.
173171

174172
Hono は Deno Deploy もサポートしています。 [公式ドキュメント](https://docs.deno.com/deploy/manual/)を参照してください。
175173

@@ -182,7 +180,7 @@ Deno でアプリケーションをテストするのは簡単です。
182180
deno add jsr:@std/assert
183181
```
184182

185-
```ts
183+
```ts [hello.ts]
186184
import { Hono } from 'hono'
187185
import { assertEquals } from '@std/assert'
188186

@@ -201,9 +199,9 @@ Deno.test('Hello World', async () => {
201199
deno test hello.ts
202200
```
203201

204-
## `npm:` 指定子
202+
## npm と JSR
205203

206-
`npm:hono` も使えます。 これを使うためには `deno.json` を修正します:
204+
Hono is available on both [npm](https://www.npmjs.com/package/hono) and [JSR](https://jsr.io/@hono/hono) (the JavaScript Registry). You can use either `npm:hono` or `jsr:@hono/hono` in your `deno.json`:
207205

208206
```json
209207
{
@@ -214,9 +212,7 @@ deno test hello.ts
214212
}
215213
```
216214

217-
`npm:hono``jsr:@hono/hono` のどちらかを使うことができます。
218-
219-
`npm:@hono/zod-validator` といったサードパーティミドルウェアを TypeScript の型推論付きで使用したい場合は、 `npm:` 指定子が必要です。
215+
When using third-party middleware, you may need to use Hono from the same registry as the middleware for proper TypeScript type inference. For example, if using the middleware from npm, you should also use Hono from npm:
220216

221217
```json
222218
{
@@ -227,3 +223,15 @@ deno test hello.ts
227223
}
228224
}
229225
```
226+
227+
We also provide many third-party middleware packages on [JSR](https://jsr.io/@hono). When using the middleware on JSR, use Hono from JSR:
228+
229+
```json
230+
{
231+
"imports": {
232+
"hono": "jsr:@hono/hono",
233+
"zod": "npm:zod",
234+
"@hono/zod-validator": "jsr:@hono/zod-validator"
235+
}
236+
}
237+
```

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ hero:
1717
image:
1818
src: /images/code.webp
1919
alt: "An example of code for Hono. \
20-
import { Homo } from 'hono' \
20+
import { Hono } from 'hono' \
2121
const app = new Hono() \
2222
app.get('/', (c) => c.text('Hello Hono!')) \
2323

0 commit comments

Comments
 (0)