Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
151 lines (134 loc) · 4.79 KB
/
Copy pathTaskfile.yml
File metadata and controls
151 lines (134 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: '3'
tasks:
# Placeholder assets so `go build` works without a yarn build.
stub_assets:
cmds:
- ./scripts/stub-assets.sh
asset_lib:
dir: ./toolgui-web/lib
cmds:
- yarn
- yarn build
- yarn typecheck
asset_app:
dir: ./toolgui-web/app
cmds:
- yarn
- yarn build
- yarn typecheck
# tgframe's tests in a browser. The origin private file system the wasm file
# store keeps uploads in exists nowhere else, and the synchronous handles it
# reads and writes through are a dedicated worker's only -- which is why the
# app runs in one too. Needs a Chrome or Chromium on PATH, or TOOLGUI_BROWSER
# pointing at one.
#
# tgframe rather than ./toolgui/...: tgexec serves over HTTP, and a listening
# socket is one of the things a tab does not have.
test_wasm:
vars:
RUNNER: '{{.RUNNER | default "/tmp/toolgui-wasmtest"}}'
cmds:
- go build -o {{.RUNNER}} ./scripts/wasmtest
- GOOS=js GOARCH=wasm go test -exec {{.RUNNER}} ./toolgui/tgframe/...
./toolgui/tgwasm/...
# Builds into toolgui-wails/assets, which assets.go embeds.
asset_wails:
dir: ./toolgui-web/wails
cmds:
- yarn
- yarn build
- yarn typecheck
asset_wasm:
dir: ./toolgui-web/wasm
cmds:
- yarn
- yarn build
- yarn typecheck
run_demo:
cmds:
- task: asset_lib
- task: asset_app
- go run ./cmd/toolgui-demo
run_todo:
cmds:
- task: asset_lib
- task: asset_app
- go run ./cmd/toolgui-todo
# The wails CLI builds the frontend and the app, and supplies the build tags
# and macOS frameworks a desktop build needs. Needs the webview deps, see
# toolgui-wails/README.md.
wails_hello:
internal: true
dir: ./toolgui-wails/example/hello
vars:
# webkit2_41 is Linux only, and only for distributions that dropped
# WebKit2GTK 4.0. Override with TAGS= on one that still ships it.
DEFAULT_TAGS: '{{if eq OS "linux"}}webkit2_41{{end}}'
TAGS: '{{.TAGS | default .DEFAULT_TAGS}}'
TAG_FLAG: '{{if .TAGS}}-tags {{.TAGS}}{{end}}'
cmds:
# The CLI generates bindings before it builds the frontend, so the embed
# in assets.go has to resolve before any of it runs.
- task: stub_assets
- go tool wails {{.WAILS_CMD}} {{.TAG_FLAG}}
# Desktop demo, with the frontend served from disk and a Go file watcher.
run_wails_hello:
cmds:
- task: wails_hello
vars:
WAILS_CMD: dev
# Desktop demo as a packaged binary, in example/hello/build/bin.
build_wails_hello:
cmds:
- task: wails_hello
vars:
WAILS_CMD: build
# Static site for the wasm example, in toolgui/tgwasm/example/hello/build.
build_wasm_hello:
cmds:
- task: asset_lib
- task: asset_wasm
- go run ./cmd/toolgui-wasm build -o toolgui/tgwasm/example/hello/build
./toolgui/tgwasm/example/hello
# The same, served at localhost:3000. Nothing runs on the server side; the
# command is there so a .wasm arrives as application/wasm.
run_wasm_hello:
cmds:
- task: asset_lib
- task: asset_wasm
- go run ./cmd/toolgui-wasm serve -o toolgui/tgwasm/example/hello/build
./toolgui/tgwasm/example/hello
# The demo as a static site, the way GitHub Pages publishes it.
build_wasm_demo:
cmds:
- task: asset_lib
- task: asset_wasm
- go run ./cmd/toolgui-wasm build -o cmd/toolgui-demo/build ./cmd/toolgui-demo
run_wasm_demo:
cmds:
- task: asset_lib
- task: asset_wasm
- go run ./cmd/toolgui-wasm serve -o cmd/toolgui-demo/build ./cmd/toolgui-demo
# The same demo, into the directory the book's component pages embed it
# from. docs/src rather than docs/book: mdBook copies what is not a .md out
# of src, and wipes anything else it finds in book. So this is built once
# and every `mdbook build` or `mdbook serve` after it carries the demo.
build_docs_demo:
cmds:
- task: asset_lib
- task: asset_wasm
- go run ./cmd/toolgui-wasm build -o docs/src/demo ./cmd/toolgui-demo
# The end to end tests of the browser build, against the demo as a static
# site. They are a run of their own rather than more specs in the web one:
# the pages are the same and the transport underneath is not, so what runs
# here is the half that differs -- above all an upload far larger than the
# tab could hold, which is what the streaming transport is for.
#
# Run `task run_wasm_demo` in another shell first, or serve the build some
# other way at 127.0.0.1:3000. It has to be localhost: the origin private
# file system uploads go into belongs to a secure context.
test_e2e_wasm:
dir: ./toolgui-e2e
cmds:
- yarn
- yarn cypress run --browser chrome --config-file cypress-wasm.config.js