Skip to content

[codec][P2] Add prepack build hook to eliminate stale-dist local-pack footgun #45

@ignromanov

Description

@ignromanov

dist/ is gitignored and built fresh by CI (release.yml runs pnpm -r build before changeset publish), so the published artifact is always correct. But none of the three packages define a prepack/prepare hook, so a developer running pnpm pack locally without first building ships a stale or missing dist/ (this is how the F0 viem-crash surfaced during the PR #44 audit — a local pack of pre-#40 dist).

Proposal: add "prepack": "pnpm run build" to networks + types (cheap tsc). For codec there is a trade-off — prepack would re-run the full wasm-pack build on every pack, and CI already builds before publish (double build). Options to weigh:

  • per-package prepack (simple, but doubles CI build + slow local packs for codec)
  • a root-level pack guard / CI dist-freshness gate instead (no double build)

Needs a small design decision before implementing. Non-blocking for 0.1.0.

Surfaced by: PR #44 (Iris review, P2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions