Skip to content

Suggest to fix the packages version in alpha stage #1379

Closed
@meteorlxy

Description

@meteorlxy

Version

1.0.0-alpha.x

What is the issue

"@vuepress/core": "^1.0.0-alpha.40",
"@vuepress/theme-default": "^1.0.0-alpha.40",

As shown above, we use ^ as prefix.

In alpha & beta stage, it's better to lock the version without ^.

Take @babel/core for example:

  • Versions are locked in alpha and beta stage and rc version
  • Versions with ^ in release version

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/core": "^1.0.0-alpha.39",
"@vuepress/theme-default": "^1.0.0-alpha.39",

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)

Metadata

Metadata

Assignees

Labels

type: enhancementRequest to enhance an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions