Mercurial > code > home > repos > streamed-graph
comparison tasks.py @ 130:73a70d00fb74
dep upgrades; working on build+release setup
author | drewp@bigasterisk.com |
---|---|
date | Sat, 06 May 2023 13:11:19 -0700 |
parents | 9a57f8c556d2 |
children | 8a30f1c9a702 |
comparison
equal
deleted
inserted
replaced
129:f47661b9ed34 | 130:73a70d00fb74 |
---|---|
2 from invoke import task # pytype: disable=import-error | 2 from invoke import task # pytype: disable=import-error |
3 | 3 |
4 | 4 |
5 @task | 5 @task |
6 def setup_js(ctx): | 6 def setup_js(ctx): |
7 if 0: # only reasonable on bang,but dash tries to rebuild it | 7 if 0: # only reasonable on bang,but dash tries to rebuild it |
8 ctx.run('pnpm install --dir=$PWD') | 8 ctx.run('pnpm install --dir=$PWD') |
9 | |
9 | 10 |
10 @task(pre=[setup_js]) | 11 @task(pre=[setup_js]) |
11 def serve_demo(ctx): | 12 def serve_demo(ctx): |
12 ctx.run('webfsd -Fp 8021') | 13 ctx.run('webfsd -Fp 8021') |
13 | 14 |
15 | |
14 @task(pre=[setup_js]) | 16 @task(pre=[setup_js]) |
15 def build(ctx): | 17 def build(ctx): |
16 ctx.run(f'pnpm run build', pty=True) | 18 ctx.run(f'pnpm run build', pty=True) |
19 | |
17 | 20 |
18 @task(pre=[setup_js]) | 21 @task(pre=[setup_js]) |
19 def build_forever(ctx): | 22 def build_forever(ctx): |
20 ctx.run(f'pnpm run build_forever', pty=True) | 23 ctx.run(f'pnpm run build_forever', pty=True) |
21 | 24 |
25 | |
22 @task(pre=[setup_js]) | 26 @task(pre=[setup_js]) |
23 def test(ctx): | 27 def test(ctx): |
24 ctx.run(f'pnpm run test', pty=True) | 28 ctx.run(f'pnpm run test', pty=True) |
29 | |
25 | 30 |
26 @task(pre=[setup_js]) | 31 @task(pre=[setup_js]) |
27 def test_forever(ctx): | 32 def test_forever(ctx): |
28 ctx.run(f'pnpm run test_forever', pty=True) | 33 ctx.run(f'pnpm run test_forever', pty=True) |
29 | 34 |
35 | |
30 @task | 36 @task |
31 def release(ctx): | 37 def release(ctx): |
32 ctx.run(f'pnpm publish --registry https://bigasterisk.com/js', pty=True) | 38 ctx.run('pnpm whoami --registry https://bigasterisk.com/js') |
39 diffs = ctx.run('hg status') | |
40 if diffs.stdout.strip(): | |
41 print(" ^^ commit these diffs first") | |
42 return | |
43 v = ctx.run('pnpm version minor').stdout.strip() | |
44 ctx.run(f'hg commit --message "release {v}"') | |
45 build(ctx) | |
46 filesRoot = '/my/site/homepage/newsrc/files' | |
47 path = f'lib/streamed-graph/{v}/' | |
48 outdir = f'{filesRoot}/{path}' | |
49 name = 'streamed-graph.es.js' | |
50 ctx.run(f'mkdir -p {outdir}') | |
51 ctx.run(f'cp dist/{name} {outdir}') | |
52 ctx.run('cd /my/site/homepage; inv build') | |
53 ctx.run( | |
54 "curl -s -o/dev/null -w '%{url_effective} %{http_code} bytes=%{size_download}\n' " | |
55 + "https://bigasterisk.com/" + path + name, | |
56 pty=True) | |
57 # this fails with ENEEDAUTH: | |
58 #ctx.run(f'pnpm publish --registry https://bigasterisk.com/js', pty=True) | |
59 | |
33 | 60 |
34 @task | 61 @task |
35 def dev(ctx): | 62 def dev(ctx): |
36 ctx.run('pnpm dev') | 63 ctx.run('pnpm dev') |
37 | 64 |
65 | |
38 @task | 66 @task |
39 def deps(ctx): | 67 def deps(ctx): |
40 ctx.run('node_modules/.bin/depcruise --config .dependency-cruiser.js -T dot src | dot -Tsvg > deps.svg') | 68 ctx.run( |
69 'node_modules/.bin/depcruise --config .dependency-cruiser.js -T dot src | dot -Tsvg > deps.svg' | |
70 ) | |
41 print(f"browse to file://{os.path.abspath('deps.svg')}") | 71 print(f"browse to file://{os.path.abspath('deps.svg')}") |