diff --git a/apps/bear/next.config.ts b/apps/bear/next.config.ts
index 25fe499..72850ad 100644
--- a/apps/bear/next.config.ts
+++ b/apps/bear/next.config.ts
@@ -18,6 +18,9 @@ const immutable = [
];
const nextConfig: NextConfig = {
+ // Every visitor gets the metadata in
, where Chrome looks for the manifest and Safari for
+ // its home-screen tags; Next.js would otherwise stream it to the end of (0054).
+ htmlLimitedBots: /.*/,
// The `/api` proxy's wait for the gateway (0018); uploads outlast Next.js's 30-second default.
experimental: { proxyTimeout: API_PROXY_TIMEOUT_MS },
// Workspace packages export TypeScript source, so Next.js compiles them.
diff --git a/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx b/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
index c11c76c..f7886a3 100644
--- a/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/login/(number)/page.tsx
@@ -6,9 +6,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('auth:login.meta-title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:login.meta-title'),
+ robots: { index: false },
+};
/** Login, the number. The frame renders on the server; the step only in the browser (0013). */
export default function LoginPage() {
diff --git a/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx b/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx
index b9ff800..61d0e61 100644
--- a/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/login/suspended/page.tsx
@@ -6,12 +6,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:suspended.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:suspended.meta-title'),
+ robots: { index: false },
+};
/**
* After a valid code for a suspended account (S6 3.1): the 560 card with the support button
diff --git a/apps/bear/src/app/(auth)/auth/login/verify/page.tsx b/apps/bear/src/app/(auth)/auth/login/verify/page.tsx
index 395424e..819b40a 100644
--- a/apps/bear/src/app/(auth)/auth/login/verify/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/login/verify/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:login.verify-meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:login.verify-meta-title'),
+ robots: { index: false },
+};
/** Login, the code. The frame renders on the server; the step only in the browser (0013). */
export default function LoginVerifyPage() {
diff --git a/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx b/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
index 0fc5796..24574f2 100644
--- a/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/register/(type)/page.tsx
@@ -6,12 +6,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.meta-title'),
+ robots: { index: false },
+};
/** Registration step 1, the account type. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterTypePage() {
diff --git a/apps/bear/src/app/(auth)/auth/register/details/page.tsx b/apps/bear/src/app/(auth)/auth/register/details/page.tsx
index bcb237c..901361c 100644
--- a/apps/bear/src/app/(auth)/auth/register/details/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/register/details/page.tsx
@@ -6,12 +6,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.details.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.details.meta-title'),
+ robots: { index: false },
+};
/** Registration step 4, account details or identity. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterDetailsPage() {
diff --git a/apps/bear/src/app/(auth)/auth/register/phone/page.tsx b/apps/bear/src/app/(auth)/auth/register/phone/page.tsx
index 3f88895..5a34df8 100644
--- a/apps/bear/src/app/(auth)/auth/register/phone/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/register/phone/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.meta-title'),
+ robots: { index: false },
+};
/** Registration step 2, the number. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterPhonePage() {
diff --git a/apps/bear/src/app/(auth)/auth/register/verify/page.tsx b/apps/bear/src/app/(auth)/auth/register/verify/page.tsx
index f0efaa9..0dbe95e 100644
--- a/apps/bear/src/app/(auth)/auth/register/verify/page.tsx
+++ b/apps/bear/src/app/(auth)/auth/register/verify/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.verify.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.verify.meta-title'),
+ robots: { index: false },
+};
/** Registration step 3, the code. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterVerifyPage() {
diff --git a/apps/bear/src/app/(flow)/account/profile/page.tsx b/apps/bear/src/app/(flow)/account/profile/page.tsx
index 223fb24..a05822c 100644
--- a/apps/bear/src/app/(flow)/account/profile/page.tsx
+++ b/apps/bear/src/app/(flow)/account/profile/page.tsx
@@ -11,12 +11,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('account:profile.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('account:profile.title'),
+ robots: { index: false },
+};
/**
* «اطلاعات کاربری» on desktop, from the account menu or حساب کاربری: the header, then one route for
diff --git a/apps/bear/src/app/(flow)/checkout/[username]/page.tsx b/apps/bear/src/app/(flow)/checkout/[username]/page.tsx
index 5c80174..a099195 100644
--- a/apps/bear/src/app/(flow)/checkout/[username]/page.tsx
+++ b/apps/bear/src/app/(flow)/checkout/[username]/page.tsx
@@ -9,12 +9,10 @@ import { CheckoutTemplate } from './templates/checkout-template';
type CheckoutPageProps = { params: Promise<{ username: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:checkout.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:checkout.title'),
+ robots: { index: false },
+};
/**
* Checkout for a creator's channel (U9), reached only from its «اشتراک». The server renders the
diff --git a/apps/bear/src/app/(flow)/compose/post/[id]/page.tsx b/apps/bear/src/app/(flow)/compose/post/[id]/page.tsx
index c85ea82..1beb80a 100644
--- a/apps/bear/src/app/(flow)/compose/post/[id]/page.tsx
+++ b/apps/bear/src/app/(flow)/compose/post/[id]/page.tsx
@@ -11,12 +11,10 @@ import { i18n } from '../../../../../i18n';
type EditPostPageProps = { params: Promise<{ id: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('content:composer.edit-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('content:composer.edit-title'),
+ robots: { index: false },
+};
/** Editing a published post, in its first 15 minutes; in the browser only. */
export default async function EditPostPage({ params }: EditPostPageProps) {
diff --git a/apps/bear/src/app/(flow)/compose/post/page.tsx b/apps/bear/src/app/(flow)/compose/post/page.tsx
index 8d7711f..94fd7d5 100644
--- a/apps/bear/src/app/(flow)/compose/post/page.tsx
+++ b/apps/bear/src/app/(flow)/compose/post/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('content:composer.new-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('content:composer.new-title'),
+ robots: { index: false },
+};
/** A new post (C4 ۷.۳): the 640px composer under the header, in the browser only. */
export default function ComposePostPage() {
diff --git a/apps/bear/src/app/(flow)/compose/prediction/page.tsx b/apps/bear/src/app/(flow)/compose/prediction/page.tsx
index b36dd19..47258de 100644
--- a/apps/bear/src/app/(flow)/compose/prediction/page.tsx
+++ b/apps/bear/src/app/(flow)/compose/prediction/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:composer.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:composer.title'),
+ robots: { index: false },
+};
/**
* «پیشبینی جدید» on a direct load (J09-1-D): the 960px composer under the header, in the browser
diff --git a/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx b/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx
index 6f11193..7fef865 100644
--- a/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx
+++ b/apps/bear/src/app/(flow)/dashboard/pricing/page.tsx
@@ -15,12 +15,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('pricing:meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('pricing:meta-title'),
+ robots: { index: false },
+};
/**
* C7, «ویرایش قیمتها» on desktop (C7 ۸.۱): the creator header with داشبورد on, «بازگشت» above
diff --git a/apps/bear/src/app/(flow)/payment/result/[paymentId]/page.tsx b/apps/bear/src/app/(flow)/payment/result/[paymentId]/page.tsx
index 3763e65..3dcdc75 100644
--- a/apps/bear/src/app/(flow)/payment/result/[paymentId]/page.tsx
+++ b/apps/bear/src/app/(flow)/payment/result/[paymentId]/page.tsx
@@ -12,12 +12,10 @@ import { i18n } from '../../../../../i18n';
type PaymentResultPageProps = { params: Promise<{ paymentId: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:result.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:result.meta-title'),
+ robots: { index: false },
+};
/**
* «نتیجه پرداخت» on desktop (U10 ۹.۴, ۹.۵): «بازگشت», then one panel in the 480 column under the
diff --git a/apps/bear/src/app/(flow)/payment/return/page.tsx b/apps/bear/src/app/(flow)/payment/return/page.tsx
index ab382cc..db6e04f 100644
--- a/apps/bear/src/app/(flow)/payment/return/page.tsx
+++ b/apps/bear/src/app/(flow)/payment/return/page.tsx
@@ -10,12 +10,10 @@ type PaymentReturnPageProps = {
searchParams: Promise<{ paymentId?: string | string[] }>;
};
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:confirm.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:confirm.meta-title'),
+ robots: { index: false },
+};
/**
* Back from the bank (U10 ۱.۱): «در حال تأیید پرداخت...» while the payment settles, then its
diff --git a/apps/bear/src/app/(flow)/terms/subscription/page.tsx b/apps/bear/src/app/(flow)/terms/subscription/page.tsx
index 7a07ac4..079e3ff 100644
--- a/apps/bear/src/app/(flow)/terms/subscription/page.tsx
+++ b/apps/bear/src/app/(flow)/terms/subscription/page.tsx
@@ -1,3 +1,7 @@
+// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
+// adds to i18n when this module loads, whichever module Next loads first (0055).
+import '../../../../bootstrap/bootstrap.server';
+
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Card } from '@lumina/island/molecules/card';
import { DesktopHeader, DesktopPageTitle } from '@lumina/market/app/navigation';
@@ -11,12 +15,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('terms:meta-title'),
- description: i18n.t('terms:meta-description'),
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('terms:meta-title'),
+ description: i18n.t('terms:meta-description'),
+};
/**
* «شرایط اشتراک» on desktop (S5 ۲.۱): the text in a panel of the 640 column under the header,
diff --git a/apps/bear/src/app/(landing)/page.tsx b/apps/bear/src/app/(landing)/page.tsx
index 6f839d1..ab0e0fe 100644
--- a/apps/bear/src/app/(landing)/page.tsx
+++ b/apps/bear/src/app/(landing)/page.tsx
@@ -1,3 +1,7 @@
+// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
+// adds to i18n when this module loads, whichever module Next loads first (0055).
+import '../../bootstrap/bootstrap.server';
+
import { Element } from '@lumina/island/primitives/element';
import { LandingRedirect } from '@lumina/market/app/guards/landing-redirect';
import { faqEntries } from '@lumina/market/app/screens/(landing)/organisms/landing-faq';
@@ -22,12 +26,10 @@ import { i18n } from '../../i18n';
export const dynamic = 'force-static';
export const revalidate = 600;
-export function generateMetadata(): Metadata {
- return landingMetadata({
- title: i18n.t('landing:meta.title'),
- description: i18n.t('landing:hero.lead'),
- });
-}
+export const metadata: Metadata = landingMetadata({
+ title: i18n.t('landing:meta.title'),
+ description: i18n.t('landing:hero.lead'),
+});
/**
* The landing, `/`: what Lumina is, for a signed-out visitor, and the way to registration. A
diff --git a/apps/bear/src/app/(main)/account/install/loading.tsx b/apps/bear/src/app/(main)/account/install/loading.tsx
index 38d83b0..2742142 100644
--- a/apps/bear/src/app/(main)/account/install/loading.tsx
+++ b/apps/bear/src/app/(main)/account/install/loading.tsx
@@ -12,6 +12,7 @@ export default function Loading() {
};
+// The one kind of route whose metadata names its data (0055): it reads through the same per-request
+// cache as the page, so the first byte, held for the metadata in (0054), waits for that
+// one read.
export async function generateMetadata({
params,
}: ChannelPageProps): Promise {
diff --git a/apps/bear/src/app/(main)/channels/[username]/posts/[id]/page.tsx b/apps/bear/src/app/(main)/channels/[username]/posts/[id]/page.tsx
index 27c5955..c6b7946 100644
--- a/apps/bear/src/app/(main)/channels/[username]/posts/[id]/page.tsx
+++ b/apps/bear/src/app/(main)/channels/[username]/posts/[id]/page.tsx
@@ -33,6 +33,9 @@ async function readPostPage(username: string, id: string) {
return { channel: channel.data, post: found };
}
+// The one kind of route whose metadata names its data (0055): it reads through the same per-request
+// cache as the page, so the first byte, held for the metadata in (0054), waits for that
+// one read.
export async function generateMetadata({
params,
}: PostPageProps): Promise {
diff --git a/apps/bear/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx b/apps/bear/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
index 6ede0ac..c779d5c 100644
--- a/apps/bear/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
+++ b/apps/bear/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
@@ -30,7 +30,10 @@ export function PostTemplate({
className="w-full max-w-content"
>
{/* A link opened on its own goes back to the post's channel (R14). */}
-
+
{channel.suspended ? (
) : post ? (
diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx
index 7c202ca..3d05245 100644
--- a/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(creator)/finance/page.tsx
@@ -21,12 +21,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:finance.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:finance.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › مالی (brief §4; C19, C20), in this order, 16px apart: when payouts are made (the same
diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx
index 2614b89..a8711db 100644
--- a/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(creator)/plans/page.tsx
@@ -19,12 +19,10 @@ import { Suspense } from 'react';
import { clientEnv } from '../../../../../env';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:plans.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:plans.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › طرحهای اشتراک (J10-1): «قیمت طرحها», «کد دعوت» (only once approved) and «مخاطبان»,
diff --git a/apps/bear/src/app/(main)/dashboard/(creator)/predictions/page.tsx b/apps/bear/src/app/(main)/dashboard/(creator)/predictions/page.tsx
index ea4f42e..17cd40c 100644
--- a/apps/bear/src/app/(main)/dashboard/(creator)/predictions/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(creator)/predictions/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:tab.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:tab.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › پیشبینیها (J10-3): the creator's record, open and recently closed predictions, in the
diff --git a/apps/bear/src/app/(main)/dashboard/(investor)/following/page.tsx b/apps/bear/src/app/(main)/dashboard/(investor)/following/page.tsx
index ed0a9b1..a1e469c 100644
--- a/apps/bear/src/app/(main)/dashboard/(investor)/following/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(investor)/following/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:following.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:following.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › دنبالشدهها (U8 ۶.۱): the investor's own list, in the browser only, behind rows of the
diff --git a/apps/bear/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx b/apps/bear/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
index 15415c0..2b9082f 100644
--- a/apps/bear/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:subscriptions.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:subscriptions.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › اشتراکها (U2, U11): the investor's own subscriptions, in the browser only, behind
diff --git a/apps/bear/src/app/(main)/dashboard/(investor)/transactions/page.tsx b/apps/bear/src/app/(main)/dashboard/(investor)/transactions/page.tsx
index e40701d..644fc27 100644
--- a/apps/bear/src/app/(main)/dashboard/(investor)/transactions/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/(investor)/transactions/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:transactions.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:transactions.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › تراکنشها (U4): the investor's own payments, in the browser only, behind rows of the
diff --git a/apps/bear/src/app/(main)/dashboard/predictions/all/page.tsx b/apps/bear/src/app/(main)/dashboard/predictions/all/page.tsx
index 9014381..247130e 100644
--- a/apps/bear/src/app/(main)/dashboard/predictions/all/page.tsx
+++ b/apps/bear/src/app/(main)/dashboard/predictions/all/page.tsx
@@ -11,12 +11,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:list.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:list.title'),
+ robots: { index: false },
+};
/**
* «همه پیشبینیها» on desktop (J10-3f): the same list in the 640 column, «بازگشت» over its title
diff --git a/apps/bear/src/app/(main)/feed/page.tsx b/apps/bear/src/app/(main)/feed/page.tsx
index fa7a90a..2f0115f 100644
--- a/apps/bear/src/app/(main)/feed/page.tsx
+++ b/apps/bear/src/app/(main)/feed/page.tsx
@@ -10,9 +10,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
import { HomeTemplate } from './templates/home-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('home:meta.title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('home:meta.title'),
+ robots: { index: false },
+};
/**
* خانه, `/feed`: the investor's feed of the creators they follow, under the featured analysts' row,
diff --git a/apps/bear/src/app/(main)/notifications/page.tsx b/apps/bear/src/app/(main)/notifications/page.tsx
index cc61ec6..49f54af 100644
--- a/apps/bear/src/app/(main)/notifications/page.tsx
+++ b/apps/bear/src/app/(main)/notifications/page.tsx
@@ -9,12 +9,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('notifications:title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('notifications:title'),
+ robots: { index: false },
+};
/**
* اعلانها at its own address on desktop, such as a link opened from elsewhere: the same centre the
diff --git a/apps/bear/src/app/(main)/search/page.tsx b/apps/bear/src/app/(main)/search/page.tsx
index da4b87d..ad1616a 100644
--- a/apps/bear/src/app/(main)/search/page.tsx
+++ b/apps/bear/src/app/(main)/search/page.tsx
@@ -10,9 +10,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
import { SearchTemplate } from './templates/search-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('home:search.title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('home:search.title'),
+ robots: { index: false },
+};
/**
* جستجو, `/search?q=` (J04-4): an investor's analyst search, in the browser only, behind the
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
index 593ed2f..25dbe41 100644
--- a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
@@ -10,12 +10,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.meta-title'),
+ robots: { index: false },
+};
/**
* Registration step 5 for a creator, on the session: the form card beside its live preview. The
diff --git a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
index 1987368..949e0b4 100644
--- a/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
+++ b/apps/bear/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
@@ -10,12 +10,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.done.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.done.meta-title'),
+ robots: { index: false },
+};
/**
* The end of registration for a creator (R2-CompleteProfile 3.3), in the 560 card. The frame renders on the server; the step only in the browser, for the signed-in creator,
diff --git a/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
index b323936..85d8922 100644
--- a/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
+++ b/apps/bear/src/app/(onboarding)/onboarding/investor-profile/page.tsx
@@ -9,12 +9,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
import { AuthTemplate } from '../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.meta-title'),
+ robots: { index: false },
+};
/**
* Registration step 5 for an investor, optional, on the session, in the 560 card. The frame
diff --git a/apps/bear/src/app/layout.tsx b/apps/bear/src/app/layout.tsx
index 0806b36..85cdb67 100644
--- a/apps/bear/src/app/layout.tsx
+++ b/apps/bear/src/app/layout.tsx
@@ -13,9 +13,7 @@ import { rootMetadata } from '../configs';
import { i18n } from '../i18n';
import { AppProviders } from './organisms/app-providers';
-export function generateMetadata(): Metadata {
- return rootMetadata();
-}
+export const metadata: Metadata = rootMetadata();
export default function RootLayout({ children }: { children: ReactNode }) {
// Only the face every page renders first; the Latin face loads where شبا is shown.
diff --git a/apps/bear/src/app/manifest.ts b/apps/bear/src/app/manifest.ts
index a063dba..8bc9252 100644
--- a/apps/bear/src/app/manifest.ts
+++ b/apps/bear/src/app/manifest.ts
@@ -1,4 +1,4 @@
-import { ROUTES } from '@lumina/market/app/navigation';
+import { buildManifest } from '@lumina/market/server';
import type { MetadataRoute } from 'next';
import { i18n } from '../i18n';
@@ -6,43 +6,17 @@ import { i18n } from '../i18n';
// Every request renders fresh, as every metadata route does: nothing is cached on the server.
export const dynamic = 'force-dynamic';
-/**
- * The light theme's `--bg-page` and `--action-primary` in island `theme.css`. The manifest can't
- * read CSS variables, so a change there changes these too.
- */
-const BACKGROUND_COLOR = '#f4f6f9';
-const THEME_COLOR = '#533afd';
+// Both apps serve this same manifest (0053). Browsers fetch it without cookies, so it speaks the
+// app's one locale, and it is the same bytes until the next deploy, so it is built once, when the
+// module loads; each request only serializes it.
+const MANIFEST = buildManifest({
+ name: i18n.t('app.name'),
+ description: i18n.t('app.description'),
+ lang: i18n.language,
+ dir: i18n.dir(),
+});
-/**
- * The web app manifest, at `/manifest.webmanifest`. Browsers fetch it without cookies, so it uses
- * the app's one locale. The installed app opens on خانه, which sends a guest to login and a creator
- * to their channel, so it never flashes the landing; `id` keeps the installed app's identity if
- * `start_url` changes.
- */
+/** The web app manifest at `/manifest.webmanifest`; Next.js adds its ``. */
export default function manifest(): MetadataRoute.Manifest {
- const name = i18n.t('app.name');
- return {
- id: '/',
- name,
- short_name: name,
- description: i18n.t('app.description'),
- lang: i18n.language,
- dir: i18n.dir(),
- start_url: ROUTES.home,
- scope: '/',
- display: 'standalone',
- background_color: BACKGROUND_COLOR,
- theme_color: THEME_COLOR,
- // Placeholders until the brand mark exists; apple-icon.png beside this file covers iOS.
- icons: [
- { src: '/pwa/icon-192.png', sizes: '192x192', type: 'image/png' },
- { src: '/pwa/icon-512.png', sizes: '512x512', type: 'image/png' },
- {
- src: '/pwa/icon-maskable-512.png',
- sizes: '512x512',
- type: 'image/png',
- purpose: 'maskable',
- },
- ],
- };
+ return MANIFEST;
}
diff --git a/apps/bull/next.config.ts b/apps/bull/next.config.ts
index 25fe499..72850ad 100644
--- a/apps/bull/next.config.ts
+++ b/apps/bull/next.config.ts
@@ -18,6 +18,9 @@ const immutable = [
];
const nextConfig: NextConfig = {
+ // Every visitor gets the metadata in , where Chrome looks for the manifest and Safari for
+ // its home-screen tags; Next.js would otherwise stream it to the end of (0054).
+ htmlLimitedBots: /.*/,
// The `/api` proxy's wait for the gateway (0018); uploads outlast Next.js's 30-second default.
experimental: { proxyTimeout: API_PROXY_TIMEOUT_MS },
// Workspace packages export TypeScript source, so Next.js compiles them.
diff --git a/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx b/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
index f9ac606..57e8e72 100644
--- a/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/login/(number)/page.tsx
@@ -8,9 +8,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('auth:login.meta-title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:login.meta-title'),
+ robots: { index: false },
+};
/** Login, the number, with back to the landing (J01-1). The frame renders on the server; the step only in the browser (0013). */
export default function LoginPage() {
diff --git a/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx b/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx
index d51f76f..f9ffab2 100644
--- a/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/login/suspended/page.tsx
@@ -7,12 +7,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:suspended.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:suspended.meta-title'),
+ robots: { index: false },
+};
/**
* After a valid code for a suspended account (S6 1.11, 2.1): the brand header with support and
diff --git a/apps/bull/src/app/(auth)/auth/login/verify/page.tsx b/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
index 1c1e15f..4c1061b 100644
--- a/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/login/verify/page.tsx
@@ -8,12 +8,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:login.verify-meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:login.verify-meta-title'),
+ robots: { index: false },
+};
/** Login, the code. The frame renders on the server; the step only in the browser (0013). */
export default function LoginVerifyPage() {
diff --git a/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx b/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
index f6d179e..0541d8c 100644
--- a/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/(type)/page.tsx
@@ -8,12 +8,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.meta-title'),
+ robots: { index: false },
+};
/** Registration step 1, the account type, with back to login (J02-1). The frame renders on the server; the step only in the browser (0013). */
export default function RegisterTypePage() {
diff --git a/apps/bull/src/app/(auth)/auth/register/details/page.tsx b/apps/bull/src/app/(auth)/auth/register/details/page.tsx
index b094546..3dc50bc 100644
--- a/apps/bull/src/app/(auth)/auth/register/details/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/details/page.tsx
@@ -7,12 +7,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.details.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.details.meta-title'),
+ robots: { index: false },
+};
/** Registration step 4, account details or identity. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterDetailsPage() {
diff --git a/apps/bull/src/app/(auth)/auth/register/phone/page.tsx b/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
index 1a51b2c..5baf838 100644
--- a/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/phone/page.tsx
@@ -8,12 +8,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.meta-title'),
+ robots: { index: false },
+};
/** Registration step 2, the number. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterPhonePage() {
diff --git a/apps/bull/src/app/(auth)/auth/register/verify/page.tsx b/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
index f9edcab..a61d852 100644
--- a/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
+++ b/apps/bull/src/app/(auth)/auth/register/verify/page.tsx
@@ -8,12 +8,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.verify.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.verify.meta-title'),
+ robots: { index: false },
+};
/** Registration step 3, the code. The frame renders on the server; the step only in the browser (0013). */
export default function RegisterVerifyPage() {
diff --git a/apps/bull/src/app/(flow)/account/profile/page.tsx b/apps/bull/src/app/(flow)/account/profile/page.tsx
index 6a599f2..6dccbe0 100644
--- a/apps/bull/src/app/(flow)/account/profile/page.tsx
+++ b/apps/bull/src/app/(flow)/account/profile/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('account:profile.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('account:profile.title'),
+ robots: { index: false },
+};
/**
* «اطلاعات کاربری» on mobile: a task page pushed from حساب کاربری, on white with no bottom nav, one
diff --git a/apps/bull/src/app/(flow)/checkout/[username]/page.tsx b/apps/bull/src/app/(flow)/checkout/[username]/page.tsx
index 5c80174..a099195 100644
--- a/apps/bull/src/app/(flow)/checkout/[username]/page.tsx
+++ b/apps/bull/src/app/(flow)/checkout/[username]/page.tsx
@@ -9,12 +9,10 @@ import { CheckoutTemplate } from './templates/checkout-template';
type CheckoutPageProps = { params: Promise<{ username: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:checkout.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:checkout.title'),
+ robots: { index: false },
+};
/**
* Checkout for a creator's channel (U9), reached only from its «اشتراک». The server renders the
diff --git a/apps/bull/src/app/(flow)/compose/post/[id]/page.tsx b/apps/bull/src/app/(flow)/compose/post/[id]/page.tsx
index 66ce2cc..9ab5abf 100644
--- a/apps/bull/src/app/(flow)/compose/post/[id]/page.tsx
+++ b/apps/bull/src/app/(flow)/compose/post/[id]/page.tsx
@@ -9,12 +9,10 @@ import { i18n } from '../../../../../i18n';
type EditPostPageProps = { params: Promise<{ id: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('content:composer.edit-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('content:composer.edit-title'),
+ robots: { index: false },
+};
/** Editing a published post (C4 ۵.۲), in its first 15 minutes; in the browser only. */
export default async function EditPostPage({ params }: EditPostPageProps) {
diff --git a/apps/bull/src/app/(flow)/compose/post/page.tsx b/apps/bull/src/app/(flow)/compose/post/page.tsx
index 446cffb..0968138 100644
--- a/apps/bull/src/app/(flow)/compose/post/page.tsx
+++ b/apps/bull/src/app/(flow)/compose/post/page.tsx
@@ -5,12 +5,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('content:composer.new-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('content:composer.new-title'),
+ robots: { index: false },
+};
/** A new post (C4): the creator's own task flow, in the browser only, with no bottom nav. */
export default function ComposePostPage() {
diff --git a/apps/bull/src/app/(flow)/compose/prediction/page.tsx b/apps/bull/src/app/(flow)/compose/prediction/page.tsx
index 8eaea26..07eb10e 100644
--- a/apps/bull/src/app/(flow)/compose/prediction/page.tsx
+++ b/apps/bull/src/app/(flow)/compose/prediction/page.tsx
@@ -5,12 +5,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:composer.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:composer.title'),
+ robots: { index: false },
+};
/** «پیشبینی جدید» (J09-1): the creator's own task flow, in the browser only, with no bottom nav. */
export default function ComposePredictionPage() {
diff --git a/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx b/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx
index 098c000..38df658 100644
--- a/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx
+++ b/apps/bull/src/app/(flow)/dashboard/pricing/page.tsx
@@ -11,12 +11,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('pricing:meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('pricing:meta-title'),
+ robots: { index: false },
+};
/**
* C7, «ویرایش قیمتها» on mobile: a task page pushed from the «قیمت طرحها» card, back · title ·
diff --git a/apps/bull/src/app/(flow)/payment/result/[paymentId]/page.tsx b/apps/bull/src/app/(flow)/payment/result/[paymentId]/page.tsx
index fcf0168..e068fb2 100644
--- a/apps/bull/src/app/(flow)/payment/result/[paymentId]/page.tsx
+++ b/apps/bull/src/app/(flow)/payment/result/[paymentId]/page.tsx
@@ -12,12 +12,10 @@ import { i18n } from '../../../../../i18n';
type PaymentResultPageProps = { params: Promise<{ paymentId: string }> };
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:result.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:result.meta-title'),
+ robots: { index: false },
+};
/**
* «نتیجه پرداخت» (U10 ۹.۱–۹.۳): back, the name and support, the investor's own payment in the
diff --git a/apps/bull/src/app/(flow)/payment/return/page.tsx b/apps/bull/src/app/(flow)/payment/return/page.tsx
index fd8e32a..02c1a67 100644
--- a/apps/bull/src/app/(flow)/payment/return/page.tsx
+++ b/apps/bull/src/app/(flow)/payment/return/page.tsx
@@ -10,12 +10,10 @@ type PaymentReturnPageProps = {
searchParams: Promise<{ paymentId?: string | string[] }>;
};
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('payment:confirm.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('payment:confirm.meta-title'),
+ robots: { index: false },
+};
/**
* Back from the bank (U10 ۱.۱): «در حال تأیید پرداخت...» while the payment settles, then its
diff --git a/apps/bull/src/app/(flow)/terms/subscription/page.tsx b/apps/bull/src/app/(flow)/terms/subscription/page.tsx
index ae716f1..d665c38 100644
--- a/apps/bull/src/app/(flow)/terms/subscription/page.tsx
+++ b/apps/bull/src/app/(flow)/terms/subscription/page.tsx
@@ -1,3 +1,7 @@
+// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
+// adds to i18n when this module loads, whichever module Next loads first (0055).
+import '../../../../bootstrap/bootstrap.server';
+
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { MobileTopBar } from '@lumina/market/app/navigation';
import {
@@ -10,12 +14,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('terms:meta-title'),
- description: i18n.t('terms:meta-description'),
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('terms:meta-title'),
+ description: i18n.t('terms:meta-description'),
+};
/**
* «شرایط اشتراک» on mobile (S5 ۱.۱): a task page pushed from checkout, a suspended card or the
diff --git a/apps/bull/src/app/(landing)/page.tsx b/apps/bull/src/app/(landing)/page.tsx
index 3b522af..827eff4 100644
--- a/apps/bull/src/app/(landing)/page.tsx
+++ b/apps/bull/src/app/(landing)/page.tsx
@@ -1,3 +1,7 @@
+// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
+// adds to i18n when this module loads, whichever module Next loads first (0055).
+import '../../bootstrap/bootstrap.server';
+
import { Element } from '@lumina/island/primitives/element';
import { LandingRedirect } from '@lumina/market/app/guards/landing-redirect';
import { faqEntries } from '@lumina/market/app/screens/(landing)/organisms/landing-faq';
@@ -22,12 +26,10 @@ import { i18n } from '../../i18n';
export const dynamic = 'force-static';
export const revalidate = 600;
-export function generateMetadata(): Metadata {
- return landingMetadata({
- title: i18n.t('landing:meta.title'),
- description: i18n.t('landing:hero.lead'),
- });
-}
+export const metadata: Metadata = landingMetadata({
+ title: i18n.t('landing:meta.title'),
+ description: i18n.t('landing:hero.lead'),
+});
/**
* The landing, `/`: what Lumina is, for a signed-out visitor, and the way to registration. A
diff --git a/apps/bull/src/app/(main)/account/install/loading.tsx b/apps/bull/src/app/(main)/account/install/loading.tsx
index e978e08..578ae00 100644
--- a/apps/bull/src/app/(main)/account/install/loading.tsx
+++ b/apps/bull/src/app/(main)/account/install/loading.tsx
@@ -11,6 +11,7 @@ export default function Loading() {
};
+// The one kind of route whose metadata names its data (0055): it reads through the same per-request
+// cache as the page, so the first byte, held for the metadata in (0054), waits for that
+// one read.
export async function generateMetadata({
params,
}: ChannelPageProps): Promise {
diff --git a/apps/bull/src/app/(main)/channels/[username]/posts/[id]/page.tsx b/apps/bull/src/app/(main)/channels/[username]/posts/[id]/page.tsx
index 27c5955..c6b7946 100644
--- a/apps/bull/src/app/(main)/channels/[username]/posts/[id]/page.tsx
+++ b/apps/bull/src/app/(main)/channels/[username]/posts/[id]/page.tsx
@@ -33,6 +33,9 @@ async function readPostPage(username: string, id: string) {
return { channel: channel.data, post: found };
}
+// The one kind of route whose metadata names its data (0055): it reads through the same per-request
+// cache as the page, so the first byte, held for the metadata in (0054), waits for that
+// one read.
export async function generateMetadata({
params,
}: PostPageProps): Promise {
diff --git a/apps/bull/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx b/apps/bull/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
index bcaedaf..9d69ac6 100644
--- a/apps/bull/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
+++ b/apps/bull/src/app/(main)/channels/[username]/posts/[id]/templates/post-template/PostTemplate.tsx
@@ -28,6 +28,7 @@ export function PostTemplate({
title={t('top-bar.post')}
previewTitle={i18n.t('content:preview.title')}
parentHref={ROUTES.channel(channel.username)}
+ backToPrevious
/>
{channel.suspended ? (
diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx
index c0cc84a..43c658c 100644
--- a/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(creator)/finance/page.tsx
@@ -21,12 +21,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:finance.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:finance.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › مالی (brief §4; C19, C20), in this order, 16px apart: when payouts are made (the same
diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx
index 447cf64..1357868 100644
--- a/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(creator)/plans/page.tsx
@@ -19,12 +19,10 @@ import { Suspense } from 'react';
import { clientEnv } from '../../../../../env';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:plans.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:plans.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › طرحهای اشتراک (J10-1): «قیمت طرحها», «کد دعوت» (only once approved) and «مخاطبان»,
diff --git a/apps/bull/src/app/(main)/dashboard/(creator)/predictions/page.tsx b/apps/bull/src/app/(main)/dashboard/(creator)/predictions/page.tsx
index 7ba0095..a6208b0 100644
--- a/apps/bull/src/app/(main)/dashboard/(creator)/predictions/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(creator)/predictions/page.tsx
@@ -7,12 +7,10 @@ import type { Metadata } from 'next';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:tab.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:tab.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › پیشبینیها (J10-3): the creator's record, open and recently closed predictions, in the
diff --git a/apps/bull/src/app/(main)/dashboard/(investor)/following/page.tsx b/apps/bull/src/app/(main)/dashboard/(investor)/following/page.tsx
index 59978d3..41a5c7e 100644
--- a/apps/bull/src/app/(main)/dashboard/(investor)/following/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(investor)/following/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:following.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:following.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › دنبالشدهها (U8 §۴): the investor's own list, in the browser only, behind rows of the
diff --git a/apps/bull/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx b/apps/bull/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
index 6e39939..c601770 100644
--- a/apps/bull/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:subscriptions.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:subscriptions.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › اشتراکها (U2, U11): the investor's own subscriptions, in the browser only, behind
diff --git a/apps/bull/src/app/(main)/dashboard/(investor)/transactions/page.tsx b/apps/bull/src/app/(main)/dashboard/(investor)/transactions/page.tsx
index 41ff9c1..57caf1a 100644
--- a/apps/bull/src/app/(main)/dashboard/(investor)/transactions/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/(investor)/transactions/page.tsx
@@ -7,12 +7,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('dashboard:transactions.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('dashboard:transactions.meta-title'),
+ robots: { index: false },
+};
/**
* داشبورد › تراکنشها (U4): the investor's own payments, in the browser only, behind rows of the
diff --git a/apps/bull/src/app/(main)/dashboard/predictions/all/page.tsx b/apps/bull/src/app/(main)/dashboard/predictions/all/page.tsx
index 1695216..dd58d31 100644
--- a/apps/bull/src/app/(main)/dashboard/predictions/all/page.tsx
+++ b/apps/bull/src/app/(main)/dashboard/predictions/all/page.tsx
@@ -11,12 +11,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('predictions:list.title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('predictions:list.title'),
+ robots: { index: false },
+};
/**
* «همه پیشبینیها» on mobile (J10-3f, J10-3g): a page pushed from the پیشبینیها tab, back ·
diff --git a/apps/bull/src/app/(main)/feed/page.tsx b/apps/bull/src/app/(main)/feed/page.tsx
index 80a75fb..6bbb4d1 100644
--- a/apps/bull/src/app/(main)/feed/page.tsx
+++ b/apps/bull/src/app/(main)/feed/page.tsx
@@ -11,9 +11,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
import { HomeTemplate } from './templates/home-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('home:meta.title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('home:meta.title'),
+ robots: { index: false },
+};
/**
* خانه, `/feed`: the investor's feed of the creators they follow, under the featured analysts' row,
diff --git a/apps/bull/src/app/(main)/notifications/page.tsx b/apps/bull/src/app/(main)/notifications/page.tsx
index f28e7ab..fd61b29 100644
--- a/apps/bull/src/app/(main)/notifications/page.tsx
+++ b/apps/bull/src/app/(main)/notifications/page.tsx
@@ -9,12 +9,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('notifications:title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('notifications:title'),
+ robots: { index: false },
+};
/**
* اعلانها on mobile (U5 ۲.۱): a page pushed from the bell, back · «اعلانها» · support, with the
diff --git a/apps/bull/src/app/(main)/search/page.tsx b/apps/bull/src/app/(main)/search/page.tsx
index 901a56c..fbf7486 100644
--- a/apps/bull/src/app/(main)/search/page.tsx
+++ b/apps/bull/src/app/(main)/search/page.tsx
@@ -10,9 +10,10 @@ import { Suspense } from 'react';
import { i18n } from '../../../i18n';
import { SearchTemplate } from './templates/search-template';
-export function generateMetadata(): Metadata {
- return { title: i18n.t('home:search.title'), robots: { index: false } };
-}
+export const metadata: Metadata = {
+ title: i18n.t('home:search.title'),
+ robots: { index: false },
+};
/**
* جستجو, `/search?q=` (J04-4): an investor's analyst search, in the browser only, behind the
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
index b8f39e7..444dcf2 100644
--- a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx
@@ -10,12 +10,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.meta-title'),
+ robots: { index: false },
+};
/**
* Registration step 5 for a creator, on the session. The frame renders on the server; the step
diff --git a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
index 591f0de..2afd34f 100644
--- a/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
+++ b/apps/bull/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx
@@ -11,12 +11,10 @@ import { i18n } from '../../../../../i18n';
import { AuthTopBar } from '../../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.done.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.done.meta-title'),
+ robots: { index: false },
+};
/**
* The end of registration for a creator (R2-CompleteProfile 1.8): the brand header, as
diff --git a/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
index f32e825..cce6941 100644
--- a/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
+++ b/apps/bull/src/app/(onboarding)/onboarding/investor-profile/page.tsx
@@ -9,12 +9,10 @@ import { i18n } from '../../../../i18n';
import { AuthTopBar } from '../../../organisms/auth-top-bar';
import { AuthTemplate } from '../../../templates/auth-template';
-export function generateMetadata(): Metadata {
- return {
- title: i18n.t('auth:register.profile.meta-title'),
- robots: { index: false },
- };
-}
+export const metadata: Metadata = {
+ title: i18n.t('auth:register.profile.meta-title'),
+ robots: { index: false },
+};
/**
* Registration step 5 for an investor, optional, on the session. The frame renders on the
diff --git a/apps/bull/src/app/layout.tsx b/apps/bull/src/app/layout.tsx
index 932b144..2875759 100644
--- a/apps/bull/src/app/layout.tsx
+++ b/apps/bull/src/app/layout.tsx
@@ -4,7 +4,7 @@ import '../styles/app.css';
import { CRITICAL_FONT_URL } from '@lumina/island/constants';
import { Element } from '@lumina/island/primitives/element';
-import type { Metadata } from 'next';
+import type { Metadata, Viewport } from 'next';
import type { ReactNode } from 'react';
import { preload } from 'react-dom';
@@ -12,9 +12,15 @@ import { rootMetadata } from '../configs';
import { i18n } from '../i18n';
import { AppProviders } from './organisms/app-providers';
-export function generateMetadata(): Metadata {
- return rootMetadata();
-}
+export const metadata: Metadata = rootMetadata();
+
+// `maximumScale: 1` stops iOS Safari zooming into a focused field whose text is under 16px, such as
+// SearchField's. iOS still lets people pinch-zoom; Android Chrome doesn't (0056).
+export const viewport: Viewport = {
+ width: 'device-width',
+ initialScale: 1,
+ maximumScale: 1,
+};
export default function RootLayout({ children }: { children: ReactNode }) {
// Only the face every page renders first; the Latin face loads where شبا is shown.
diff --git a/apps/bull/src/app/manifest.ts b/apps/bull/src/app/manifest.ts
index a063dba..8bc9252 100644
--- a/apps/bull/src/app/manifest.ts
+++ b/apps/bull/src/app/manifest.ts
@@ -1,4 +1,4 @@
-import { ROUTES } from '@lumina/market/app/navigation';
+import { buildManifest } from '@lumina/market/server';
import type { MetadataRoute } from 'next';
import { i18n } from '../i18n';
@@ -6,43 +6,17 @@ import { i18n } from '../i18n';
// Every request renders fresh, as every metadata route does: nothing is cached on the server.
export const dynamic = 'force-dynamic';
-/**
- * The light theme's `--bg-page` and `--action-primary` in island `theme.css`. The manifest can't
- * read CSS variables, so a change there changes these too.
- */
-const BACKGROUND_COLOR = '#f4f6f9';
-const THEME_COLOR = '#533afd';
+// Both apps serve this same manifest (0053). Browsers fetch it without cookies, so it speaks the
+// app's one locale, and it is the same bytes until the next deploy, so it is built once, when the
+// module loads; each request only serializes it.
+const MANIFEST = buildManifest({
+ name: i18n.t('app.name'),
+ description: i18n.t('app.description'),
+ lang: i18n.language,
+ dir: i18n.dir(),
+});
-/**
- * The web app manifest, at `/manifest.webmanifest`. Browsers fetch it without cookies, so it uses
- * the app's one locale. The installed app opens on خانه, which sends a guest to login and a creator
- * to their channel, so it never flashes the landing; `id` keeps the installed app's identity if
- * `start_url` changes.
- */
+/** The web app manifest at `/manifest.webmanifest`; Next.js adds its ``. */
export default function manifest(): MetadataRoute.Manifest {
- const name = i18n.t('app.name');
- return {
- id: '/',
- name,
- short_name: name,
- description: i18n.t('app.description'),
- lang: i18n.language,
- dir: i18n.dir(),
- start_url: ROUTES.home,
- scope: '/',
- display: 'standalone',
- background_color: BACKGROUND_COLOR,
- theme_color: THEME_COLOR,
- // Placeholders until the brand mark exists; apple-icon.png beside this file covers iOS.
- icons: [
- { src: '/pwa/icon-192.png', sizes: '192x192', type: 'image/png' },
- { src: '/pwa/icon-512.png', sizes: '512x512', type: 'image/png' },
- {
- src: '/pwa/icon-maskable-512.png',
- sizes: '512x512',
- type: 'image/png',
- purpose: 'maskable',
- },
- ],
- };
+ return MANIFEST;
}