Skip to content

Commit a9a2047

Browse files
committed
Fix errors
1 parent a967fe1 commit a9a2047

11 files changed

Lines changed: 1344 additions & 1043 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"json-preserve-indent": "npm:json-preserve-indent@^1.1.3",
5454
"postgres": "npm:postgres@^3.4.7",
5555
"preact": "npm:preact@10.19.6",
56-
"tsdown": "npm:tsdown@^0.12.9"
56+
"tsdown": "npm:tsdown@^0.18.4"
5757
},
5858
"unstable": [
5959
"fs",

deno.lock

Lines changed: 333 additions & 225 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/manual/lint.md

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ and to receive activities from other servers.
275275

276276
~~~~ typescript twoslash
277277
// @noErrors: 2345
278-
import { createFederation, Person } from "@fedify/fedify";
278+
import { createFederation } from "@fedify/fedify";
279+
import { Person } from "@fedify/vocab";
279280
const federation = createFederation<void>({ kv: null as any });
280281
// ---cut-before---
281282
// ❌ Bad: Missing id property
@@ -308,7 +309,8 @@ won't be able to properly verify the actor's identity or send activities to it.
308309

309310
~~~~ typescript twoslash
310311
// @noErrors: 2345
311-
import { createFederation, Person } from "@fedify/fedify";
312+
import { createFederation } from "@fedify/fedify";
313+
import { Person } from "@fedify/vocab";
312314
const federation = createFederation<void>({ kv: null as any });
313315
// ---cut-before---
314316
// ❌ Bad: Using hardcoded URL
@@ -351,7 +353,8 @@ are legitimate.
351353

352354
~~~~ typescript twoslash
353355
// @noErrors: 2345
354-
import { createFederation, Person } from "@fedify/fedify";
356+
import { createFederation } from "@fedify/fedify";
357+
import { Person } from "@fedify/vocab";
355358
const federation = createFederation<void>({ kv: null as any });
356359
// ---cut-before---
357360
// ❌ Bad: Missing publicKey when setKeyPairsDispatcher is configured
@@ -401,7 +404,8 @@ Signatures.
401404

402405
~~~~ typescript twoslash
403406
// @noErrors: 2345
404-
import { createFederation, Person } from "@fedify/fedify";
407+
import { createFederation } from "@fedify/fedify";
408+
import { Person } from "@fedify/vocab";
405409
const federation = createFederation<void>({ kv: null as any });
406410
// ---cut-before---
407411
// ❌ Bad: Missing assertionMethod when setKeyPairsDispatcher is configured
@@ -454,7 +458,8 @@ activities.
454458

455459
~~~~ typescript twoslash
456460
// @noErrors: 2345
457-
import { createFederation, Person } from "@fedify/fedify";
461+
import { createFederation } from "@fedify/fedify";
462+
import { Person } from "@fedify/vocab";
458463
const federation = createFederation<void>({ kv: null as any });
459464
// ---cut-before---
460465
// ❌ Bad: Missing inbox when setInboxListeners is configured
@@ -493,7 +498,8 @@ a different URI will cause incoming activities to fail.
493498

494499
~~~~ typescript twoslash
495500
// @noErrors: 2345
496-
import { createFederation, Person } from "@fedify/fedify";
501+
import { createFederation } from "@fedify/fedify";
502+
import { Person } from "@fedify/vocab";
497503
const federation = createFederation<void>({ kv: null as any });
498504
// ---cut-before---
499505
// ❌ Bad: Using hardcoded URL
@@ -527,7 +533,8 @@ activities. It's part of the standard ActivityPub actor profile.
527533

528534
~~~~ typescript twoslash
529535
// @noErrors: 2345
530-
import { createFederation, Person } from "@fedify/fedify";
536+
import { createFederation } from "@fedify/fedify";
537+
import { Person } from "@fedify/vocab";
531538
const federation = createFederation<void>({ kv: null as any });
532539
// ---cut-before---
533540
// ❌ Bad: Missing outbox when setOutboxDispatcher is configured
@@ -565,7 +572,8 @@ The outbox URI must match the path configured in `setOutboxDispatcher()`.
565572

566573
~~~~ typescript twoslash
567574
// @noErrors: 2345
568-
import { createFederation, Person } from "@fedify/fedify";
575+
import { createFederation } from "@fedify/fedify";
576+
import { Person } from "@fedify/vocab";
569577
const federation = createFederation<void>({ kv: null as any });
570578
// ---cut-before---
571579
// ❌ Bad: Using wrong context method
@@ -600,7 +608,8 @@ which is important for activity delivery and social graph discovery.
600608

601609
~~~~ typescript twoslash
602610
// @noErrors: 2345
603-
import { createFederation, Person } from "@fedify/fedify";
611+
import { createFederation } from "@fedify/fedify";
612+
import { Person } from "@fedify/vocab";
604613
const federation = createFederation<void>({ kv: null as any });
605614
// ---cut-before---
606615
// ❌ Bad: Missing followers when setFollowersDispatcher is configured
@@ -639,7 +648,8 @@ The followers URI must match the path configured in `setFollowersDispatcher()`.
639648

640649
~~~~ typescript twoslash
641650
// @noErrors: 2345
642-
import { createFederation, Person } from "@fedify/fedify";
651+
import { createFederation } from "@fedify/fedify";
652+
import { Person } from "@fedify/vocab";
643653
const federation = createFederation<void>({ kv: null as any });
644654
// ---cut-before---
645655
// ❌ Bad: Using wrong context method
@@ -673,7 +683,8 @@ The following URL allows other servers to discover who this actor follows.
673683

674684
~~~~ typescript twoslash
675685
// @noErrors: 2345
676-
import { createFederation, Person } from "@fedify/fedify";
686+
import { createFederation } from "@fedify/fedify";
687+
import { Person } from "@fedify/vocab";
677688
const federation = createFederation<void>({ kv: null as any });
678689
// ---cut-before---
679690
// ❌ Bad: Missing following when setFollowingDispatcher is configured
@@ -712,7 +723,8 @@ The following URI must match the path configured in `setFollowingDispatcher()`.
712723

713724
~~~~ typescript twoslash
714725
// @noErrors: 2345
715-
import { createFederation, Person } from "@fedify/fedify";
726+
import { createFederation } from "@fedify/fedify";
727+
import { Person } from "@fedify/vocab";
716728
const federation = createFederation<void>({ kv: null as any });
717729
// ---cut-before---
718730
// ❌ Bad: Using wrong context method
@@ -746,7 +758,8 @@ liked.
746758

747759
~~~~ typescript twoslash
748760
// @noErrors: 2345
749-
import { createFederation, Person } from "@fedify/fedify";
761+
import { createFederation } from "@fedify/fedify";
762+
import { Person } from "@fedify/vocab";
750763
const federation = createFederation<void>({ kv: null as any });
751764
// ---cut-before---
752765
// ❌ Bad: Missing liked when setLikedDispatcher is configured
@@ -783,7 +796,8 @@ The liked URI must match the path configured in `setLikedDispatcher()`.
783796

784797
~~~~ typescript twoslash
785798
// @noErrors: 2345
786-
import { createFederation, Person } from "@fedify/fedify";
799+
import { createFederation } from "@fedify/fedify";
800+
import { Person } from "@fedify/vocab";
787801
const federation = createFederation<void>({ kv: null as any });
788802
// ---cut-before---
789803
// ❌ Bad: Using wrong context method
@@ -818,7 +832,8 @@ highlighted content (commonly shown at the top of a profile).
818832

819833
~~~~ typescript twoslash
820834
// @noErrors: 2345
821-
import { createFederation, Person } from "@fedify/fedify";
835+
import { createFederation } from "@fedify/fedify";
836+
import { Person } from "@fedify/vocab";
822837
const federation = createFederation<void>({ kv: null as any });
823838
// ---cut-before---
824839
// ❌ Bad: Missing featured when setFeaturedDispatcher is configured
@@ -857,7 +872,8 @@ The featured URI must match the path configured in `setFeaturedDispatcher()`.
857872

858873
~~~~ typescript twoslash
859874
// @noErrors: 2345
860-
import { createFederation, Person } from "@fedify/fedify";
875+
import { createFederation } from "@fedify/fedify";
876+
import { Person } from "@fedify/vocab";
861877
const federation = createFederation<void>({ kv: null as any });
862878
// ---cut-before---
863879
// ❌ Bad: Using wrong context method
@@ -893,7 +909,8 @@ hashtags (commonly used for profile discovery).
893909

894910
~~~~ typescript twoslash
895911
// @noErrors: 2345
896-
import { createFederation, Person } from "@fedify/fedify";
912+
import { createFederation } from "@fedify/fedify";
913+
import { Person } from "@fedify/vocab";
897914
const federation = createFederation<void>({ kv: null as any });
898915
// ---cut-before---
899916
// ❌ Bad: Missing featuredTags when setFeaturedTagsDispatcher is configured
@@ -933,7 +950,8 @@ The featuredTags URI must match the path configured in
933950

934951
~~~~ typescript twoslash
935952
// @noErrors: 2345
936-
import { createFederation, Person } from "@fedify/fedify";
953+
import { createFederation } from "@fedify/fedify";
954+
import { Person } from "@fedify/vocab";
937955
const federation = createFederation<void>({ kv: null as any });
938956
// ---cut-before---
939957
// ❌ Bad: Using wrong context method
@@ -969,7 +987,8 @@ on your server with a single request, improving federation efficiency.
969987

970988
~~~~ typescript twoslash
971989
// @noErrors: 2345
972-
import { createFederation, Endpoints, Person } from "@fedify/fedify";
990+
import { createFederation } from "@fedify/fedify";
991+
import { Endpoints, Person } from "@fedify/vocab";
973992
const federation = createFederation<void>({ kv: null as any });
974993
// ---cut-before---
975994
// ❌ Bad: Missing sharedInbox when setInboxListeners has shared inbox path
@@ -1010,7 +1029,8 @@ The shared inbox URI must match the shared inbox path configured in
10101029

10111030
~~~~ typescript twoslash
10121031
// @noErrors: 2345
1013-
import { createFederation, Endpoints, Person } from "@fedify/fedify";
1032+
import { createFederation } from "@fedify/fedify";
1033+
import { Endpoints, Person } from "@fedify/vocab";
10141034
const federation = createFederation<void>({ kv: null as any });
10151035
// ---cut-before---
10161036
// ❌ Bad: Using getInboxUri with identifier for shared inbox
@@ -1088,7 +1108,8 @@ Here's an example of code that would trigger lint errors:
10881108

10891109
~~~~ typescript twoslash
10901110
// @noErrors: 2345
1091-
import { createFederation, Person } from "@fedify/fedify";
1111+
import { createFederation } from "@fedify/fedify";
1112+
import { Person } from "@fedify/vocab";
10921113
const federation = createFederation<void>({ kv: null as any });
10931114
// ---cut-before---
10941115
// ❌ Wrong: Using relative URL for actor ID
@@ -1107,7 +1128,8 @@ Corrected version:
11071128

11081129
~~~~ typescript twoslash
11091130
// @noErrors: 2345
1110-
import { createFederation, Person } from "@fedify/fedify";
1131+
import { createFederation } from "@fedify/fedify";
1132+
import { Person } from "@fedify/vocab";
11111133
const federation = createFederation<void>({ kv: null as any });
11121134
// ---cut-before---
11131135
// ✅ Correct: Using Context.getActorUri() for actor ID

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"x-forwarded-fetch": "^0.2.0"
6464
},
6565
"scripts": {
66-
"dev": "cd ../ && pnpm run --filter '!{docs}' --filter='!./examples/**' -r build && cd docs/ && vitepress dev --host",
67-
"build": "cd ../ && pnpm run --filter '!{docs}' --filter '!./examples/**' -r build && cd docs/ && NODE_OPTIONS='--max-old-space-size=8192' vitepress build",
68-
"preview": "cd ../ && pnpm run --filter '!{docs}' --filter '!./examples/**' -r build && cd docs/ && vitepress preview"
66+
"dev": "cd ../ && pnpm run --filter '@fedify/*' -r build && cd docs/ && vitepress dev --host",
67+
"build": "cd ../ && pnpm run --filter '@fedify/*' -r build && cd docs/ && NODE_OPTIONS='--max-old-space-size=8192' vitepress build",
68+
"preview": "cd ../ && pnpm run --filter '@fedify/*' -r build && cd docs/ && vitepress preview"
6969
}
7070
}

packages/fastify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
"build": "tsdown",
6060
"prepack": "tsdown",
6161
"prepublish": "tsdown",
62-
"test": "tsdown && node --experimental-transform-types --test"
62+
"test": "node --experimental-transform-types --test"
6363
}
6464
}

packages/fedify/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"dependencies": {
113113
"@fedify/vocab": "workspace:*",
114114
"@fedify/vocab-runtime": "workspace:*",
115+
"@fedify/webfinger": "workspace:*",
115116
"@js-temporal/polyfill": "^0.5.1",
116117
"@logtape/logtape": "catalog:",
117118
"@multiformats/base-x": "^4.0.1",

packages/fedify/src/testing/mod.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from "@fedify/fixture";
21
export { createInboxContext, createRequestContext } from "./context.ts";

packages/fedify/tsdown.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default [
1212
"./src/otel/mod.ts",
1313
"./src/utils/mod.ts",
1414
"./src/sig/mod.ts",
15-
"./src/webfinger/mod.ts",
1615
],
1716
dts: true,
1817
format: ["esm", "cjs"],

packages/testing/src/mock.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { InboxContext } from "@fedify/fedify/federation";
2+
import { test } from "@fedify/fixture";
23
import { Create, Note, Person } from "@fedify/vocab";
34
import { assertEquals, assertRejects } from "@std/assert";
4-
import { test } from "../../fedify/src/testing/mod.ts";
55
import { createFederation } from "./mock.ts";
66

77
test("getSentActivities returns sent activities", async () => {

0 commit comments

Comments
 (0)