jackfranklin / jspm-dev-builder

Incremental development builds with jspm
66 stars 7 forks source link

Create a CLI Tool #10

Open jackfranklin opened 8 years ago

jackfranklin commented 8 years ago

So people don't have to implement the CLI tool themselves.

It should allow the user to run a command which:

blittle commented 8 years ago

Want some help in building a cli?

jackfranklin commented 8 years ago

@blittle would love some!

blittle commented 8 years ago

I'm pretty invested in jspm right now, so I'd love to help. I'll hold off until we can figure out https://github.com/jackfranklin/jspm-dev-builder/issues/9 which has me baffled.

jackfranklin commented 8 years ago

:+1: agreed, pretty keen to route out the problem of #9.

blittle commented 8 years ago

@jackfranklin Would it be best to include the CLI within this or a separate project?

jackfranklin commented 8 years ago

I'd like it with this.

jackfranklin commented 8 years ago

@blittle BTW let's not hold off on this, happy to take PRs whenever. #9 looks like being a pain!

peteruithoven commented 8 years ago

It might not have to hook into a hot reloader thing. The jspm-dev-builder cli could just be running, rebuilding (incrementally) on file changes separately from someone's favorite webserver (like browser-sync or caddy) and something like the chokidar-socket-emitter. Using the jspm-dev-server the last two are combined. This would allow much faster initial site loading and full page refreshes and a hot reloader could then pick up regular file changes, enabling retaining state.

This could easily be combined in a npm script like:

"scripts": {
  "start": "npm run serve & npm run build & npm run emitchanges",
  "serve": "browser-sync start --server",
  "build": "jspm-dev-builder -w",
  "emitchanges": "chokidar-socket-emitter"
},
jackfranklin commented 8 years ago

As of jspm-0.17-beta12 this is now built in to jspm. I don't see much reason to build this for older jspms (I'd like to encourage movement to latest version!) but if someone would like to I'd still be happy to include it.

ArmorDarks commented 8 years ago

@peteruithoven Or I'm mistaken, or your npm start will never work as you expect it to work. It will run Browser Sync and then will stuck with it, so npm run build will be never executed

peteruithoven commented 8 years ago

@ArmorDarks No, this works, maybe you're confusing the & with &&.

ArmorDarks commented 8 years ago

Turns out & doesn't work in Win's cmd native environment. The only way to do same thing is to use node-run-all with --parallel flag. So, my bad, sorry.