Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,17 @@ The test results are stored in `/tmp/fedify-init/<run-id>/`(UNIX).
> to configure the init command to use local workspace packages instead of
> published versions.

#### Testing the examples

If you want to test the example projects, you can run the following command
from the root:

~~~~ bash
mise run test:examples
~~~~

This command runs the tests for all example projects.

### Building the docs

If you want to change the Fedify docs, you would like to preview the changes
Expand Down
1 change: 1 addition & 0 deletions examples/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"wrangler": "^4.18.0"
},
"dependencies": {
"@fedify/cfworkers": "workspace:^",
"@fedify/fedify": "workspace:^",
"@fedify/vocab": "workspace:^"
}
Expand Down
3 changes: 2 additions & 1 deletion examples/custom-collections/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createFederation, MemoryKvStore, Note } from "@fedify/fedify";
import { createFederation, MemoryKvStore } from "@fedify/fedify";
import { Note } from "@fedify/vocab";

// Mock data - in a real application, this would query your database
const POSTS = [
Expand Down
2 changes: 1 addition & 1 deletion examples/elysia/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ federation.setNodeInfoDispatcher("/nodeinfo/2.1", (ctx) => {
return {
software: {
name: "fedify-elysia", // Lowercase, digits, and hyphens only.
version: { major: 1, minor: 0, patch: 0 },
version: "1.0.0",
homepage: new URL(ctx.canonicalOrigin),
},
protocols: ["activitypub"],
Expand Down
2 changes: 1 addition & 1 deletion examples/fastify/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createFederation, MemoryKvStore } from "@fedify/fedify";
import { Person } from "@fedify/vocab";
import Fastify from "fastify";
import fedifyPlugin from "../../packages/fastify/src/index.ts";
import fedifyPlugin from "@fedify/fastify";

const fastify = Fastify({ logger: true });

Expand Down
4 changes: 2 additions & 2 deletions examples/h3/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { integrateFederation, onError } from "@fedify/h3";
import {
createApp,
createRouter,
defineEventHandler,
setResponseHeader,
toWebHandler,
} from "h3";
import { integrateFederation, onError } from "../src";
import { federation } from "./federation";
import { federation } from "./federation.ts";

export const app = createApp({
onError,
Expand Down
2 changes: 1 addition & 1 deletion examples/hono-sample/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createFederation, MemoryKvStore } from "@fedify/fedify/federation";
import { createFederation, MemoryKvStore } from "@fedify/fedify";
import { federation } from "@fedify/hono";
import { Person } from "@fedify/vocab";
import { Hono } from "hono";
Expand Down
6 changes: 6 additions & 0 deletions examples/next14-app-router/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
/* config options here */
};

export default nextConfig;
7 changes: 0 additions & 7 deletions examples/next14-app-router/next.config.ts

This file was deleted.

8 changes: 7 additions & 1 deletion examples/next15-app-router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
"~/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"app/.well-known/**/*.ts"
],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/sveltekit-sample/src/lib/federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
createFederation,
generateCryptoKeyPair,
MemoryKvStore,
PUBLIC_COLLECTION,
} from "@fedify/fedify";
import {
Accept,
Expand All @@ -11,6 +10,7 @@ import {
Image,
Note,
Person,
PUBLIC_COLLECTION,
type Recipient,
Undo,
} from "@fedify/vocab";
Expand Down
3 changes: 2 additions & 1 deletion examples/sveltekit-sample/src/lib/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Note, type RequestContext } from "@fedify/fedify";
import { type RequestContext } from "@fedify/fedify";
import { Note } from "@fedify/vocab";
import type { Post, User } from "./types";
import { postStore } from "./store";

Expand Down
2 changes: 1 addition & 1 deletion examples/sveltekit-sample/src/lib/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Note, Person } from "@fedify/fedify";
import type { Note, Person } from "@fedify/vocab";

declare global {
var keyPairsStore: Map<string, Array<CryptoKeyPair>>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { default as federation, default as fedi } from "$lib/federation";
import { getPosts, getUser } from "$lib/fetch";
import { postStore } from "$lib/store";
import { Create, Note } from "@fedify/fedify";
import { Create, Note } from "@fedify/vocab";
import { error, redirect } from "@sveltejs/kit";
import type { Action, Actions, PageServerLoad } from "./$types";

Expand Down
3 changes: 2 additions & 1 deletion examples/sveltekit-sample/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import tailwindcss from "@tailwindcss/vite";
import { sveltekit } from "@sveltejs/kit/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
server: { allowedHosts: true },
});
Loading
Loading