@btst/stack 1.3.0 → 1.3.1

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.
Files changed (28) hide show
  1. package/dist/packages/better-stack/src/plugins/blog/api/plugin.cjs +8 -2
  2. package/dist/packages/better-stack/src/plugins/blog/api/plugin.mjs +8 -2
  3. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +1 -1
  4. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +1 -1
  5. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/on-this-page.cjs +1 -1
  6. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/on-this-page.mjs +1 -1
  7. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.cjs +2 -2
  8. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.mjs +2 -2
  9. package/dist/plugins/blog/api/index.d.cts +1 -1
  10. package/dist/plugins/blog/api/index.d.mts +1 -1
  11. package/dist/plugins/blog/api/index.d.ts +1 -1
  12. package/dist/plugins/blog/client/hooks/index.d.cts +4 -4
  13. package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
  14. package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
  15. package/dist/plugins/blog/client/index.d.cts +1 -1
  16. package/dist/plugins/blog/client/index.d.mts +1 -1
  17. package/dist/plugins/blog/client/index.d.ts +1 -1
  18. package/dist/plugins/blog/query-keys.d.cts +8 -8
  19. package/dist/plugins/blog/query-keys.d.mts +8 -8
  20. package/dist/plugins/blog/query-keys.d.ts +8 -8
  21. package/package.json +3 -3
  22. package/src/plugins/blog/api/plugin.ts +10 -4
  23. package/src/plugins/blog/client/components/pages/post-page.internal.tsx +1 -1
  24. package/src/plugins/blog/client/components/shared/on-this-page.tsx +1 -1
  25. package/src/plugins/blog/client/components/shared/recent-posts-carousel.tsx +2 -2
  26. package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CbuN2zVV.d.cts} +4 -4
  27. package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CbuN2zVV.d.mts} +4 -4
  28. package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CbuN2zVV.d.ts} +4 -4
@@ -181,7 +181,10 @@ const blogBackendPlugin = (hooks) => api.defineBackendPlugin({
181
181
  }
182
182
  }
183
183
  let result = posts.map((post) => {
184
- const postTags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
184
+ const postTags = (post.postTag || []).map((pt) => {
185
+ const tag = tagMap.get(pt.tagId);
186
+ return tag ? { ...tag } : void 0;
187
+ }).filter((tag) => tag !== void 0);
185
188
  const { postTag: _, ...postWithoutJoin } = post;
186
189
  return {
187
190
  ...postWithoutJoin,
@@ -505,7 +508,10 @@ const blogBackendPlugin = (hooks) => api.defineBackendPlugin({
505
508
  }
506
509
  }
507
510
  const mapPostWithTags = (post) => {
508
- const tags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
511
+ const tags = (post.postTag || []).map((pt) => {
512
+ const tag = tagMap.get(pt.tagId);
513
+ return tag ? { ...tag } : void 0;
514
+ }).filter((tag) => tag !== void 0);
509
515
  const { postTag: _, ...postWithoutJoin } = post;
510
516
  return {
511
517
  ...postWithoutJoin,
@@ -179,7 +179,10 @@ const blogBackendPlugin = (hooks) => defineBackendPlugin({
179
179
  }
180
180
  }
181
181
  let result = posts.map((post) => {
182
- const postTags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
182
+ const postTags = (post.postTag || []).map((pt) => {
183
+ const tag = tagMap.get(pt.tagId);
184
+ return tag ? { ...tag } : void 0;
185
+ }).filter((tag) => tag !== void 0);
183
186
  const { postTag: _, ...postWithoutJoin } = post;
184
187
  return {
185
188
  ...postWithoutJoin,
@@ -503,7 +506,10 @@ const blogBackendPlugin = (hooks) => defineBackendPlugin({
503
506
  }
504
507
  }
505
508
  const mapPostWithTags = (post) => {
506
- const tags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
509
+ const tags = (post.postTag || []).map((pt) => {
510
+ const tag = tagMap.get(pt.tagId);
511
+ return tag ? { ...tag } : void 0;
512
+ }).filter((tag) => tag !== void 0);
507
513
  const { postTag: _, ...postWithoutJoin } = post;
508
514
  return {
509
515
  ...postWithoutJoin,
@@ -51,7 +51,7 @@ function PostPage({ slug }) {
51
51
  if (!slug || !post) {
52
52
  return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(emptyList.EmptyList, { message: localization.BLOG_PAGE_NOT_FOUND_DESCRIPTION }) });
53
53
  }
54
- return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { className: "gap-0 px-4 lg:px-4 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start w-full", children: [
54
+ return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { className: "gap-0 px-4 lg:px-2 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start w-full", children: [
55
55
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-44 shrink-0 hidden xl:flex mr-auto" }),
56
56
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center flex-1 mx-auto w-full max-w-4xl min-w-0", children: [
57
57
  /* @__PURE__ */ jsxRuntime.jsx(onThisPage.OnThisPageSelect, { markdown: post.content }),
@@ -49,7 +49,7 @@ function PostPage({ slug }) {
49
49
  if (!slug || !post) {
50
50
  return /* @__PURE__ */ jsx(PageWrapper, { children: /* @__PURE__ */ jsx(EmptyList, { message: localization.BLOG_PAGE_NOT_FOUND_DESCRIPTION }) });
51
51
  }
52
- return /* @__PURE__ */ jsx(PageWrapper, { className: "gap-0 px-4 lg:px-4 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start w-full", children: [
52
+ return /* @__PURE__ */ jsx(PageWrapper, { className: "gap-0 px-4 lg:px-2 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start w-full", children: [
53
53
  /* @__PURE__ */ jsx("div", { className: "w-44 shrink-0 hidden xl:flex mr-auto" }),
54
54
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center flex-1 mx-auto w-full max-w-4xl min-w-0", children: [
55
55
  /* @__PURE__ */ jsx(OnThisPageSelect, { markdown: post.content }),
@@ -40,7 +40,7 @@ function OnThisPage({ markdown, className }) {
40
40
  className
41
41
  ),
42
42
  "aria-label": "Table of contents",
43
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto px-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 p-4 pt-0 text-sm", children: [
43
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto px-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 p-2 pt-0 text-sm", children: [
44
44
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 font-semibold text-muted-foreground sticky top-0 h-6 text-xs", children: [
45
45
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TextAlignStart, { className: "w-3 h-3" }),
46
46
  " ",
@@ -38,7 +38,7 @@ function OnThisPage({ markdown, className }) {
38
38
  className
39
39
  ),
40
40
  "aria-label": "Table of contents",
41
- children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto px-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 p-4 pt-0 text-sm", children: [
41
+ children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto px-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 p-2 pt-0 text-sm", children: [
42
42
  /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 font-semibold text-muted-foreground sticky top-0 h-6 text-xs", children: [
43
43
  /* @__PURE__ */ jsx(TextAlignStart, { className: "w-3 h-3" }),
44
44
  " ",
@@ -47,8 +47,8 @@ function RecentPostsCarousel({ posts, ref }) {
47
47
  },
48
48
  post.id
49
49
  )) }),
50
- /* @__PURE__ */ jsxRuntime.jsx(carousel.CarouselPrevious, { className: "-left-4 lg:-left-12 hover:cursor-pointer" }),
51
- /* @__PURE__ */ jsxRuntime.jsx(carousel.CarouselNext, { className: "-right-4 lg:-right-12 hover:cursor-pointer" })
50
+ /* @__PURE__ */ jsxRuntime.jsx(carousel.CarouselPrevious, { className: "-left-4 z-50 hover:cursor-pointer" }),
51
+ /* @__PURE__ */ jsxRuntime.jsx(carousel.CarouselNext, { className: "-right-4 z-50 hover:cursor-pointer" })
52
52
  ]
53
53
  }
54
54
  ) })
@@ -45,8 +45,8 @@ function RecentPostsCarousel({ posts, ref }) {
45
45
  },
46
46
  post.id
47
47
  )) }),
48
- /* @__PURE__ */ jsx(CarouselPrevious, { className: "-left-4 lg:-left-12 hover:cursor-pointer" }),
49
- /* @__PURE__ */ jsx(CarouselNext, { className: "-right-4 lg:-right-12 hover:cursor-pointer" })
48
+ /* @__PURE__ */ jsx(CarouselPrevious, { className: "-left-4 z-50 hover:cursor-pointer" }),
49
+ /* @__PURE__ */ jsx(CarouselNext, { className: "-right-4 z-50 hover:cursor-pointer" })
50
50
  ]
51
51
  }
52
52
  ) })
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.cjs';
5
+ import '../../../shared/stack.CbuN2zVV.cjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.mjs';
5
+ import '../../../shared/stack.CbuN2zVV.mjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.js';
5
+ import '../../../shared/stack.CbuN2zVV.js';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.cjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CbuN2zVV.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -129,9 +129,9 @@ declare function useSuspenseTags(): {
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
131
  title: string;
132
- published: boolean;
133
132
  content: string;
134
133
  excerpt: string;
134
+ published: boolean;
135
135
  tags: ({
136
136
  name: string;
137
137
  } | {
@@ -140,10 +140,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
140
140
  slug: string;
141
141
  })[];
142
142
  slug?: string | undefined;
143
- createdAt?: Date | undefined;
144
- image?: string | undefined;
145
143
  publishedAt?: Date | undefined;
144
+ createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.mjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CbuN2zVV.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -129,9 +129,9 @@ declare function useSuspenseTags(): {
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
131
  title: string;
132
- published: boolean;
133
132
  content: string;
134
133
  excerpt: string;
134
+ published: boolean;
135
135
  tags: ({
136
136
  name: string;
137
137
  } | {
@@ -140,10 +140,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
140
140
  slug: string;
141
141
  })[];
142
142
  slug?: string | undefined;
143
- createdAt?: Date | undefined;
144
- image?: string | undefined;
145
143
  publishedAt?: Date | undefined;
144
+ createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.js';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CbuN2zVV.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -129,9 +129,9 @@ declare function useSuspenseTags(): {
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
131
  title: string;
132
- published: boolean;
133
132
  content: string;
134
133
  excerpt: string;
134
+ published: boolean;
135
135
  tags: ({
136
136
  name: string;
137
137
  } | {
@@ -140,10 +140,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
140
140
  slug: string;
141
141
  })[];
142
142
  slug?: string | undefined;
143
- createdAt?: Date | undefined;
144
- image?: string | undefined;
145
143
  publishedAt?: Date | undefined;
144
+ createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.cjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CbuN2zVV.cjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.mjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CbuN2zVV.mjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.js';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CbuN2zVV.js';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
8
8
  import 'zod';
9
9
 
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.cjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.cjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -197,9 +197,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
197
197
  content: string;
198
198
  excerpt: string;
199
199
  slug?: string | undefined;
200
- published?: boolean | undefined;
200
+ publishedAt?: unknown;
201
201
  createdAt?: unknown;
202
+ updatedAt?: unknown;
202
203
  image?: string | undefined;
204
+ published?: boolean | undefined;
203
205
  tags?: ({
204
206
  name: string;
205
207
  } | {
@@ -207,8 +209,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
207
209
  name: string;
208
210
  slug: string;
209
211
  })[] | undefined;
210
- publishedAt?: unknown;
211
- updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -235,13 +235,15 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
235
235
  options: {
236
236
  method: "POST";
237
237
  body: z.ZodObject<{
238
- title: z.ZodString;
239
238
  slug: z.ZodOptional<z.ZodString>;
240
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
239
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
240
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
+ title: z.ZodString;
242
243
  content: z.ZodString;
243
244
  excerpt: z.ZodString;
244
245
  image: z.ZodOptional<z.ZodString>;
246
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
245
247
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
246
248
  name: z.ZodString;
247
249
  }, z.core.$strip>, z.ZodObject<{
@@ -249,8 +251,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
249
251
  name: z.ZodString;
250
252
  slug: z.ZodString;
251
253
  }, z.core.$strip>]>>>>;
252
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.mjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.mjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -197,9 +197,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
197
197
  content: string;
198
198
  excerpt: string;
199
199
  slug?: string | undefined;
200
- published?: boolean | undefined;
200
+ publishedAt?: unknown;
201
201
  createdAt?: unknown;
202
+ updatedAt?: unknown;
202
203
  image?: string | undefined;
204
+ published?: boolean | undefined;
203
205
  tags?: ({
204
206
  name: string;
205
207
  } | {
@@ -207,8 +209,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
207
209
  name: string;
208
210
  slug: string;
209
211
  })[] | undefined;
210
- publishedAt?: unknown;
211
- updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -235,13 +235,15 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
235
235
  options: {
236
236
  method: "POST";
237
237
  body: z.ZodObject<{
238
- title: z.ZodString;
239
238
  slug: z.ZodOptional<z.ZodString>;
240
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
239
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
240
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
+ title: z.ZodString;
242
243
  content: z.ZodString;
243
244
  excerpt: z.ZodString;
244
245
  image: z.ZodOptional<z.ZodString>;
246
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
245
247
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
246
248
  name: z.ZodString;
247
249
  }, z.core.$strip>, z.ZodObject<{
@@ -249,8 +251,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
249
251
  name: z.ZodString;
250
252
  slug: z.ZodString;
251
253
  }, z.core.$strip>]>>>>;
252
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.js';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.js';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -197,9 +197,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
197
197
  content: string;
198
198
  excerpt: string;
199
199
  slug?: string | undefined;
200
- published?: boolean | undefined;
200
+ publishedAt?: unknown;
201
201
  createdAt?: unknown;
202
+ updatedAt?: unknown;
202
203
  image?: string | undefined;
204
+ published?: boolean | undefined;
203
205
  tags?: ({
204
206
  name: string;
205
207
  } | {
@@ -207,8 +209,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
207
209
  name: string;
208
210
  slug: string;
209
211
  })[] | undefined;
210
- publishedAt?: unknown;
211
- updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -235,13 +235,15 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
235
235
  options: {
236
236
  method: "POST";
237
237
  body: z.ZodObject<{
238
- title: z.ZodString;
239
238
  slug: z.ZodOptional<z.ZodString>;
240
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
239
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
240
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
241
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
+ title: z.ZodString;
242
243
  content: z.ZodString;
243
244
  excerpt: z.ZodString;
244
245
  image: z.ZodOptional<z.ZodString>;
246
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
245
247
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
246
248
  name: z.ZodString;
247
249
  }, z.core.$strip>, z.ZodObject<{
@@ -249,8 +251,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
249
251
  name: z.ZodString;
250
252
  slug: z.ZodString;
251
253
  }, z.core.$strip>]>>>>;
252
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btst/stack",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A composable, plugin-based library for building full-stack applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -157,7 +157,7 @@
157
157
  }
158
158
  },
159
159
  "dependencies": {
160
- "@btst/db": "2.0.2",
160
+ "@btst/db": "2.0.3",
161
161
  "@lukemorales/query-key-factory": "^1.3.4",
162
162
  "@milkdown/crepe": "^7.17.1",
163
163
  "@milkdown/kit": "^7.17.1",
@@ -196,7 +196,7 @@
196
196
  "zod": ">=3.24.0"
197
197
  },
198
198
  "devDependencies": {
199
- "@btst/adapter-memory": "2.0.2",
199
+ "@btst/adapter-memory": "2.0.3",
200
200
  "@btst/yar": "1.1.1",
201
201
  "@types/react": "^19.0.0",
202
202
  "@types/slug": "^5.0.9",
@@ -360,10 +360,13 @@ export const blogBackendPlugin = (hooks?: BlogBackendHooks) =>
360
360
  }
361
361
  }
362
362
 
363
- // Map tags to posts
363
+ // Map tags to posts (spread to avoid circular references)
364
364
  let result = posts.map((post) => {
365
365
  const postTags = (post.postTag || [])
366
- .map((pt) => tagMap.get(pt.tagId))
366
+ .map((pt) => {
367
+ const tag = tagMap.get(pt.tagId);
368
+ return tag ? { ...tag } : undefined;
369
+ })
367
370
  .filter((tag): tag is Tag => tag !== undefined);
368
371
  const { postTag: _, ...postWithoutJoin } = post;
369
372
  return {
@@ -739,10 +742,13 @@ export const blogBackendPlugin = (hooks?: BlogBackendHooks) =>
739
742
  }
740
743
  }
741
744
 
742
- // Helper to map post with tags
745
+ // Helper to map post with tags (spread to avoid circular references)
743
746
  const mapPostWithTags = (post: PostWithPostTag) => {
744
747
  const tags = (post.postTag || [])
745
- .map((pt) => tagMap.get(pt.tagId))
748
+ .map((pt) => {
749
+ const tag = tagMap.get(pt.tagId);
750
+ return tag ? { ...tag } : undefined;
751
+ })
746
752
  .filter((tag): tag is Tag => tag !== undefined);
747
753
  const { postTag: _, ...postWithoutJoin } = post;
748
754
  return {
@@ -71,7 +71,7 @@ export function PostPage({ slug }: { slug: string }) {
71
71
  }
72
72
 
73
73
  return (
74
- <PageWrapper className="gap-0 px-4 lg:px-4 py-0 pb-18" testId="post-page">
74
+ <PageWrapper className="gap-0 px-4 lg:px-2 py-0 pb-18" testId="post-page">
75
75
  <div className="flex items-start w-full">
76
76
  <div className="w-44 shrink-0 hidden xl:flex mr-auto" />
77
77
  <div className="flex flex-col items-center flex-1 mx-auto w-full max-w-4xl min-w-0">
@@ -63,7 +63,7 @@ export function OnThisPage({ markdown, className }: OnThisPageProps) {
63
63
  aria-label="Table of contents"
64
64
  >
65
65
  <div className="overflow-y-auto px-2">
66
- <div className="flex flex-col gap-1 p-4 pt-0 text-sm">
66
+ <div className="flex flex-col gap-1 p-2 pt-0 text-sm">
67
67
  <p className="flex items-center gap-2 font-semibold text-muted-foreground sticky top-0 h-6 text-xs">
68
68
  <TextAlignStart className="w-3 h-3" />{" "}
69
69
  {localization.BLOG_POST_ON_THIS_PAGE}
@@ -68,8 +68,8 @@ export function RecentPostsCarousel({ posts, ref }: RecentPostsCarouselProps) {
68
68
  </CarouselItem>
69
69
  ))}
70
70
  </CarouselContent>
71
- <CarouselPrevious className="-left-4 lg:-left-12 hover:cursor-pointer" />
72
- <CarouselNext className="-right-4 lg:-right-12 hover:cursor-pointer" />
71
+ <CarouselPrevious className="-left-4 z-50 hover:cursor-pointer" />
72
+ <CarouselNext className="-right-4 z-50 hover:cursor-pointer" />
73
73
  </Carousel>
74
74
  </div>
75
75
  </>
@@ -35,13 +35,15 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
39
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
+ title: z.ZodString;
42
43
  content: z.ZodString;
43
44
  excerpt: z.ZodString;
44
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
45
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
46
48
  name: z.ZodString;
47
49
  }, z.core.$strip>, z.ZodObject<{
@@ -49,8 +51,6 @@ declare const createPostSchema: z.ZodObject<{
49
51
  name: z.ZodString;
50
52
  slug: z.ZodString;
51
53
  }, z.core.$strip>]>>>>;
52
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
53
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -35,13 +35,15 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
39
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
+ title: z.ZodString;
42
43
  content: z.ZodString;
43
44
  excerpt: z.ZodString;
44
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
45
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
46
48
  name: z.ZodString;
47
49
  }, z.core.$strip>, z.ZodObject<{
@@ -49,8 +51,6 @@ declare const createPostSchema: z.ZodObject<{
49
51
  name: z.ZodString;
50
52
  slug: z.ZodString;
51
53
  }, z.core.$strip>]>>>>;
52
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
53
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -35,13 +35,15 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
39
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
+ title: z.ZodString;
42
43
  content: z.ZodString;
43
44
  excerpt: z.ZodString;
44
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
45
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
46
48
  name: z.ZodString;
47
49
  }, z.core.$strip>, z.ZodObject<{
@@ -49,8 +51,6 @@ declare const createPostSchema: z.ZodObject<{
49
51
  name: z.ZodString;
50
52
  slug: z.ZodString;
51
53
  }, z.core.$strip>]>>>>;
52
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
53
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;