@micelio/strapi-plugin-core
v0.4.0
Published
Micelio's core as a Strapi 5 plugin: sites, blocks, the editorial workflow, hooks and the host check.
Readme
Micelio Plugin Core
@micelio/strapi-plugin-core is Micelio's core as a Strapi 5 plugin. It will hold what a Micelio site needs from its CMS: several sites per CMS, the block catalogue, the editorial workflow, the hooks other Micelio plugins build on, and a host check that refuses to start in production when the host is missing what Micelio needs (ADR-0017).
It is at 0.4.0 and alpha: it holds the site type (one row per site,
with a default site created on an empty instance), site scoping for content types,
the editorial workflow,
the block catalogue (docs/blocks.md) and its per-site management
(docs/operate/block-catalogue.md),
the hooks other plugins subscribe to, the host check (npx micelio doctor,
docs/operate/host-check.md),
the site export and import (npx micelio export and import,
docs/operate/export.md),
the status page in the admin (the Micelio entry of its menu,
docs/operate/status-page.md), the preview of drafts on the frontend,
which opens in a new tab when the frame stays silent
(docs/operate/preview.md),
the page weight budget that refuses a publish over it or without its measurement,
with the cost meter of the preview page and the cost line of the edit view
(docs/operate/budgets.md) and the category and tag types.
Since 0.3.0 it adds the builder, with its keyboard and Media Library
(docs/guide/builder.md); page settings on a host's page type through the
exported withPageSettings, with redirects when a published slug changes
(docs/guide/pages.md); page templates
(docs/guide/templates.md); send to review, schedule, the In review page
and the editorial panel of the edit view (docs/guide/review.md); the SEO and
social tab (docs/guide/seo.md); islands and the presentation options of the
blocks (docs/blocks.md); the Sites, Export and import and About pages
(docs/operate/transfer-page.md,
docs/operate/about-page.md); and the carbon estimate beside the cost
meter (docs/operate/budgets.md). The other capabilities arrive with the
issues of the first milestone. Until then, install nothing from it on a site.
Plugin or distribution
micelio-cms is the reference distribution: a Strapi project with the plugins installed and the configuration a plugin cannot set for its host (security middlewares, CSP, uploads provider, database, image and Compose files). It is what hosting runs and what "Micelio 0.6" means. Use it to run a Micelio site. The plugin is for a developer who already runs Strapi and wants Micelio in it.
micelio in package.json names the release line of Micelio this version supports (0.7).
Getting started
npm ci
npm run checknpm run check builds the plugin, boots a clean Strapi 5 on SQLite with it installed, and checks that it registers. Conventions, commands and structure are in AGENTS.md; the rules every Micelio repository shares are in the engineering standard. To contribute, read CONTRIBUTING.md.
Configuration
The plugin reads its options from the host's config/plugins:
module.exports = {
micelio: {
config: {
// When the scheduler publishes the scheduled entries that are due, as a cron rule.
// `false` turns it off: scheduled entries then wait for `transitions.publishDue()`.
scheduledPublishRule: '* * * * *', // the default: every minute
// When the host check and the checks of other plugins run again on their own, as a cron rule.
// `false` turns it off: they then run only with "Run host check" in the status page.
statusRefreshRule: '0 4 * * *', // the default: every day at 04:00 server time
// The weight, in kB, above which publishing a page with blocks is refused (docs/operate/budgets.md).
// A key replaces the default of that page type; `sites` sets a site's own, by its slug.
// `contentTypes` lists the types measured at publish, the ones the frontend previews.
budgets: {
contentTypes: ['api::page.page', 'api::article.article'], // the default
pageTypes: { landing: 60, standard: 120, 'long-read': 160 }, // the defaults
sites: {},
},
},
},
}Releases
The Release workflow (.github/workflows/release.yml) is started by the maintainer from the Actions tab. It defaults to a dry run that prints the version and the notes and names the package it would publish (@micelio/strapi-plugin-core), and changes nothing. A pull request title with a conventional prefix decides the version (section 7 of the standard). Publishing needs a release environment (Settings → Environments) with the maintainer as required reviewer and deployments limited to main, which gate the publish job, and the NPM_TOKEN secret of an npm account that can publish under @micelio. NPM_TOKEN is a secret of the release environment, not a repository secret: only the publish job runs in that environment, after the approval, and fails before it publishes anything if the token is not set; the plan job never reads it, so a dry run works without it. A repository secret of the same name keeps working, but every workflow of the repository can read it. Set it with gh secret set NPM_TOKEN --env release -R bogd3v/micelio-plugin-core.
The first release is v0.1.0, the version in package.json: with no earlier tag there is no bump, so no chore(release) pull request comes before it. To cut it:
Run the workflow on
mainwithdry_runon (the default) andcompatibilityfilled in, and read the plan: tagv0.1.0, the notes,npm: would publish @micelio/strapi-plugin-core.Run it again with
dry_runoff and the samecompatibility. The publish job waits for the maintainer's approval in thereleaseenvironment, then publishes to npm with provenance and creates the tag and the GitHub release with an SBOM.Check it:
npm view @micelio/[email protected]answers. Then verify the provenance in an empty project, not in this repository (npm audit signatureschecks the dependencies of the project it runs in, and this package is not one of its own):mkdir verify-core && cd verify-core && npm init -y npm install @micelio/[email protected] npm audit signaturesThe output says the package has a verified registry signature and a verified attestation.
compatibility is required to publish. Every release states the release line of the core it supports (micelio in package.json) and the minimum Node (engines):
- Micelio release line: 0.7
- Node: 22.19 or laterWhen a pull request since the last release is breaking (a ! in its title), the workflow refuses to publish unless both breaking_changes (the hand-written "Breaking changes" section: who is affected) and upgrade_notes (what to do) are set; a dry run only warns. Both are Markdown and go in the release body.
A release candidate (release_candidate) is published under the next tag and moves neither X.Y nor latest.
License
AGPL-3.0-only. Third-party material is listed in THIRD-PARTY.md.
