Repository navigation
fix(wasm): sanitize TypeScript declarations and Wasm exports - #123
Merged
byteland-app merged 3 commits intoNov 25, 2026
Conversation
- Add scripts/postbuild-wasm.mjs to sanitize pkg/tunelet.d.ts - Replace Symbol.dispose and DOM types in pkg/tunelet.d.ts - Decode undefined HarmonyConfig.voices to 4 in src/harmony.rs - Export the Wasm binary subpaths in package.json - Read file: URL strings and cross-realm file: URLs in src/index.ts - Enable exactOptionalPropertyTypes in tsconfig.json without DOM - Check four strict TypeScript profiles in scripts/verify-pack.mjs
Contributor
|
Review: Preferred over #103, #105, #110, and #119 for TypeScript declaration hygiene (zero declare global pollution, single source of truth from tsify, TS 7.0 WasmMemory parity, and { voices: undefined } fix). Please make two small adjustments:
|
This was referenced Nov 25, 2026
- Merge origin/main into the feature branch - Pass object arguments to init and initSync in verify-pack.mjs - Check SyncInitInput parity across the four TypeScript profiles
- Add a reference to esnext.disposable at the top of pkg/tunelet.d.ts. - Keep [Symbol.dispose]() on Tunelet in scripts/postbuild-wasm.mjs. - Reject any other triple-slash reference in pkg/tunelet.d.ts. - Check using and object initializers in scripts/verify-pack.mjs.
Contributor
Author
|
Addressed both adjustments in
|
google-labs-stitch Bot
added a commit
that referenced
this pull request
Nov 25, 2026
- Delete scripts/normalize-wasm-pkg.mjs in favor of #123 - Restore package.json, tsconfig.json and AGENTS.md to main - Restore the TypeScript and default checks in scripts/verify-pack.mjs - Keep the isolated node:http loader checks in scripts/verify-pack.mjs
byteland-app
deleted the
stitch/sanitize-ts-declarations-and-wasm-exports-jm1-aba0f6bd-aafd-4b2f-9880-05b0fa5219ee
branch
November 25, 2026 14:27
byteland-app
pushed a commit
that referenced
this pull request
Nov 25, 2026
* fix(npm): normalize Wasm types and verify HTTP loaders - Add esnext.disposable and portable global types to pkg/tunelet.d.ts - Replace RequestInfo and BufferSource aliases before tsc runs - Remove synthetic DOM and disposable libs from tsconfig.json - Check browser, WebWorker and NodeNext consumers in verify-pack.mjs - Test HTTP loaders, 404 retries, buffers, modules and initSync - Verify both tunelet and @bytelandtechnology/tunelet archives - Document the declaration matrix and loader checks in AGENTS.md * test(npm): keep only the HTTP loader checks in verify-pack - Delete scripts/normalize-wasm-pkg.mjs in favor of #123 - Restore package.json, tsconfig.json and AGENTS.md to main - Restore the TypeScript and default checks in scripts/verify-pack.mjs - Keep the isolated node:http loader checks in scripts/verify-pack.mjs --------- Co-authored-by: google-labs-stitch[bot] <315546542+google-labs-stitch[bot]@users.noreply.github.com>
This was referenced Nov 25, 2026
google-labs-stitch Bot
added a commit
that referenced
this pull request
Nov 25, 2026
- Merge main at v0.3.4 into the mix and bypass branch. - Keep the correction key reset documentation from #46 in Processor. - Decode undefined mix and bypass fields in Wasm as in #123. - Add undefined to optional mix and bypass TypeScript declarations. - Update README.md for undefined optional fields and v0.3.4 queries.
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.
Summary
scripts/postbuild-wasm.mjstonpm run build:wasmto removepkg/.gitignore, preserve[Symbol.dispose](): voidonTuneletvia a top-level/// <reference lib="esnext.disposable" />directive, and replaceRequestInfo,Response,URL,BufferSource, andWebAssemblyinpkg/tunelet.d.tswith module-local structural interfaces withoutdeclare globalor any other/// <reference ... />directives.scripts/postbuild-wasm.mjswith an explicit error if any expectedwasm-bindgendeclaration anchor changes, if an unexpected triple-slash reference appears, or if any ambient DOM/WebAssemblysymbol stays in declaration code.undefinedHarmonyConfig.voicesto4withdeserialize_withinsrc/harmony.rsand emitvoices?: number | undefinedthroughtsifywhile keepingpub voices: u8unchanged."./pkg/tunelet_bg.wasm"and"./tunelet_bg.wasm"to"./pkg/tunelet_bg.wasm"inpackage.jsonwhile keeping the eight-file npm archive contract and.github/workflows/release.ymlupload paths unchanged.initializeinsrc/index.tsand the WebAssembly section inREADME.mdso Node.js reads"file:"URL strings and cross-realmfile:URLobjects from disk withnode:fs/promises.ESNext.DisposableandDOMfromtsconfig.json, enableexactOptionalPropertyTypes, and verify four strict consumertscprofiles (node,es2023,dom, andwebworker) — includingusingdisposal and{ module_or_path }/{ module }object arguments forinitandinitSync— plus runtime.wasmresolution,"file:"string loading,[Symbol.dispose](), and{ voices: undefined }handling inscripts/verify-pack.mjs.Verification
cargo fmt --checkcargo clippy --locked --lib -- -D warningscargo build --locked --releaseRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-depscargo package --lockedRUSTDOCFLAGS="-D warnings" npm run check:wasmnpm run verify:packAutomated PR initiated by user @byteland-app via Stitch Loop.