Yarn: Provide dev snapshot update API for side-by-side module development

Created on 21 Dec 2016  路  1Comment  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

Feature.

What is the current behavior?

AFAICS there's no API equivalent to npm update {package} that would update a package to the latest version matching the package.json definition without touching it.

When developing multiple interdependent modules side-by-side (simplest case being a "library" module shared between multiple "app" modules), it's useful to link to the "latest dev snapshot" of a module and publish these snapshots on a regular basis during the development process. Even though this breaks the "everybody gets the same dependencies" rule in principle, it saves a lot of valuable time compared to keeping track of the snapshot numbers and updating the dependencies all the time. (Of course this is a development scenario only.)

AFAICS Yarn provides just the upgrade API which not only updates the package.json, but more upgrades only to latest stable version, so in the scenario described above it actually downgrades.

What is the expected behavior?

I'd expect Yarn to provide an API that allows updating to the latest dev snapshots for definitions like this one:

"my-library-module": "~1.2.3-pre"

without touching the definition itself. At the very least I'd expect upgrade to be able to get the latest pre-release version (even if it does write it in package.json).

_If neither of these options make sense, please explain in the comments why._

Most helpful comment

I have exactly the same problem. In the Java world, Maven has the concept of a _SNAPSHOT_ release. SNAPSHOT is a special name in the version number, and Maven not just automatically updates the dependency package when the checksum does not match, but also prevents release versions to have snapshot dependencies.

In Yarn, if we are developing a library and a module at the same time, every time the library is updated, the module will fail the build. There must be a way to say that the checksum of a dependency shouldn't be verified.

This StackOverflow question gives a hack to fix it, but the tool must have a standard solution for this common problem.

>All comments

I have exactly the same problem. In the Java world, Maven has the concept of a _SNAPSHOT_ release. SNAPSHOT is a special name in the version number, and Maven not just automatically updates the dependency package when the checksum does not match, but also prevents release versions to have snapshot dependencies.

In Yarn, if we are developing a library and a module at the same time, every time the library is updated, the module will fail the build. There must be a way to say that the checksum of a dependency shouldn't be verified.

This StackOverflow question gives a hack to fix it, but the tool must have a standard solution for this common problem.

Was this page helpful?
0 / 5 - 0 ratings