Add "new" command for scaffolding projects#15
Conversation
|
@mbpolan love it. Can you expand a little on how the templates work? For example, could any of the examples be a template? |
|
@tiny-dancer The idea with these templates is to set up a "starter" project based on the choices the user makes in the prompts, similar to how CRA/expo will initialize a working project for you to start hacking. Right now, this just creates the necessary runiac config files and skeleton directories. Ideally I'd like to bootstrap these with something like the examples, just haven't settled on an approach yet. I've looked at a few ideas on how to bundle those static files with our CLI. The most promising feature is the embed package, but that requires Go 1.16. For our version of Go, some possibilities include a packager like rice. Was planning on this being the next iteration of this feature. |
|
@mbpolan hugo or gatsby might be a good reference here as well. TL/DR instead of bundling with the cli pull over the wire in a conventionalized way. that could lead to something like https://www.gatsbyjs.com/starters/ |
…runiac into feature/cli-new-command
|
@tiny-dancer I've reworked this PR a bit to be more general. I also dropped the command line arguments I originally had in favor of interactive prompts. A user can now run
|
|
In conjunction with this pull request will also be looking to have the default container be set to a |
|
Also take note runiac.io and docs have a repo of their own: https://github.com/runiac/website |
|
@tiny-dancer Makes sense to me. I swapped the default container to |
Unit Test Results 1 files 15 suites 0s ⏱️ Results for commit e542a38. ♻️ This comment has been updated with latest results. |
Proposed changes
This PR adds a
newcommand to the CLI. The intent is to quickly scaffold a new runiac project with recommended directory structures. The usage is to runruniac newand let the interactive prompts guide the user. Depending on the choices the user makes, the following actions are done:git initis run if it is installed and the user chooses to use itruniac.ymlis createdentrypoint.shis createdruniac initis executed in the target directory with the correct base Docker imageOutput of a custom scaffold using a single set of steps:
Output of a custom scaffold using the
trackstemplate:Issues for these changes
N/A
Types of changes
Checklist
README.md,CHANGELOG.md, etc. - if appropriate)Dependencies and Blockers
N/A
Relevant Links
N/A
Further comments
Much of this
newcommand takes inspiration from other various CLIs, includingexpo initandnpm init. The idea is to give the user either guided prompts to give answers, or command line arguments for powerusers.