Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

elm-package init #122

Closed
rtorr opened this issue Aug 23, 2015 · 6 comments
Closed

elm-package init #122

rtorr opened this issue Aug 23, 2015 · 6 comments
Labels

Comments

@rtorr
Copy link

rtorr commented Aug 23, 2015

enhancement request:

Knowing that one of the main goals of Elm is to make "getting started" as quick as javascript development, I thought this might be a great addition.

When writing front-end or back-end projects or modules with javascript, for the last few years I have been using NPM. Getting a basic project setup is as easy as npm init. It seems like this might be overthinking, but we get this same functionality once we install a package.

rtorr@~/git/elm-tmp> elm-package install evancz/elm-html 
To install evancz/elm-html I would like to add the following
dependency to elm-package.json:

    "evancz/elm-html": "4.0.1 <= v < 5.0.0"

May I add that to elm-package.json for you? (y/n) y

Some new packages are needed. Here is the upgrade plan.

  Install:
    elm-lang/core 2.1.0
    evancz/elm-html 4.0.1
    evancz/virtual-dom 2.0.0

Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Downloading evancz/elm-html
Downloading evancz/virtual-dom
Packages configured successfully!

elm-package init would produce the same workflow as installing a package May I add that to elm-package.json for you? (y/n)

Maybe some more interesting defaults to elm-package.json would be great too. I might try a PR if interested.

It would be really rad if a new user only had to do elm-package init and get everything they need to compile their new program with a main and hello world.

@eeue56
Copy link
Contributor

eeue56 commented Aug 27, 2015

+1.

This would provide a similar use to things like yo generators. At the moment it's not too much of a hassle to get people to download a standard zip containing elm-package.json, Main.elm, index.html, but it would be a lot nicer if it was built straight into elm.

Filling out things like repository from git config --get remote.origin.url would also be very helpful.

This also ties into elm-lang/elm-make#23. Some of the suggestions in there would be more suited to being part of elm-package first and foremost, then called when hitting an error from elm-make. Point number 1 is a great example in there of this - there should be an elm-package init command so that the user doesn't have to run something they wouldn't expect to generate (elm-make) a skeleton in order to start a project.

@flip111
Copy link

flip111 commented Oct 6, 2015

good suggestion

@eeue56 i think the repo url thing is duplicated here #131

what would also be useful with an init command is to write a .gitignore file if none is present. By the way does anyone have a good template for gitignore in elm projects?

@eeue56
Copy link
Contributor

eeue56 commented Oct 6, 2015

I thought about the .gitignore. It would make more sense I think for a .gitignore for Elm to be added to Github's defaults, like every other language. The most common workflow that I see people use with Github is always

  • Create a new repo
  • Set the default README
  • git clone the repo
  • add .gitignore
  • Write some basic structure for elm
  • Run elm-make

This proposal makes it so that the workflow instead becomes

  • Create a new repo
  • set the default .gitignore + README as done with other languages
  • git clone the repo
  • elm-package init
  • write some elm

@Apanatshka
Copy link

There are (I think multiple) PRs open to add an Elm.gitignore to GitHub's gitignores repository. Sadly there is very little activity around merging those PRs.

@eeue56
Copy link
Contributor

eeue56 commented Oct 6, 2015

There are, with github/gitignore#1440 being the first made, but I think github/gitignore#1610 is the most complete. According to the contribution docs, the only thing that that PR is missing is a link to an official source talking about a valid .gitignore for a standard Elm projects.

@evancz
Copy link
Contributor

evancz commented Mar 7, 2018

Having a good "get started" path makes sense. I do not think it would look exactly like this though. Some current ideas are to have an elm call with nothing ask if you want to get a project set up. Or to have elm reactor notice that you have no elm.json and offer to start a project for you. Things like that.

Point is, this is in consideration, but having this issue open should not change the time-to-completion.

@evancz evancz closed this as completed Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants