update to new react UI and various fixes

This commit is contained in:
Jon Lundy
2018-03-13 16:25:18 -06:00
parent 1dcd0f73cf
commit 0a6fa4bc53
14 changed files with 98 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
ROUTE_ASSET=routes/bindata_assetfs.go
ROUTE_FILES=public/index.html public/app.js public/paste.sh public/style.css
ROUTE_ASSET=routes/bindata.go
ROUTE_FILES=$(wildcard assets/src/*) $(wildcard assets/public/*)
VENDOR_FILES=$(wildcard vendor/*)
@@ -11,6 +11,11 @@ all: $(BINARY)
clean:
rm -f $(BINARY) $(ROUTE_ASSET) $(ROUTE_FILES)
setup:
dep ensure
go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
run: $(BINARY)
./$(BINARY) -vv serve
@@ -18,29 +23,21 @@ $(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES)
go build
$(ROUTE_ASSET): $(ROUTE_FILES)
export PATH=$$GOPATH/bin:$$PATH; cd routes; go-bindata-assetfs -pkg routes -prefix ../ ../public/
public/index.html: assets/index.html assets/ui/*
cd assets; \
(sed '/INSERT_TEMPLATES/Q' index.html; \
for f in ui/*.html; \
do echo "<script id='$$f' type='text/ng-template'>"; \
html-minifier --minify-css --collapse-whitespace $$f; \
echo '</script>'; \
done; \
sed '1,/INSERT_TEMPLATES/d;/REMOVE_ASSET_START/,/REMOVE_ASSET_END/d' index.html) \
| html-minifier --minify-css --collapse-whitespace > ../public/index.html
rm -rf build ../public; \
npm run build; \
cp -r build ../public; \
export PATH=$$GOPATH/bin:$$PATH; \
cd ../routes; \
go-bindata-assetfs -pkg routes \
-prefix ../ \
../public/ \
../public/static/css/ \
../public/static/js/ \
../public/static/media/
public/app.js: assets/lib.js assets/app.js
cat assets/lib.js assets/app.js | uglifyjs > public/app.js
public/paste.sh: assets/paste.sh
cp assets/paste.sh public/paste.sh
public/style.css: assets/*.css
cleancss assets/*.css > public/style.css
deploy: $(SOURCE) $(ROUTE_ASSET)
cd debian && make && make deploy
cd debian && make
.PHONEY: clean deploy run
.PHONEY: all clean deploy run setup