Browse Source

Consolidate *.do files

bonjour-mdns-experiment
Tony Garnock-Jones 3 years ago
parent
commit
caf5302c18
  1. 2
      all.do
  2. 2
      clean.do
  3. 0
      packages/core/all.do
  4. 12
      packages/default.do
  5. 30
      packages/default.js.do
  6. 1
      packages/driver-browser-ui/all.do
  7. 1
      packages/driver-browser-ui/clean.do
  8. 5
      packages/driver-browser-ui/default.js.do
  9. 1
      packages/driver-http-node/all.do
  10. 1
      packages/driver-http-node/clean.do
  11. 5
      packages/driver-http-node/default.js.do
  12. 1
      packages/driver-timer/all.do
  13. 1
      packages/driver-timer/clean.do
  14. 5
      packages/driver-timer/default.js.do
  15. 1
      packages/driver-udp-node/all.do
  16. 1
      packages/driver-udp-node/clean.do
  17. 5
      packages/driver-udp-node/default.js.do
  18. 1
      packages/driver-websocket/all.do
  19. 1
      packages/driver-websocket/clean.do
  20. 5
      packages/driver-websocket/default.js.do
  21. 2
      packages/syntax-playground/all.do
  22. 2
      packages/syntax-playground/clean.do
  23. 16
      packages/syntax-playground/default.js.do
  24. 1
      packages/syntax/_all.do
  25. 3
      packages/syntax/all.do
  26. 1
      packages/syntax/clean.do
  27. 14
      packages/syntax/default.js.do

2
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

2
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

0
packages/core/all.do

12
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

30
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

1
packages/driver-browser-ui/all.do

@ -1 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange

1
packages/driver-browser-ui/clean.do

@ -1 +0,0 @@
rm -rf lib

5
packages/driver-browser-ui/default.js.do

@ -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"

1
packages/driver-http-node/all.do

@ -1 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange

1
packages/driver-http-node/clean.do

@ -1 +0,0 @@
rm -rf lib

5
packages/driver-http-node/default.js.do

@ -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"

1
packages/driver-timer/all.do

@ -1 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange

1
packages/driver-timer/clean.do

@ -1 +0,0 @@
rm -rf lib

5
packages/driver-timer/default.js.do

@ -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"

1
packages/driver-udp-node/all.do

@ -1 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange

1
packages/driver-udp-node/clean.do

@ -1 +0,0 @@
rm -rf lib

5
packages/driver-udp-node/default.js.do

@ -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"

1
packages/driver-websocket/all.do

@ -1 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange

1
packages/driver-websocket/clean.do

@ -1 +0,0 @@
rm -rf lib

5
packages/driver-websocket/default.js.do

@ -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"

2
packages/syntax-playground/all.do

@ -1,2 +0,0 @@
for d in src/*.js; do echo lib/$(basename $d); done | xargs redo-ifchange
redo-ifchange dist/main.js

2
packages/syntax-playground/clean.do

@ -1,2 +0,0 @@
rm -rf lib
rm -rf dist

16
packages/syntax-playground/default.js.do

@ -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

1
packages/syntax/_all.do

@ -0,0 +1 @@
redo-ifchange lib/babel_parser.js

3
packages/syntax/all.do

@ -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

1
packages/syntax/clean.do

@ -1 +0,0 @@
rm -rf lib

14
packages/syntax/default.js.do

@ -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
Loading…
Cancel
Save