diff --git a/Makefile b/Makefile index 34583b5..4e803df 100644 --- a/Makefile +++ b/Makefile @@ -12,31 +12,30 @@ ENV ?= $(shell export $(cat .env | xargs)) all: build .PHONY: install -install: $(wildcard *.go) +install: $(wildcard *.go) $(GOPATH)/bin/packr $(GOPATH)/bin/packr install -v -ldflags '-w $(LDFLAGS)' $(MAIN_PKG) .PHONY: build build: $(EXECUTABLE) -$(EXECUTABLE): $(GO_SOURCES) $(SQL_SOURCES) assets/build $(GOPATH)/bin/packr - $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG) +$(EXECUTABLE): $(GO_SOURCES) assets/build + go build -o $@ $(MAIN_PKG) dist: assets/dist build/fathom-linux-amd64 -build/fathom-linux-amd64: $(GOPATH)/bin/packr +build/fathom-linux-amd64: $(GOPATH)/bin/packr $(SQL_SOURCES) $(GO_SOURCES) $(JS_SOURCES) GOOS=linux GOARCH=amd64 $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG) $(GOPATH)/bin/packr: GOBIN=$(GOPATH)/bin go get github.com/gobuffalo/packr/... - assets/build: $(JS_SOURCES) if [ ! -d "node_modules" ]; then npm install; fi - gulp + ./node_modules/gulp/bin/gulp.js assets/dist: $(JS_SOURCES) if [ ! -d "node_modules" ]; then npm install; fi - NODE_ENV=production gulp + NODE_ENV=production ./node_modules/gulp/bin/gulp.js .PHONY: clean clean: diff --git a/README.md b/README.md index 707ff02..a06a2d5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ For getting a development version of Fathom up & running, go through the followi 1. Ensure you have [Golang](https://golang.org/doc/install#install) installed properly 1. Get code: `git clone git@github.com:usefathom/fathom.git $GOPATH/src/github.com/usefathom/fathom` 1. Compile into binary & prepare assets: `make build` +1. (Optional) Set your [custom configuration values](https://github.com/usefathom/fathom/wiki/Configuration-file). 1. Register your user account: `fathom register --email= --password=` 1. Start the webserver: `fathom server` and then visit **http://localhost:8080** to access your analytics dashboard. @@ -23,7 +24,7 @@ To install and run Fathom in production, [have a look at the installation instru #### Tracking snippet -To start tracking, include the following JavaScript on your site and replace `yourfathom.com` with the URL to your Fathom instance (twice). +To start tracking, include the following JavaScript on your site and replace `yourfathom.com` with the URL to your Fathom instance. ```html diff --git a/assets/src/js/components/Chart.js b/assets/src/js/components/Chart.js index ba7dfed..dccaa05 100644 --- a/assets/src/js/components/Chart.js +++ b/assets/src/js/components/Chart.js @@ -98,7 +98,7 @@ class Chart extends Component { } let padding = { top: 12, right: 12, bottom: 24, left: 40 }; - let height = Math.max( this.base.clientHeight, 240 ); + let height = 240; let width = this.base.clientWidth; let innerWidth = width - padding.left - padding.right; let innerHeight = height - padding.top - padding.bottom; diff --git a/assets/src/js/components/DatePicker.js b/assets/src/js/components/DatePicker.js index 0cca746..45f7d2f 100644 --- a/assets/src/js/components/DatePicker.js +++ b/assets/src/js/components/DatePicker.js @@ -45,19 +45,22 @@ class DatePicker extends Component { let startDate = new Date(); startDate.setHours(0); startDate.setMinutes(0); + startDate.setSeconds(0); let endDate = new Date(); - endDate.setHours(24); - endDate.setMinutes(0); + endDate.setHours(23); + endDate.setMinutes(59); + endDate.setSeconds(59); switch(period) { case "week": startDate.setDate(startDate.getDate() - (startDate.getDay() + 6) % 7); - endDate.setDate(startDate.getDate() + 7); + endDate.setDate(startDate.getDate() + 6); break; case "month": startDate.setDate(1); - endDate.setMonth(endDate.getMonth() + 1); + endDate.setDate(5); // because every month has date 5... use date-fn here later on + endDate.setMonth(startDate.getMonth() + 1); endDate.setDate(0); break; case "year": diff --git a/gulpfile.js b/gulpfile.js index 28f8cff..57241e8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -68,8 +68,8 @@ gulp.task('sass', function () { }); gulp.task('watch', ['default'], function() { - gulp.watch(['./assets/js/**/*.js'], ['browserify'] ); - gulp.watch(['./assets/sass/**/**/*.scss'], ['sass'] ); - gulp.watch(['./assets/**/*.html'], ['html'] ); - gulp.watch(['./assets/img/**/*'], ['img'] ); + gulp.watch(['./assets/src/js/**/*.js'], ['browserify'] ); + gulp.watch(['./assets/src/sass/**/**/*.scss'], ['sass'] ); + gulp.watch(['./assets/src/**/*.html'], ['html'] ); + gulp.watch(['./assets/src/img/**/*'], ['img'] ); });