Description
Version
1.0.0-alpha.x
What is the issue
vuepress/packages/vuepress/package.json
Lines 32 to 33 in 1850be7
As shown above, we use ^
as prefix.
In alpha & beta stage, it's better to lock the version without ^
.
Take @babel/core
for example:
Why
As known, we may have breaking changes in alpha stage, and each packages may not work well with each other if the versions are different.
When users want to rollback/lock to a certain version of vuepress, i.e.
yarn add vuepress@1.0.0-alpha.39
As the dependencies of vuepress@1.0.0-alpha.39
are:
vuepress/packages/vuepress/package.json
Lines 32 to 33 in 170cf6e
They will get 1.0.0-alpha.40
for all other packages.
Workaround is to lock all (possible) related packages manually:
yarn add \
vuepress@1.0.0-alpha.39 \
@vuepress/core@1.0.0-alpha.39 \
@vuepress/theme-default@1.0.0-alpha.39 \
@vuepress/markdown@1.0.0-alpha.39 \
@vuepress/markdown-loader@1.0.0-alpha.39
---- update
The workaround above does not work... 😓
I got things like this:
+--- node_modules
+--- @vuepress
+--- core # 1.0.0-alpha.39
+--- vuepress # 1.0.0-alpha.39
+--- node_modules
+--- @vuepress
+--- core # 1.0.0-alpha.40 (why?!)
and the yarn.lock
file:
"@vuepress/core@1.0.0-alpha.39":
version "1.0.0-alpha.39"
"@vuepress/core@^1.0.0-alpha.39":
version "1.0.0-alpha.40"
That means, although I try to lock the version of @vuepress/core
to 1.0.0-alpha.39
, the vuepress
cli will always use @vuepress/core@1.0.0-alpha.40
.
I even tried to modify the yarn.lock
manually and delete the "1.0.0-alpha.40"
section, remove node_modules
, then use yarn install --frozen-lockfile
to install, and get the same node_modules
...
So if we don't fix the packages version, it might be impossible to rollback/lock to a certain version of vuepress by yarn. (npm works well, though)