simplify setup process
This commit is contained in:
parent
2573262e2b
commit
9f19116d3e
5 changed files with 51 additions and 17 deletions
10
.travis.yml
10
.travis.yml
|
@ -2,15 +2,13 @@ language: node_js
|
|||
node_js: 5
|
||||
|
||||
install:
|
||||
- gem install sass
|
||||
- npm install -g babel-cli
|
||||
- npm install babel-preset-es2015 babel-preset-react
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- mkdir -p dist/css dist/js
|
||||
- sass scss/all.scss dist/css/all.css
|
||||
- babel -V
|
||||
- babel --presets es2015,react --out-dir dist/js js
|
||||
- node_modules/.bin/node-sass scss/all.scss dist/css/all.css
|
||||
- node_modules/.bin/babel -V
|
||||
- node_modules/.bin/babel --presets es2015,react --out-dir dist/js js
|
||||
- mkdir upload
|
||||
- cd dist; zip -r ../upload/dist.zip *; cd -
|
||||
- .travis/echo_sha.sh > upload/data.json
|
||||
|
|
1
LICENSE.md
Normal file
1
LICENSE.md
Normal file
|
@ -0,0 +1 @@
|
|||
See https://github.com/lbryio/lbry/blob/master/LICENSE
|
10
README.md
10
README.md
|
@ -8,10 +8,7 @@ These steps will get you to change-reload-see:
|
|||
|
||||
- Install [LBRY](https://github.com/lbryio/lbry/releases)
|
||||
- Install node and npm ([this gist may be useful](https://gist.github.com/isaacs/579814))
|
||||
- Install babel (`npm install -g babel-cli`)
|
||||
- Install babel presets (`npm install babel-preset-es2015 babel-preset-react`)
|
||||
- Install [SASS](http://sass-lang.com/install)
|
||||
- Run `./watch.sh`
|
||||
- Run `./watch.sh` (this will `npm install` dependencies)
|
||||
- Run `lbrynet-daemon --ui=/full/path/to/dist/`
|
||||
- Changes made in `js` and `sass` will be auto compiled to `dist`
|
||||
- `lbrynet-daemon --branch=branchname` can be used to test remote branches
|
||||
|
@ -22,5 +19,6 @@ These steps will get you to change-reload-see:
|
|||
1. Error: Couldn't find preset "es2015" relative to directory "js"
|
||||
|
||||
Fix with:
|
||||
npm install babel-preset-es2015 --save
|
||||
npm install babel-preset-react --save
|
||||
|
||||
npm install babel-preset-es2015 --save
|
||||
npm install babel-preset-react --save
|
||||
|
|
27
package.json
Normal file
27
package.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "lbry-web-ui",
|
||||
"version": "1.0.0",
|
||||
"description": "LBRY web ui",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lbryio/lbry-web-ui.git"
|
||||
},
|
||||
"keywords": [
|
||||
"lbry"
|
||||
],
|
||||
"author": "Alex Liebowitz <aliebowitz@lbry.io>",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lbryio/lbry-web-ui/issues"
|
||||
},
|
||||
"homepage": "https://github.com/lbryio/lbry-web-ui#readme",
|
||||
"dependencies": {
|
||||
"babel-cli": "^6.11.4",
|
||||
"babel-preset-es2015": "^6.13.2",
|
||||
"babel-preset-react": "^6.11.1",
|
||||
"node-sass": "^3.8.0"
|
||||
}
|
||||
}
|
20
watch.sh
20
watch.sh
|
@ -1,9 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
trap 'jobs -p | xargs kill' EXIT
|
||||
set -euo pipefail
|
||||
#set -x
|
||||
|
||||
mkdir -p dist/css
|
||||
mkdir -p dist/js
|
||||
#trap 'kill $(jobs -p)' EXIT # IS THIS NECESSARY? on linux, it kills all child processes when you ctrl-c
|
||||
|
||||
sass --watch scss:dist/css --sourcemap=none &
|
||||
babel --presets es2015,react --out-dir dist/js/ --watch js/
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
mkdir -p $DIR/dist/css
|
||||
mkdir -p $DIR/dist/js
|
||||
|
||||
if [ ! -d "$DIR/node_modules" ]; then
|
||||
echo "Installing NPM modules"
|
||||
npm install
|
||||
fi
|
||||
|
||||
$DIR/node_modules/.bin/node-sass --output $DIR/dist/css --sourcemap=none --watch $DIR/scss/ &
|
||||
$DIR/node_modules/.bin/babel --presets es2015,react --out-dir $DIR/dist/js/ --watch $DIR/js/
|
||||
|
|
Loading…
Reference in a new issue