nestarz / heritage

Tiny Package Manager for the Web
MIT License
9 stars 0 forks source link

Installation of multiple versions of a package #4

Closed abingham closed 3 years ago

abingham commented 3 years ago

I'm trying to understand why heritage sometimes installs multiple version of a package. When I install prosemirror-inputrules with heritage (after completely deleting web_modules):

$ rm -Rf web_modules
$ npx heritage add prosemirror-inputrules
Heritage Package Manager
Installing prosemirror-inputrules@1.1.3 from pika registry.

I get this in my import-map.json:

{
  "imports": {
    "prosemirror-inputrules": "./prosemirror-inputrules/1.1.3/prosemirror-inputrules.js"
  },
  "scopes": {
    "./prosemirror-inputrules/1.1.3/": {
      "prosemirror-state": "./prosemirror-state/1.3.4/prosemirror-state.js",
      "prosemirror-transform": "./prosemirror-transform/1.3.3/prosemirror-transform.js",
      "prosemirror-model": "./prosemirror-model/1.15.0/prosemirror-model.js",
      "orderedmap": "./orderedmap/1.1.1/orderedmap.js"
    },
    "./prosemirror-state/1.3.4/": {
      "prosemirror-model": "./prosemirror-model/1.15.0/prosemirror-model.js",
      "prosemirror-transform": "./prosemirror-transform/1.3.3/prosemirror-transform.js"
    },
    "./prosemirror-transform/1.3.2/": {
      "prosemirror-model": "./prosemirror-model/1.15.0/prosemirror-model.js"
    },
    "./prosemirror-transform/1.3.3/": {
      "prosemirror-model": "./prosemirror-model/1.15.0/prosemirror-model.js"
    },
    "./prosemirror-model/1.15.0/": {
      "orderedmap": "./orderedmap/1.1.1/orderedmap.js"
    }
  }
}

I'm getting two prosemirror-transform versions installed, and I can't figure out why. As far as I can tell, none of the packages express a dependency on a specific verseion of prosemirror-transform.

Is there any way I can debug why this is happening? Or is there some reason heritage might be doing this?

nestarz commented 3 years ago

I think it's related to the following dependency prosemirror-state@v1.3.4 which needs prosemirror-transform@1.3.3, while prosemirror-inputrules@v1.1.3 needs prosemirror-transform@1.3.2

abingham commented 3 years ago

Yes, that's almost certainly it. Thanks for helping me sort this out.