File tree Expand file tree Collapse file tree 15 files changed +69
-46
lines changed
Expand file tree Collapse file tree 15 files changed +69
-46
lines changed Original file line number Diff line number Diff line change 11{
2- "presets" : [ " es2016-node5 " , " stage-1 " ],
2+ "presets" : [ " grind " ],
33 "plugins" : [
4- " babel-plugin-import-auto-name" ,
5- " babel-plugin-transform-isnil" ,
64 [
75 " babel-plugin-module-alias" , [
86 { "src" : " ./app" , "expose" : " App" },
Original file line number Diff line number Diff line change 11language : node_js
22node_js :
3- - " 5"
43 - " 6"
4+ - " 7"
55sudo : false
6- install : " npm install"
76script : " bin/lint"
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ bin/cli db:seed
1515``` bash
1616# Use `watch` to automatically restart the server on file changes
1717# Watch is recommended for development
18- bin/watch
18+ bin/cli watch
1919
2020# Use `serve --cluster` to launch a cluster of workers
2121# Cluster is recommended for production
22- bin/serve --cluster
22+ bin/cli serve --cluster
2323
2424# Use `serve` to launch a single worker
25- bin/serve
25+ bin/cli serve
2626```
2727
2828You should now be able to go to [ localhost:3000/states] ( http://localhost:3000/states ) .
Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ cd "`dirname "$BASH_SOURCE"`"
77
88WORKING_DIR=` pwd`
99
10- if [ -d " $WORKING_DIR /../node_modules" ];
11- then
10+ if [ -d " $WORKING_DIR /../node_modules" ]; then
1211 NODE_ROOT=" $WORKING_DIR /../node_modules"
13- elif [ -d " $WORKING_DIR /../node_modules" ];
14- then
12+ elif [ -d " $WORKING_DIR /../../node_modules" ]; then
1513 NODE_ROOT=" $WORKING_DIR /../../node_modules"
1614else
1715 NODE_ROOT=` npm root`
Original file line number Diff line number Diff line change @@ -4,23 +4,29 @@ source ${0%/*}/.init
44
55strip_babel () {
66 cp " $1 " " $1 -tmp"
7- cat " $1 -tmp" | sed ' s/babel-node/node \-\-es_staging/g' > " $1 "
7+
8+ if [ $( node -e ' console.log(Number.parseFloat(process.version.substring(1)) >= 7)' ) == " true" ]; then
9+ cat " $1 -tmp" | sed ' s/babel-node/node/g' | sed ' s/FLAGS=.*$/FLAGS="--harmony-async-await"/g' > " $1 "
10+ else
11+ cat " $1 -tmp" | sed ' s/babel-node/node/g' | sed ' s/FLAGS=.*$/FLAGS=""/g' > " $1 "
12+ fi
13+
814 rm " $1 -tmp"
915}
1016
1117echo " Cleaning up old build"
1218rm -fr build
1319
1420echo " Building"
21+
1522mkdir build build/app build/boot
1623babel -s inline -d build/app/ app/
1724babel -s inline -d build/boot/ boot/
1825
1926echo " Setting up bins"
2027cp -R bin build/bin
21- rm build/bin/build build/bin/lint build/bin/watch
28+ rm build/bin/build build/bin/lint
2229
23- strip_babel build/bin/serve
2430strip_babel build/bin/cli
2531chmod +x build/bin/* build/bin/.init
2632
Original file line number Diff line number Diff line change @@ -6,4 +6,19 @@ popd > /dev/null
66
77source ${0%/* } /.init
88
9- IN_CLI=true CLI_BIN=" $CLI_BIN " exec babel-node boot/Cli.js " $@ "
9+ COMMAND=$1
10+
11+ if [[ " $@ " == * " --help" * ]]; then
12+ COMMAND=" $COMMAND -help"
13+ fi
14+
15+ FLAGS=$( node -e ' console.log(Number.parseFloat(process.version.substring(1)) >= 7 ? "--harmony-async-await" : "")' )
16+
17+ case $COMMAND in
18+ watch) exec babel-node $FLAGS boot/Http.js --watch=app,config $@
19+ ;;
20+ serve) exec babel-node $FLAGS boot/Http.js $@
21+ ;;
22+ * ) IN_CLI=true CLI_BIN=" $CLI_BIN " exec babel-node $FLAGS boot/Cli.js " $@ "
23+ ;;
24+ esac
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { CliProvider } from 'grind-cli'
1+ import { CliProvider } from 'grind-cli'
22import 'App/Providers/CommandsProvider'
33
44const app = require ( 'App/Bootstrap' )
55app . providers . push ( CliProvider , CommandsProvider )
66
7- app . boot ( ) . then ( ( ) => app . cli . run ( ) )
7+ app . boot ( ) . then ( ( ) => app . cli . run ( ) ) . catch ( err => {
8+ Log . error ( 'Boot Error' , err )
9+ process . exit ( 1 )
10+ } )
Original file line number Diff line number Diff line change 1- import { HttpServer } from 'grind-framework'
1+ import { HttpServer } from 'grind-framework'
22
3- ( new HttpServer ( ( ) => require ( 'App/Bootstrap' ) ) ) . start ( )
3+ ( new HttpServer ( ( ) => require ( 'App/Bootstrap' ) ) ) . start ( ) . catch ( err => {
4+ Log . error ( 'Boot Error' , err )
5+ process . exit ( 1 )
6+ } )
You can’t perform that action at this time.
0 commit comments