unnessesary diff
parent
9be1b09b73
commit
f04d68edad
|
@ -1,49 +0,0 @@
|
||||||
# @hono/hello
|
|
||||||
|
|
||||||
## 0.1.1
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- [#235](https://github.com/honojs/middleware/pull/235) [`a3da3da`](https://github.com/honojs/middleware/commit/a3da3dac910e24075466932ac39bb4e529dfb483) Thanks [@yusukebe](https://github.com/yusukebe)! - chore: tweak
|
|
||||||
|
|
||||||
## 0.1.0
|
|
||||||
|
|
||||||
### Minor Changes
|
|
||||||
|
|
||||||
- [#228](https://github.com/honojs/middleware/pull/228) [`b9baf4a`](https://github.com/honojs/middleware/commit/b9baf4a9902ddd2dd09dd65e00699088fcbac403) Thanks [@yusukebe](https://github.com/yusukebe)! - feat: bump infer type correctly using `satisfies`
|
|
||||||
|
|
||||||
## 0.0.15
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- [#44](https://github.com/honojs/middleware/pull/44) [`fe80b93`](https://github.com/honojs/middleware/commit/fe80b939e5e8cfbfdb6fe9a59c8c6477ce1bb766) Thanks [@yusukebe](https://github.com/yusukebe)! - fix peerDependencies
|
|
||||||
|
|
||||||
## 0.0.14
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 5a14c91: fix types
|
|
||||||
|
|
||||||
## 0.0.13
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 10dd016: new message
|
|
||||||
|
|
||||||
## 0.0.11
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 845f880: this is a "blank" update
|
|
||||||
|
|
||||||
## 0.0.8
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 45a22b8: `@honojs` to `@hono`
|
|
||||||
|
|
||||||
## 0.0.7
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 0e7e7e2: nothing is changed
|
|
|
@ -1,28 +0,0 @@
|
||||||
# Hello middleware for Hono
|
|
||||||
|
|
||||||
[](https://codecov.io/github/honojs/middleware)
|
|
||||||
|
|
||||||
An example project of the third-party middleware for [Hono](https://github.com/honojs/hono).
|
|
||||||
This middleware add `X-Message` header to the Response.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { hello } from '@hono/hello'
|
|
||||||
import { Hono } from 'hono'
|
|
||||||
|
|
||||||
const app = new Hono()
|
|
||||||
|
|
||||||
app.use('*', hello('Hello!! Hono!!'))
|
|
||||||
app.get('/', (c) => c.text('foo'))
|
|
||||||
|
|
||||||
export default app
|
|
||||||
```
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
Yusuke Wada <https://github.com/yusukebe>
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
|
@ -1,54 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@hono/effect",
|
|
||||||
"version": "0.1.1",
|
|
||||||
"description": "An example of third-party middleware for Hono",
|
|
||||||
"type": "module",
|
|
||||||
"module": "dist/index.js",
|
|
||||||
"types": "dist/index.d.ts",
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsup ./src/index.ts",
|
|
||||||
"prepack": "yarn build",
|
|
||||||
"publint": "attw --pack && publint",
|
|
||||||
"typecheck": "tsc -b tsconfig.json",
|
|
||||||
"test": "vitest"
|
|
||||||
},
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"import": {
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"default": "./dist/index.js"
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"types": "./dist/index.d.cts",
|
|
||||||
"default": "./dist/index.cjs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"publishConfig": {
|
|
||||||
"registry": "https://registry.npmjs.org",
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/honojs/middleware.git",
|
|
||||||
"directory": "packages/effect"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/honojs/middleware",
|
|
||||||
"peerDependencies": {
|
|
||||||
"hono": "*"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@arethetypeswrong/cli": "^0.17.4",
|
|
||||||
"publint": "^0.3.9",
|
|
||||||
"tsup": "^8.4.0",
|
|
||||||
"typescript": "^5.8.2",
|
|
||||||
"vitest": "^3.0.8"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"effect": "^3.14.11"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
import { Hono } from 'hono'
|
|
||||||
import { hello } from '.'
|
|
||||||
|
|
||||||
describe('Hello middleware', () => {
|
|
||||||
const app = new Hono()
|
|
||||||
|
|
||||||
app.use('/hello/*', hello())
|
|
||||||
app.get('/hello/foo', (c) => c.text('foo'))
|
|
||||||
|
|
||||||
app.use('/x/*', hello('X'))
|
|
||||||
app.get('/x/foo', (c) => c.text('foo'))
|
|
||||||
|
|
||||||
it('Should be hello message', async () => {
|
|
||||||
const res = await app.request('http://localhost/hello/foo')
|
|
||||||
expect(res).not.toBeNull()
|
|
||||||
expect(res.status).toBe(200)
|
|
||||||
expect(res.headers.get('X-Message')).toBe('Hello!')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Should be X', async () => {
|
|
||||||
const res = await app.request('http://localhost/x/foo')
|
|
||||||
expect(res).not.toBeNull()
|
|
||||||
expect(res.status).toBe(200)
|
|
||||||
expect(res.headers.get('X-Message')).toBe('X')
|
|
||||||
})
|
|
||||||
})
|
|
|
@ -1,15 +0,0 @@
|
||||||
import { Effect } from 'effect'
|
|
||||||
import { Hono } from 'hono'
|
|
||||||
import type { Context } from 'hono'
|
|
||||||
import { createMiddleware } from 'hono/factory'
|
|
||||||
|
|
||||||
export const effect = async <ContextType extends Context, SuccessType>(
|
|
||||||
program: Effect.Effect<SuccessType>,
|
|
||||||
c: ContextType
|
|
||||||
) => {
|
|
||||||
const result = await Effect.runPromise(program)
|
|
||||||
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
const app = new Hono().get('/', (c) => effect(c))
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
|
||||||
"emitDeclarationOnly": false
|
|
||||||
},
|
|
||||||
"include": ["src/**/*.ts"],
|
|
||||||
"exclude": ["**/*.test.ts"],
|
|
||||||
"references": []
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"files": [],
|
|
||||||
"include": [],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.build.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.spec.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../dist/out-tsc/packages/hello",
|
|
||||||
"types": ["vitest/globals"]
|
|
||||||
},
|
|
||||||
"include": ["**/*.test.ts", "vitest.config.ts"],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.build.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { defineProject } from 'vitest/config'
|
|
||||||
|
|
||||||
export default defineProject({
|
|
||||||
test: {
|
|
||||||
globals: true,
|
|
||||||
},
|
|
||||||
})
|
|
Loading…
Reference in New Issue