EddyLane / cloudcatcher-elm-learning

1 stars 0 forks source link

Installation instructions for an Elm newbie? #1

Closed PaulCapestany closed 8 years ago

PaulCapestany commented 8 years ago

Hi—this project looked super interesting to me due to the fact that it seems to be using PouchDB in an Elm language project... however, there seem to be quite a few different moving parts and I'm not totally sure how best to try getting this to run locally.

Any help/pointers/tips at all would be hugely appreciated (no worries otherwise though)!

EddyLane commented 8 years ago

Hi Paul!

Thats great, this project was really a bit of a learning experience with me getting started with Elm and I didn't expect anyone else to use it! I'm not 100% where I actually left it, but I can give you a little advise:

This uses TypeScript and JSPM so after you'll want to npm install -g jspm and then jspm install to fully set up the deps. It uses tsd for typings, so npm install -g tsd and tsd reinstall --save will give you the typings. Then you'll need to use elm-reactor for the Elm stuff.

I've since sortof ditched this project as i'm trying to build this out into a project with a Phoenix backend (https://github.com/EddyLane/cloudcatcher-phoenix-elm) but that'll probably be as tricky to get running as this one!

If I can give you any specific advise just let me know :)

EddyLane commented 8 years ago

Oh, so once you've done all the above, you'll need to serve the directory somehow! I use python simplehttpserver but you can use whatever will allow you to hit the index.html file :)

PaulCapestany commented 8 years ago

@EddyLane thanks for the replies!

So, I followed your directions, but then ran into a slight issue with some missing node modules for bootstrap and some other things. However, simply running npm install seems to have solved that.

With that taken care of though, when then attempting to serve the app via running python -m SimpleHTTPServer I get the following 404 error:

127.0.0.1 - - [02/Mar/2016 14:59:40] code 404, message File not found
127.0.0.1 - - [02/Mar/2016 14:59:40] "GET /dist/Main.js HTTP/1.1" 404 -

I guess I'm missing some build/installation step still?

EddyLane commented 8 years ago

Hi, That's my fault! Sorry it's been a while since I booted up this project.

I'm actually using gulp and gulp-elm instead of elm-reactor. You should just need to run gulp elm to build once or gulp watch to watch for changes, that should build out the Main.js file to the dist directory.

Let me know how you get on :)

EDIT @PaulCapestany You'll need a new-ish version of node because I use const keyword in the gulpfile and to install gulp globally with npm install -g gulp.

PaulCapestany commented 8 years ago

Ok, cool, just tried out your advice and it all worked—thanks!