Skip to content

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

Closed

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.

Activity

  1. marc0olo commented on Sep 25, 2026

    @marc0olo
    ContributorAuthor

    Closing, the fork is archived and each item is settled:

    1. Installing without the binary download: documented in the getting-started guide (docs: replace DFX guidance and make the guides work as written #293). When the binary comes from binPath or POCKET_IC_BIN, the install script can stay blocked.
    2. Shipping src: not adopted. The published sourcemaps already map stack traces to src/*.ts lines in Jest, Vitest and node --enable-source-maps. Shipping src would only let editors open those files, which isn't worth the extra package size.
    3. wasmMemoryLimit enforcement test: not adopted. It tests PocketIC's enforcement rather than PicJS, which only passes the setting through.

    One step is left, and only the npm maintainer of pic-js-mops can take it: npm deprecate pic-js-mops. It still gets ~1.2k monthly downloads, mostly through ic-mops 2.0.0–2.19.2, which depend on it. ic-mops 2.20.0 switched to upstream @dfinity/pic, bundled into the CLI, so those users only need to upgrade ic-mops. Direct users should switch to @dfinity/pic. A message covering both: "No longer maintained. Via ic-mops: upgrade to ic-mops 2.20.0 or later. Used directly: switch to @dfinity/pic."

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

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