v0.4.9 is a systematic review: walk through the CLI and dev server, hunting specifically for cases where the tool "happily produced the wrong result instead of complaining". All eight fixes share that pattern — the old version never raised an error, and you only found out when some detail didn't line up.
What this release solves
The principle here is simple: prefer a loud error over a silent wrong result. xfm new creating files in an empty directory and then pointing you at a build that fails, a UTF-8 BOM swallowing the entire front-matter, dates off by a day because of a timezone — all of these put the cost of the tool's assumption on your shoulders. Each is now either correct or explicitly rejected.
What changed
Fixed
xfm newoutside a site now errors out. In an empty directory it used to createcontent/posts/<slug>.mdand print "already publishable —xfm buildand you'll see it", while the build itself failed on the missing theme. It now stops with the path, a hint toxfm create, and creates nothing.xfm createrecognises every config form. Onlyxfm.config.mjswas checked, so a site configured viaxfm.config.js/.cjs/.jsonor a"xfm"field inpackage.jsongot overwritten without--force— includingcontent/index.md,content/about.mdand the starter post.hasConfig()now backs both this check and the dev-server config watcher.- A UTF-8 BOM no longer swallows front-matter. Files saved as "UTF-8 with BOM" — the default in several Windows editors — lost the whole block: the title fell back to the file path and
date/layout/tagsvanished. The BOM is now stripped before looking for---. - The layout wins over a contradicting scaffold. A
scaffolds/draft.mdthat still saysdraft: falseorlayout: page.html(usual when copied from another template) produced a published page while the CLI reported it wouldn't appear in the build output.layout,typeanddraftare now forced from the requested layout; apostscaffold with a leftoverdraft: trueis written back tofalse, so the two never disagree. - Backslashes in
--dir=are normalised.xfm new page about --dir=docs\subechoed/docs\sub/about/while the real URL was/docs/sub/about/. Paths are normalised before the summary, and--dirrefuses to climb out of the content directory. - Date-only front-matter is a local calendar day. By spec,
new Date('2026-11-10')is UTC midnight, so every site west of UTC rendered those posts one day early. Date-only andYYYY-MM-DD HH:mmvalues are now constructed in local time explicitly; timestamped values keep their time. - The dev server works under a sub-path (
site.base: '/blog/'): the live-reload event stream follows the base (/blog/__xfm/events), 404-page links carry the prefix, a half-closed browser connection can no longer abort a rebuild, andxfm.config.cjs/config.jsare watched like the other config files instead of silently ignored.
Added
xfm createwrites a.gitignore(node_modules/,dist/,.xfm/, OS junk) so the first build no longer floodsgit status; an existing.gitignoreis left untouched.- Tests went from 120 to 128, covering BOM handling, date parsing, scaffold/layout conflicts,
--dirnormalisation, the non-site guard, config detection and.gitignore.
Do you need to do anything
No config changes needed. Two behavioral differences worth noting: posts whose front-matter date is a bare YYYY-MM-DD may render a day apart from the old version (the new behavior is the one you wanted), and xfm create now requires an explicit --force to overwrite an existing site. Command details in the CLI guide.
Comments