janet-lang / jpm

Janet Project Manager
MIT License
65 stars 21 forks source link

No subcommand to create project with `create-executable` #74

Closed sogaiu closed 1 year ago

sogaiu commented 1 year ago

As noted in this discussion:

In my view to create an executable should be the standard template for new-project

I agree that it would be nice for there to be some convenient way to create a new project that by default has an appropriate create-executable form in it.

I don't know whether that should be new-project, hence this issue instead of a PR.

pepe commented 1 year ago

I had the same thought when reading the discussion.

sogaiu commented 1 year ago

I guess one relatively simple idea would be another subcommand like new-exe-project or new-project-with-exe.

MarcusE1W commented 1 year ago

How about new-exec or new-executable ?

sogaiu commented 1 year ago

Yeah, may be those are nicely shorter names, perhaps fitting for the situation of quickly wanting to make a small executable :)

Though with such names I might expect a project.janet file that has content without declare-source, i.e. like:

(declare-project
  :name "fun"
  :description "Nice name"
  :version "0.0.0")

(declare-executable
  :name "fun"
  :entry "fun/init.janet")
sogaiu commented 1 year ago

On a side note, the file scaffold.janet code seems to have some "Python PEP292" templating features in it. I wonder if something based on that would be a good addition to spork...

Anyway, I'll see if I can put together a draft PR using the name new-exe-project.

Possibly the -project extension makes sense to have because when looking over the other subcommand names like quickbin, a name like new-exe* (without -project) might be confusing.

Another name can be chosen if discussion indicates there is a better choice.

sogaiu commented 1 year ago

75 has been created.