Makefile 🔗
@@ -11,7 +11,8 @@ install:
test: build
go test ./...
-webui:
+pack-webui:
npm run --prefix webui build
+ go run webui/pack_webui.go
.PHONY: build install test
Michael Muré created
Makefile | 3 ++-
README.md | 2 --
webui/.gitignore | 2 --
webui/packed_assets.go | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 39 insertions(+), 5 deletions(-)
@@ -11,7 +11,8 @@ install:
test: build
go test ./...
-webui:
+pack-webui:
npm run --prefix webui build
+ go run webui/pack_webui.go
.PHONY: build install test
@@ -75,8 +75,6 @@ This web UI is entirely packed inside the same go binary and serve static conten
The web UI interact with the backend through a GraphQL API. The schema is available [here](graphql/schema.graphql).
-Note: the compiled web UI is not commited in git for now so you will have to install npm packages and build it before compiling the go binary.
-
## Internals
Interested by how it works ? Have a look at the [data model](doc/model.md).
@@ -17,5 +17,3 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-
-packed_assets.go
@@ -0,0 +1,248 @@
+// Code generated by vfsgen; DO NOT EDIT.
+
+// +build deploy_build
+
+package webui
+
+import (
+ "bytes"
+ "compress/gzip"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "os"
+ pathpkg "path"
+ "time"
+)
+
+// WebUIAssets statically implements the virtual filesystem provided to vfsgen.
+var WebUIAssets = func() http.FileSystem {
+ fs := vfsgen۰FS{
+ "/": &vfsgen۰DirInfo{
+ name: "/",
+ modTime: time.Date(2018, 8, 6, 12, 12, 50, 500208387, time.UTC),
+ },
+ "/asset-manifest.json": &vfsgen۰CompressedFileInfo{
+ name: "asset-manifest.json",
+ modTime: time.Date(2018, 8, 6, 12, 12, 50, 404205812, time.UTC),
+ uncompressedSize: 96,
+
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xaa\xe6\x52\x50\x50\xca\x4d\xcc\xcc\xd3\xcb\x2a\x56\xb2\x52\x50\x2a\x2e\x49\x2c\xc9\x4c\xd6\xcf\x2a\xd6\x07\x0b\x1a\x98\x9b\x1b\x9b\x18\x9b\x59\x82\x64\x75\x90\x94\xea\xe5\x26\x16\xe0\x57\x0e\x56\xc1\x55\x0b\x08\x00\x00\xff\xff\x38\x8c\x8d\x35\x60\x00\x00\x00"),
+ },
+ "/favicon.ico": &vfsgen۰CompressedFileInfo{
+ name: "favicon.ico",
+ modTime: time.Date(2018, 8, 6, 12, 12, 43, 824029330, time.UTC),
+ uncompressedSize: 3870,
+