Releases
Changelog
All @mortar-kit packages release together, at the same version. Each
release lists what it adds and, under Upgrading, anything that can stop
an existing site from building or starting.
0.3.0 (2026-11-24)
These come from feedback on a site built with 0.2.0.
Added
createContentServer({ canWrite })decides each write per user and collection.falseanswers 403 "Not allowed".allowMembers({ fields: ['role'] })copies member fields onto the user. (#29)useRenderedPage()gives the app the page's CSP nonce and whether it hydrates, for its own scripts. (#32)createMiddlewaretakesheaders,sitemap,robotsanddev. The sign-in rate limit counts sending a code and trying one separately.sitemap()takeslastmod. (#33)
Fixed
- The admin shows a thrown Response's text, not "[object Response]". Deletes that throw no longer fail silently. (#31)
Upgrading
MORTAR_ADMINSwithauthorize.authFromEnvused to ignoreMORTAR_ADMINSwhen you passedauthorize. Now it lets both in. If you set the variable and rely onauthorizealone, unset the variable. (#30)- New default headers.
createMiddlewarenow sendsX-Frame-Options: SAMEORIGIN,X-Content-Type-Options: nosniffandReferrer-Policy: strict-origin-when-cross-origin. If another site frames yours, passheaders: { 'X-Frame-Options': null }. The CSP is now off on the dev server by default (csp: trueturns it back on). (#33)
0.2.0 (2026-11-23)
0.2 takes over most of the code a site used to write around Mortar: server functions, middleware, auth setup, the server entry, the sitemap.
Added
createContentServer({ content, auth })(@mortar-kit/core/server) returns the content functions for your'use server'module, with every write behindauth.require.contentClient(server, …)(main entry) builds the cachedsource,freshSourceand the admin'scontentfrom them. It also sets the server-function upload limit fromcreateContent'sassets.maxSize.createMiddleware({ auth, blobs })(@mortar-kit/auth): onestart.middlewarethat rate-limits sign-in, runs the auth routes and the/adminguard, serves uploads, and sends a nonce CSP.authFromEnv({ store }):createAuthbuilt from environment variables (see Upgrading). AlsoresendMailer, andallowMembers({ content, collection }), which signs people in from a collection of your own.createRender({ manifest, app })(@mortar-kit/core/render) and<ClientScripts>: public pages ship no JavaScript, and onlyhydratepaths hydrate (['/admin']by default).- Brick actions:
defineBrick({ action }),<ActionForm>,props.submissionandContent.runAction. A brick handles its own form, with or without JavaScript. - Islands:
defineBrick({ interactive: true })hydrates just that brick on a page that otherwise ships no JavaScript. AlsohydrateIslands,lazyBricks,islandActions, and fields markedprivate: true. - Collection URLs:
defineCollection({ url: '/posts/:slug', home? }),collection.urlOf(doc),resolveUrl(admin preview links), andsitemap(content, collections, { origin }). <AdminRoute>(@mortar-kit/admin/router) keeps the admin's location in the URL and adds the unsaved-changes leave guard.seed(content, docs)puts starter documents in empty collections.- Media library: asset titles, alt text, folders and search.
- Collection previews: a collection without a preview layout previews
as
DocPreview(passcollectionstoPreviewPage).
Fixed
- The admin preview's
list()no longer crashescreateContentwhen a GET sends its missing options asnull.
Upgrading from 0.1
The package APIs of 0.1 still work. What can break is the setup around them:
Environment variables. If you move your auth setup to
authFromEnv, it reads these names, all prefixedMORTAR_except the providers' own:Variable Use MORTAR_AUTH_SECRETSession signing key. Required in production. MORTAR_ADMINSAddresses and *@domains that may sign in, unless you passauthorize.MORTAR_BASE_URLPublic origin, behind a proxy. GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRETGoogle sign-in. Set both or neither. RESEND_API_KEY,MORTAR_EMAIL_FROMEmail sign-in through Resend. If you set
RESEND_API_KEYwithoutMORTAR_EMAIL_FROM, the server throws on startup. A site that read its ownEMAIL_FROMmust rename it. Production also refuses to start without a secret, without someone who may sign in, or without any way to sign in. The dev fallbacks (a fixed secret,[email protected], emails printed to the console) apply only under Vite's dev server.Hand-written glue you can delete. Server functions that wrapped
content.list/get/save/…become one-line re-exports ofcreateContentServer. A custom middleware for auth, uploads and the CSP becomescreateMiddleware. A custom entry-server with a styles-only manifest becomescreateRender. A hand-made sitemap becomessitemap(). Each replacement is in the docs (Storage, Sign-in, No JavaScript, Collections).Upload limit.
createContentServerraises the server-function body limit itself. Import the module that calls it from the vite plugin'sserverFunctions.serverSetup, and drop any limit you set by hand.Installing. pnpm can refuse a release in its first day (see "Installing new releases" below).
0.1.0 (2026-11-23)
The first release on npm: @mortar-kit/core, @mortar-kit/admin,
@mortar-kit/auth and the four admin themes.
Installing new releases
Recent pnpm versions refuse packages published less than a day ago
(minimumReleaseAge). To install a Mortar release on the day it comes
out, exclude the packages in pnpm-workspace.yaml:
minimumReleaseAgeExclude:
- '@mortar-kit/*'