-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of checking in binaries like `ui/bindata.go` and `template/internal/deftmpl/bindata.go` into git, we generate them whenever `make build` is run. If they already exist, we only regenerate them if they are outdated. When one makes changes to the front-end and runs the single command `make-build` on the root level Makefile, the front-end is rebuild accordingly. `make build` will use Docker to build the front-end. If someone prefers to install all the dev dependencies on their local machine instead, one can add the `NO_DOCKER=true` flag. For folks that only want to make back-end changes `ui/app/script.js` is checked in, so they do not have to build the front-end.
- Loading branch information
Showing
9 changed files
with
66 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ | |
!/circle.yml | ||
!/.travis.yml | ||
!/.promu.yml | ||
|
||
ui/bindata.go | ||
|
||
/template/internal/deftmpl/bindata.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
dist/ | ||
elm-stuff/ | ||
script.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
ELM_FILES := $(shell find src -iname *.elm) | ||
format: $(ELM_FILES) | ||
elm-format --yes $? | ||
DOCKER_IMG :=elm-env | ||
DOCKER_CMD := docker run --rm -t -v $(PWD):/app -w /app $(DOCKER_IMG) | ||
TEMPFILE := $(shell mktemp ./elm-XXXXXXXXXX.js) | ||
|
||
test: | ||
elm-test | ||
ifeq ($(NO_DOCKER), true) | ||
DOCKER_CMD= | ||
endif | ||
|
||
elm-env: | ||
@(if [ "$(NO_DOCKER)" != "true" ] ; then \ | ||
echo ">> building elm-env docker image"; \ | ||
docker build -t $(DOCKER_IMG) ../. > /dev/null; \ | ||
fi; ) | ||
|
||
format: elm-env $(ELM_FILES) | ||
@echo ">> format front-end code" | ||
@$(DOCKER_CMD) elm-format --yes $(ELM_FILES) | ||
|
||
test: elm-env | ||
@$(DOCKER_CMD) elm-format $(ELM_FILES) --validate | ||
@$(DOCKER_CMD) elm-test | ||
|
||
dev-server: | ||
elm-reactor | ||
|
||
TEMPFILE := $(shell mktemp /tmp/elm-XXXXXXXXXX.js) | ||
script.js: $(ELM_FILES) | ||
elm make src/Main.elm --yes --output $(TEMPFILE) | ||
uglifyjs $(TEMPFILE) --compress unused --mangle --output $(@) | ||
rm $(TEMPFILE) | ||
script.js: elm-env format $(ELM_FILES) | ||
@echo ">> building script.js" | ||
@$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE) | ||
@$(DOCKER_CMD) uglifyjs $(TEMPFILE) --compress unused --mangle --output $(@) | ||
@rm $(TEMPFILE) | ||
|
||
clean: | ||
- @rm script.js | ||
@docker rmi $(DOCKER_IMG) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.