wende / elchemy

Write Elixir code using statically-typed Elm-like syntax (compatible with Elm tooling)
https://wende.github.io/elchemy/
MIT License
1.15k stars 28 forks source link

Add one step generator for new projects #117

Open wende opened 7 years ago

wende commented 7 years ago

Add:

Example:

elmchemy new my_project
mix test 
# 0

->

my_project/
├── elm-package.json
├── mix.exs
├── elm
    ├── Hello.elm
├── lib
    ├── Hello.ex
├── tests
    ├── hello_test.exs
Hajto commented 7 years ago

I technically could do that.

Hajto commented 7 years ago

Shouldn't files be named after project name or something? What contents should those files have?

wende commented 7 years ago

They (elm/File.elm, tests/file_test.exs) could be parametrized to the name of the project. The main idea is to cut the boilerplate and hopefully generate something self-explanatory code with benefits of learning all the essential basics with just a template

Hajto commented 7 years ago

@wende Do you still want to store files under Elm directory after name change?

Hajto commented 7 years ago

@wende Mix task is created and it does work. It needs more testing though. I have no idea how to put in production.

Sample usage. Go into installer and call:

mix elchemy.new erlang_style_name --location where_to_put_files
Hajto commented 7 years ago

Also help needs to be written.

wende commented 7 years ago

@wende Do you still want to store files under Elm directory after name change

That's a good question actually. I think it's worth leaving it as it is until we're using .elm extension and Elm tooling

wende commented 7 years ago

@Baransu Let me know when you're feeling like picking up this issue