rux run
Open a window on a document, find the workspace entry point, and hot-reload as you type.
rux run opens a native window on a document.
rux run # the workspace's app.rux or index.rux
rux run app.rux # a named file
rux app.rux # the same, said shorterFinding the entry point
With no file, rux run looks for app.rux, then index.rux, in the current
directory and then in every parent directory. So it works from inside
components/ the same way git does, and being told to cd back to the root
is not a thing that happens.
Only app.rux is generated by rux new. index.rux is
accepted because the web habit is strong and someone will reach for it, but
offering two names for one thing is how a convention stops being one, so the
scaffold picks.
A directory holding both is not an error. app.rux wins, silently, because
refusing to start over a question the author is not asking at that moment would
be worse.
Bare rux prints the usage
It does not run anything. A tool that launches a GUI when invoked with no
arguments is a surprise, and cargo, git and npm all answer a bare
invocation by explaining themselves.
This used to be worse than a surprise. Bare rux defaulted to
examples/battery.rux, a path that only exists inside a checkout of the Rux
repository, so for everyone who had installed from crates.io the first command
they typed produced a panic out of the file watcher.
Options
--route <path> | Open on this route instead of /, the way a deep link arrives |
rux run --route /settingsHot reload
Edit any .rux file the window is using, including imported components, and it
reloads. There is no build step and nothing to restart.
A file that fails to load does not take the window down with it: the last good tree stays on screen and the dev overlay says what went wrong. Fix the file and the next save recovers.
What it will not do
A missing file is a message, not a stack trace, and so is a directory given
where a file was expected. If the argument has no extension, the message also
points at rux --help, because the most likely cause is a subcommand typed
slightly wrong.