Skip to content

Commit 84920fa

Browse files
committed
fix(relay): add temporal polyfill
1 parent 7902d02 commit 84920fa

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

packages/relay/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"dist/",
4848
"package.json"
4949
],
50+
"dependencies": {
51+
"@js-temporal/polyfill": "catalog:"
52+
},
5053
"peerDependencies": {
5154
"@fedify/fedify": "workspace:^"
5255
},

packages/relay/src/relay.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import {
88
type MessageQueue,
99
} from "@fedify/fedify";
1010
import { type Actor, Application, isActor, Object } from "@fedify/fedify/vocab";
11-
import { LitePubRelay, MastodonRelay } from "@fedify/relay";
1211
import type {
1312
AuthenticatedDocumentLoaderFactory,
1413
DocumentLoaderFactory,
1514
} from "@fedify/vocab-runtime";
15+
import { LitePubRelay } from "./litepub.ts";
16+
import { MastodonRelay } from "./mastodon.ts";
1617

1718
export const RELAY_SERVER_ACTOR = "relay";
1819

packages/relay/tsdown.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,16 @@ export default defineConfig({
55
dts: true,
66
format: ["esm", "cjs"],
77
platform: "node",
8+
outputOptions(outputOptions, format) {
9+
if (format === "cjs") {
10+
outputOptions.intro = `
11+
const { Temporal } = require("@js-temporal/polyfill");
12+
`;
13+
} else {
14+
outputOptions.intro = `
15+
import { Temporal } from "@js-temporal/polyfill";
16+
`;
17+
}
18+
return outputOptions;
19+
},
820
});

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)