Files
pnpm/docs/store-json.md
zkochan 40621818bc fix(uninstall): dependencies from all sources can be deleted
pnpm uninstall could not always link the dependency name to the
dependency ID (used in the store). To solve this issue, a dependency
name to ID map is added to the dependencies section of `store.json`.

PR #371

BREAKING CHANGE:

The structure of the `store.json` has been changed.

Previously the dependencies property contained just a list of
dependency IDs. E.g.:

```json
{
  "dependencies": {
    "math": [
      "sum@1.0.0",
      "@zkochan+max@2.1.0"
    ]
  }
}
```

With this structure it was hard to link the dependencies to their IDs.
The new structure uses a map which links the dependency to its ID:

```json
{
  "dependencies": {
    "map": {
      "sum": "sum@1.0.0",
      "@zkochan/max": "@zkochan+max@2.1.0"
    }
  }
}
```

Unfortunately the stores created by older version of pnpm are not usable
after this breaking change. They have to be removed before using the new
version of pnpm.
2016-09-25 21:28:47 +03:00

1.3 KiB

store.json

store.json contains information about all the different internal/external dependencies that the packages in the store have. This is especially useful because pnpm allows to use shared stores.

pnpm

The last compatible pnpm version that has modified the store.

dependents

A dictionary that shows what packages are dependent on each of the package from the store. The dependent packages can be other packages from the store, or packages that use the store to install their dependencies.

For example, pnpm has a dependency on npm and semver. But semver is also a dependency of npm. It means that after installation, the store.json would have connections like this in the dependents property:

{
  "dependents": {
    "semver@5.3.0": [
      "/home/john_smith/src/pnpm/package.json",
      "npm@3.10.2"
    ],
    "npm@3.10.2": [
      "/home/john_smith/src/pnpm/package.json"
    ]
  }
}

dependencies

A dictionary that is the opposite of dependents. However, it contains not just a list of dependency names but a map of the dependencies to their exact resolved ID.

{
  "dependencies": {
    "/home/john_smith/src/pnpm/package.json": {
      "semver": "semver@5.3.0",
      "npm": "npm@3.10.2"
    },
    "npm@3.10.2": {
      "semver": "semver@5.3.0"
    }
  }
}