v6.20.0
Minor Changes
-
New property supported via the
dependenciesMetafield ofpackage.json:injected. Wheninjectedis set totrue, the package will be hard linked tonode_modules, not symlinked #3915.For instance, the following
package.jsonin a workspace will create a symlink tobarin thenode_modulesdirectory offoo:{ "name": "foo", "dependencies": { "bar": "workspace:1.0.0" } }But what if
barhasreactin its peer dependencies? If all projects in the monorepo use the same version ofreact, then no problem. But what ifbaris required byfoothat usesreact16 andqarwithreact17? In the past, you'd have to choose a single version of react and install it as dev dependency ofbar. But now with theinjectedfield you can injectbarto a package, andbarwill be installed with thereactversion of that package.So this will be the
package.jsonoffoo:{ "name": "foo", "dependencies": { "bar": "workspace:1.0.0", "react": "16" }, "dependenciesMeta": { "bar": { "injected": true } } }barwill be hard linked into the dependencies offoo, andreact16 will be linked to the dependencies offoo/node_modules/bar.And this will be the
package.jsonofqar:{ "name": "qar", "dependencies": { "bar": "workspace:1.0.0", "react": "17" }, "dependenciesMeta": { "bar": { "injected": true } } }barwill be hard linked into the dependencies ofqar, andreact17 will be linked to the dependencies ofqar/node_modules/bar.
Patch Changes
- Buffer warnings fixed #3932.