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

Move elm-scripts into a separate package (like create-react-app) #183

Open
jackfranklin opened this issue Sep 29, 2017 · 4 comments
Open
Labels
discussion An issue that requires a discussion feature A feature request

Comments

@jackfranklin
Copy link
Contributor

Let's say as as user I have created my app with c-e-a and now I want to setup npm run deploy which runs elm-app build and then some custom deploy script.

This will work if I have elm-app installed globally but it means that all my colleagues also have to ensure they are running the same version.

What create-react-app does is install react-scripts locally into the new project it creates. react-scripts contains the build, start, test and eject commands. It then creates a package.json with this in:

scripts: {
  "start": "react-scripts start",
   ...
}

This also means if they update react-scripts with a bug fix, any user can get that fix by installing the latest react-scripts.

I think we should consider replicating this for create-elm-app as I think it adds a few benefits. What do you think @halfzebra ? :)

@jackfranklin
Copy link
Contributor Author

Alternatively, c-e-a should add itself as a dependency of the new project and then this works as designed but is less effort. See how I've done it here: https://github.com/jackfranklin/do-you-even-elm/blob/master/package.json

@halfzebra
Copy link
Owner

halfzebra commented Sep 29, 2017

@jackfranklin this is a good idea!

We are trying to avoid introducing a local package.json and local npm dependencies as long as it is possible to reduce the initial complexity of the setup and keep a default global encapsulated config on user's machine to work with all Elm Apps they have created.

I don't know if that's a reasonable ambition, personally, I prefer to use a single global version of Create Elm App and introduce local npm dependencies in Elm Apps if it's totally necessary.

I have started splitting up the project already, but I there's no consensus on local npm dependencies yet. Let's get some more feedback and try to figure out the best way of pulling this off.

My original motivation for splitting the project is to simplify the development process on the utilities and see what kind of opportunities we will get in the context of extensibility. I would like to enable users to fork elm-app-scripts to customize the build setup for situations like #134 #174 #175 #176 #178

@halfzebra halfzebra added discussion An issue that requires a discussion feature A feature request labels Sep 29, 2017
@jackfranklin
Copy link
Contributor Author

I think in any realistic project it's pretty likely that you will end up needing a package.json and some npm dependencies - I was in fact surprised to see that c-e-a didn't do it for you. Normally now I run c-e-a and then npm init to get going.

@gyzerok
Copy link
Contributor

gyzerok commented Oct 28, 2017

Isn’t it possible to just npm i —save-dev create-elm-app && npx elm-app build to solve the described issue? Why would you need to split anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion An issue that requires a discussion feature A feature request
Projects
None yet
Development

No branches or pull requests

3 participants