Repository navigation
wasi: reorganize — internal/ machinery, no cycles, no deprecated baggage - #146
Merged
Merged
Conversation
The package's public subpath surface stays exactly as designed (one subpath per impl); the reorganization is everything behind it. STRUCTURE. Non-fragment machinery moves to src/internal/ (never exported): fs_provider, sockets_platform, and the sockets tracks. The sockets module becomes four cleanly-layered files — sockets_shared.ts (WIT types, address codec, wasmtime-parity validation, platform error mapping), sockets_03.ts and sockets_02.ts (the tracks), and the public sockets.ts (fragment factory + docs + vocabulary re-exports). This deletes the deliberate sockets.ts <-> sockets_02.ts import cycle: both tracks now import the shared vocabulary, nothing imports a sibling. Same cut for cli: internal/cli_shared.ts (ExitError, terminal resources, track types) severs cli_stdio's import of the capture impl; ./cli remains the vocabulary's public home. BAGGAGE DELETED (external consumers all pin the OLD @deltic/wasi-shims package at old SHAs — verified — so nothing consumes these): * wasiShims / WasiShims / WasiShimsOptions (mod.ts + the release bundle's re-exports + the header's rename-transition note), * cli-stdio's StdinStream / StdoutStream / STDIO_HIGH_WATER aliases (superseded by io.ts's FedInputStream / SinkOutputStream / STREAM_HIGH_WATER when the classes moved in #141). ROOT MODULE TRIMMED to the batteries surface: wasi(), the option types, CliCaptured, and ExitError (thrown through throwOnExit, so batteries embedders classify it). Everything else lives at its subpath; the composition doc's fragment-dependency notes updated to match (io.ts is the package-wide vocabulary; internal/ is the machinery layer). No behavior change intended; wasi suite 179 green, full gates pass (publish-check covers the JSR surface of the new layout, the bundle builds with the trimmed entry, browser + OPFS lanes green).
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.
Reorganizes the wasi package with no compatibility baggage. The public subpath surface (
./cli,./cli-stdio,./clocks,./filesystem{,-node,-web},./http,./io,./random,./sockets) stays exactly as designed — the reorganization is everything behind it.Structure
sockets.ts ↔ sockets_02.ts(the "cyclic on purpose, hoisting makes it safe" arrangement) is replaced by both tracks importingsockets_shared.ts; nothing imports a sibling.internal/cli_shared.ts;./cliremains its public home.Baggage deleted
Verified first: every external consumer (polymorph family, wosh) pins the old
@deltic/wasi-shimspackage at old commit SHAs — nothing consumes the current package's deprecated names.wasiShims/WasiShims/WasiShimsOptions(mod.ts, release-bundle entry, header transition note)StdinStream/StdoutStream/STDIO_HIGH_WATERaliases (superseded by./io'sFedInputStream/SinkOutputStream/STREAM_HIGH_WATER)wasi,WasiOptions,WasiImports,CliCaptured+ option types,ExitError); everything else at its subpath.Verification
No behavior change intended. wasi suite 179 green; full
just gatespass — notablypublish-check(the JSR surface over the new layout),test-bundle(trimmed entry), browsers + OPFS smoke, and the consumer smokes (smoke-tlsconsumesmod.tsdirectly).