v0.30.1 configuration engine as wasm
Package / arch (push) Canceled after 0s
Package / user (push) Canceled after 0s
Package / deb (push) Canceled after 0s
Package / freebsd (push) Canceled after 0s
Package / image (push) Canceled after 0s
Test / test (push) Canceled after 0s
Test / e2e (push) Canceled after 0s
Package / arch (push) Canceled after 0s
Package / user (push) Canceled after 0s
Package / deb (push) Canceled after 0s
Package / freebsd (push) Canceled after 0s
Package / image (push) Canceled after 0s
Test / test (push) Canceled after 0s
Test / e2e (push) Canceled after 0s
This commit is contained in:
1 parent
883af0fcaa
commit
bfcc15613a
13 files changed
+320
-52
No files matched your search
+6
-2
@@ -26,6 +26,9 @@ The Makefile works with GNU make and BSD make alike. Targets:
|
||||
- `make build`: `bin/lw`, with version, commit and build time from git
|
||||
- `make release`: the same, static (`CGO_ENABLED=0`), `-trimpath`, stripped
|
||||
- `make dev`: built with the race detector
|
||||
- `make wasm`: `bin/lwconf.wasm`, the configuration engine for the
|
||||
website, version stamped, beside the toolchain's `wasm_exec.js`; prints
|
||||
both checksums
|
||||
- `make version`: the metadata a build would embed
|
||||
- `make completion`: regenerate the bash, zsh and fish completion in
|
||||
`deploy/package/completion/` from `cmd/lw`'s `shorts` and `commands`
|
||||
@@ -34,8 +37,9 @@ The Makefile works with GNU make and BSD make alike. Targets:
|
||||
- Check
|
||||
- `make test`: the Go tests
|
||||
- `make verify`: tests, `go vet`, `gofmt -l` on the Go files changed since
|
||||
`main`, linux and freebsd cross builds for amd64 and arm64, and the web
|
||||
client's `node --test` when node is installed
|
||||
`main`, linux and freebsd cross builds for amd64 and arm64 and the js/wasm
|
||||
one, and, when node is installed, `node --test` for the web client and
|
||||
for `cmd/lwconf` (which runs `make wasm`)
|
||||
- `make e2e`: builds, then runs every `test/*-test.sh --auto` in turn and
|
||||
reports passes, failures and skips; `E2E='test/scram-*-test.sh'` runs a
|
||||
subset; see [Test Scripts](#test-scripts)
|
||||
|
||||
+17
-10
@@ -114,14 +114,21 @@ Steps:
|
||||
optional, in `color`: export the 16 xterm reference shades (RGBTo16 maps
|
||||
the site's hues badly, so the 16-color tier is chosen by hand).
|
||||
5. `lw --tui`: done ([doc/cli.md](cli.md#lw---tui)).
|
||||
6. WebAssembly: `cmd/lwconf` (`js && wasm`) exposes schema, preset, parse,
|
||||
validate and emit to the page as JSON strings. `make wasm` builds
|
||||
`bin/lwconf.wasm` with the version stamped, copies the toolchain's
|
||||
`wasm_exec.js`, and prints both checksums. A prototype measured about 6 MB,
|
||||
1.7 MB gzipped, ready in about 60 ms in Chromium; `wasm_exec.js` uses no
|
||||
eval, so the page needs only `'wasm-unsafe-eval'` in its `script-src`.
|
||||
6. WebAssembly: done. `make wasm` builds `bin/lwconf.wasm`, version stamped,
|
||||
beside the toolchain's `wasm_exec.js`, and prints both checksums: about
|
||||
6.9 MB, 1.9 MB gzipped. `wasm_exec.js` uses no eval, so the page needs only
|
||||
`'wasm-unsafe-eval'` in its `script-src`. The page runs the module with
|
||||
`new Go().run(instance)`, then calls `globalThis.lwconf`; each call takes
|
||||
strings and returns a JSON object, `{"value": ...}` or `{"error": "..."}`:
|
||||
- `schema()`: what `lw --schema` prints.
|
||||
- `preset(name, values)`: a preset's pipelines; `values` is a JSON object
|
||||
of strings, and a directory path ends in `/`.
|
||||
- `parse(line)`: a pasted command line's pipelines.
|
||||
- `validate(pipelines)`: the pipelines settled (defaults, kinds, ids), or
|
||||
the first problem by its key path.
|
||||
- `emit(pipelines, form)`: `command`, `environment` or `file`.
|
||||
- Pipelines are a JSON list in the file's shape (`name`, `flow`,
|
||||
`plugin_sources`, `plugin_sinks`); a misspelled key is refused.
|
||||
|
||||
Verify:
|
||||
- CI builds `cmd/lwconf` for `GOOS=js` and runs a node test of its calls.
|
||||
- The diagram rendered into a cell buffer at 80x24 and 64x24, per tier; a
|
||||
scripted session on a pseudo-terminal for Run and each output.
|
||||
Still to verify: a scripted session on a pseudo-terminal for Run and each
|
||||
output.
|
||||
Reference in new issue
Block a user