fix(codec): consumer-onboarding hardening for 0.1.0 first publish#44
Merged
Conversation
Both packages were emitting *.test.js / *.test.d.ts triples into dist/, which would ship in the published tarball. Match codec's existing pattern: include src/**/*.ts + exclude src/**/*.test.ts. Also aligns include glob from `src/**/*` (networks) to `src/**/*.ts` — the broader glob was causing exclude to be ignored by tsc. Fixes: Ft
… lower engines floor - F1: Move @void-layer/types from devDependencies to dependencies so TS consumers installing only @void-layer/codec get the type auto-installed (dist/index.d.ts imports Invoice from @void-layer/types). - F3: Add sideEffects field — wasm init files are side-effectful; JS/TS modules are tree-shakeable. Prevents bundlers from dropping wasm init. - F4: Lower engines.node from >=24 to >=20 to cover Node 20/22/24 LTS. Build confirmed green with current toolchain (wasm-pack 0.13.1).
…cts: false - F5: Change @void-layer/types from workspace:* (publishes as exact 0.1.0 pin) to workspace:^ (publishes as ^0.1.0) for patch-version flexibility. - F3: Add sideEffects: false — pure data/functions package, safe for tree-shaking by bundlers.
The bundler entry (src/index.ts) was re-exporting raw wasm bindings whose generated .d.ts types were `any`. Apply the same typed-cast pattern used in index.node.ts: import * as _wasmPkg, cast to a typed surface with Invoice return types, then re-export named consts. Runtime behaviour is unchanged — same WASM functions, same bytes. Bundler consumers now get Invoice / Uint8Array return types in their IDE and tsc --noEmit checks instead of `any`. Verified: tsc --noEmit on fresh consumer project exits 0 with strict mode.
Comment referenced CodecError::PrecisionLoss; the actual variant is CodecError::InvalidAmount. Comment-only change, no logic affected.
Reflects @void-layer/types moving from devDependencies to dependencies in @void-layer/codec (F1 fix).
This was referenced Jun 4, 2026
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.
Consumer-onboarding hardening for the 0.1.0 first publish
Deep publish-readiness audit (4 parallel static audits + an out-of-workspace tarball-install simulation) surfaced consumer-experience gaps that would have shipped as paper-cuts in the very first
@void-layer0.1.0. None were publish-blockers (therelease.ymlpipeline builds fresh and was already GO), but each degrades the firstnpm installexperience. This batch fixes all of them.Findings fixed
import '@void-layer/networks'(root barrel) could pullviemvia a stale localdist→ERR_MODULE_NOT_FOUNDwithout viem. (Build-artifact staleness only; CI always builds fresh.)./wagmisubpath@void-layer/typeswas adevDependencyof codec, but the shipped.d.tsimports it → solonpm i @void-layer/codecleft TS consumers without theInvoicetypedependencies(workspace:^→^0.1.0)decodeInvoiceCanonicalreturnedanyin the bundler entry.d.ts(only the node entry was typed)src/index.ts(types-only, no byte change)decompressBounded,encodeWire,decodeWire) reachable from the public surface@void-layer/typeswasworkspace:*(publishes as exact pin)workspace:^sideEffectsmissing → bundlers can't tree-shake["*.wasm","pkg/**","pkg-node/**"]; networksfalseengines.node: ">=24"excluded Node 20/22 LTS (no Node-24-only API used)>=20*.test.*intodist/→ shipped to consumers**/*.test.tsfrom build tsconfig (match codec)CodecError::PrecisionLossin test comment + describe() labelInvalidAmountDeferred: F6 (typed
CodecErrorJS surface) → #43 (additive/non-breaking, 0.1.x).Verification
pnpm -r build·pnpm -r lint· 455 tests ·tsc --noEmit ×3— all green; coverage codec 98%+, networks 100%tscconsumer with codec-only install — passed (Atlas + independent pack)Follow-ups (P2, non-blocking)