Loading .github/workflows/build.yaml +19 −18 Original line number Diff line number Diff line Loading @@ -375,25 +375,26 @@ jobs: message: | The latest push to this pull request has been published to JSR and npm as a pre-release: - [`jsr:@fedify/fedify@${{ steps.versioning.outputs.version }}`][1] - [`npm:@fedify/fedify@${{ steps.versioning.outputs.short_version }}`][2] - [`jsr:@fedify/amqp@${{ steps.versioning.outputs.version }}`][3] - [`npm:@fedify/amqp@${{ steps.versioning.outputs.short_version }}`][4] - [`jsr:@fedify/express@${{ steps.versioning.outputs.version }}`][5] - [`npm:@fedify/express@${{ steps.versioning.outputs.short_version }}`][6] - [`jsr:@fedify/postgres@${{ steps.versioning.outputs.version }}`][7] - [`npm:@fedify/postgres@${{ steps.versioning.outputs.short_version }}`][8] - [`jsr:@fedify/cli@${{ steps.versioning.outputs.version }}`][9] | Package | Version | JSR | npm | | ---------------- | --------------------------------------- | --------------------------- | --------------------------- | | @fedify/fedify | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/fedify] | [npm][npm:@fedify/fedify] | | @fedify/cli | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/cli] | | | @fedify/amqp | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | | @fedify/express | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | | @fedify/h3 | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | | @fedify/postgres | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | [1]: https://jsr.io/@fedify/fedify@${{ steps.versioning.outputs.version }} [2]: https://www.npmjs.com/package/@fedify/fedify/v/${{ steps.versioning.outputs.short_version }} [3]: https://jsr.io/@fedify/amqp@${{ steps.versioning.outputs.version }} [4]: https://www.npmjs.com/package/@fedify/amqp/v/${{ steps.versioning.outputs.short_version }} [5]: https://jsr.io/@fedify/express@${{ steps.versioning.outputs.version }} [6]: https://www.npmjs.com/package/@fedify/express/v/${{ steps.versioning.outputs.short_version }} [7]: https://jsr.io/@fedify/postgres@${{ steps.versioning.outputs.version }} [8]: https://www.npmjs.com/package/@fedify/postgres/v/${{ steps.versioning.outputs.short_version }} [9]: https://jsr.io/@fedify/cli@${{ steps.versioning.outputs.version }} [jsr:@fedify/fedify]: https://jsr.io/@fedify/fedify@${{ steps.versioning.outputs.version }} [npm:@fedify/fedify]: https://www.npmjs.com/package/@fedify/fedify/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/cli]: https://jsr.io/@fedify/cli@${{ steps.versioning.outputs.version }} [jsr:@fedify/amqp]: https://jsr.io/@fedify/amqp@${{ steps.versioning.outputs.version }} [npm:@fedify/amqp]: https://www.npmjs.com/package/@fedify/amqp/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/express]: https://jsr.io/@fedify/express@${{ steps.versioning.outputs.version }} [npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/h3]: https://jsr.io/@fedify/h3@${{ steps.versioning.outputs.version }} [npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres@${{ steps.versioning.outputs.version }} [npm:@fedify/postgres]: https://www.npmjs.com/package/@fedify/postgres/v/${{ steps.versioning.outputs.short_version }} pr-number: ${{ github.event.pull_request.number }} comment-tag: publish Loading deno.json +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ "./cli", "./amqp", "./express", "./h3", "./postgres", "./examples/blog", "./examples/cloudflare-workers", Loading @@ -19,6 +20,7 @@ "@std/fs": "jsr:@std/fs@^1.0.3", "@std/path": "jsr:@std/path@^1.0.6", "amqplib": "npm:amqplib@^0.10.8", "h3": "npm:h3@^1.15.0", "json-preserve-indent": "npm:json-preserve-indent@^1.1.3", "postgres": "npm:postgres@^3.4.7", "preact": "npm:preact@10.19.6", Loading docs/manual/integration.md +2 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,8 @@ h3 [SolidStart], [TanStack Start], and other many web frameworks. The [@fedify/h3] package provides a middleware to integrate Fedify with h3: ~~~~ typescript {9-15} ~~~~ typescript {9-15} twoslash // @noErrors: 2345 import { createApp, createRouter } from "h3"; import { createFederation } from "@fedify/fedify"; import { integrateFederation, onError } from "@fedify/h3"; Loading docs/package.json +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ "@fedify/amqp": "workspace:", "@fedify/express": "workspace:", "@fedify/fedify": "workspace:", "@fedify/h3": "workspace:", "@fedify/postgres": "workspace:", "@fedify/redis": "^0.4.0", "@hono/node-server": "^1.13.7", Loading @@ -25,6 +26,7 @@ "amqplib": "catalog:", "dayjs": "^1.11.13", "express": "catalog:", "h3": "catalog:", "hono": "^4.6.14", "ioredis": "^5.4.2", "markdown-it-abbr": "^2.0.0", Loading examples/h3/federation.ts 0 → 100644 +23 −0 Original line number Diff line number Diff line import { MemoryKvStore, Note, Person, createFederation } from "@fedify/fedify"; export const federation = createFederation<void>({ kv: new MemoryKvStore(), }); federation.setActorDispatcher("/users/{handle}", async (ctx, handle) => { return new Person({ id: ctx.getActorUri(handle), preferredUsername: handle, }); }); federation.setObjectDispatcher( Note, "/users/{handle}/{id}", async (ctx, values) => { return new Note({ id: ctx.getObjectUri(Note, values), name: values.id, }); }, ); Loading
.github/workflows/build.yaml +19 −18 Original line number Diff line number Diff line Loading @@ -375,25 +375,26 @@ jobs: message: | The latest push to this pull request has been published to JSR and npm as a pre-release: - [`jsr:@fedify/fedify@${{ steps.versioning.outputs.version }}`][1] - [`npm:@fedify/fedify@${{ steps.versioning.outputs.short_version }}`][2] - [`jsr:@fedify/amqp@${{ steps.versioning.outputs.version }}`][3] - [`npm:@fedify/amqp@${{ steps.versioning.outputs.short_version }}`][4] - [`jsr:@fedify/express@${{ steps.versioning.outputs.version }}`][5] - [`npm:@fedify/express@${{ steps.versioning.outputs.short_version }}`][6] - [`jsr:@fedify/postgres@${{ steps.versioning.outputs.version }}`][7] - [`npm:@fedify/postgres@${{ steps.versioning.outputs.short_version }}`][8] - [`jsr:@fedify/cli@${{ steps.versioning.outputs.version }}`][9] | Package | Version | JSR | npm | | ---------------- | --------------------------------------- | --------------------------- | --------------------------- | | @fedify/fedify | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/fedify] | [npm][npm:@fedify/fedify] | | @fedify/cli | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/cli] | | | @fedify/amqp | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | | @fedify/express | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | | @fedify/h3 | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | | @fedify/postgres | ${{ steps.versioning.outputs.version }} | [JSR][jsr:@fedify/postgres] | [npm][npm:@fedify/postgres] | [1]: https://jsr.io/@fedify/fedify@${{ steps.versioning.outputs.version }} [2]: https://www.npmjs.com/package/@fedify/fedify/v/${{ steps.versioning.outputs.short_version }} [3]: https://jsr.io/@fedify/amqp@${{ steps.versioning.outputs.version }} [4]: https://www.npmjs.com/package/@fedify/amqp/v/${{ steps.versioning.outputs.short_version }} [5]: https://jsr.io/@fedify/express@${{ steps.versioning.outputs.version }} [6]: https://www.npmjs.com/package/@fedify/express/v/${{ steps.versioning.outputs.short_version }} [7]: https://jsr.io/@fedify/postgres@${{ steps.versioning.outputs.version }} [8]: https://www.npmjs.com/package/@fedify/postgres/v/${{ steps.versioning.outputs.short_version }} [9]: https://jsr.io/@fedify/cli@${{ steps.versioning.outputs.version }} [jsr:@fedify/fedify]: https://jsr.io/@fedify/fedify@${{ steps.versioning.outputs.version }} [npm:@fedify/fedify]: https://www.npmjs.com/package/@fedify/fedify/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/cli]: https://jsr.io/@fedify/cli@${{ steps.versioning.outputs.version }} [jsr:@fedify/amqp]: https://jsr.io/@fedify/amqp@${{ steps.versioning.outputs.version }} [npm:@fedify/amqp]: https://www.npmjs.com/package/@fedify/amqp/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/express]: https://jsr.io/@fedify/express@${{ steps.versioning.outputs.version }} [npm:@fedify/express]: https://www.npmjs.com/package/@fedify/express/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/h3]: https://jsr.io/@fedify/h3@${{ steps.versioning.outputs.version }} [npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3/v/${{ steps.versioning.outputs.short_version }} [jsr:@fedify/postgres]: https://jsr.io/@fedify/postgres@${{ steps.versioning.outputs.version }} [npm:@fedify/postgres]: https://www.npmjs.com/package/@fedify/postgres/v/${{ steps.versioning.outputs.short_version }} pr-number: ${{ github.event.pull_request.number }} comment-tag: publish Loading
deno.json +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ "./cli", "./amqp", "./express", "./h3", "./postgres", "./examples/blog", "./examples/cloudflare-workers", Loading @@ -19,6 +20,7 @@ "@std/fs": "jsr:@std/fs@^1.0.3", "@std/path": "jsr:@std/path@^1.0.6", "amqplib": "npm:amqplib@^0.10.8", "h3": "npm:h3@^1.15.0", "json-preserve-indent": "npm:json-preserve-indent@^1.1.3", "postgres": "npm:postgres@^3.4.7", "preact": "npm:preact@10.19.6", Loading
docs/manual/integration.md +2 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,8 @@ h3 [SolidStart], [TanStack Start], and other many web frameworks. The [@fedify/h3] package provides a middleware to integrate Fedify with h3: ~~~~ typescript {9-15} ~~~~ typescript {9-15} twoslash // @noErrors: 2345 import { createApp, createRouter } from "h3"; import { createFederation } from "@fedify/fedify"; import { integrateFederation, onError } from "@fedify/h3"; Loading
docs/package.json +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ "@fedify/amqp": "workspace:", "@fedify/express": "workspace:", "@fedify/fedify": "workspace:", "@fedify/h3": "workspace:", "@fedify/postgres": "workspace:", "@fedify/redis": "^0.4.0", "@hono/node-server": "^1.13.7", Loading @@ -25,6 +26,7 @@ "amqplib": "catalog:", "dayjs": "^1.11.13", "express": "catalog:", "h3": "catalog:", "hono": "^4.6.14", "ioredis": "^5.4.2", "markdown-it-abbr": "^2.0.0", Loading
examples/h3/federation.ts 0 → 100644 +23 −0 Original line number Diff line number Diff line import { MemoryKvStore, Note, Person, createFederation } from "@fedify/fedify"; export const federation = createFederation<void>({ kv: new MemoryKvStore(), }); federation.setActorDispatcher("/users/{handle}", async (ctx, handle) => { return new Person({ id: ctx.getActorUri(handle), preferredUsername: handle, }); }); federation.setObjectDispatcher( Note, "/users/{handle}/{id}", async (ctx, values) => { return new Note({ id: ctx.getObjectUri(Note, values), name: values.id, }); }, );