Skip to content

fix(npm): normalize Wasm types and verify browser loaders - #103

Closed
google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/verify-browser-loaders-chromium-fixtures-jm1-82cb0dc5-3175-4799-9e6d-80b37286edbb
Closed

google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/verify-browser-loaders-chromium-fixtures-jm1-82cb0dc5-3175-4799-9e6d-80b37286edbb

Conversation

@google-labs-stitch

Copy link
Copy Markdown
Contributor

Summary

This change normalizes the generated pkg/tunelet.d.ts declarations during npm run build and expands npm run verify:pack to check isolated TypeScript fixtures, cold-start Node.js loaders and headless Chromium HTTP and Web Worker loaders.

Changes

  • Add scripts/normalize-pkg.mjs to npm run build:wasm to remove pkg/.gitignore, reference esnext.disposable, replace RequestInfo and BufferSource with portable unions and declare open-ended Request, Response, URL and WebAssembly interfaces.
  • Set compilerOptions.lib in tsconfig.json to ["ES2020"] so the package build does not hide consumer type errors behind internal DOM or ESNext.Disposable flags.
  • Update scripts/verify-pack.mjs to unpack the eight-file archive into isolated browser (DOM), WebWorker and Node.js NodeNext fixtures for both tunelet and @bytelandtechnology/tunelet and run tsc --noEmit --strict without skipLibCheck.
  • Verify cold-start Node.js runtime paths for file: retry recovery, default loadTunelet(), explicit file: URL, Uint8Array, Promise<WebAssembly.Module> and initSync on root and ./wasm exports.
  • Add scripts/verify-browser.mjs to serve unpacked dist/ and pkg/ over a local HTTP server with <script type="importmap">, application/wasm, application/octet-stream, HTTP 404 and module Web Worker routes, and verify them in headless Chromium through the Chrome DevTools Protocol.
  • Pin browser-actions/setup-chrome@48ad923757ca74d66703209fe939badbdf80f2f4 (v2.2.0) in .github/workflows/ci.yml and .github/workflows/release.yml with contents: read permissions and pass CHROME_BIN to npm run verify:pack before artifact upload.
  • Document local Chrome or Chromium prerequisites and CHROME_BIN in AGENTS.md.

Verification

  • cargo fmt --check
  • cargo clippy --locked --lib -- -D warnings
  • cargo build --locked --release
  • RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps
  • cargo package --list --locked
  • RUSTDOCFLAGS="-D warnings" npm run check:wasm
  • CHROME_BIN=/usr/bin/google-chrome npm run verify:pack

Headless Chromium loader and Web Worker verification


Automated PR initiated by user @byteland-app via Stitch Loop.

- Normalize pkg/tunelet.d.ts for browser, worker and Node.js types
- Remove DOM and ESNext.Disposable from tsconfig.json
- Check strict browser, WebWorker and NodeNext package fixtures
- Verify Node.js file:, Uint8Array, Module and initSync loaders
- Verify HTTP 404 retry, import map, MIME fallback and Web Workers
- Pin browser-actions/setup-chrome in ci.yml and release.yml
- Document local Chrome prerequisites and verify:pack in AGENTS.md
@byteland-app

Copy link
Copy Markdown
Contributor

Closing this PR. Injecting declare global { interface Request/Response/URL ... } into pkg/tunelet.d.ts pollutes consumer global scopes (prefer #123), and requiring Chrome/Chromium + an 871-line custom CDP client in verify-pack and release.yml adds heavy maintenance overhead. Lightweight HTTP loader checks can be adapted from #105 instead.

@byteland-app
byteland-app deleted the stitch/verify-browser-loaders-chromium-fixtures-jm1-82cb0dc5-3175-4799-9e6d-80b37286edbb branch November 25, 2026 08:04
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Understood — leaving #103 closed with no further changes pushed to this branch, deferring to #123 for module-local TypeScript declaration sanitization without declare global pollution and #105 for lightweight node:http loader verification without Chromium/CDP overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant