Skip to content

Commit

Permalink
🧩 [consolidate]: Separate build and bundle steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyp committed Oct 21, 2024
1 parent e990c30 commit bfb7136
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
yarn install
set -x -e
yarn purs-tidy check src/**/*.purs test/**/*.purs
yarn build-website
yarn build
yarn build-standalone-all
./script/compile.sh
./script/bundle-website.sh
./script/bundle.sh test Test.Test
./script/bundle-standalone-all.sh
yarn test-all
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"tidy": "./script/tidy.sh",
"build-website": "./script/build-website.sh",
"build": "./script/build.sh test Test.Test",
"build-test": "./script/build.sh test Test.Test",
"build-article": "./script/build-article.sh",
"build-bench": "./script/build.sh bench Test.Benchmark",
"build-ESOP-artifact": "./script/build-ESOP-artifact.sh",
Expand Down
15 changes: 0 additions & 15 deletions script/build-article.sh

This file was deleted.

6 changes: 0 additions & 6 deletions script/build.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdir -p dist
cp -r fluid dist
cp -r web/css dist

./script/build-standalone.sh EsopFig2
./script/build-standalone.sh EsopFig4
./script/bundle-standalone.sh EsopFig2
./script/bundle-standalone.sh EsopFig4

cp -r web/ESOP-artifact.html dist/index.html
12 changes: 12 additions & 0 deletions script/bundle-article.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# run from project root
set -xe

rm -rf dist/article
mkdir -p dist/article

cp -r fluid dist/article
cp -r web/css dist/article
cp web/template.html dist/article/index.html

./script/util/bundle.sh article Standalone.Article
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -e

for FILE in src/Standalone/*.purs; do
NAME=$(basename $FILE .purs)
. script/build-standalone.sh $NAME
. script/bundle-standalone.sh $NAME
done
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ if [[ ! -e "src/Standalone/$NAME.purs" ]]; then
exit 1
fi

# Could factor this through build.sh but currently these are shared by all standalone figures
cp -r fluid dist
cp -r web/css dist

Expand All @@ -20,8 +19,7 @@ echo "$1 -> $NAME_LISP_CASE"
rm -rf dist/$NAME_LISP_CASE
mkdir -p dist/$NAME_LISP_CASE

# ./script/compile.sh
./script/bundle.sh $NAME_LISP_CASE Standalone.$NAME
./script/util/bundle.sh $NAME_LISP_CASE Standalone.$NAME

if [[ -e "src/Standalone/$NAME.html" ]]; then
cp src/Standalone/$NAME.html dist/$NAME_LISP_CASE/index.html
Expand Down
2 changes: 1 addition & 1 deletion script/build-website.sh → script/bundle-website.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -xe

./script/build.sh / Standalone.Website
./script/bundle.sh / Standalone.Website

# TODO: run build-standalone.sh for each separate page that features on the website

Expand Down
4 changes: 3 additions & 1 deletion script/bundle.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -xe
yarn purs-backend-es bundle-app --main $2 --to dist/$1/fluid.js ${@:3}

. script/clean.sh $1
. script/util/bundle.sh ${@:1}
3 changes: 3 additions & 0 deletions script/util/bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -xe
yarn purs-backend-es bundle-app --main $2 --to dist/$1/fluid.js ${@:3}

0 comments on commit bfb7136

Please sign in to comment.