diff --git a/apps/website/src/components/docs/PageActions.tsx b/apps/website/src/components/docs/PageActions.tsx index c3f9c9b6..d41fc448 100644 --- a/apps/website/src/components/docs/PageActions.tsx +++ b/apps/website/src/components/docs/PageActions.tsx @@ -3,11 +3,7 @@ import { useEffect, useRef, useState } from 'react'; import { tokens } from '@threadplane/design-tokens'; import { analyticsEvents } from '../../lib/analytics/events'; import { track } from '../../lib/analytics/client'; - -// NOTE: SITE_ORIGIN is duplicated from lib/site-metadata rather than imported, -// because site-metadata transitively pulls in lib/blog (Node `fs`), which a -// 'use client' component cannot bundle. Keep in sync with site-metadata.ts. -const SITE_ORIGIN = 'https://threadplane.ai'; +import { SITE_ORIGIN } from '../../lib/site-origin'; const GITHUB_EDIT_BASE = 'https://github.com/cacheplane/angular-agent-framework/edit/main/apps/website/content/docs'; diff --git a/apps/website/src/lib/site-metadata.ts b/apps/website/src/lib/site-metadata.ts index 120695f6..60d19754 100644 --- a/apps/website/src/lib/site-metadata.ts +++ b/apps/website/src/lib/site-metadata.ts @@ -2,8 +2,9 @@ import type { Metadata } from 'next'; import { getAllSolutionSlugs } from './solutions-data'; import { docsConfig } from './docs-config'; import { getAllPosts } from './blog'; +import { SITE_ORIGIN } from './site-origin'; -export const SITE_ORIGIN = 'https://threadplane.ai'; +export { SITE_ORIGIN }; export const SITE_NAME = 'Threadplane'; export const DEFAULT_SOCIAL_IMAGE = '/opengraph-image'; export { diff --git a/apps/website/src/lib/site-origin.ts b/apps/website/src/lib/site-origin.ts new file mode 100644 index 00000000..36da0375 --- /dev/null +++ b/apps/website/src/lib/site-origin.ts @@ -0,0 +1,4 @@ +// Leaf module: the canonical site origin with NO Node-only (`fs`) imports, so it +// is safe to import from `'use client'` components. `site-metadata.ts` re-exports +// it; client code should import from here directly. +export const SITE_ORIGIN = 'https://threadplane.ai';