-
-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New middleware structures, and how we manage #350
Comments
Or we can compose third-party middleware by monorepo pattern like the project @Code-Hex taught to me. https://github.com/dotansimha/graphql-code-generator/tree/master/packages/plugins/typescript In monorepo pattern, all third-party middlewares are in one repository. Such as The nice thing about this pattern is that it allows for common test code and packages. Instead, middleware authors will not be free to configure the project. |
Thanks for a lot of writing down your thinking. Indeed, it may be better to have separate repositories for each package if you give privileges rights to each package (This is my opinion). Summary of Pros, Cons of management. I'd like to know if there's anything else you'd like to share. Non-monorepoPros
Cons
MonorepoPros
Cons
|
Hi @Code-Hex ! Thank you for summarizing. I think the monorepo pattern is good. It's easy to make settings of projects to be common. But, if we think about Deno, it will be difficult to use monorepo. On Deno, the version is specified by the GitHub project's tag name. For example, if the latest tag is I don't think all modules need to be Deno modules, but this is important. So, I'm planning to use no-monorepo pattern. In the non-monorepo pattern, it's difficult to follow the version up of Hono as you said and it's treble to set up projects for each middleware. However, I think it can't be helped. We can try and find improvements such as using Dependabot/Renovate to follow updates of Hono and making the example project for reference. If you know of a better solution, please let me know. |
Thanks @yusukebe I see. I don't have release strategy for deno. This is agree me.
I'm fine non-monorepo pattern 😄 |
@Code-Hex Thank you! I'm making the template project for third-party middleware. https://github.com/honojs/middleware-template It's just PoC status. We might use this template after releasing v2.0.0 to develop third-party middleware. |
@yusukebe Great work! I understand. but I have one question. What do you think about the release flow for npm? Currently, you considering releasing by using honojs org. I think we should support deployment via GitHub Actions. Because you can share npm token via secrets for an organization. I believe this is a safe way (maybe). |
@Code-Hex Thank you!
I was just thinking about it!
I think so, it's a better solution. So, I'll try to set up GitHub Actions with |
I think it's great to manage the third-party middleware in individual repo, which benefits,
|
Going to #407 |
I want to renew middleware structures for v2.0.0. I'll tell you my plan roughly.
There are two types of middleware:
1. Built-in middleware
Basic. It does not depend on other libraries. Such as
basic-auth
,cors
,etag
,jsx
, and so on. Included inhono
packages. So, we can usehono/{name}
syntax like this:2. Third-party middleware
Extended. It depends on other libraries. Such as
graphql-server
,mustache
, orfirebase-auth
. These are not included inhono
package but distributed by@honojs/{name}
package. like this:And, these middleware are managed in under
honojs
org on GitHub. Each middleware has its own repository. Suchhonojs
org in npmAlready, I've got
honojs
org in the npm repository.https://www.npmjs.com/org/honojs
We can use
@honojs/{name}
namespace.Privileges
We have to think about the privileges of managing third-party middleware.
Basically, I keep managing
github.com/honojs/hono
forhono
package including built-in middleware.And, the GitHub repository and npm package of third-party middleware is managed by the author of it. To do it I'll give privileges to access GitHub and npm repo to the author of the middleware.
For example. If @Code-Hex wants to make
firebase-auth
middleware, I will give the privileges to manage GitHubgithub.com/honojs/firebase-auth
and npm@honojs/firebase-auth
. The author is free to use the repository for development and release it to npm freely.How to
For example:
graphqh-server
middleware fromhonojs/hono
repository. And move it tohonojs/graphql-server
.@honojs/graphql-server
on the npm repository.honojs/firebase-auth
repository.honojs
org and add privileges to managehonojs/firebase-auth
repository.@honojs/firebase-auth
honojs
and add privileges to release and manage@honojs/firebase-auth
.It's just an idea. We have to consider it.
The text was updated successfully, but these errors were encountered: