diff --git a/src/web/api/build.cmd b/src/web/api/build.cmd deleted file mode 100644 index f9f8e24e5..000000000 --- a/src/web/api/build.cmd +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -cd %~dp0 -bash -c "./build.sh" - diff --git a/src/web/api/build.sh b/src/web/api/build.sh old mode 100644 new mode 100755 index 35a7f9503..d3fe6e4b2 --- a/src/web/api/build.sh +++ b/src/web/api/build.sh @@ -8,6 +8,10 @@ PROTO_LIST="../../lib/api/*.proto ../../lib/api/services/*.proto ../../lib/domai alias npx='npx --no-install' +if [ ! -d "node_modules" ]; then + npm install +fi + # Run pbjs to produce protobuf module echo \* pbjs npx pbjs -t json-module -w commonjs -o $OUT/api/proto.js $PROTO_LIST @@ -17,6 +21,7 @@ npx pbjs -t json-module -w commonjs -o $OUT/api/proto.js $PROTO_LIST # We generate them here and then delete them after the typescript build echo \* protoc mkdir src/gen 2> /dev/null +PYTHONPATH=../../../externals/linux/python/ \ ../../../externals/linux/bin/protoc \ --plugin=protoc-gen-service=../../lib/api/service_compiler/plugin.py \ --service_out=lang=js,strip_out_path=1:src/gen \ @@ -25,7 +30,7 @@ mkdir src/gen 2> /dev/null $PROTO_LIST # run typescript compiler to convert typescript to javascript -echo \* tsc +echo \* tsc -- Errors in descriptor.ts are OK npx tsc -p tsconfig.release.json # cleanup @@ -37,9 +42,22 @@ ts2fable() { for FILE in $1/*.d.ts; do filename=$(basename -- $FILE) filename="${filename%.d.ts}" - npx ts2fable $1/$filename.d.ts $1/$filename.fs + npx ts2fable $1/$filename.d.ts $1/$filename.fs & done + wait } ts2fable $OUT/api -ts2fable $OUT/api/gen \ No newline at end of file +ts2fable $OUT/api/gen + +if [ "$1" == "-full" ]; then + echo \* fable + cd ../ui/ + if [ ! -d "node_modules" ]; then + npm install + fi + cd src + dotnet restore + dotnet fable webpack -- -p + cp ../public/* ../$OUT/ui/ +fi