You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5a366bd
Browse filesBrowse the repository at this point in the historyBrowse files
feat(core)!: split plugins and app configs into a definition and a runtime (#25) (#25)
Chain step 5 of the linear merge chain onto main 3b4a112: this PR's own changes, resolved against the PRs before it in the merge order.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: .claude/skills/voting/SKILL.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ description: Build a native upvote/downvote (voting) feature on a TanStack CMS 1
8
8
Add Reddit/HN-style upvote/downvote voting to a TanStack CMS app. The worked
9
9
reference for everything below is
10
10
[`examples/blog-voting`](../../../examples/blog-voting): the blog example plus
11
-
`src/cms.config.ts` (the `vote` collection + count fields), `src/voting/`
11
+
`src/cms.definition.ts` (the `vote` collection + count fields), `src/voting/`
12
12
(the write/read paths, component, and tests), and `src/routes/top.tsx`. When
13
13
in doubt, read that.
14
14
@@ -25,7 +25,8 @@ All store functions from `@tanstack/cms-core/server` are **async** —
25
25
26
26
## 0. Prerequisites
27
27
28
-
- A TanStack CMS app (`cms.config.ts` + `cmsVirtualRoutes()`), e.g. a copy of
28
+
- A TanStack CMS app (`cms.definition.ts` + `cms.config.ts` +
29
+
`cmsVirtualRoutes()`), e.g. a copy of
29
30
[`examples/blog`](../../../examples/blog).
30
31
- An `auth` config (`createMockAuth()` from `@tanstack/cms-ui-react` for
31
32
demos, `auth: { getUser }` in production) so votes have a voter.
@@ -44,9 +45,11 @@ All store functions from `@tanstack/cms-core/server` are **async** —
44
45
| Review queue? |**No.** Votes commit directly | The review queue is for _content_ awaiting human approval. Votes are user interactions; the vote documents themselves are the audit trail (revisions give you who-voted-what-when) |
45
46
| Anonymous votes | Not by default | Anonymous voting invites brigading and can't do one-vote-per-user. If the product needs it, say so explicitly and accept the tradeoffs (§4) |
46
47
47
-
## 2. Model the schema → `src/cms.config.ts`
48
+
## 2. Model the schema → `src/cms.definition.ts`
48
49
49
-
Add a `vote` collection to the `collections` array and count fields on the votable collection:
50
+
Add a `vote` collection to the definition's `collections` array (in a one-file
51
+
app, `defineCms({ collections })` in `cms.config.ts`) and count fields on the
52
+
votable collection:
50
53
51
54
```ts
52
55
defineCollection({
@@ -267,7 +270,7 @@ A small component: up arrow, score, down arrow. Requirements:
267
270
Agents can read `post` scores through the standard tools, and you can expose
268
271
voting as a first-class operation and MCP/WebMCP/content-agent tool with
0 commit comments