Skip to content

Commit

Permalink
Fixed type for Article.published property
Browse files Browse the repository at this point in the history
Since the upgrade from 0.11.0-dev to 0.13.0-dev Fedify no longer accepts a
datetime string for the `published` property and requires a Temporal.Instant
  • Loading branch information
allouis committed Aug 4, 2024
1 parent 191398c commit 5689ed8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dependencies": {
"@fedify/fedify": "0.13.0-dev.318",
"@hono/node-server": "1.11.1",
"@js-temporal/polyfill": "0.4.4",
"@sentry/node": "8.13.0",
"hono": "4.4.6",
"knex": "3.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ContextData, HonoContextVariables, fedify } from './app';
import { getSiteSettings } from './ghost';
import type { PersonData } from './user';
import { ACTOR_DEFAULT_HANDLE } from './constants';
import { Temporal } from '@js-temporal/polyfill';

type StoredThing = {
object: string | {
Expand Down Expand Up @@ -55,7 +56,7 @@ async function postToArticle(ctx: RequestContext<ContextData>, post: Post) {
name: post.title,
content: post.html,
image: toURL(post.feature_image),
published: post.published_at,
published: Temporal.Instant.from(post.published_at),
preview: preview,
url: toURL(post.url),
});
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@js-temporal/polyfill@^0.4.4":
"@js-temporal/polyfill@0.4.4", "@js-temporal/polyfill@^0.4.4":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@js-temporal/polyfill/-/polyfill-0.4.4.tgz#4c26b4a1a68c19155808363f520204712cfc2558"
integrity sha512-2X6bvghJ/JAoZO52lbgyAPFj8uCflhTo2g7nkFzEQdXd/D8rEeD4HtmTEpmtGCva260fcd66YNXBOYdnmHqSOg==
Expand Down

0 comments on commit 5689ed8

Please sign in to comment.