Skip to content

Drop the vendored @dfinity/pic bundle once pic downloads its binary lazily #651

Description

@Kamirus

@dfinity/pic downloads a ~94 MB pocket-ic binary in a postinstall that throws when it cannot. Since the published ic-mops package is the unbundled dist/ tree with the full dependency list, a plain dependencies entry would make npm i -g ic-mops pull that binary and fail outright with no network. #642 works around it by keeping pic a devDependency and pre-bundling it into dist/vendor/pic.mjs.

The workaround costs three moving parts that exist only for this: cli/vendor/pic-entry.mjs (explicit re-exports, because pic ships CJS and export * through esbuild silently yields no named exports), the vendor:pic build step, and the fix-dist import rewrite — plus cli/tests/vendor-pic.test.ts guarding the silent-failure mode.

mraszyk suggested during review of dfinity/pic-js#276 that pic download the binary lazily at runtime instead of in a postinstall: dfinity/pic-js#276 (comment)

If that lands, pic becomes an ordinary dependency and all four pieces above get deleted. It also fixes the one place the download still bites: a clean npm install in cli/ pulls the 94 MB binary for local dev and CI, because devDependency install scripts do run.

Next step is filing the request upstream (not filed yet — the idea is the maintainer's own, so it may be worth asking whether they want to implement it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    clidependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions