annotate tasks.py @ 126:9a57f8c556d2

add depgraph task
author drewp@bigasterisk.com
date Fri, 05 May 2023 21:22:35 -0700
parents 5e6840229a05
children 73a70d00fb74
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
126
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
1 import os
0
drewp@localhost
parents:
diff changeset
2 from invoke import task # pytype: disable=import-error
drewp@localhost
parents:
diff changeset
3
drewp@localhost
parents:
diff changeset
4
drewp@localhost
parents:
diff changeset
5 @task
60
0d0638bd98be use pnpm
drewp@bigasterisk.com
parents: 50
diff changeset
6 def setup_js(ctx):
92
8db5ba7e12b9 pnpm install is slow & broken over nfs with a mismatching abspath
drewp@bigasterisk.com
parents: 90
diff changeset
7 if 0: # only reasonable on bang,but dash tries to rebuild it
8db5ba7e12b9 pnpm install is slow & broken over nfs with a mismatching abspath
drewp@bigasterisk.com
parents: 90
diff changeset
8 ctx.run('pnpm install --dir=$PWD')
0
drewp@localhost
parents:
diff changeset
9
68
f357cd36c26e pnpm install is cheap; do it all the time
drewp@bigasterisk.com
parents: 60
diff changeset
10 @task(pre=[setup_js])
0
drewp@localhost
parents:
diff changeset
11 def serve_demo(ctx):
35
29d8ed02a275 build and tests, including jsonld
drewp@bigasterisk.com
parents: 33
diff changeset
12 ctx.run('webfsd -Fp 8021')
0
drewp@localhost
parents:
diff changeset
13
68
f357cd36c26e pnpm install is cheap; do it all the time
drewp@bigasterisk.com
parents: 60
diff changeset
14 @task(pre=[setup_js])
0
drewp@localhost
parents:
diff changeset
15 def build(ctx):
60
0d0638bd98be use pnpm
drewp@bigasterisk.com
parents: 50
diff changeset
16 ctx.run(f'pnpm run build', pty=True)
29
45ed53428e74 fix configs to run tests (all in one bundle though)
drewp@bigasterisk.com
parents: 25
diff changeset
17
68
f357cd36c26e pnpm install is cheap; do it all the time
drewp@bigasterisk.com
parents: 60
diff changeset
18 @task(pre=[setup_js])
29
45ed53428e74 fix configs to run tests (all in one bundle though)
drewp@bigasterisk.com
parents: 25
diff changeset
19 def build_forever(ctx):
60
0d0638bd98be use pnpm
drewp@bigasterisk.com
parents: 50
diff changeset
20 ctx.run(f'pnpm run build_forever', pty=True)
9
26d3e4860adc working on porting graph_view to n3.js. also working on making tests run
drewp@bigasterisk.com
parents: 0
diff changeset
21
68
f357cd36c26e pnpm install is cheap; do it all the time
drewp@bigasterisk.com
parents: 60
diff changeset
22 @task(pre=[setup_js])
9
26d3e4860adc working on porting graph_view to n3.js. also working on making tests run
drewp@bigasterisk.com
parents: 0
diff changeset
23 def test(ctx):
60
0d0638bd98be use pnpm
drewp@bigasterisk.com
parents: 50
diff changeset
24 ctx.run(f'pnpm run test', pty=True)
29
45ed53428e74 fix configs to run tests (all in one bundle though)
drewp@bigasterisk.com
parents: 25
diff changeset
25
68
f357cd36c26e pnpm install is cheap; do it all the time
drewp@bigasterisk.com
parents: 60
diff changeset
26 @task(pre=[setup_js])
29
45ed53428e74 fix configs to run tests (all in one bundle though)
drewp@bigasterisk.com
parents: 25
diff changeset
27 def test_forever(ctx):
60
0d0638bd98be use pnpm
drewp@bigasterisk.com
parents: 50
diff changeset
28 ctx.run(f'pnpm run test_forever', pty=True)
90
6077fdc9ed44 inv release
drewp@bigasterisk.com
parents: 68
diff changeset
29
6077fdc9ed44 inv release
drewp@bigasterisk.com
parents: 68
diff changeset
30 @task
6077fdc9ed44 inv release
drewp@bigasterisk.com
parents: 68
diff changeset
31 def release(ctx):
6077fdc9ed44 inv release
drewp@bigasterisk.com
parents: 68
diff changeset
32 ctx.run(f'pnpm publish --registry https://bigasterisk.com/js', pty=True)
108
5e6840229a05 rewrite freeStatements rendering to put more planning in layout
drewp@bigasterisk.com
parents: 92
diff changeset
33
5e6840229a05 rewrite freeStatements rendering to put more planning in layout
drewp@bigasterisk.com
parents: 92
diff changeset
34 @task
5e6840229a05 rewrite freeStatements rendering to put more planning in layout
drewp@bigasterisk.com
parents: 92
diff changeset
35 def dev(ctx):
126
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
36 ctx.run('pnpm dev')
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
37
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
38 @task
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
39 def deps(ctx):
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
40 ctx.run('node_modules/.bin/depcruise --config .dependency-cruiser.js -T dot src | dot -Tsvg > deps.svg')
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents: 108
diff changeset
41 print(f"browse to file://{os.path.abspath('deps.svg')}")