0.0.31 • Published 1 year ago

with-peer-deps v0.0.31

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

with-peer-deps

This tool allows JavaScript developers to install and uninstall dependencies considering the peerDependencies and peerDevDependencies of the package to be installed/uninstalled as if they were dependencies and devDependencies of the parent repository.

WARNING: This tool only works for projects whose dependencies have been installed by yarn, not npm

How to use

To install a dependency and its peerDependencies as local dependencies and its peerDevDependencies as local devDependencies:

npx with-peer-deps@latest add <anyPackageName>

You can also append --include-prereleases to consider versions like 1.2.3-alpha.3.

To upgrade or downgrade an already installed dependency to a specific version and syncronize its peerDependencies as local dependencies and its peerDevDependencies as local devDependencies:

npx with-peer-deps@latest add <anyPackageName@desiredVersion>

If you are using yarn link for the installed dependencies, you must append --ignore-node-modules to resolve the installed version using only the package.json declared version (ignore link):

npx with-peer-deps@latest add <anyPackageName@desiredVersion> --ignore-node-modules

You can also append --set-resolution to save the specified package version in the package.json resolutions section.

To uninstall a dependency, its peerDependencies from local dependencies and its peerDevDependencies from local devDependencies:

npx with-peer-deps@latest remove <anyPackageName>

Use case

When we want to install an X dependency that contains several peerDependencies in a Y project, we will also need those peerDependencies declared as local dependencies of the Y project.

my-mobile-app -> package.json:

{
  "name": "my-mobile-app",
  "version": "0.0.1",
  "dependencies": {
    "my-design-system": "0.0.3",
    "react-native-svg": "^12.1.1" // <-- this will be automatically appended when you add my-design-system using `npx with-peer-deps@latest add my-design-system`
  },
  "devDependencies": {
    "react-native-svg-transformer": "^0.14.3" // <-- this will be automatically appended when you add my-design-system using `npx with-peer-deps@latest add my-design-system`
  }
}

my-design-system -> package.json:

{
  "name": "my-design-system",
  "version": "0.0.3",
  "peerDependencies": {
    "react-native-svg": "^12.1.1"
  },
  "peerDevDependencies": {
    "react-native-svg-transformer": "^0.14.3"
  }
}
0.0.31

1 year ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago