Skip to content

@zkochan zkochan released this Jun 23, 2021 · 72 commits to main since this release

Minor Changes

  • A new optional field added to the pnpm section of package.json: packageExtensions. The packageExtensions fields offer a way to extend the existing package definitions with additional information. For example, if react-redux should have react-dom in its peerDependencies but it has not, it is possible to patch react-redux using packageExtensions:

    {
      "pnpm": {
        "packageExtensions": {
          "react-redux": {
            "peerDependencies": {
              "react-dom": "*"
            }
          }
        }
      }
    }

    The keys in packageExtensions are package names or package names and semver ranges, to it is possible to patch only some versions of a package:

    {
      "pnpm": {
        "packageExtensions": {
          "react-redux@1": {
            "peerDependencies": {
              "react-dom": "*"
            }
          }
        }
      }
    }

    The following fields may be extended using packageExtensions: dependencies, optionalDependencies, peerDependencies, and peerDependenciesMeta.

    A bigger example:

    {
      "pnpm": {
        "packageExtensions": {
          "express@1": {
            "optionalDependencies": {
              "typescript": "2"
            }
          },
          "fork-ts-checker-webpack-plugin": {
            "dependencies": {
              "@babel/core": "1"
            },
            "peerDependencies": {
              "eslint": ">= 6"
            },
            "peerDependenciesMeta": {
              "eslint": {
                "optional": true
              }
            }
          }
        }
      }
    }
16 people reacted
Assets 2