Skip to content

v0.2.9

Choose a tag to compare

@github-actions github-actions released this 29 Aug 07:23
· 107 commits to main since this release

Ship migrate, migrate:rollback and migrate:status as commands

Same move as the schedule pair: they were JavaScript inside a Rust string
literal, booting an application to drive the migrations registry. Nothing
native about them either.

The registry stays the ream particularity it was — a command that names no
store, so an app holding a relational store and a time-series one migrates both
in one pass — and --only still picks one. Sequential, because two stores on one
server contend on locks and interleaved output cannot be attributed.

Ship schedule:list and schedule:run as commands, not as Rust

Both existed only inside the ream binary, as JavaScript in a Rust string
literal that booted an application and drove the scheduler through it. Nothing
about them is native: they read the scheduler out of the container and print.

They are command classes now, behind @c9up/ream/commands — the shape AdonisJS
uses for @adonisjs/core/commands. The Ignitor registers that loader itself,
before discovery and before reamrc.commands, so an application keeps the
commands it had and can still override either by name.

The distinct exit codes survive the move (1 failed, 2 unknown task or missing
provider, 3 already running), and are now covered by tests the embedded script
could not have.

Let a package ship one command loader, as AdonisJS does

reamrc.commands accepted one shape: a module default-exporting a single
command class. A package with six of them — atlas has exactly six —
needed six rc entries, and ream list imported every class to read a
name off it.

AdonisJS accepts a LOADER: getMetaData() answers the list, and
getCommand() imports a class only when it is about to run. @adonisjs/lucid
ships one, backed by a generated commands.json. ream already had the
interface — CommandLoader, same two methods — and the kernel already
loads lazily through it; only this channel would not take one.

That gap has a cost, and it has already been paid. nebula and nova wired
their commands into the ream CLI binary instead: clap variants, a Rust
module each, shelling back to Node. Every package with a command then
needs a release of a binary that is not even on crates.io. atlas is
worse — its six commands exist, are exported, and no application declares
them, so the only working path is a Rust copy that drives the migration
runner through JavaScript embedded in string literals.

The docs now say it in one line, in both languages: this is the ONLY way
a package adds a command, and the CLI already dispatches any name it does
not own to the console kernel. The single-class form still works, for a
package that has one.


Changes since v0.2.8.