v0.1.12
Release the cache at shutdown, and cover the tiered driver
The provider never disconnected: the memory driver sweeps on a timer and
the redis driver holds a connection, so every dev reload left another one
behind. It now releases the cache it booted, and only clears the module
singleton while that still points at it.
The tiered driver had almost no tests, and its bugs are the silent kind — a
promotion that loses the remaining TTL leaves an immortal L1 copy serving a
value the shared L2 has already expired.
Declare the environment variables the generated config reads
Checked against @adonisjs/mail 10.4.0, whose configure() publishes the config
AND calls defineEnvVariables beside it. Mine wrote a config full of
env.get('QUEUE_STORE') and declared nothing, which is the half-installation
the hook exists to prevent: the application boots, the config asks the
environment for something nothing ever put there, and the fallback answers.
addEnvVars was already on ream's codemods and simply went unused.
Say that ream add sets this up, because it does now
Ship the configure hook ream add expects
ream add <pkg> installs, then imports <pkg>/configure and runs it. Nine
packages provided that hook and this one did not, so ream add left an
application with a provider registered and no config file for it to read —
falling back to a default that is rarely the one anybody wanted, silently.
The hook registers the provider and writes the config stub beside it, because
the two are one step: a provider without its file is not installed, it is half
installed.
Describe a cache store a layer at a time
Echo's stores were { driver: drivers.x() }, which says nothing about which
layer a driver is and turns a tiered cache into a driver call rather than a
layering. A cache config elsewhere reads as store().useL1Layer(…).useL2Layer(…),
and the words carry the meaning: L1 is the fast layer, L2 the shared one, and
the bus is what keeps each instance's L1 in step after a write.
stores: {
memory: store().useL1Layer(drivers.memory()),
tiered: store({ ttl: 60 })
.useL1Layer(drivers.memory())
.useL2Layer(drivers.redis({ connection: 'main' })),
}
A store with no layer throws, and so does a bus with a single layer — silently
ignoring it would hide a cache that never invalidates across instances.
The plain { driver } form is still accepted.
Create the GitHub release from the publish workflow
A published version arrived with no notes: npm showed a number, GitHub showed
nothing, and the only way to learn what changed was to read a diff. The commit
messages already carry the reasoning, so the release is built from the commits
the tag contains rather than written twice.
Skips a pure version bump, leaves an existing release alone, and does nothing
when the run was not built from a tag. The job takes contents:write for this;
the workflow default stays read.
Changes since v0.1.11.