Closed sid-707 closed 1 year ago
Is there any status on merging this? I was considering adding a kind of scaffold like Phoenix has based off of my current HTTP server setup. It'd register a supervisor, a simple submillisecond HTTP server, register the server under the supervisor, maybe a database connection and setup the .cargo/config.toml
file. Maybe something like lunatic new.rust.sub_ms
...
I'm a bit in doubt if we should keep extending the lunatic
CLI with additional commands for setting up projects.
What I like at the moment is that you can easily just stick to cargo
commands to start a new project and don't need to learn a new CLI tool. Should we maybe just extend cargo with cargo submillisecond.new
, cargo lunatic.new
, ...?
This would let us keep the runtime focused on more runtime specific "stuff", instead of also being a collection of starter project layouts.
I'm a bit in doubt if we should keep extending the
lunatic
CLI with additional commands for setting up projects.What I like at the moment is that you can easily just stick to
cargo
commands to start a new project and don't need to learn a new CLI tool. Should we maybe just extend cargo withcargo submillisecond.new
,cargo lunatic.new
, ...?This would let us keep the runtime focused on more runtime specific "stuff", instead of also being a collection of starter project layouts.
I like the cargo
approach more now that you mention it. It makes sense to let lunatic
remain as just a runtime and not have any starter project layouts.
Just a suggestion:
How about cargo sub.new
for a new submillisecond project?
Starting a Phoenix project is just mix phx.new
.
This PR adds a new command to Lunatic:
lunatic new <project-name>
.It generates a new Lunatic Rust project with the name
<project-name>
by performing the following steps: 1) Runcargo new <project_name>
to create the project. 2) Change the directory to<project_name>
. 3) Add the latest version of Lunatic as a dependency to the project. 4) Run theinit
command to add the.cargo/config.toml
file. 5) Replace Cargo's defaultsrc/main.rs
with an example that uses Lunatic.The example program is a modified version of Bernard's example from Writing Rust the Erlang way.