cms.user() calls work in preview environmentsnext as a direct dependency to the
alinea package. While we're currently focused on providing a clean Next.js
integration, Alinea is not tied to Next.js and should not depend on it.alinea init command for a Next.js website will now auto-create
the handler route in app/(alinea)/api/cms/route.ts. The generated cms.ts
config file also includes more default options such as the baseUrl and
handlerUrl.enableDrafts: true. Drafts and archived entries will now show their
status in the sidebar as well. Workflows are adjusted to be able to create a
draft entry, including draft children. These will show up as "unpublished" and
can be published in one go. Further stability improvements were made to
updating entry statuses.cms.find and cms.get so they work reliable
in non-strict Typescript codebases as well.Query.parent, Query.next and Query.previous
which were incorrectly typed as an Array.Fix removing field contents in Edit.update. Pass an undefined value to remove
field contents:
await cms.commit(
Edit.update({
id: '...',
set: {removeMe: undefined}
})
)
Fix processing link data correctly even it contains legacy data
Add the Infer.Entry and Infer.ListItem types which can be used to infer the type of an entry or list item from a query.
type Entry = Infer.Entry<typeof EntryType>
const entry: Entry = await cms.get({type: MyType})
type ListItem = Infer.ListItem<typeof ListType>
const list: Array<ListItem> = await cms.get({select: MyType.list})
withAlinea export found in
'alinea/next'.cms.find/get is rewritten to take a single query object.
Have a look at the docs to see how to use the new query api.Field.create.npx alinea build --fix.