yarnpkg/yarn

File dependencies from transitive dependencies are stored incorrectly in lock file

Open

#4 388 ouverte le 11 sept. 2017

Voir sur GitHub
 (18 commentaires) (17 réactions) (1 assigné)JavaScript (2 731 forks)batch import
cat-bughelp wantedhigh-prioritytriaged

Métriques du dépôt

Stars
 (41 514 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur