From 19932812e410c2213c602a2446ef4bfddb611dce Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Wed, 5 Oct 2016 14:17:17 -0400 Subject: [PATCH] Add package.json, automate installing js packages --- Makefile | 7 +++++-- README | 25 ++++++++++++++++++++----- package.json | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 package.json diff --git a/Makefile b/Makefile index 911a49c..550a295 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,13 @@ JS_SOURCES = $(wildcard js/*.js) $(wildcard js/*/*.js) all: static/bundle.js static/react-widgets -static/bundle.js: $(JS_SOURCES) +node_modules: + npm install + +static/bundle.js: $(JS_SOURCES) node_modules browserify -t [ babelify --presets [ react ] ] js/main.js -o static/bundle.js -static/react-widgets: node_modules/react-widgets/dist +static/react-widgets: node_modules/react-widgets/dist node_modules rsync -a node_modules/react-widgets/dist/ static/react-widgets/ .PHONY = all diff --git a/README b/README index 3396e6b..6e3ab7b 100644 --- a/README +++ b/README @@ -4,10 +4,25 @@ Installation ============ First, install npm in your distribution: -$ sudo pacman -S npm + $ sudo pacman -S npm -Install browserify globally: -$ sudo npm install -g browserify +Install browserify globally using npm: + $ sudo npm install -g browserify -Next, install browserify, babel, react, react-bootstrap, react-widgets, globalize, and big.js in our directory using npm: -$ npm install browserify react react-dom react-addons-update react-bootstrap react-widgets redux react-redux redux-thunk babelify babel-preset-react globalize cldr-data big.js keymirror +You'll then want to build everything (the Golang and Javascript portions) using +something like: + + $ export GOPATH=`pwd` + $ go get -v github.com/aclindsa/moneygo + $ go generate -v github.com/aclindsa/moneygo + $ go install -v github.com/aclindsa/moneygo + +Running +======= + +Assuming you're in the same directory you ran the above installation comands +from, running MoneyGo is then as easy as: + + $ ./bin/moneygo \ + -port 8080 \ + -base src/github.com/aclindsa/moneygo/ diff --git a/package.json b/package.json new file mode 100644 index 0000000..7cb61ea --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "moneygo", + "version": "0.0.1", + "description": "A personal finance web application", + "main": "js/main.js", + "dependencies": { + "babel-preset-react": "^6.16.0", + "babelify": "^7.3.0", + "big.js": "^3.1.3", + "browserify": "^13.1.0", + "cldr-data": "^29.0.2", + "globalize": "^1.1.1", + "keymirror": "^0.1.1", + "react": "^15.3.2", + "react-addons-update": "^15.3.2", + "react-bootstrap": "^0.30.5", + "react-dom": "^15.3.2", + "react-redux": "^4.4.5", + "react-widgets": "^3.4.4", + "redux": "^3.6.0", + "redux-thunk": "^2.1.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/aclindsa/moneygo.git" + }, + "author": "Aaron Lindsay", + "bugs": { + "url": "https://github.com/aclindsa/moneygo/issues" + }, + "homepage": "https://github.com/aclindsa/moneygo#README" +}