diff --git a/Makefile b/Makefile index a3d17c5016..02dda82a38 100644 --- a/Makefile +++ b/Makefile @@ -37,14 +37,14 @@ $(APP_EXE) $(PROBE_EXE): go get -tags netgo ./$(@D) go build -ldflags "-extldflags \"-static\" -X main.version $(GIT_REVISION)" -tags netgo -o $@ ./$(@D) -static: client/dist/scripts/bundle.js - esc -o app/static.go -prefix client/dist client/dist +static: client/build/app.js + esc -o app/static.go -prefix client/build client/build -client/dist/scripts/bundle.js: client/app/scripts/* - mkdir -p client/dist +client/build/app.js: client/app/scripts/* + mkdir -p client/build docker run -ti -v $(shell pwd)/client/app:/home/weave/app \ - -v $(shell pwd)/client/dist:/home/weave/dist \ - $(SCOPE_UI_BUILD_IMAGE) gulp build + -v $(shell pwd)/client/build:/home/weave/build \ + $(SCOPE_UI_BUILD_IMAGE) gulp build --release client-test: client/test/* docker run -ti -v $(shell pwd)/client/app:/home/weave/app \ @@ -62,7 +62,7 @@ $(SCOPE_UI_BUILD_EXPORT): client/Dockerfile client/gulpfile.js client/package.js clean: go clean ./... - rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_EXPORT) client/dist + rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_EXPORT) client/build deps: go get \ diff --git a/client/.gitignore b/client/.gitignore index 2f4628a1ad..dd87e2d73f 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -1,6 +1,2 @@ node_modules -dist -.tmp -.sass-cache -bower_components -test/bower_components +build diff --git a/client/Dockerfile b/client/Dockerfile index 7eeb476ce1..8efe53933d 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -14,6 +14,6 @@ RUN npm install -g gulp ADD package.json /home/weave/ RUN npm install -ADD gulpfile.js /home/weave/ +ADD gulpfile.js webpack.config.js .eslintrc /home/weave/ # For instructions on running this container, consult the toplevel Makefile diff --git a/client/README.md b/client/README.md index c4ed8e4c63..6b1bd9b096 100644 --- a/client/README.md +++ b/client/README.md @@ -2,7 +2,14 @@ ## Getting Started -- Install: `npm install` -- Run `gulp` for building to the `dist` directory or `gulp serve` to serve the UI via a webserver -- Develop using `gulp watch` for automatic code reload +- Setup: `npm install` +- Build: `gulp build --release`, output will be in `build/` +- Develop: `gulp sync` and then open `http://localhost:3000/` + +To see a topology, `../app/app` needs to be running, as well as a probe. + +## Coding + +This directory has a `.eslintrc`, make sure your editor supports linter hints. +To run a linter, you also run `gulp lint`. diff --git a/client/app/index.html b/client/app/index.html index 3688c79140..981cd91dbd 100644 --- a/client/app/index.html +++ b/client/app/index.html @@ -5,14 +5,6 @@