Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ded2775
feat: comments plugin
olliethedev Mar 12, 2026
0f77db8
fix: various implementation issues
olliethedev Mar 13, 2026
8cc2e9d
build: update lock file
olliethedev Mar 13, 2026
9834da0
refactor: implement transaction handling for comment like toggling to…
olliethedev Mar 13, 2026
b752ec1
fix: ensure default status is "approved" for comments to prevent unau…
olliethedev Mar 13, 2026
8661202
fix: set default comment status to "approved" to prevent unauthorized…
olliethedev Mar 13, 2026
5669680
fix: require onBeforePost hook in comments plugin to enhance security…
olliethedev Mar 13, 2026
1da7113
docs: add comments feature description to README
olliethedev Mar 13, 2026
b08774f
chore: update stack package version
olliethedev Mar 13, 2026
1979b37
fix: update comments plugin to derive authorId from session in onBefo…
olliethedev Mar 13, 2026
2802886
fix: enhance comment list key computation for optimistic updates by n…
olliethedev Mar 13, 2026
42233ca
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
2dfbbe3
feat: add loading skeleton components for post navigation and recent …
olliethedev Mar 13, 2026
b42141a
fix: update onBeforeList hook documentation and implementation to cla…
olliethedev Mar 13, 2026
13fee34
chore: update registry
olliethedev Mar 13, 2026
cb5abf5
feat: import loading skeleton components for improved post page rende…
olliethedev Mar 13, 2026
a4a2acd
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
3cc343e
feat: add replyCount to comments for tracking approved replies and en…
olliethedev Mar 13, 2026
1a5992e
feat: add comments section to blog posts in layout components for enh…
olliethedev Mar 13, 2026
02f7bd4
fix: enhance access control in onBeforeList hook to restrict non-appr…
olliethedev Mar 13, 2026
2069c1e
feat: add PATCH method support and currentUserId prop to layout compo…
olliethedev Mar 13, 2026
83784b4
feat: add PATCH method support to request handlers for improved API f…
olliethedev Mar 13, 2026
27e3f91
feat: install shadcn CLI locally to prevent npx cache issues and ensu…
olliethedev Mar 13, 2026
e37affb
feat: enhance optimistic comment handling in usePostComment hook to m…
olliethedev Mar 13, 2026
e879dad
fix: specify shadcn CLI version in test-registry script to ensure con…
olliethedev Mar 13, 2026
acce3aa
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
574b0ed
fix: resolve issues with comment posting and retrieval by ensuring PO…
olliethedev Mar 13, 2026
3b9919f
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
2e70ab5
feat: implement tests for visibility of own pending comments and repl…
olliethedev Mar 13, 2026
fdd0295
feat: enhance comment retrieval logic, reply count, and page layout
olliethedev Mar 13, 2026
a167ffd
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
5c093ec
feat: add My Comments page functionality with author-specific comment…
olliethedev Mar 13, 2026
75b8433
fix: update promise handling in useResolvedCurrentUserId to ensure pr…
olliethedev Mar 13, 2026
d6ed28e
feat: add user-specific comment handling and resource links in layout…
olliethedev Mar 13, 2026
1c93827
fix: update resourceLinks example in comments plugin documentation fo…
olliethedev Mar 13, 2026
d3cabd9
feat: add author-specific access control for comment listing to enhan…
olliethedev Mar 13, 2026
a4a5a48
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 13, 2026
b752994
feat: enhance comment handling by adding spam and approval status ind…
olliethedev Mar 13, 2026
dfb9f92
feat: add localization support for comments plugin, enhancing UI text…
olliethedev Mar 13, 2026
069d9f3
fix: handle null parentId in comments queries to ensure proper query …
olliethedev Mar 13, 2026
a6335af
feat: implement infinite scrolling for comments with pagination suppo…
olliethedev Mar 13, 2026
b29134b
feat: implement load more comments functionality with pagination supp…
olliethedev Mar 14, 2026
889076a
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 14, 2026
219234f
feat: add onBeforeEdit hook for comment editing to enforce ownership …
olliethedev Mar 14, 2026
bfd236e
feat: add resolveCurrentUserId hook to comments plugin for secure use…
olliethedev Mar 14, 2026
9ba9026
feat: invalidate comments thread cache on comment approval and status…
olliethedev Mar 14, 2026
67d4256
feat: update resolveCurrentUserId to echo client-supplied currentUser…
olliethedev Mar 14, 2026
5e90f9f
fix: update resource URL construction in my-comments-page to include …
olliethedev Mar 14, 2026
a8041b2
feat: optimize comment listing by merging approved and pending commen…
olliethedev Mar 14, 2026
62476ed
feat: return fully serialized comment after update to ensure client r…
olliethedev Mar 14, 2026
0c8492f
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 14, 2026
7318516
refactor: update comments API to prevent client-supplied currentUserI…
olliethedev Mar 14, 2026
be5baad
refactor: extract utility functions for error handling and initials g…
olliethedev Mar 14, 2026
14fb748
fix: ensure total count in comments pagination updates correctly afte…
olliethedev Mar 14, 2026
89c3067
refactor: update resolveCurrentUserId to derive user ID from request …
olliethedev Mar 14, 2026
16f4b15
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 14, 2026
f9ca672
refactor: streamline comment testing by creating blog posts directly …
olliethedev Mar 14, 2026
6dd14e7
feat: add support for running E2E tests for individual frameworks, en…
olliethedev Mar 14, 2026
15de11e
feat: enhance comments plugin by adding loginHref for unauthenticated…
olliethedev Mar 14, 2026
dd05313
feat: add new E2E smoke test configurations for Next.js, TanStack, an…
olliethedev Mar 14, 2026
67483fb
feat: add data-testid attribute to comment form for improved testing …
olliethedev Mar 14, 2026
7b11f4c
test: removed unauthed placeholder test
olliethedev Mar 14, 2026
9cd9351
chore: update Next.js version to 16.1.6 and add experimental turbopac…
olliethedev Mar 16, 2026
cb809b7
test: remove redundant pending comment badge test to streamline E2E t…
olliethedev Mar 16, 2026
ebab389
refactor: simplify comment query authorization logic and improve erro…
olliethedev Mar 16, 2026
0dc37e1
feat: enhance comment thread UI with toggle button for replies and up…
olliethedev Mar 16, 2026
dbb9f82
feat: implement useResolvedCurrentUserId hook for dynamic user ID res…
olliethedev Mar 16, 2026
b1f6f97
feat: add pageSize parameter to usePostComment for optimized infinite…
olliethedev Mar 16, 2026
5c37284
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 16, 2026
914a0f3
fix: improve error handling in usePostComment by ensuring context is …
olliethedev Mar 16, 2026
1a23df7
test: remove redundant regression test for posting comments via UI to…
olliethedev Mar 16, 2026
cc7631f
fix: update resolveCurrentUserId to return hardcoded user ID for demo…
olliethedev Mar 16, 2026
6ed18a2
feat: implement pagination and moderation-specific comment fetching i…
olliethedev Mar 16, 2026
8d8860a
feat: enhance deleteComment function to cascade deletion of child rep…
olliethedev Mar 16, 2026
24af61a
refactor: update comments fetching logic to utilize x-user-id header …
olliethedev Mar 16, 2026
31d1eb5
fix: ensure safe access to headers in x-user-id retrieval for user au…
olliethedev Mar 16, 2026
b133656
feat: add onBeforeEdit hook to handle comment editing with authentica…
olliethedev Mar 16, 2026
912820c
refactor: remove editable prop from task description input in TaskFor…
olliethedev Mar 16, 2026
4048abc
refactor: update blog hooks to include authentication checks and impr…
olliethedev Mar 16, 2026
943b040
fix: pin tiptap dep for test-registry script as their latest release …
olliethedev Mar 16, 2026
5361259
refactor: add wait helper function and update tiptap package pinning …
olliethedev Mar 16, 2026
8a4db49
refactor: rename wait function to pause for clarity in test-registry …
olliethedev Mar 16, 2026
4fc00a0
fix: add error handling for user ID resolution in useResolvedCurrentU…
olliethedev Mar 16, 2026
46fb4f2
fix: add error handling for comment retrieval in commentsBackendPlugi…
olliethedev Mar 16, 2026
49080bb
chore: update shadcn registry [skip ci]
github-actions[bot] Mar 16, 2026
1079a4b
feat: add headers for user identification in layout components across…
olliethedev Mar 16, 2026
1e12fe4
feat: enhance comments plugin with configurable posting and editing o…
olliethedev Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@ on:

jobs:
e2e:
name: E2E (${{ matrix.framework }})
runs-on: ubuntu-latest
concurrency:
group: e2e-${{ github.ref }}
group: e2e-${{ matrix.framework }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NODE_OPTIONS: --max-old-space-size=8192

strategy:
fail-fast: false
matrix:
framework: [nextjs, tanstack, react-router]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v4


- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -42,23 +47,23 @@ jobs:
- name: Build workspace
run: pnpm -w build

- name: Run Playwright smoke tests
run: pnpm e2e:smoke
- name: Run Playwright smoke tests (${{ matrix.framework }})
run: pnpm e2e:smoke:${{ matrix.framework }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
name: playwright-report-${{ matrix.framework }}
path: e2e/playwright-report
if-no-files-found: ignore

- name: Upload traces
if: failure()
uses: actions/upload-artifact@v4
with:
name: traces
name: traces-${{ matrix.framework }}
path: test-results/**/*.zip
if-no-files-found: ignore
9 changes: 8 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ export $(cat ../examples/nextjs/.env | xargs)
pnpm e2e:smoke
```

Run for a single framework only (starts only that framework's server):
```bash
pnpm e2e:smoke:nextjs
pnpm e2e:smoke:tanstack
pnpm e2e:smoke:react-router
```

Run specific test file:
```bash
pnpm e2e:smoke -- tests/smoke.chat.spec.ts
Expand All @@ -605,7 +612,7 @@ The `playwright.config.ts` defines three projects:
- `tanstack:memory` - port 3004
- `react-router:memory` - port 3005

All three web servers start for every test run. Timeout is 300 seconds per server.
By default (`pnpm e2e:smoke`) all three web servers start. Set `BTST_FRAMEWORK=nextjs|tanstack|react-router` (or use the per-framework scripts above) to start only the matching server and run only its tests. The CI workflow uses a matrix to run each framework in a separate parallel job.

### API Key Requirements

Expand Down
14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,27 +709,35 @@ test.describe("Your Plugin", () => {
})
```

Run the full E2E suite (requires all three example apps to start):
Run the full E2E suite (starts all three example apps):

```bash
cd e2e
export $(cat ../examples/nextjs/.env | xargs)
pnpm e2e:smoke
```

Run against a single framework only (starts only that framework's server — faster):

```bash
pnpm e2e:smoke:nextjs
pnpm e2e:smoke:tanstack
pnpm e2e:smoke:react-router
```

Run a single test file:

```bash
pnpm e2e:smoke -- tests/smoke.your-plugin.spec.ts
```

Run against a specific framework:
Run against a specific Playwright project:

```bash
pnpm e2e:smoke -- --project="nextjs:memory"
```

Tests run against three Playwright projects: `nextjs:memory` (port 3003), `tanstack:memory` (3004), `react-router:memory` (3005).
Tests run against three Playwright projects: `nextjs:memory` (port 3003), `tanstack:memory` (3004), `react-router:memory` (3005). In CI, each framework runs as a separate parallel job via a matrix strategy.

---

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Enable the features you need and keep building your product.
| **OpenAPI** | Auto-generated API documentation with interactive Scalar UI |
| **Route Docs** | Auto-generated client route documentation with interactive navigation |
| **Better Auth UI** | Beautiful shadcn/ui authentication components for better-auth |
| **Comments** | Commenting system with moderation, likes, and nested replies |

Each plugin ships **frontend + backend together**:
routes, APIs, database models, React components, SSR, and SEO — already wired.
Expand Down
6 changes: 6 additions & 0 deletions docs/content/docs/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,9 @@ Because the CLI executes your config file to extract the `dbSchema`, there are a
```bash
SOME_VAR=value npx @btst/cli generate --config=lib/stack.ts --orm=prisma --output=schema.prisma
```

or using dotenv-cli:

```bash
npx dotenv-cli -e .env.local -- npx @btst/cli generate --orm drizzle --config lib/stack.ts --output db/btst-schema.ts
```
4 changes: 4 additions & 0 deletions docs/content/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ In order to use BTST, your application must meet the following requirements:
export const GET = handler
export const POST = handler
export const PUT = handler
export const PATCH = handler
export const DELETE = handler
```
</Tab>
Expand Down Expand Up @@ -390,6 +391,9 @@ In order to use BTST, your application must meet the following requirements:
PUT: async ({ request }) => {
return handler(request)
},
PATCH: async ({ request }) => {
return handler(request)
},
DELETE: async ({ request }) => {
return handler(request)
},
Expand Down
1 change: 1 addition & 0 deletions docs/content/docs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"plugins/form-builder",
"plugins/ui-builder",
"plugins/kanban",
"plugins/comments",
"plugins/open-api",
"plugins/route-docs",
"plugins/better-auth-ui",
Expand Down
26 changes: 26 additions & 0 deletions docs/content/docs/plugins/blog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,32 @@ overrides={{
}}
```

**Slot overrides:**

| Override | Type | Description |
|----------|------|-------------|
| `postBottomSlot` | `(post: SerializedPost) => ReactNode` | Render additional content below each blog post — use to embed a `CommentThread` |

```tsx
import { CommentThread } from "@btst/stack/plugins/comments/client/components"

overrides={{
blog: {
// ...
postBottomSlot: (post) => (
<CommentThread
resourceId={post.slug}
resourceType="blog-post"
apiBaseURL={baseURL}
apiBasePath="/api/data"
currentUserId={session?.user?.id}
loginHref="/login"
/>
),
}
}}
```

## React Data Hooks and Types
You can import the hooks from `"@btst/stack/plugins/blog/client/hooks"` to use in your components.

Expand Down
Loading