honojs-middleware/README.md

54 lines
2.1 KiB
Markdown
Raw Normal View History

# monorepo for Hono third-party middleware
2022-10-16 16:52:21 +08:00
This repository is monorepo for third-party middleware of Hono.
We develop middleware in this repository and manage the issues and pull requests.
2022-10-16 16:52:21 +08:00
## What is third-party middleware?
2022-10-16 16:52:21 +08:00
Hono has three types of middleware.
2022-10-16 16:52:21 +08:00
1. Custom middleware - Created by users themselves.
2. Built-in middleware - Included in the Hono core package. It does not depend on any other external libraries.
3. Third-party middleware - Created outside of the core package. It can depend on the external libraries.
2022-10-16 16:52:21 +08:00
2022-12-24 20:20:56 +08:00
Third-party middleware is maintained in this `github.com/honojs/middleware` repository and published to npm in the `@hono` namespace. For example, a third-party middleware called hello is hosted at `github.com/honojs/middleware/packages/hello` and distributed under the name `@hono/hello`.
2023-02-04 19:31:47 +08:00
You can install it with the following command.
2022-10-16 16:52:21 +08:00
```
2022-12-24 20:20:56 +08:00
npm install @hono/hello
```
2023-02-04 19:31:47 +08:00
For Deno, we do not publish them on `deno.land/x`, but distribute them via CDNs such as Skypack and esm.sh. We will also use the `npm:` that will be introduced in the Deno itself in the future.
```ts
2022-12-24 20:20:56 +08:00
import { hello } from 'npm:@hono/hello'
```
## How to contribute
Anyone can propose third-party Middleware.
2023-02-04 19:31:47 +08:00
The Hono maintainers and other contributors will discuss whether we accept the middleware or not.
If it's OK, it will be maintained in this repository.
2023-02-04 19:31:47 +08:00
The proposer maintains it.
The specific flow is as follows
1. Clone this repository
2. Write your middleware. Refer to [hello Middleware](https://github.com/honojs/middleware/tree/main/packages/hello).
3. Create the pull request.
We use [changesets](https://github.com/changesets/changesets) to manage releases and CHANGELOG.
Run the following command at the top level to describe any changes.
```
yarn changeset
```
2023-02-04 19:31:47 +08:00
When merged into the main, a pull request for release is created.
The Hono maintainers will merge it to release the package at the appropriate time.
## Author & License
The Author of this repository is Yusuke Wada <<https://github.com/yusukebe>>. However, the code under the `packges/*` is in each Middleware author.
2023-02-04 19:31:47 +08:00
Basically, distributed under the MIT license.