feat(wasm): examples/wasm-viewer, an HDF5/NetCDF-4 viewer page
Drop a file (or pass ?file=<url>&path=<object>), browse the tree lazily, see a dataset's type, shape, max shape and attributes, and page through its values as 50x12 hyperslab windows (leading dims of 3-D+ data held at chosen indices). build.sh produces pkg/ (not committed) with wasm-bindgen --target web and checks the CLI matches the crate version. test/run.sh builds it and runs test.mjs under Node against the h5py/ netCDF4 fixture (250 checks: every dataset whole and as a strided hyperslab, listings, attributes, error paths, the page's DOM-free helpers), then browser.sh renders the page in headless Chromium for eight objects and checks the DOM. The fixture gains LZ4 (read) and Zstd (refused: links C) datasets and a compound attribute (value null plus its type). ci-test.sh runs it when node and wasm-bindgen exist; the CI container has neither, so CI relies on the native h5py_interop test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -121,6 +121,19 @@ run_step "wasm32 clippy (clawhdf5-wasm)" cargo clippy \
|
||||
--all-targets \
|
||||
-- -D warnings
|
||||
|
||||
# The built wasm package, run under Node against h5py/netCDF4-written files,
|
||||
# and the viewer page in headless Chromium when one is found.
|
||||
# Needs node and the wasm-bindgen CLI, which the CI container does not have;
|
||||
# the same expectations are checked natively by clawhdf5-wasm's h5py_interop
|
||||
# test in the cargo test step.
|
||||
if command -v node >/dev/null && command -v wasm-bindgen >/dev/null; then
|
||||
run_step "wasm package under Node (+ browser)" bash "$SCRIPT_DIR/../examples/wasm-viewer/test/run.sh"
|
||||
else
|
||||
echo ""
|
||||
echo "==> [wasm package under Node] SKIPPED: needs node and wasm-bindgen"
|
||||
STEPS+=("SKIP: wasm package under Node")
|
||||
fi
|
||||
|
||||
# The workspace declares a minimum Rust version (rust-version in Cargo.toml);
|
||||
# check that it really builds there, so the README badge and the manifests
|
||||
# cannot drift from the truth. Separate target dir: a different toolchain
|
||||
|
||||
Reference in New Issue
Block a user