Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ coverage
*.tgz
*.zip
*~
.todo.md
10 changes: 0 additions & 10 deletions packages/h3/build.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/h3/docs/functions/getHeaderLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The **first language tag** of header, if header is not exists, or `*` (any langu

## Description

parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.

## Example

Expand Down
22 changes: 15 additions & 7 deletions packages/h3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,27 @@
"files": [
"dist"
],
"main": "dist/index.cjs",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./*"
]
}
},
"scripts": {
"build": "unbuild",
"build": "tsdown",
"build:docs": "typedoc --excludeInternal",
"play:basic": "pnpx tsx ./playground/basic/index.ts",
"prepack": "pnpm build"
Expand All @@ -63,10 +70,11 @@
"@types/node": "catalog:",
"@types/supertest": "^6.0.3",
"h3": "^1.15.4",
"publint": "catalog:",
"supertest": "^7.1.4",
"tsdown": "catalog:",
"typedoc": "catalog:",
"typedoc-plugin-markdown": "catalog:",
"typescript": "catalog:",
"unbuild": "catalog:"
"typescript": "catalog:"
}
}
12 changes: 12 additions & 0 deletions packages/h3/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'tsdown'

import type { UserConfig } from 'tsdown'

const config: UserConfig = defineConfig({
entry: ['./src/index.ts'],
outDir: 'dist',
clean: true,
publint: true
})

export default config
4 changes: 2 additions & 2 deletions packages/hono/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const i18nMiddleware = defineI18nMiddleware<[ResourceSchema], 'en' | 'ja'>({
// ...
})

// someting your implementation code ...
// something your implementation code ...
// ...
```

Expand Down Expand Up @@ -247,7 +247,7 @@ app.get('/', c => {

The advantage of this way is that it is not necessary to specify the resource schema in the `useTranslation` type parameter.

## 🛠️ Utilites & Helpers
## 🛠️ Utilities & Helpers

`@intlify/hono` has a concept of composable utilities & helpers.

Expand Down
10 changes: 0 additions & 10 deletions packages/hono/build.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/hono/docs/functions/getHeaderLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A **first language tag** of header, if header is not exists, or `*` (any languag

## Description

parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.

## Example

Expand Down
20 changes: 14 additions & 6 deletions packages/hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,27 @@
"files": [
"dist"
],
"main": "dist/index.cjs",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./*"
]
}
},
"scripts": {
"build": "unbuild",
"build": "tsdown",
"build:docs": "typedoc --excludeInternal",
"play:basic": "wrangler dev ./playground/basic/index.ts",
"prepack": "pnpm build"
Expand All @@ -62,10 +69,11 @@
"@cloudflare/workers-types": "^4.20231016.0",
"@types/node": "catalog:",
"hono": "^3.8.1",
"publint": "catalog:",
"tsdown": "catalog:",
"typedoc": "catalog:",
"typedoc-plugin-markdown": "catalog:",
"typescript": "catalog:",
"unbuild": "catalog:",
"wrangler": "^3.6.0"
}
}
2 changes: 1 addition & 1 deletion packages/hono/playground/typesafe-schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const i18n = defineI18nMiddleware<[ResourceSchema], 'en' | 'ja'>({

const app = new Hono()
app.use('*', i18n)
// someting your implementation code ...
// something your implementation code ...
// ...

export default app
2 changes: 1 addition & 1 deletion packages/hono/src/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { MiddlewareHandler } from 'hono'

test('defineI18nMiddleware', () => {
const _en = {
hello: 'workd'
hello: 'worked'
}
// @ts-expect-error -- FIXME
type ResourceSchema = typeof _en // eslint-disable-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars -- NOTE: for type testing
Expand Down
2 changes: 1 addition & 1 deletion packages/hono/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('useTranslation', () => {
expect(t('hello', { name: 'hono' })).toEqual('こんにちは, hono')
})

test('not initilize context', () => {
test('not initialize context', () => {
const mockContext = {
req: {
header: _name => 'ja,en'
Expand Down
12 changes: 12 additions & 0 deletions packages/hono/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'tsdown'

import type { UserConfig } from 'tsdown'

const config: UserConfig = defineConfig({
entry: ['./src/index.ts'],
outDir: 'dist',
clean: true,
publint: true
})

export default config
Loading
Loading