Skip to content

Commit

Permalink
Merge pull request #22 from sor4chi/changeset-release/main
Browse files Browse the repository at this point in the history
Version Packages
  • Loading branch information
sor4chi authored Nov 30, 2023
2 parents 44b5065 + a9309dc commit 38162ef
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 77 deletions.
71 changes: 0 additions & 71 deletions .changeset/three-actors-develop.md

This file was deleted.

7 changes: 7 additions & 0 deletions examples/batcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hono-do-example-batcher

## 0.0.3

### Patch Changes

- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]:
- [email protected]

## 0.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/batcher/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hono-do-example-chat

## 0.0.4

### Patch Changes

- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]:
- [email protected]

## 0.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/counter-with-storage-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)]:
- [email protected]

## 0.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/counter-with-storage-helper/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions examples/counter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hono-do-example-counter

## 0.0.4

### Patch Changes

- Updated dependencies [[`f659d6c`](https://github.com/sor4chi/hono-do/commit/f659d6ce48e0c77f785a813faf1585d8f0b216ec)]:
- [email protected]

## 0.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions examples/hibernatable-chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)]:
- [email protected]
2 changes: 1 addition & 1 deletion examples/hibernatable-chat/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
76 changes: 76 additions & 0 deletions packages/hono-do/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/hono-do/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 38162ef

Please sign in to comment.