Conversation
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
| .file_name() | ||
| .context("Invalid project path")? | ||
| .to_str() | ||
| .context("Project name must be valid UTF-8")?; |
There was a problem hiding this comment.
might want to do a bit more validation here on the name? I am not sure what makes up a valid project name but we would want to strip strings from beginning end etc. Maybe special characters?
| use anyhow::{Context, Result, ensure}; | ||
| use clap::Parser; | ||
|
|
||
| const HYPERLIGHT_VERSION: &str = "0.13"; |
There was a problem hiding this comment.
can we take this as input so we don't need to bump the tool everytime?
There was a problem hiding this comment.
I thought about this, but I'm not sure it makes sense, since we might have breaking changes. I think it's better we just bump it manually and at that time make sure the template is up to date. Perhaps we could do a quick check to make sure the version is the latest released version and add a warning if not to make users aware they are using an old version. Although this does require a cargo-hyperlight release for every hyperlight release, which I am unsure if we currently do.
jsturtevant
left a comment
There was a problem hiding this comment.
I think this will make it much easier to get started and be successful! Did you consider any existing templating libraries in the eco system? This is pretty straight forward for now but there are often a lot of edge cases for projects that are larger.
Initial draft for a scaffolding command to create a ready-to-compile/run hyperlight project (with guest). Currently just targets 0.13. Might be useful in the future to decouple the templating from the template, so we can have multiple versions etc etc, and releasing a new hyperlight version won't need a new cargo-hyperlight release.
I plan to include this command in main hyperlight repo docs/markdown in something like the README.md or getting-started.md docs.
I'm particularly looking for feedback on the actual templated code. I made it slightly longer than I initially intended, but I think it makes sense given it shows off a lot important hyperlight features. I also think it makes sense to add a wit host+guest to this command as well, but can do that later