Skip to content

Adopt remaining pic-js-mops changes before archiving the fork #282

Description

@marc0olo

dfinity/pic-js-mops is a fork of this repo that diverged at v0.13.1 (2025-05-07) and is a functional subset of pic-js today. It is slated for archival. Three items are worth adopting first.

The fork exists for one reason, stated in its own (now closed) PR #5: to use PocketIC "without depending on @dfinity/pic and its PocketIC binary postinstall". Item 1 removes that reason.

1. Document installing without the postinstall binary download

Blocking for archival. Docs only — every mechanism already exists:

  • postinstall.mjs is in files, so node node_modules/@dfinity/pic/postinstall.mjs works on demand
  • binPath (feat(pic): support overriding the PocketIC binary path #276) and POCKET_IC_BIN select an existing binary
  • .pocket-ic-version pins the version
  • ignore-scripts=true installs cleanly (verified: install succeeds, no binary fetched)

docs/src/content/docs/guides/running-tests.mdx documents binPath but never ignore-scripts, air-gapped/CI installs, or invoking the postinstall script manually.

2. Ship src in packages/pic files

sourceMap: true is enabled and dist/*.js.map is published containing "sources":["../src/pocket-ic.ts"], but files is ["dist", "postinstall.mjs"]. Every published sourcemap is unresolvable. The fork ships ["dist", "src"]. Alternatives: inlineSources, or drop sourcemaps.

3. Add a wasmMemoryLimit enforcement test

The API is fully implemented (pocket-ic-types.ts:582, pocket-ic.ts:275,644,708, management-canister.ts:48,62). Missing is a behavioral assertion that an undersized limit rejects installation — pocket-ic.spec.ts:219 covers updateCanisterSettings but not wasmMemoryLimit. ~25 lines, portable from the fork's PR #5.

Explicitly not adopting

The fork's ESM build config (.js import extensions, module: ES2022, moduleResolution: bundler): Node already resolves named exports through the current CJS emit, @icp-sdk/core ships dual-format, and bundler resolution is what breaks the fork's own Jest setup.

Considered and left out: @icp-sdk/core as a peerDependency — plausible for type-level version skew, unverified.

After archival

npm deprecate pic-js-mops "use @dfinity/pic" — archiving the repository does not unpublish the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions