Skip to content

Library: a re-bundled dist/index.js reads the consumer's own registry/vaults.json #59

Closed

Description

@Kevin-Chen0

src/registry.ts and src/version.ts read ../registry/vaults.json and ../package.json relative to their own module file at runtime. That is correct in every layout this repository ships: the repository root, an npm install under node_modules/@temporalabs/treasury/, and the plugin's plugin/ folder. Since #57 it also holds when the npm bin runs through a symlink.

It is not correct when a library consumer re-bundles dist/index.js into their own output. import.meta.url is then the consumer's bundle, so the registry and version are read from beside it. If a registry/vaults.json exists there, it is read silently; otherwise the first registry read throws ENOENT.

The likely fix is to embed the registry (and the version) at build time instead of reading them at runtime. That changes why plugin/ carries its registry/ and package.json copies, so it needs a design pass rather than a patch. Proposed for v0.1.2.

Activity

  1. Kevin-Chen0 commented on Oct 5, 2026

    @Kevin-Chen0
    ContributorAuthor

    Decision: option B from the design note in #94 (import the two JSON files so they are embedded at build time), targeted at v0.1.3 rather than v0.1.2. The work is tracked in #107.

  2. Kevin-Chen0 commented on Oct 11, 2026

    @Kevin-Chen0
    ContributorAuthor

    Fixed by #129: a re-bundled library now carries its own registry instead of reading one beside the consumer's bundle.

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