yarnpkg/yarn

File dependencies from transitive dependencies are stored incorrectly in lock file

Open

#4,388 建立於 2017年9月11日

在 GitHub 查看
 (18 留言) (17 反應) (1 負責人)JavaScript (41,514 star) (2,731 fork)batch import
cat-bughelp wantedhigh-prioritytriaged

描述

What is the current behavior?

When having a file dependency that has more file dependencies, these second-level dependencies are referenced in cache, e.g.:

{
  name: "x"
  dependencies: {
    "a": "file:../../a"
  }
}

with:

{
  name: "a",
  dependencies: {
    "b": "../b"
  }

would result in a lock entry like:

 "a@file:../../a":
   dependencies:
     "b" "file:../../../../../Library/Caches/Yarn/v1/npm-b"

instead of (yarn 0.27.5):

 "a@file:../../a":
   dependencies:
     "b" "file:../b"

If the current behavior is a bug, please provide the steps to reproduce.

Create two chains of dependencies, see: https://github.com/joscha/yarn-101-links especially https://github.com/joscha/yarn-101-links/blob/master/my-package/yarn.lock#L8

What is the expected behavior? Have relative links only, so the whole node_modules folder can be gzipped.

Please mention your node.js, yarn and operating system version. node: 8.4.0 yarn 1.0.1 OSX Sierra

貢獻者指南