Nibble 0.16.0
Installed and upgraded as one folder. Nibble lives in
vendor/nibbleand loads as a Rails engine; an upgrade replaces that folder and leaves the rest to the site.
What’s new
bin/rails nibble:versionprints the release a site runs, and says so when the install record inconfig/nibble.ymlnames another, as an upgrade that didn’t finish leaves it. It answers without booting the site.bin/rails nibblelists every Nibble command, the grouped ones (nibble:admin:*,nibble:schema:*and the rest) included, with their full descriptions, under a header naming the release, the site’s install record, its theme, the release whose behaviour it has switched on (load_defaults), the Ruby, Rails and Node it runs on, and the theme, schema and content format versions.
What’s fixed
- The release feed carries every release, not the latest 25, so the oldest releases keep their notes and their pages on the documentation site.
- The asset build bundles the theme
NIBBLE_THEMEnames, as the server renders it. The build readconfig/nibble.ymlfirst and the server read the environment first, so a site choosing its theme by environment served one theme’s pages with another’s assets. An image build takes the theme as theNIBBLE_THEMEbuild argument. Upgrade: if your theme comes fromNIBBLE_THEME, re-renderDockerfilewhen the upgrade offers it and pass the theme underbuilder: args:inconfig/deploy.yml. - Tests follow
config/nibble.yml, whateverNIBBLE_THEMEa shell exports for running the site. bin/devrenders pages on the server with the theme you are working on. It rendered them with the last production build inpublic/vite-ssrinstead, whichever theme that was built for, so a view that build lacked failed with “Page not found” and the rest showed stale markup until the browser replaced it. Server rendering now goes through the Vite dev server whenever it is running.
Changed
- Nibble lives in
vendor/nibble/. What was underlib/nibble/,lib/commands/andlib/middleware/moved there, and loads as a Rails engine: theGemfileevaluatesvendor/nibble/Gemfile.config/application.rbis plain Rails,config/initializers/nibble.rbis gone, andlib/is yours. Ejected screens are copied fromvendor/nibble/frontend/. Upgrade: re-renderDockerfilewhen the upgrade offers it — the old one copiesvendor/in a way that no longer installs Nibble’s gems. - Everything of a site’s own that Nibble reads lives in
site/.schema/issite/schema/,content/issite/content/, a site’s theme issite/themes/<name>/, and control panel overrides aresite/cp/pages/andsite/cp/slots/.crumbsships invendor/nibble/themes/and is used from there unlesssite/themes/crumbs/exists;nibble:generate:themecopies it intosite/themes/. Upgrade:git mv schema site/schema,git mv content site/content,git mv site/pages site/cp/pages,git mv site/slots site/cp/slots, andgit mv themes/<yours> site/themes/<yours>for a theme of your own. - Generated types are
site/types.d.ts, imported as@site/types, rather than a file inside the active theme, so a theme that ships with Nibble is never written to. Upgrade: in your theme, replace imports from'../.nibble/types'(at any depth) with'@site/types', delete its.nibble/folder and runbin/rails nibble:schema:types. - What Nibble needs from Rails’ configuration comes with Nibble. Its initializers (Inertia, WebAuthn, the
mediainflection, the assets prefix, the baseline content security policy) and its production settings (storage service, Solid Cache and Solid Queue, mail fromSITE_URLand SMTP) are part of the engine, and its recurring jobs are read fromvendor/nibble/config/recurring.yml. A site’s ownconfig/holds Rails’ defaults, which it can change and which win over Nibble’s. Upgrade: re-renderCLAUDE.mdwhen the upgrade offers it. If you changed any of the moved initializers, put your change in an initializer of your own. - Taking a release is
bin/rails nibble:upgrade; bringing a database up to it isbin/rails nibble:prepare. The first wasbin/nibble-upgrade, a script beside yours; it is now a command that ships with Nibble. The second was callednibble:upgrade, and is named after Rails’db:prepare, which it stands in for when a server starts. Upgrade: inbin/docker-entrypoint, or wherever your deploy runs it, changenibble:upgradetonibble:prepare, and take releases from now on withbin/rails nibble:upgrade. - A site is installed from a release, not a clone.
curl -fsSL nibble.ink/install.sh | bashasks for the site’s name and makes its folder from it, downloads the release’s archive, checks it against the published checksum, unpacks it intovendor/nibbleand writes every other file from its templates, starting from the gem and npm versions that release was tested with. It works from any shell, fish included, and no longer needsgit. - An upgrade replaces
vendor/nibblewith the next release.bin/rails nibble:upgradedownloads the release and checks it against its published checksum, then hands over to that release’s own upgrader, so a fix to upgrading applies in the release that ships it. It refuses if Nibble’s files were changed in place (eject what you need to change), checks the release’s Ruby, Node and theme requirements, snapshots the database, swaps the folders (the old one stays intmp/), migrates, offers the site files whose templates moved on and reports ejected screens whose originals changed. It no longer needs git, and no longer merges anything. Upgrade: a site installed by cloning has novendor/nibble/MANIFEST, so it can’t take releases this way. Install a fresh site from this release and move yoursite/,app/,db/migrateand settings into it. - A new site’s credentials include a
secret_key_base. Without one, production refused to boot. Upgrade: ifbin/rails runner 'p Rails.application.credentials.secret_key_base.present?'printsfalse, addsecret_key_base: <the output of bin/rails secret>withbin/rails credentials:edit. - Installing with
--defaultsrecords the answers it used, so later upgrades can offer the files rendered from them. - A site’s own Ruby and tests live where Rails puts them.
site/initializers/andsite/test/are gone, and so isGemfile.local: a site’sconfig/initializers/,test/andGemfileare its own now, and a new site starts with Rails’test/test_helper.rb. The notes that were insite/schema/README.mdandsite/content/README.mdare insite/README.md. Upgrade: movesite/initializers/*.rbintoconfig/initializers/,site/test/intotest/, and the gems inGemfile.localintoGemfile. - Nibble’s files changed in place are found by checksum.
bin/rails nibble:checkcomparesvendor/nibblewith the release’sMANIFESTand names any file changed there, which the next upgrade would refuse to replace. The install record no longer holds a git commit, and nothing in Nibble needs git. - Nibble’s record of a site lives at the end of
config/nibble.yml, below a line that says so: the release it is on, the install’s answers and what it ejected. Only that part is ever rewritten, so your settings and comments above it stay as you wrote them..nibble/is gone. Upgrade: add# Written by Nibble from here to the end of the file. Your settings go above this line.as the last line ofconfig/nibble.yml; under it,install:with the keys of.nibble/install.ymlindented beneath, then theejected:section of.nibble/ejected.ymlif you have one. Then delete.nibble/.