diff --git a/all.do b/all.do index 11ca569..8a661d3 100644 --- a/all.do +++ b/all.do @@ -1 +1 @@ -for p in packages/*; do [ -f $p/all.do ] && echo $p/all; done | xargs redo-ifchange +for p in packages/*/; do echo $p/all; done | xargs redo-ifchange diff --git a/clean.do b/clean.do index a6e376d..50a2ff2 100644 --- a/clean.do +++ b/clean.do @@ -1 +1 @@ -for p in packages/*; do [ -f $p/clean.do ] && echo $p/clean; done | xargs redo +for p in packages/*/; do echo $p/clean; done | xargs redo diff --git a/packages/core/all.do b/packages/core/all.do new file mode 100644 index 0000000..e69de29 diff --git a/packages/default.do b/packages/default.do new file mode 100644 index 0000000..6fde4c9 --- /dev/null +++ b/packages/default.do @@ -0,0 +1,12 @@ +cd "$(dirname "$1")" +case "$1" in + */all) + for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange + [ -f webpack.config.js ] && redo-ifchange dist/main.js + [ -f _all.do ] && redo-ifchange _all || true + ;; + */clean) + rm -rf lib + rm -rf dist + ;; +esac diff --git a/packages/default.js.do b/packages/default.js.do new file mode 100644 index 0000000..803d72f --- /dev/null +++ b/packages/default.js.do @@ -0,0 +1,30 @@ +# To be invoked with PACKAGENAME/lib/FOO.js or PACKAGENAME/dist/main.js +targettempfile="$(pwd)/$3" +mkdir -p "$(dirname "$1")" +cd "$(dirname "$1")"/.. +case "$1" in + syntax/lib/babel_parser.js) + src=node_modules/@babel/parser/lib/index.js + [ -f "$src" ] || npm -i . + redo-ifchange "$src" babel_parser_suffix.js + cat "$src" babel_parser_suffix.js + ;; + syntax/lib/*) + file=$(basename "$1") + redo-ifchange "src/$file" + npx babel "src/$file" + ;; + */lib/*) + redo-ifchange ../syntax/all + file=$(basename "$1") + redo-ifchange "src/$file" + npx syndicate-babel "src/$file" + ;; + */dist/*) + for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange + for maybedep in $(npx webpack --json -o "$targettempfile" | jq -r '.modules[].identifier') + do + [ -f "$maybedep" ] && echo "$maybedep" + done | xargs redo-ifchange + ;; +esac diff --git a/packages/driver-browser-ui/all.do b/packages/driver-browser-ui/all.do deleted file mode 100644 index 785671b..0000000 --- a/packages/driver-browser-ui/all.do +++ /dev/null @@ -1 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/driver-browser-ui/clean.do b/packages/driver-browser-ui/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/driver-browser-ui/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/driver-browser-ui/default.js.do b/packages/driver-browser-ui/default.js.do deleted file mode 100644 index 530131a..0000000 --- a/packages/driver-browser-ui/default.js.do +++ /dev/null @@ -1,5 +0,0 @@ -src=$(echo "$1" | sed -e 's:^lib/:src/:') -[ -f ../syntax/all.do ] && redo-ifchange ../syntax/all -redo-ifchange "$src" -mkdir -p $(dirname "$1") -npx syndicate-babel "$src" diff --git a/packages/driver-http-node/all.do b/packages/driver-http-node/all.do deleted file mode 100644 index 785671b..0000000 --- a/packages/driver-http-node/all.do +++ /dev/null @@ -1 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/driver-http-node/clean.do b/packages/driver-http-node/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/driver-http-node/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/driver-http-node/default.js.do b/packages/driver-http-node/default.js.do deleted file mode 100644 index 530131a..0000000 --- a/packages/driver-http-node/default.js.do +++ /dev/null @@ -1,5 +0,0 @@ -src=$(echo "$1" | sed -e 's:^lib/:src/:') -[ -f ../syntax/all.do ] && redo-ifchange ../syntax/all -redo-ifchange "$src" -mkdir -p $(dirname "$1") -npx syndicate-babel "$src" diff --git a/packages/driver-timer/all.do b/packages/driver-timer/all.do deleted file mode 100644 index 785671b..0000000 --- a/packages/driver-timer/all.do +++ /dev/null @@ -1 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/driver-timer/clean.do b/packages/driver-timer/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/driver-timer/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/driver-timer/default.js.do b/packages/driver-timer/default.js.do deleted file mode 100644 index 530131a..0000000 --- a/packages/driver-timer/default.js.do +++ /dev/null @@ -1,5 +0,0 @@ -src=$(echo "$1" | sed -e 's:^lib/:src/:') -[ -f ../syntax/all.do ] && redo-ifchange ../syntax/all -redo-ifchange "$src" -mkdir -p $(dirname "$1") -npx syndicate-babel "$src" diff --git a/packages/driver-udp-node/all.do b/packages/driver-udp-node/all.do deleted file mode 100644 index 785671b..0000000 --- a/packages/driver-udp-node/all.do +++ /dev/null @@ -1 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/driver-udp-node/clean.do b/packages/driver-udp-node/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/driver-udp-node/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/driver-udp-node/default.js.do b/packages/driver-udp-node/default.js.do deleted file mode 100644 index 530131a..0000000 --- a/packages/driver-udp-node/default.js.do +++ /dev/null @@ -1,5 +0,0 @@ -src=$(echo "$1" | sed -e 's:^lib/:src/:') -[ -f ../syntax/all.do ] && redo-ifchange ../syntax/all -redo-ifchange "$src" -mkdir -p $(dirname "$1") -npx syndicate-babel "$src" diff --git a/packages/driver-websocket/all.do b/packages/driver-websocket/all.do deleted file mode 100644 index 785671b..0000000 --- a/packages/driver-websocket/all.do +++ /dev/null @@ -1 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/driver-websocket/clean.do b/packages/driver-websocket/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/driver-websocket/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/driver-websocket/default.js.do b/packages/driver-websocket/default.js.do deleted file mode 100644 index 530131a..0000000 --- a/packages/driver-websocket/default.js.do +++ /dev/null @@ -1,5 +0,0 @@ -src=$(echo "$1" | sed -e 's:^lib/:src/:') -[ -f ../syntax/all.do ] && redo-ifchange ../syntax/all -redo-ifchange "$src" -mkdir -p $(dirname "$1") -npx syndicate-babel "$src" diff --git a/packages/syntax-playground/all.do b/packages/syntax-playground/all.do deleted file mode 100644 index 9dad159..0000000 --- a/packages/syntax-playground/all.do +++ /dev/null @@ -1,2 +0,0 @@ -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange -redo-ifchange dist/main.js diff --git a/packages/syntax-playground/clean.do b/packages/syntax-playground/clean.do deleted file mode 100644 index 63a0f50..0000000 --- a/packages/syntax-playground/clean.do +++ /dev/null @@ -1,2 +0,0 @@ -rm -rf lib -rm -rf dist diff --git a/packages/syntax-playground/default.js.do b/packages/syntax-playground/default.js.do deleted file mode 100644 index ee66827..0000000 --- a/packages/syntax-playground/default.js.do +++ /dev/null @@ -1,16 +0,0 @@ -mkdir -p $(dirname "$1") -case "$1" in - lib/*) - src=$(echo "$1" | sed -e 's:^lib/:src/:') - [ -f ../syntax/all.do ] && redo-ifchange ../syntax/all - redo-ifchange "$src" - mkdir -p $(dirname "$1") - npx syndicate-babel "$src" - ;; - dist/*) - for maybedep in $(npx webpack --json -o "$3" | jq -r '.modules[].identifier') - do - [ -f "$maybedep" ] && echo "$maybedep" - done | xargs redo-ifchange - ;; -esac diff --git a/packages/syntax/_all.do b/packages/syntax/_all.do new file mode 100644 index 0000000..0582df8 --- /dev/null +++ b/packages/syntax/_all.do @@ -0,0 +1 @@ +redo-ifchange lib/babel_parser.js diff --git a/packages/syntax/all.do b/packages/syntax/all.do deleted file mode 100644 index ef223c1..0000000 --- a/packages/syntax/all.do +++ /dev/null @@ -1,3 +0,0 @@ -exec >&2 -redo-ifchange lib/babel_parser.js -for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange diff --git a/packages/syntax/clean.do b/packages/syntax/clean.do deleted file mode 100644 index 9fafe3f..0000000 --- a/packages/syntax/clean.do +++ /dev/null @@ -1 +0,0 @@ -rm -rf lib diff --git a/packages/syntax/default.js.do b/packages/syntax/default.js.do deleted file mode 100644 index 4408f77..0000000 --- a/packages/syntax/default.js.do +++ /dev/null @@ -1,14 +0,0 @@ -mkdir -p $(dirname "$1") -case "$1" in - lib/babel_parser.js) - src=node_modules/@babel/parser/lib/index.js - [ -f "$src" ] || npm -i . - redo-ifchange "$src" babel_parser_suffix.js - cat "$src" babel_parser_suffix.js - ;; - *) - src=$(echo "$1" | sed -e 's:^lib/:src/:') - redo-ifchange "$src" - npx babel "$src" - ;; -esac