js: ship the jco-transpile wrapper as a bin; export the shared driver glue - #67
Merged
Conversation
… glue Continuation of #5's one-harness consolidation: the case loop moved upstream, but three consumer-glue pieces stayed copied per repo and diverged — the jco-transpile CLI wrapper (three copies, existing only because @bytecodealliance/jco-transpile publishes the library without its CLI; the webrtc copy's no-eager-subtask-return option folded in), the wasi/test-context import binding for -I async instantiation, and the suite.replaceAll("-","_") lockfile-identity reconciliation in every runner. - js/jco-transpile.mjs, packaged as the component-test-jco-transpile bin; resolves @bytecodealliance/jco-transpile from the invoking package so each consumer keeps pinning its own toolchain. - js/viewer/imports.mjs (exports ./imports): bindImports over the caller's preview2-shim namespaces + explicit environment + SUT imports, bare and versioned spellings both (wasiVersions covers components built against later wasi 0.2 minors). - envelope() normalizes the suite name to the wasm-stem identity; a no-op for the already-normalized names every caller passes. verify-imports (plain node, in `all`) pins the glue; verify-node's byte-for-byte goldens pin the envelope no-op. Fixes #58.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #58 (umbrella #14, continuation of #5). Three consumer-glue pieces, currently copied per repo with drift:
component-test-jco-transpilebin (js/jco-transpile.mjs): the thrice-copied wrapper (webcrypto/websocket/webrtc, 8-line pairwise diffs), superset version — webrtc'sno-eager-subtask-returnoption included, both wiring styles supported (--async-mode+--mapand-I async). Resolves@bytecodealliance/jco-transpilefrom the invoking package's node_modules, so consumers keep pinning their own transpiler (registry 0.5.2 and the lann-fork tarball both work)../importsexport (js/viewer/imports.mjs):bindImports— the websocket/webrtcharness.mjsbinding trio generalized: caller's preview2-shim namespaces (absent members skipped), explicit env, SUT imports, upstreamContextalways bound; bare + versioned key spellings with configurablewasiVersions(components built against wasi 0.2.6 need the exact minor — learned on the tls spike). Browser-safe, no Node APIs.envelope()normalizes the suite name to the lockfile identity (wasm stem, underscores) — thereplaceAll("-","_")hack lived in every runner copy; harness-core knowledge now lives in the harness. No-op for existing callers (verify-node's byte-for-byte goldens confirm).New
verify-importsrecipe (plain node) added tojust all. Full driver-layer unification stays out by design — that's #59.