diff --git a/.changeset/three-actors-develop.md b/.changeset/three-actors-develop.md deleted file mode 100644 index d6c13dec..00000000 --- a/.changeset/three-actors-develop.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -"hono-do": major ---- - -Support for three handlers about [Hibernation Websocket API](https://developers.cloudflare.com/durable-objects/learning/websockets/#websocket-hibernation). - -- `webSocketMessage` handler -- `webSocketClose` handler -- `webSocketError` handler - -You can use these handlers same way as `alarm` handler in Hono DO. - -## Usage - -### Flat way - -```ts -const DO = generateHonoObject("/", () => {}); -DO.alarm(async () => {}); -DO.webSocketMessage(async () => {}); -DO.webSocketClose(async () => {}); -DO.webSocketError(async () => {}); -``` - -### Chaining way - -```ts -generateHonoObject("/", () => {}) - .alarm(async () => {}) - .webSocketMessage(async () => {}) - .webSocketClose(async () => {}) - .webSocketError(async () => {}); -``` - -### Argument way - -```ts -generateHonoObject("/", () => {}, { - alarm: async () => {}, - webSocketMessage: async () => {}, - webSocketClose: async () => {}, - webSocketError: async () => {}, -}); -``` - -Take care for registering multiple handlers for same event. -If you register so, you will get an error. - -## Breaking changes - -Changed the interface of how to configure `AlarmHandler` in `generateHonoObject` argument. - -### Before - -```ts -generateHonoObject("/", () => {}, () => { - console.log("alarm"); -}); -``` - -### After - -```ts -generateHonoObject("/", () => {}, { - alarm: () => { - console.log("alarm"); - }, -}); -``` - -This is because we want to support many fields of Durable Object as handlers. diff --git a/examples/batcher/CHANGELOG.md b/examples/batcher/CHANGELOG.md index df08f1d4..9092f982 100644 --- a/examples/batcher/CHANGELOG.md +++ b/examples/batcher/CHANGELOG.md @@ -1,5 +1,12 @@ # hono-do-example-batcher +## 0.0.3 + +### Patch Changes + +- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]: + - hono-do@1.0.0 + ## 0.0.2 ### Patch Changes diff --git a/examples/batcher/package.json b/examples/batcher/package.json index 854f7a91..bb0fb2ba 100644 --- a/examples/batcher/package.json +++ b/examples/batcher/package.json @@ -1,7 +1,7 @@ { "name": "hono-do-example-batcher", "private": true, - "version": "0.0.2", + "version": "0.0.3", "scripts": { "lint": "eslint --fix --ext .ts,.tsx src", "lint:check": "eslint --ext .ts,.tsx src", diff --git a/examples/chat/CHANGELOG.md b/examples/chat/CHANGELOG.md index 64210f7f..ad9d6345 100644 --- a/examples/chat/CHANGELOG.md +++ b/examples/chat/CHANGELOG.md @@ -1,5 +1,12 @@ # hono-do-example-chat +## 0.0.4 + +### Patch Changes + +- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]: + - hono-do@1.0.0 + ## 0.0.3 ### Patch Changes diff --git a/examples/chat/package.json b/examples/chat/package.json index 89fc1420..cbbfb3e4 100644 --- a/examples/chat/package.json +++ b/examples/chat/package.json @@ -1,7 +1,7 @@ { "name": "hono-do-example-chat", "private": true, - "version": "0.0.3", + "version": "0.0.4", "scripts": { "lint": "eslint --fix --ext .ts,.tsx src", "lint:check": "eslint --ext .ts,.tsx src", diff --git a/examples/counter-with-storage-helper/CHANGELOG.md b/examples/counter-with-storage-helper/CHANGELOG.md index 435ea305..d92a4c0b 100644 --- a/examples/counter-with-storage-helper/CHANGELOG.md +++ b/examples/counter-with-storage-helper/CHANGELOG.md @@ -1,5 +1,12 @@ # hono-do-example-counter-with-storage-helper +## 0.0.3 + +### Patch Changes + +- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]: + - hono-do@1.0.0 + ## 0.0.2 ### Patch Changes diff --git a/examples/counter-with-storage-helper/package.json b/examples/counter-with-storage-helper/package.json index 8fe8a581..c239b76d 100644 --- a/examples/counter-with-storage-helper/package.json +++ b/examples/counter-with-storage-helper/package.json @@ -1,7 +1,7 @@ { "name": "hono-do-example-counter-with-storage-helper", "private": true, - "version": "0.0.2", + "version": "0.0.3", "scripts": { "lint": "eslint --fix --ext .ts,.tsx src", "lint:check": "eslint --ext .ts,.tsx src", diff --git a/examples/counter/CHANGELOG.md b/examples/counter/CHANGELOG.md index 9339ffa3..4df37f3a 100644 --- a/examples/counter/CHANGELOG.md +++ b/examples/counter/CHANGELOG.md @@ -1,5 +1,12 @@ # hono-do-example-counter +## 0.0.4 + +### Patch Changes + +- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]: + - hono-do@1.0.0 + ## 0.0.3 ### Patch Changes diff --git a/examples/counter/package.json b/examples/counter/package.json index 6b321fe7..e408137f 100644 --- a/examples/counter/package.json +++ b/examples/counter/package.json @@ -1,7 +1,7 @@ { "name": "hono-do-example-counter", "private": true, - "version": "0.0.3", + "version": "0.0.4", "scripts": { "lint": "eslint --fix --ext .ts,.tsx src", "lint:check": "eslint --ext .ts,.tsx src", diff --git a/examples/hibernatable-chat/CHANGELOG.md b/examples/hibernatable-chat/CHANGELOG.md new file mode 100644 index 00000000..81575d74 --- /dev/null +++ b/examples/hibernatable-chat/CHANGELOG.md @@ -0,0 +1,8 @@ +# hono-do-example-hibernatable-chat + +## 0.0.1 + +### Patch Changes + +- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]: + - hono-do@1.0.0 diff --git a/examples/hibernatable-chat/package.json b/examples/hibernatable-chat/package.json index 20c17174..10460694 100644 --- a/examples/hibernatable-chat/package.json +++ b/examples/hibernatable-chat/package.json @@ -1,7 +1,7 @@ { "name": "hono-do-example-hibernatable-chat", "private": true, - "version": "0.0.0", + "version": "0.0.1", "scripts": { "lint": "eslint --fix --ext .ts,.tsx src", "lint:check": "eslint --ext .ts,.tsx src", diff --git a/packages/hono-do/CHANGELOG.md b/packages/hono-do/CHANGELOG.md index 66cbeea3..269cbf12 100644 --- a/packages/hono-do/CHANGELOG.md +++ b/packages/hono-do/CHANGELOG.md @@ -1,5 +1,81 @@ # hono-do +## 1.0.0 + +### Major Changes + +- [#21](https://github.com/sor4chi/hono-do/pull/21) [`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec) Thanks [@sor4chi](https://github.com/sor4chi)! - Support for three handlers about [Hibernation Websocket API](https://developers.cloudflare.com/durable-objects/learning/websockets/#websocket-hibernation). + + - `webSocketMessage` handler + - `webSocketClose` handler + - `webSocketError` handler + + You can use these handlers same way as `alarm` handler in Hono DO. + + ## Usage + + ### Flat way + + ```ts + const DO = generateHonoObject("/", () => {}); + DO.alarm(async () => {}); + DO.webSocketMessage(async () => {}); + DO.webSocketClose(async () => {}); + DO.webSocketError(async () => {}); + ``` + + ### Chaining way + + ```ts + generateHonoObject("/", () => {}) + .alarm(async () => {}) + .webSocketMessage(async () => {}) + .webSocketClose(async () => {}) + .webSocketError(async () => {}); + ``` + + ### Argument way + + ```ts + generateHonoObject("/", () => {}, { + alarm: async () => {}, + webSocketMessage: async () => {}, + webSocketClose: async () => {}, + webSocketError: async () => {}, + }); + ``` + + Take care for registering multiple handlers for same event. + If you register so, you will get an error. + + ## Breaking changes + + Changed the interface of how to configure `AlarmHandler` in `generateHonoObject` argument. + + ### Before + + ```ts + generateHonoObject( + "/", + () => {}, + () => { + console.log("alarm"); + }, + ); + ``` + + ### After + + ```ts + generateHonoObject("/", () => {}, { + alarm: () => { + console.log("alarm"); + }, + }); + ``` + + This is because we want to support many fields of Durable Object as handlers. + ## 0.2.1 ### Patch Changes diff --git a/packages/hono-do/package.json b/packages/hono-do/package.json index b8ba62f8..2bf0cd20 100644 --- a/packages/hono-do/package.json +++ b/packages/hono-do/package.json @@ -1,6 +1,6 @@ { "name": "hono-do", - "version": "0.2.1", + "version": "1.0.0", "description": "A wrapper for Cloudflare Workers' Durable Object, designed for Hono.", "type": "module", "module": "dist/index.js",