Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ./mill init with the example projects (500USD Bounty) #3548

Open
lihaoyi opened this issue Sep 15, 2024 · 5 comments
Open

Integrate ./mill init with the example projects (500USD Bounty) #3548

lihaoyi opened this issue Sep 15, 2024 · 5 comments
Labels

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Sep 15, 2024


From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


Mill's example/ folder projects are all zipped up and published for download with every release, and form a far more comprehensive and richly documented set of project templates than is available on giter8. We should update ./mill init to prioritize using these examples as getting started templates for users using ./mill init. We can continue to support giter8 if we want, but I expect the built in example templates will be what people want 99% of the time and render external giter8 templates largely unnecessary.

Success criteria:

  • When you run ./mill init without any argument, it shows the user a list of all the Mill example/ projects, grouped and organized in some meaningful way
  • The user can then select one of those example projects (e.g. by typing in its number in the list, or its path e.g. javalib/basic/1-simple) and Mill will download the project from the Mill Releases page and unpack it into the local directory
  • The user can also pass in the path of the example as an argument, and as long as it matches one of the accepted example paths, Mill will download and unpack the example zip rather than use giter8

The list of valid examples can vary between Mill versions, and should be computed at build time as a resource generator and bundled together with Mill during creation of its dist.assembly.

@lihaoyi lihaoyi changed the title Integrate ./mill init with the example projects Integrate ./mill init with the example projects (500USD Bounty) Sep 15, 2024
@lihaoyi lihaoyi added the bounty label Sep 15, 2024
@pawelsadlo
Copy link
Contributor

does it need to run interactively, prompting example number just like init is working now?
or its ok to ask user to run ./mill init [number or path of example]

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 19, 2024

@pawelsadlo no need interactivly for now, AFAIK mill init today is non interactive:

$ ./mill init
Creating a new project...
Error: Missing argument <template>
Try --help for more information.

I think it would be fine just to print out a big list of potential templates and then ask the user to copy paste the one they want for now. Once all the example templates are all wired up and in place, we can separately look at tweaking the CLI experience

@pawelsadlo
Copy link
Contributor

Ah right , the g8 template generation is interactive, not the init command.
Anyway can mill command even be interactive without running creating a subprocess?

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 19, 2024

./mill -i does allow interactive stuff, like console. Even without a subprocess you can do the same thing and read/write from stdin/stdout

@lefou
Copy link
Member

lefou commented Sep 19, 2024

For the purpose of copy-and-paste in tutorials and readmes, it would be nice when mill init can be used non-interactively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants