@vexcms/core 0.0.3 → 0.0.5

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 (2) hide show
  1. package/README.md +37 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,23 @@
1
1
  # @vexcms/core
2
2
 
3
- The foundational package for [VEX CMS](https://github.com/vexcms) — a headless content management system built for [Convex](https://convex.dev).
3
+ The foundational package for [VEX CMS](https://github.com/ianyimi/vex) — a headless content management system built for [Convex](https://convex.dev).
4
4
 
5
5
  `@vexcms/core` provides the configuration API, field type system, schema generation, type generation, and all core utilities that power the VEX CMS ecosystem. It has no direct Convex dependency — Convex is a peer dependency only.
6
6
 
7
- ## Installation
7
+ ## Quick Start
8
+
9
+ The easiest way to get started is with the `create-vexcms` CLI:
10
+
11
+ ```bash
12
+ pnpm create vexcms@latest
13
+ ```
14
+
15
+ This scaffolds a complete project with all `@vexcms/*` packages, authentication, and an admin panel. See the [create-vexcms README](https://www.npmjs.com/package/create-vexcms) for full setup instructions.
16
+
17
+ ### Manual Installation
8
18
 
9
19
  ```bash
10
- pnpm add @vexcms/core
20
+ pnpm add @vexcms/core @vexcms/cli @vexcms/admin-next @vexcms/ui @vexcms/richtext @vexcms/better-auth @vexcms/file-storage-convex
11
21
  ```
12
22
 
13
23
  ## Features
@@ -115,16 +125,35 @@ defineCollection({
115
125
 
116
126
  ### Access Control (RBAC)
117
127
 
118
- Field-level and collection-level permissions:
128
+ Role-based permissions at the document and field level:
119
129
 
120
130
  ```typescript
121
131
  import { defineAccess } from "@vexcms/core"
122
132
 
123
133
  const access = defineAccess({
124
- posts: {
125
- read: true,
126
- update: { mode: "allow", fields: ["title", "content"] },
127
- delete: false,
134
+ roles: ["user", "admin"],
135
+ adminRoles: ["admin"],
136
+ userCollection: users,
137
+ resources: [posts, users, media],
138
+ permissions: {
139
+ admin: {
140
+ posts: true,
141
+ user: true,
142
+ media: true,
143
+ },
144
+ user: {
145
+ posts: {
146
+ create: true,
147
+ read: true,
148
+ update: ({ data, user }) => data.author === user._id,
149
+ delete: false,
150
+ },
151
+ // Field-level permissions
152
+ user: {
153
+ read: { mode: "allow", fields: ["name", "email"] },
154
+ update: { mode: "deny", fields: ["role", "email"] },
155
+ },
156
+ },
128
157
  },
129
158
  })
130
159
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vexcms/core",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {