-
-
Notifications
You must be signed in to change notification settings - Fork 145
feat(publisher): cloudflare durable object adapter #1253
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4e55bf4
durable object
dinwwwh 3ce67d7
durable publisher
dinwwwh c6026e6
resume
dinwwwh bc67b9e
build
dinwwwh d5da450
Merge branch 'main' into feat/publisher/durable-object-adapter
dinwwwh 77f3ad9
fix type:check
dinwwwh aa73a69
fix test coverage
dinwwwh ed73510
improve logging
dinwwwh c9438fe
improve logic
dinwwwh cfd631d
improve docs
dinwwwh 1700eb0
improve
dinwwwh 3c0688d
Merge branch 'main' into feat/publisher/durable-object-adapter
dinwwwh bfd1177
typo
dinwwwh afc8794
playground
dinwwwh c8f6eb4
fix ttype check
dinwwwh 86faa6e
improve
dinwwwh d9c9d34
add alarm scheduling logic to prevent duplicate alarms in ResumeStorage
dinwwwh 3f5e971
version
dinwwwh 6bd6b32
improve
dinwwwh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Hidden folders and files | ||
| .* | ||
| !.gitignore | ||
| !.*.example | ||
|
|
||
| # Common generated folders | ||
| logs/ | ||
| node_modules/ | ||
| out/ | ||
| dist/ | ||
| dist-ssr/ | ||
| build/ | ||
| coverage/ | ||
| temp/ | ||
|
|
||
| # Common generated files | ||
| *.log | ||
| *.log.* | ||
| *.tsbuildinfo | ||
| *.vitest-temp.json | ||
| vite.config.ts.timestamp-* | ||
| vitest.config.ts.timestamp-* | ||
|
|
||
| # Common manual ignore files | ||
| *.local | ||
| *.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| <div align="center"> | ||
| <image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" /> | ||
|
dinwwwh marked this conversation as resolved.
|
||
| </div> | ||
|
|
||
| <h1></h1> | ||
|
dinwwwh marked this conversation as resolved.
|
||
|
|
||
| <div align="center"> | ||
| <a href="https://codecov.io/gh/unnoq/orpc"> | ||
| <img alt="codecov" src="https://codecov.io/gh/unnoq/orpc/branch/main/graph/badge.svg"> | ||
| </a> | ||
| <a href="https://www.npmjs.com/package/@orpc/experimental-publisher-durable-object"> | ||
| <img alt="weekly downloads" src="https://img.shields.io/npm/dw/%40orpc%2Fexperimental-publisher-durable-object?logo=npm" /> | ||
| </a> | ||
| <a href="https://github.com/unnoq/orpc/blob/main/LICENSE"> | ||
| <img alt="MIT License" src="https://img.shields.io/github/license/unnoq/orpc?logo=open-source-initiative" /> | ||
| </a> | ||
| <a href="https://discord.gg/TXEbwRBvQn"> | ||
| <img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" /> | ||
| </a> | ||
| <a href="https://deepwiki.com/unnoq/orpc"> | ||
| <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"> | ||
| </a> | ||
| </div> | ||
|
|
||
| <h3 align="center">Typesafe APIs Made Simple 🪄</h3> | ||
|
|
||
| **oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards | ||
|
|
||
| --- | ||
|
|
||
| ## Highlights | ||
|
|
||
| - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server. | ||
| - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard. | ||
| - **📝 Contract-First Development**: Optionally define your API contract before implementation. | ||
| - **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability. | ||
| - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more. | ||
| - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms. | ||
| - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators. | ||
| - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more. | ||
| - **⏱️ Lazy Router**: Enhance cold start times with our lazy routing feature. | ||
| - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming. | ||
| - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond. | ||
| - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors. | ||
|
|
||
| ## Documentation | ||
|
|
||
| You can find the full documentation [here](https://orpc.unnoq.com). | ||
|
dinwwwh marked this conversation as resolved.
|
||
|
|
||
| ## Packages | ||
|
|
||
| - [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract. | ||
| - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract. | ||
| - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety. | ||
| - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests. | ||
| - [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability. | ||
| - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/). | ||
| - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions. | ||
| - [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration. | ||
| - [@orpc/experimental-react-swr](https://www.npmjs.com/package/@orpc/experimental-react-swr): [SWR](https://swr.vercel.app/) integration. | ||
| - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/). | ||
| - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration. | ||
| - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet. | ||
| - [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/). | ||
| - [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/). | ||
|
|
||
| ## `@orpc/experimental-publisher-durable-object` | ||
|
|
||
| Publisher adapter for [Durable Objects](https://developers.cloudflare.com/durable-objects/) | ||
|
|
||
| ## Sponsors | ||
|
|
||
| <p align="center"> | ||
| <a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg"> | ||
| <img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/> | ||
|
dinwwwh marked this conversation as resolved.
|
||
| </a> | ||
| </p> | ||
|
|
||
| ## License | ||
|
|
||
| Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { defineBuildConfig } from 'unbuild' | ||
|
|
||
| export default defineBuildConfig({ | ||
| externals: [ | ||
| 'cloudflare:workers', | ||
| ], | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "name": "@orpc/experimental-publisher-durable-object", | ||
| "type": "module", | ||
| "version": "0.0.1", | ||
| "license": "MIT", | ||
| "homepage": "https://orpc.unnoq.com", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/unnoq/orpc.git", | ||
| "directory": "packages/publisher-durable-object" | ||
| }, | ||
| "keywords": [ | ||
| "unnoq", | ||
| "orpc" | ||
| ], | ||
| "publishConfig": { | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.mts", | ||
| "import": "./dist/index.mjs", | ||
| "default": "./dist/index.mjs" | ||
| } | ||
| } | ||
| }, | ||
| "exports": { | ||
| ".": "./src/index.ts" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "unbuild", | ||
| "build:watch": "pnpm run build --watch", | ||
| "type:check": "tsc -b", | ||
| "type:check:test": "tsc -p tsconfig.test.json --noEmit" | ||
| }, | ||
| "dependencies": { | ||
| "@orpc/client": "workspace:*", | ||
| "@orpc/experimental-publisher": "workspace:*", | ||
| "@orpc/shared": "workspace:*", | ||
| "@orpc/standard-server": "workspace:*" | ||
| }, | ||
| "devDependencies": { | ||
| "@cloudflare/workers-types": "^4.20251118.0", | ||
| "@orpc/standard-server-peer": "workspace:*", | ||
| "@types/node": "^22.15.30" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.