Repository navigation
Ridu v0.5.0
Ridu 0.5.0 adds a GraphQL playground to the admin and makes hooks, filters and upgrades simpler to write and easier to understand. Hooks can refuse an operation with a message editors see, unique values report which field conflicted, duplicated documents get a free slug, and ridu upgrade moves a project to a new release in one command. The CMS still builds into one Go binary with its static admin embedded.
Try Ridu
Install Go 1.25.13 or newer, Node.js 24 and Bun 1.4.0, then run:
bun create ridu@0.5.0 my-ridu-app
cd my-ridu-app
bun install
bun run devChoose SQLite for a local trial without a separate database service. See the quickstart and deployment guide.
What changed
- Applications that use the GraphQL plugin get a playground at
/admin/graphql, from the new@riducms/plugin-graphqladmin package. Admins get schema-aware autocompletion and validation, run operations under the current admin access rules, and browse the schema in a docs panel. The schema reaches the playground through the admin loader boundary instead of enabling GraphQL endpoint introspection. The editor loads only when the page opens. ridu.Reject(message, issues...)lets a collection, global, or field hook refuse an operation with a message for the editor. The admin shows the message and marks any fields named by the issues; REST, the SDK, and the Local API return a newrejectederror (HTTP 422). Other hook errors are still reported as internal errors whose messages stay on the server.- Saving a value that another document already uses in a
.Unique()field, including everyfield.Slug, now fails with auniqueissue on that field instead of a generic conflict. - Duplicating a document gives a copied slug the next free value, such as
about-us-copy, instead of failing on the unique slug. ridu upgrade <version>rewrites every@riducms/*pin, official plugin and the Go module requirement, installs dependencies, and runs the new CLI'sgenerate,agent syncandmigrate create.query.Field("price")names a field in filters written in code without an error check, andquery.And,query.Orandquery.Notreturn an expression directly.- Field transforms return
operation.Set(value)oroperation.Clear[T](). - Field hooks now receive the saved document's ID once a create or duplicate is stored, including in
AfterCommit; a duplicate's hooks see the copy, not the original. ridu migratereadsRIDU_ALLOW_INSECURE_DATABASElike the generated server, so a local.envworks for both.- The SvelteKit server client uses SvelteKit's
event.fetchby default, as SvelteKit recommends for server code. The client still sends its token in a header and never forwards the web app's cookies. ridu generate,ridu check,ridu buildandridu devwarn with an install command when a registered plugin's admin package is missing from the admin workspace.ridu.RootHooksis available from theridupackage, so application-wide hooks no longer importcore.- The hooks,
operationandqueryguides document every hook and type with its own example. - Admin updates submit only edited fields, preserving protected unchanged values, keyed row order and membership, and complete content when an edited locale fallback becomes a new translation.
Breaking changes and upgrading from 0.4.x
Run the new CLI's upgrade command from the project root, then review and commit the result:
bunx @riducms/cli@0.5.0 upgrade 0.5.0It creates one migration, ridu-0-5-0. Manifests no longer record plugin package versions, so this migration contains only a schema assertion; later plugin or framework upgrades do not need a migration unless the schema changes.
GraphQL
The GraphQL plugin now pairs with an admin package. Install it in the admin workspace:
bun add --cwd admin @riducms/plugin-graphql@0.5.0To keep GraphQL without the playground, set graphqlplugin.Options{DisablePlayground: true} instead.
Hooks
BeforeValidatenow runs only for create, duplicate, update, publish and unpublish, and no longer for reads, deletes or restores.AfterCommitno longer runs after reads. It still runs after deletes and restores. Remove read guards such asif ctx.Operation == operation.Read { return nil }from after-commit hooks if you like; they are now unnecessary.BeforeOperationandAfterOperationstill run for every operation.
Go API
- Replace
operation.Replace(operation.Present(value))withoperation.Set(value)andoperation.Replace(operation.Empty[T]())withoperation.Clear[T]().operation.Replacehas been removed. query.And,query.Orandquery.Notreturnquery.Expressionwithout an error. With one condition,AndandOrreturn that condition; they panic when given no conditions or a nil one, like the comparison helpers. Check the length of a list built from input before calling them.- Use
query.Field(...)for field names written in code;query.NewPathandquery.ParsePathstill return errors for paths from input.
Errors
- A unique conflict on a
.Unique()field returnsvalidation(HTTP 422) with auniqueissue instead ofconflict(HTTP 409). Revision and other conflicts still returnconflict. - Add
rejectedto any exhaustive handling of Ridu error codes.
Data and deployment
Update the Go module, CLI, all framework npm packages and official plugins together to 0.5.0.
Regenerate application contracts, review the generated migration plan, and rebuild the embedded
admin and Go binary. This release does not introduce a new database migration encoding or rewrite
historical artifacts. Back up database and upload storage together and rehearse the upgrade against
a restored copy before directing production traffic to it.
SQLite remains qualified for a local file on one host. PostgreSQL retains its networked,
multi-replica operating model. MongoDB retains its documented authenticated replica-set, TLS and
Linux x86-64 qualification limits. The GraphQL playground adds static admin assets and does not
add a JavaScript server to the CMS runtime.