@pylonsync/react 0.3.264 → 0.3.265

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.264",
6
+ "version": "0.3.265",
7
7
  "type": "module",
8
8
  "main": "src/index.ts",
9
9
  "types": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "check": "tsc -p tsconfig.json --noEmit"
13
13
  },
14
14
  "dependencies": {
15
- "@pylonsync/sdk": "0.3.264",
16
- "@pylonsync/sync": "0.3.264"
15
+ "@pylonsync/sdk": "0.3.265",
16
+ "@pylonsync/sync": "0.3.265"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=19.0.0"
package/src/index.ts CHANGED
@@ -20,6 +20,10 @@ export type {
20
20
  SsrCookieOptions,
21
21
  Metadata,
22
22
  GenerateMetadata,
23
+ Sitemap,
24
+ SitemapEntry,
25
+ Robots,
26
+ RobotsRule,
23
27
  RouteSegmentConfig,
24
28
  ErrorBoundaryProps,
25
29
  NotFoundProps,
package/src/ssr.ts CHANGED
@@ -206,6 +206,57 @@ export type GenerateMetadata<
206
206
  props: PageProps<TParams, TSearchParams>,
207
207
  ) => Metadata | Promise<Metadata>;
208
208
 
209
+ /**
210
+ * Return type for an `app/sitemap.ts` default export (Next-shaped). The runtime
211
+ * serializes it to `/sitemap.xml`. The export may be sync or async, so it can
212
+ * enumerate dynamic pages from the DB:
213
+ *
214
+ * export default async function sitemap(): Promise<Sitemap> {
215
+ * const posts = await getPosts();
216
+ * return [{ url: "https://x.com/", priority: 1 }, ...posts.map(...)];
217
+ * }
218
+ */
219
+ export interface SitemapEntry {
220
+ url: string;
221
+ lastModified?: string | Date;
222
+ changeFrequency?:
223
+ | "always"
224
+ | "hourly"
225
+ | "daily"
226
+ | "weekly"
227
+ | "monthly"
228
+ | "yearly"
229
+ | "never";
230
+ priority?: number;
231
+ /** hreflang alternates, e.g. `{ languages: { "en-US": "https://…/en" } }`. */
232
+ alternates?: { languages?: Record<string, string> };
233
+ }
234
+ export type Sitemap = SitemapEntry[];
235
+
236
+ export interface RobotsRule {
237
+ userAgent?: string | string[];
238
+ allow?: string | string[];
239
+ disallow?: string | string[];
240
+ crawlDelay?: number;
241
+ }
242
+
243
+ /**
244
+ * Return type for an `app/robots.ts` default export (Next-shaped). The runtime
245
+ * serializes it to `/robots.txt`.
246
+ *
247
+ * export default function robots(): Robots {
248
+ * return {
249
+ * rules: { userAgent: "*", allow: "/", disallow: "/admin" },
250
+ * sitemap: "https://x.com/sitemap.xml",
251
+ * };
252
+ * }
253
+ */
254
+ export interface Robots {
255
+ rules: RobotsRule | RobotsRule[];
256
+ sitemap?: string | string[];
257
+ host?: string;
258
+ }
259
+
209
260
  /**
210
261
  * Per-route configuration, declared as top-level `export const` in a
211
262
  * `page.tsx` (Next-shaped). All optional. The runtime reads these statically